代表生产环境中的执行时间

时间:2014-10-25 08:55:45

标签: delegates localhost production-environment

这是我以前的代码:

 objChartControls.RFV = GetChartFacadeObj().LoadROV(chartID);
                 objChartControls.Vitals = GetChartFacadeObj().LoadLastVitalPrint(patientAccount, chartID);
                objChartControls.Allergies = GetChartFacadeObj().LoadAllergyPrintData(long.Parse(patientAccount), long.Parse(chartID), Is_CF);

                objChartControls.PMH = GetChartFacadeObj().GetPastMedicalProblems(patientAccount, chartID, Is_CF);
                 objChartControls.Immunization = GetChartFacadeObj().GetPatientImmunizationData_New(patientAccount, chartID, Is_CF);
                 objChartControls.PastHospitalization = GetChartFacadeObj().GetPastHospitialization(patientAccount, chartID, Is_CF);
                 objChartControls.PastSurgeries = GetChartFacadeObj().GetSurgeryProcedure(long.Parse(patientAccount), long.Parse(chartID),  Is_CF);

                 objChartControls.Cognative = GetChartFacadeObj().GetCognative_Functional_New(long.Parse(chartID), long.Parse(patientAccount), Is_CF);
                 objChartControls.CarePlanNotes = GetChartFacadeObj().GetPatientCarePlan(patientAccount, chartID);

                 objChartControls.SocialHx = GetChartFacadeObj().GetSocialHxDetail(long.Parse(patientAccount), long.Parse(chartID),  Is_CF);
                objChartControls.FamilyHx = GetChartFacadeObj().GetFamilyHxDetail(chartID, patientAccount,  Is_CF);

                 objChartControls.ROS = GetChartFacadeObj().GetPatientRosChartsPrint(patientAccount, chartID);
                 objChartControls.AssessmentsComment = GetChartFacadeObj().GetOfficeAssesmentComments(patientAccount, chartID); 
             objChartControls.PE = GetChartFacadeObj().GetPatientPhysicalExam(chartID);
                 objChartControls.ChartNotes = GetChartFacadeObj().GetPatientChartNotes(patientAccount, chartID);
                // objChartControls.PlanofCareNotes = GetChartFacadeObj().GetPatientPlanOfCareNotes(patientAccount, chartID);
                 objChartControls.OfficeAssessments = GetChartFacadeObj().GetPatientOfficeAssesmentDetails1(patientAccount, chartID,  Is_CF);
                objChartControls.OfficeProcedures = GetChartFacadeObj().GetPatientOfficeProcedureDetails(patientAccount, chartID);
                 objChartControls.Dermatology = GetPatientDermatologicalExam(patientAccount, chartID);
                 objChartControls.Nuerology = GetPatientNeurologilcalExam(patientAccount, chartID);
                 objChartControls.Muscolotecal = GetPatientMuscoloskeletalExam(patientAccount, chartID);
                 RxPrescription objPrescripton = new RxPrescription(GetProBaseObj().UserName.ToString(), GetProBaseObj().GetPropertyValue("ConnectionStringName").ToString(), GetProBaseObj().GetPropertyValue("PracticeCode").ToString());
                objChartControls.Medication = objPrescripton.GetPatientPrescription("", patientAccount, true, chartID,  Is_CF);
                 objChartControls.Phy.Psy = getphsydata().GetSocialRows(chartID, patientAccount, true);
                 objChartControls.Phy.psy_men = getphsydata().GetPhyscRows(chartID, patientAccount, true);
                 objChartControls.Annotation = GetChartFacadeObj().getAnotDetails(chartID, patientAccount);
                 objChartControls.Vascular = GetPatientPodiatryVascularExamText(patientAccount, chartID);
                 OfficeTest objOfficeTest = new OfficeTest();
                 objOfficeTest.URINALYSIS = GetChartFacadeObj().GetPatientUrinalysisDetails(chartID, patientAccount);
                 objOfficeTest.SugarLog = GetChartFacadeObj().GetPatientSugarLogDetails(chartID, patientAccount);
                 objOfficeTest.FSBG = GetChartFacadeObj().GetPatientFSBGDetails(chartID, patientAccount);
                 objOfficeTest.PeakFlow = GetChartFacadeObj().GetPatientPeakFlowDetails(chartID, patientAccount);
                 objOfficeTest.EKG = GetChartFacadeObj().GetElectrocardiogramDetails(chartID, patientAccount);
                 objOfficeTest.Urine_Pregnancy = GetChartFacadeObj().GetPatientCommonTestDetails(chartID, patientAccount, "Urine_Pregnancy");
                 objOfficeTest.RapidStrep = GetChartFacadeObj().GetPatientCommonTestDetails(chartID, patientAccount, "RapidStrep");
                 objOfficeTest.Hemoccult = GetChartFacadeObj().GetPatientCommonTestDetails(chartID, patientAccount, "Hemoccult");
                 objOfficeTest.MonospotStep = GetChartFacadeObj().GetPatientCommonTestDetails(chartID, patientAccount, "MonospotStep");
                 objOfficeTest.DynamicTestDetails = GetDynamicOfficeTest(chartID);
                 objChartControls.OBGYNText = getOBGYNHISTORY(patientAccount, chartID);

现在我通过将它们称为异步将其转换为委托逻辑。这是我的逻辑:

 ChartControls objChartControls = new ChartControls();
                RxPrescription objPrescripton = new RxPrescription(GetProBaseObj().UserName.ToString(), GetProBaseObj().GetPropertyValue("ConnectionStringName").ToString(), GetProBaseObj().GetPropertyValue("PracticeCode").ToString());
                OfficeTest objOfficeTest = new OfficeTest();
                // ali code starts

                //Reason For Visit

                ReasonForVisitDelegate reasonForVisit = new ReasonForVisitDelegate(GetChartFacadeObj().LoadROV);
                IAsyncResult RFV = reasonForVisit.BeginInvoke(chartID, null, null);


                // Vitals

                VitalsDelegate vitals = new VitalsDelegate(GetChartFacadeObj().LoadLastVitalPrint);
                IAsyncResult Vitals = vitals.BeginInvoke(patientAccount, chartID, null, null);



                //Allergies
                //4855 change id:443 (4855) start
                AllergiesDelegate allergies = new AllergiesDelegate(GetChartFacadeObj().LoadAllergyPrintGlobalData);
                IAsyncResult Allergies = allergies.BeginInvoke(long.Parse(patientAccount), long.Parse(chartID), "0", null, null);

                //Office Assessments

                OfficeAssessmentsDelegate officeAssessments = new OfficeAssessmentsDelegate(GetChartFacadeObj().GetAssessmentPrintGlobal);
                IAsyncResult OfficeAssessments = officeAssessments.BeginInvoke(patientAccount, chartID, "0", null, null);

                //Medication

                PrescriptionDelegate prescription = new PrescriptionDelegate(GetChartFacadeObj().GetGlobalPatientPrescription);
                IAsyncResult Medication = prescription.BeginInvoke(patientAccount, chartID, "0", null, null);
                //Review of System

                PatientROSDelegate patientReviewOfSystem = new PatientROSDelegate(GetChartFacadeObj().GetPatientRosChartsPrint);
                IAsyncResult ROS = patientReviewOfSystem.BeginInvoke(patientAccount, chartID,"0",null, null);


                //4855 change id:443 (4855) end
                // Past Medical History
                PastMedicalHistoryDelegate pastMedicalHistory = new PastMedicalHistoryDelegate(GetChartFacadeObj().GetPastMedicalProblems);
                IAsyncResult PMH = pastMedicalHistory.BeginInvoke(patientAccount, chartID, Is_CF, null, null);


                //Immunization
                ImmunizationDelegate immunization = new ImmunizationDelegate(GetChartFacadeObj().GetPatientImmunizationData_New);
                IAsyncResult Immunization = immunization.BeginInvoke(patientAccount, chartID, Is_CF, null, null);


                //PastHospitalization

                PastHospitalizationDelegate pastHospitalizationDelegate = new PastHospitalizationDelegate(GetChartFacadeObj().GetPastHospitialization);
                IAsyncResult PastHospitalization = pastHospitalizationDelegate.BeginInvoke(patientAccount, chartID, Is_CF, null, null);


                //PastSurgeries

                PastSurgeriesDelegate pastSurgeries = new PastSurgeriesDelegate(GetChartFacadeObj().GetSurgeryProcedure);
                IAsyncResult PastSurgeries = pastSurgeries.BeginInvoke(long.Parse(patientAccount), long.Parse(chartID), Is_CF, null, null);


                //Social History

                SocialHxDelegate socailHistory = new SocialHxDelegate(GetChartFacadeObj().GetSocialHxDetail);
                IAsyncResult SocialHx = socailHistory.BeginInvoke(long.Parse(patientAccount), long.Parse(chartID), Is_CF, null, null);


                //Family History

                FamilyHxDelegate familyHistory = new FamilyHxDelegate(GetChartFacadeObj().GetFamilyHxDetail);
                IAsyncResult FamilyHx = familyHistory.BeginInvoke(chartID, patientAccount, Is_CF, null, null);



                //Cognative

                CognativeDelegate cognative = new CognativeDelegate(GetChartFacadeObj().GetCognative_Functional_New);
                IAsyncResult Cognative = cognative.BeginInvoke(long.Parse(chartID), long.Parse(patientAccount), Is_CF, null, null);


                //Patient Care Plan

                PatientCarePlanDelegate patientCarePlan = new PatientCarePlanDelegate(GetChartFacadeObj().GetPatientCarePlan);
                IAsyncResult CarePlanNotes = patientCarePlan.BeginInvoke(patientAccount, chartID, null, null);


                //Assessments Comment
                AssessmentsCommentDelegate assesmentComment = new AssessmentsCommentDelegate(GetChartFacadeObj().GetOfficeAssesmentComments);
                IAsyncResult AssessmentsComment = assesmentComment.BeginInvoke(patientAccount, chartID, null, null);


                //Physical Exam
                PhysicalExamDelegate physicalExam = new PhysicalExamDelegate(GetChartFacadeObj().GetPatientPhysicalExam);
                IAsyncResult PE = physicalExam.BeginInvoke(chartID, null, null);



                //Chart Notes

                ChartNotesDelegate chartNotes = new ChartNotesDelegate(GetChartFacadeObj().GetPatientChartNotes);
                IAsyncResult ChartNotes = chartNotes.BeginInvoke(patientAccount, chartID, null, null);


                //Plan Of Care Notes

                PlanofCareNotesDelegate planOfCareNotes = new PlanofCareNotesDelegate(GetChartFacadeObj().GetPatientPlanOfCareNotes);
                IAsyncResult PlanofCareNotes = planOfCareNotes.BeginInvoke(patientAccount, chartID, null, null);




                //Office Procedures

                OfficeProceduresDelegate officeProcedures = new OfficeProceduresDelegate(GetChartFacadeObj().GetPatientOfficeProcedureDetails);
                IAsyncResult OfficeProcedures = officeProcedures.BeginInvoke(patientAccount, chartID, null, null);


                //Dermatology

                DermatologyDelegate dermatology = new DermatologyDelegate(GetPatientDermatologicalExam);
                IAsyncResult Dermatology = dermatology.BeginInvoke(patientAccount, chartID, null, null);


                //Neurology
                NeurologyDelegate neurology = new NeurologyDelegate(GetPatientNeurologilcalExam);
                IAsyncResult Nuerology = neurology.BeginInvoke(patientAccount, chartID, null, null);


                //Muscolotecal

                MuscolotecalDelegate muscolotecal = new MuscolotecalDelegate(GetPatientMuscoloskeletalExam);
                IAsyncResult Muscolotecal = muscolotecal.BeginInvoke(patientAccount, chartID, null, null);





                //Annotation
                AnnotationDelegate annotation = new AnnotationDelegate(GetChartFacadeObj().getAnotDetails);
                IAsyncResult Annotation = annotation.BeginInvoke(chartID, patientAccount, null, null);


                //Vascular

                VascularDelegate vascular = new VascularDelegate(GetPatientPodiatryVascularExamText);
                IAsyncResult Vascular = vascular.BeginInvoke(patientAccount, chartID, null, null);



                //Urine Analysis

                UrineAnalysisDelegate urineAnalysis = new UrineAnalysisDelegate(GetChartFacadeObj().GetPatientUrinalysisDetails);
                IAsyncResult URINALYSIS = urineAnalysis.BeginInvoke(chartID, patientAccount, null, null);


                //SugarLog

                SugarLogDelegate sugarLog = new SugarLogDelegate(GetChartFacadeObj().GetPatientSugarLogDetails);
                IAsyncResult SugarLog = sugarLog.BeginInvoke(chartID, patientAccount, null, null);


                //FSBG
                FsbgDelegate fsbg = new FsbgDelegate(GetChartFacadeObj().GetPatientFSBGDetails);
                IAsyncResult FSBG = fsbg.BeginInvoke(chartID, patientAccount, null, null);


                //Peak Flow
                PeakFlowDelegate peakFlow = new PeakFlowDelegate(GetChartFacadeObj().GetPatientPeakFlowDetails);
                IAsyncResult PeakFlow = peakFlow.BeginInvoke(chartID, patientAccount, null, null);


                //EKG

                EkgDelegate ekg = new EkgDelegate(GetChartFacadeObj().GetElectrocardiogramDetails);
                IAsyncResult EKG = ekg.BeginInvoke(chartID, patientAccount, null, null);


                //Urine Test

                UrinePregnancyDelegate urineTest = new UrinePregnancyDelegate(GetChartFacadeObj().GetPatientCommonTestDetails);
                IAsyncResult Urine_Pregnancy = urineTest.BeginInvoke(chartID, patientAccount, "Urine-Pregnancy", null, null);


                //Rapid Strep

                RapidStrepDelegate rapidStrp = new RapidStrepDelegate(GetChartFacadeObj().GetPatientCommonTestDetails);
                IAsyncResult RapidStrep = rapidStrp.BeginInvoke(chartID, patientAccount, "Rapid Strep", null, null);


                //Hemoccult

                HemoccultDelegate hemocCult = new HemoccultDelegate(GetChartFacadeObj().GetPatientCommonTestDetails);
                IAsyncResult Hemoccult = hemocCult.BeginInvoke(chartID, patientAccount, "Hemoccult", null, null);


                //Monospot

                MonospotDelegate monospot = new MonospotDelegate(GetChartFacadeObj().GetPatientCommonTestDetails);
                IAsyncResult MonospotStep = monospot.BeginInvoke(chartID, patientAccount, "Monospot Step", null, null);



                //Dynamic Test Detail

                DynamicTestDetailDelegate dynamicTestDetail = new DynamicTestDetailDelegate(GetDynamicOfficeTest);
                IAsyncResult DynamicTestDetails = dynamicTestDetail.BeginInvoke(chartID, null, null);


                //Obgyn Text

                ObgynTextDelegate obygnText = new ObgynTextDelegate(getOBGYNHISTORY);
                IAsyncResult OBGYNText = obygnText.BeginInvoke(patientAccount, chartID, null, null);


                //Social Rows 

                SocialRowsDelegate socialRow = new SocialRowsDelegate(getphsydata().GetSocialRows);
                IAsyncResult Psy = socialRow.BeginInvoke(chartID, patientAccount, true, null, null);


                //Physc Rows

                PhyscRowsDelegate physRow = new PhyscRowsDelegate(getphsydata().GetPhyscRows);
                IAsyncResult psy_men = physRow.BeginInvoke(chartID, patientAccount, true, null, null);



                // stop invoking
                objChartControls.RFV = reasonForVisit.EndInvoke(RFV);
                objChartControls.Vitals = vitals.EndInvoke(Vitals);
                objChartControls.Allergies = allergies.EndInvoke(Allergies);
                objChartControls.PMH = pastMedicalHistory.EndInvoke(PMH);
                objChartControls.Immunization = immunization.EndInvoke(Immunization);
                objChartControls.PastHospitalization = pastHospitalizationDelegate.EndInvoke(PastHospitalization);
                objChartControls.PastSurgeries = pastSurgeries.EndInvoke(PastSurgeries);
                objChartControls.SocialHx = socailHistory.EndInvoke(SocialHx);
                objChartControls.FamilyHx = familyHistory.EndInvoke(FamilyHx);
                objChartControls.ROS = patientReviewOfSystem.EndInvoke(ROS);
                objChartControls.Cognative = cognative.EndInvoke(Cognative);
                objChartControls.CarePlanNotes = patientCarePlan.EndInvoke(CarePlanNotes);
                objChartControls.AssessmentsComment = assesmentComment.EndInvoke(AssessmentsComment);
                objChartControls.PE = physicalExam.EndInvoke(PE);
                objChartControls.ChartNotes = chartNotes.EndInvoke(ChartNotes);
                objChartControls.PlanofCareNotes = planOfCareNotes.EndInvoke(PlanofCareNotes);
                objChartControls.OfficeAssessments = officeAssessments.EndInvoke(OfficeAssessments);
                objChartControls.OfficeProcedures = officeProcedures.EndInvoke(OfficeProcedures);
                objChartControls.Dermatology = dermatology.EndInvoke(Dermatology);
                objChartControls.Nuerology = neurology.EndInvoke(Nuerology);
                objChartControls.Muscolotecal = muscolotecal.EndInvoke(Muscolotecal);
                objChartControls.Medication = prescription.EndInvoke(Medication);
                objChartControls.Annotation = annotation.EndInvoke(Annotation);
                objChartControls.Vascular = vascular.EndInvoke(Vascular);
                objOfficeTest.URINALYSIS = urineAnalysis.EndInvoke(URINALYSIS);
                objOfficeTest.SugarLog = sugarLog.EndInvoke(SugarLog);
                objOfficeTest.FSBG = fsbg.EndInvoke(FSBG);
                objOfficeTest.PeakFlow = peakFlow.EndInvoke(PeakFlow);
                objOfficeTest.EKG = ekg.EndInvoke(EKG);
                objOfficeTest.Urine_Pregnancy = urineTest.EndInvoke(Urine_Pregnancy);
                objOfficeTest.RapidStrep = rapidStrp.EndInvoke(RapidStrep);
                objOfficeTest.Hemoccult = hemocCult.EndInvoke(Hemoccult);
                objOfficeTest.MonospotStep = monospot.EndInvoke(MonospotStep);
                objOfficeTest.DynamicTestDetails = dynamicTestDetail.EndInvoke(DynamicTestDetails);
                objChartControls.OBGYNText = obygnText.EndInvoke(OBGYNText);
                objChartControls.Phy.Psy = socialRow.EndInvoke(Psy);
                objChartControls.Phy.psy_men = physRow.EndInvoke(psy_men);

本地主机上,与顺序函数调用相比,委托执行速度更快。我通过停止监视以及网络选项卡生产服务器时,它的响应时间比我以前的代码慢。我把这些读数读了三到四次。请指导我为什么会这样。谢谢。

0 个答案:

没有答案