예제 #1
0
 public void CloseStatCaseWithServiceMin()
 {
     using (TestPixServiceClient c = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         c.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient client = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
         client.CreateCase(Global.GUID, caseStat);
         caseStat            = (new SetData()).MinCaseStatSetForClose();
         caseStat.MedRecords = new List <MedRecord>
         {
             (new SetData()).MinService(),
             (new SetData()).MinClinicMainDiagnosis()
         };
         client.CloseCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #2
0
파일: SetData.cs 프로젝트: nbIxMaN/EMKT
        public CaseStat MinCaseStatSetForClose()
        {
            CaseStat caseStat = new CaseStat();

            caseStat.CloseDate              = CaseStatData.caseStat.CloseDate;
            caseStat.IdCaseMis              = CaseStatData.caseStat.IdCaseMis;
            caseStat.Confidentiality        = CaseStatData.caseStat.Confidentiality;
            caseStat.DoctorConfidentiality  = CaseStatData.caseStat.DoctorConfidentiality;
            caseStat.CuratorConfidentiality = CaseStatData.caseStat.CuratorConfidentiality;
            caseStat.IdLpu        = CaseStatData.caseStat.IdLpu;
            caseStat.IdCaseResult = CaseStatData.caseStat.IdCaseResult;
            caseStat.Comment      = CaseStatData.caseStat.Comment;
            caseStat.IdPatientMis = CaseStatData.caseStat.IdPatientMis;
            caseStat.HospResult   = CaseStatData.caseStat.HospResult;

            caseStat.DoctorInCharge = MinDoctorSet();

            caseStat.Author = new Participant
            {
                Doctor = MinDoctorSet()
            };

            caseStat.Authenticator = new Participant
            {
                Doctor = MinDoctorSet()
            };

            return(caseStat);
        }
예제 #3
0
 public void AddStepToCaseStatCaseWithServiceMin()
 {
     using (TestPixServiceClient c = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         c.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient client = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
         client.CreateCase(Global.GUID, caseStat);
         StepStat stepStat = (new SetData()).MinStepStatSet();
         stepStat.MedRecords = new List <MedRecord>
         {
             (new SetData()).MinService()
         };
         client.AddStepToCase(Global.GUID, Data.idlpu, caseStat.IdPatientMis, caseStat.IdCaseMis, stepStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #4
0
        public void AddMedRecord_ToCase_StatCaseWithServiceFull()
        {
            using (TestPixServiceClient c = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                c.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient client = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSet();
                client.AddCase(Global.GUID, caseStat);

                MedRecord medRecord = MedRecordData.service;

                client.AddMedRecord(Global.GUID, Data.idlpu, caseStat.IdPatientMis, medRecord, caseStat.IdCaseMis);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
예제 #5
0
        public void UpdateStatCaseWithAppointedMedicationMin()
        {
            using (TestPixServiceClient c = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                c.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient client = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSet();
                client.AddCase(Global.GUID, caseStat);
                StepStat stepStat = (new SetData()).MinStepStatSet();
                stepStat.MedRecords = new List <MedRecord>
                {
                    (new SetData()).MinAppointedMedication()
                };

                caseStat.Steps = new List <StepStat>
                {
                    stepStat
                };
                client.UpdateCase(Global.GUID, caseStat);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
예제 #6
0
파일: SetData.cs 프로젝트: nbIxMaN/EMKT
        public CaseStat MinCaseStatSetForCreate()
        {
            CaseStat caseStat = new CaseStat();

            caseStat.OpenDate               = CaseStatData.caseStat.OpenDate;
            caseStat.IdCaseMis              = CaseStatData.caseStat.IdCaseMis;
            caseStat.IdPaymentType          = CaseStatData.caseStat.IdPaymentType;
            caseStat.Confidentiality        = CaseStatData.caseStat.Confidentiality;
            caseStat.DoctorConfidentiality  = CaseStatData.caseStat.DoctorConfidentiality;
            caseStat.CuratorConfidentiality = CaseStatData.caseStat.CuratorConfidentiality;
            caseStat.IdLpu                  = CaseStatData.caseStat.IdLpu;
            caseStat.IdPatientMis           = CaseStatData.caseStat.IdPatientMis;
            caseStat.HistoryNumber          = CaseStatData.caseStat.HistoryNumber;
            caseStat.IdTypeFromDiseaseStart = CaseStatData.caseStat.IdTypeFromDiseaseStart;
            caseStat.IdRepetition           = CaseStatData.caseStat.IdRepetition;
            caseStat.IdHospChannel          = CaseStatData.caseStat.IdHospChannel;

            caseStat.Author = new Participant
            {
                Doctor = MinDoctorSet()
            };

            caseStat.Authenticator = new Participant
            {
                Doctor = MinDoctorSet()
            };

            caseStat.Steps = new List <StepStat>
            {
                MinStepStatSet()
            };

            return(caseStat);
        }
예제 #7
0
 public void UpdateStatCaseRef_ToStep()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSet();
         EmkClient.AddCase(Global.GUID, caseStat);
         StepStat stepStat = (new SetData()).MinStepStatSet();
         stepStat.MedRecords = new List <MedRecord>
         {
             MedRecordData.referral
         };
         caseStat.Steps = new List <StepStat>
         {
             stepStat
         };
         EmkClient.UpdateCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #8
0
 public void UpdateStatCaseWithMaxConsultNote()
 {
     using (TestPixServiceClient c = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         c.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient client = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSet();
         client.AddCase(Global.GUID, caseStat);
         caseStat.MedRecords = new List <MedRecord>
         {
             MedRecordData.consultNote,
             (new SetData()).MinClinicMainDiagnosis()
         };
         client.UpdateCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #9
0
 public void UpdateStatCaseFullSick()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSet();
         EmkClient.AddCase(Global.GUID, caseStat);
         caseStat.MedRecords = new List <MedRecord>
         {
             MedRecordData.sickList,
             (new SetData()).MinClinicMainDiagnosis()
         };
         EmkClient.UpdateCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #10
0
        public void UpdateMinStatCase_AfterClose()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
                EmkClient.CreateCase(Global.GUID, caseStat);

                caseStat = (new SetData()).MinCaseStatSetForClose();
                EmkClient.CloseCase(Global.GUID, caseStat);

                caseStat = (new SetData()).MinCaseStatSet();
                EmkClient.UpdateCase(Global.GUID, caseStat);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
예제 #11
0
        public void AddMinStatCase()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSet();
                caseStat.PrehospitalDefects = new List <byte>()
                {
                    1, 2
                };

                EmkClient.AddCase(Global.GUID, caseStat);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
예제 #12
0
 public void CreateStatCaseMinSick()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
         caseStat.MedRecords = new List <MedRecord>
         {
             (new SetData()).MinSickList()
         };
         EmkClient.CreateCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #13
0
 public void CreateStatCaseWithServiceFull()
 {
     using (TestPixServiceClient c = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         c.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient client = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
         caseStat.MedRecords = new List <MedRecord>
         {
             MedRecordData.service
         };
         StepStat stepStat = (new SetData()).MinStepStatSet();
         stepStat.MedRecords = new List <MedRecord>
         {
             MedRecordData.service,
             (new SetData()).MinService()
         };
         caseStat.Steps = new List <StepStat>
         {
             stepStat
         };
         client.CreateCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #14
0
 public void AddDeathInfo()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSet();
         caseStat.IdCaseResult = 6;
         caseStat.MedRecords   = new List <MedRecord>
         {
             MedRecordData.anatomopathologicalClinicMainDiagnosis,
             MedRecordData.deathInfo
         };
         EmkClient.AddCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #15
0
        public void AddStatStep_SameIdFull()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
                EmkClient.CreateCase(Global.GUID, caseStat);

                StepStat stepStat = CaseStatData.otherStep;
                stepStat.IdStepMis  = CaseStatData.step.IdStepMis;
                stepStat.MedRecords = new List <MedRecord>
                {
                    (new SetData()).MinService(),
                    (new SetData()).MinAppointedMedication(),
                    (new SetData()).MinDiagnosis(),
                    MedRecordData.clinicMainDiagnosis,
                    MedRecordData.referral,
                    (new SetData()).MinLaboratoryReport()
                };
                EmkClient.AddStepToCase(Global.GUID, Data.idlpu, caseStat.IdPatientMis, caseStat.IdCaseMis, stepStat);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
예제 #16
0
        public void AddStatStep_SameIdMin()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
                EmkClient.CreateCase(Global.GUID, caseStat);

                StepStat stepStat = (new SetData()).MinOtherStepStatSet();
                stepStat.IdStepMis = CaseStatData.step.IdStepMis;
                EmkClient.AddStepToCase(Global.GUID, Data.idlpu, caseStat.IdPatientMis, caseStat.IdCaseMis, stepStat);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
예제 #17
0
        public void UpdateMinStatCase_AfterClose()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient("D500E893-166B-4724-9C78-D0DBE1F1C48D", "1.2.643.5.1.13.3.25.78.118", patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
                EmkClient.CreateCase("D500E893-166B-4724-9C78-D0DBE1F1C48D", caseStat);

                caseStat = (new SetData()).MinCaseStatSetForClose();
                EmkClient.CloseCase("D500E893-166B-4724-9C78-D0DBE1F1C48D", caseStat);
                caseStat = (new SetData()).MinCaseStatSet();
                EmkClient.UpdateCase("D500E893-166B-4724-9C78-D0DBE1F1C48D", caseStat);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
예제 #18
0
        public void UpdateFullStatCase_AfterClose()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient("D500E893-166B-4724-9C78-D0DBE1F1C48D", "1.2.643.5.1.13.3.25.78.118", patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
                EmkClient.CreateCase("D500E893-166B-4724-9C78-D0DBE1F1C48D", caseStat);

                caseStat = (new SetData()).MinCaseStatSetForClose();
                EmkClient.CloseCase("D500E893-166B-4724-9C78-D0DBE1F1C48D", caseStat);

                CaseStat caseStatUpdate = (new SetData()).FullCaseStatSet();
                SetData  set            = new SetData();
                caseStat.MedRecords = new MedRecord[]
                {
                    set.MinService(),
                        set.MinTfomsInfo(),
                        MedRecordData.deathInfo,
                        set.MinDiagnosis(),
                        MedRecordData.clinicMainDiagnosis,
                        MedRecordData.anatomopathologicalClinicMainDiagnosis,
                        MedRecordData.referral,
                        MedRecordData.sickList,
                        set.MinDischargeSummary(),
                        set.MinLaboratoryReport(),
                        set.MinConsultNote()
                };
                StepStat stepStat = (new SetData()).MinStepStatSet();
                stepStat.MedRecords = new MedRecord[]
                {
                    set.MinService(),
                        set.MinAppointedMedication(),
                        set.MinDiagnosis(),
                        MedRecordData.clinicMainDiagnosis,
                        MedRecordData.referral,
                        set.MinLaboratoryReport(),
                };
                caseStat.Steps = new StepStat[]
                {
                    stepStat
                };

                EmkClient.UpdateCase("D500E893-166B-4724-9C78-D0DBE1F1C48D", caseStatUpdate);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
예제 #19
0
파일: SetData.cs 프로젝트: nbIxMaN/EMKT
        public CaseStat FullCaseStatSetForClose()
        {
            CaseStat caseStat = CaseStatData.caseStat;

            caseStat.Steps        = null;
            caseStat.HospResult   = 1;
            caseStat.IdCaseResult = 1;
            return(caseStat);
        }
예제 #20
0
        public void UpdateFullStatCase_AfterClose()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
                EmkClient.CreateCase(Global.GUID, caseStat);

                caseStat = (new SetData()).MinCaseStatSetForClose();
                EmkClient.CloseCase(Global.GUID, caseStat);

                CaseStat caseStatUpdate = (new SetData()).FullCaseStatSet();
                SetData  set            = new SetData();
                caseStat.MedRecords = new List <MedRecord>
                {
                    set.MinService(),
                        set.MinTfomsInfo(),
                        MedRecordData.deathInfo,
                        set.MinDiagnosis(),
                        MedRecordData.anatomopathologicalClinicMainDiagnosis,
                        set.MinRefferal(),
                        set.MinSickList(),
                        set.MinDischargeSummary(),
                        set.MinLaboratoryReport(),
                        set.MinConsultNote(),
                        MedRecordData.form027U
                };
                StepStat stepStat = (new SetData()).MinStepStatSet();
                stepStat.MedRecords = new List <MedRecord>
                {
                    set.MinService(),
                        set.MinAppointedMedication(),
                        set.MinDiagnosis(),
                        set.MinRefferal(),
                        set.MinLaboratoryReport(),
                };
                caseStat.Steps = new List <StepStat>
                {
                    stepStat
                };

                EmkClient.UpdateCase(Global.GUID, caseStatUpdate);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
예제 #21
0
파일: SetData.cs 프로젝트: nbIxMaN/EMKT
        public CaseStat FullCaseStatSetForCreate()
        {
            CaseStat caseStat = CaseStatData.caseStat;

            caseStat.CloseDate    = new DateTime();
            caseStat.IdCaseResult = new byte();
            caseStat.Comment      = null;
            caseStat.HospResult   = new byte();

            return(caseStat);
        }
예제 #22
0
파일: UnitTest1.cs 프로젝트: nbIxMaN/EMKT
 public void _CreateStatCase()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).FullCaseStatSetForCreate();
         caseStat.Guardian = null;
         caseStat.OpenDate = new DateTime(2014, 06, 01);
         SetData  set      = new SetData();
         StepStat stepStat = (new SetData()).MinStepStatSet();
         caseStat.Steps = new List <StepStat>
         {
             stepStat
         };
         caseStat.Steps[0].DateStart = new DateTime(2014, 06, 01);
         caseStat.Steps[0].DateEnd   = new DateTime(2014, 06, 04);
         EmkClient.CreateCase(Global.GUID, caseStat);
         StepStat s = CaseStatData.otherStep;
         s.MedRecords = new List <MedRecord>
         {
             MedRecordData.appointedMedication,
             MedRecordData.service
         };
         s.DateStart = new DateTime(2014, 06, 05);
         s.DateEnd   = new DateTime(2014, 06, 10);
         EmkClient.AddStepToCase(Global.GUID, caseStat.IdLpu, caseStat.IdPatientMis, caseStat.IdCaseMis, s);
         caseStat            = (new SetData()).FullCaseStatSetForClose();
         caseStat.Guardian   = null;
         caseStat.CloseDate  = new DateTime(2014, 06, 10);
         caseStat.MedRecords = new List <MedRecord>
         {
             MedRecordData.clinicMainDiagnosis,
             GetEpic()
         };
         EmkClient.CloseCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #23
0
 public void AddStatMedRecTfomfsInfo_nonexistentCase()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
         //EmkClient.CreateCase(Global.GUID, caseStat);
         EmkClient.AddMedRecord(Global.GUID, Data.idlpu, caseStat.IdPatientMis, MedRecordData.tfomsInfo, "nonexistentCase");
     }
     Assert.IsTrue(Global.errors1.Contains(" - Случай обслуживания не найден"), "MedRecord был добавлен");
 }
예제 #24
0
 public void CancelFullStatCase()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).FullCaseStatSetForCreate();
         SetData  set      = new SetData();
         caseStat.MedRecords = new List <MedRecord>
         {
             set.MinService(),
                 set.MinTfomsInfo(),
                 set.MinDiagnosis(),
                 MedRecordData.clinicMainDiagnosis,
                 MedRecordData.referral,
                 MedRecordData.sickList,
                 set.MinLaboratoryReport(),
         };
         StepStat stepStat = (new SetData()).MinStepStatSet();
         stepStat.MedRecords = new List <MedRecord>
         {
             set.MinService(),
                 set.MinAppointedMedication(),
                 set.MinDiagnosis(),
                 MedRecordData.clinicMainDiagnosis,
                 MedRecordData.referral,
                 set.MinLaboratoryReport(),
         };
         caseStat.Steps = new List <StepStat>
         {
             stepStat
         };
         EmkClient.CreateCase(Global.GUID, caseStat);
         EmkClient.CancelCase(Global.GUID, Data.idlpu, caseStat.IdPatientMis, caseStat.IdCaseMis);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #25
0
 public void UpdateMinStatCase_AfterAdd()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSet();
         EmkClient.AddCase(Global.GUID, caseStat);
         caseStat = (new SetData()).MinCaseStatSet();
         caseStat.DoctorInCharge = new MedicalStaff
         {
             IdLpu        = Data.idlpu,
             IdSpeciality = 31,
             IdPosition   = 76,
             Person       = new PersonWithIdentity
             {
                 IdPersonMis = "unknown1",
                 Sex         = 2,
                 Birthdate   = new DateTime(1976, 03, 09),
                 Documents   = new List <IdentityDocument>
                 {
                     DocumentData.SNILS,
                 },
                 HumanName = new HumanName
                 {
                     FamilyName = "unknown1",
                     GivenName  = "unknown1",
                     MiddleName = "unknown1",
                 },
             }
         };
         caseStat.DoctorInCharge.Person.Documents[0].DocN = "11111111549";
         EmkClient.UpdateCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #26
0
 public void AddMedForm027U_CloseCase()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSet();
         EmkClient.AddCase(Global.GUID, caseStat);
         EmkClient.AddMedRecord(Global.GUID, Data.idlpu, caseStat.IdPatientMis, MedRecordData.form027U, caseStat.IdCaseMis);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #27
0
 public void AddStatMedRecConsultNote_OpenCase()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
         EmkClient.CreateCase(Global.GUID, caseStat);
         EmkClient.AddMedRecord(Global.GUID, Data.idlpu, caseStat.IdPatientMis, MedRecordData.consultNote, caseStat.IdCaseMis);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #28
0
 public void AddStatMedRecAnatomDiagnosis_CloseCase()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSet();
         EmkClient.AddCase(Global.GUID, caseStat);
         EmkClient.AddMedRecord(Global.GUID, Data.idlpu, caseStat.IdPatientMis, MedRecordData.anatomopathologicalClinicMainDiagnosis, caseStat.IdCaseMis);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #29
0
        public void CloseStatCaseFull()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
                EmkClient.CreateCase(Global.GUID, caseStat);

                CaseStat CaseStatClose = (new SetData()).FullCaseStatSetForClose();
                //CaseStatClose.Guardian = null;
                CaseStatClose.MedRecords = new List <MedRecord>
                {
                    (new SetData()).MinService(),
                    (new SetData()).MinTfomsInfo(),
                    MedRecordData.deathInfo,
                    (new SetData()).MinDiagnosis(),
                    MedRecordData.anatomopathologicalClinicMainDiagnosis,
                    MedRecordData.referral,
                    MedRecordData.sickList,
                    (new SetData()).MinDischargeSummary(),
                    (new SetData()).MinLaboratoryReport(),
                    (new SetData()).MinConsultNote(),
                    MedRecordData.form027U
                };
                EmkClient.CloseCase(Global.GUID, CaseStatClose);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
예제 #30
0
 public void AddStatMedRecConsultNote_CloseCase()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSet();
         EmkClient.AddCase(Global.GUID, caseStat);
         //var x = N3.EMK.Infrastructure.Helpers.Md5Helper.VerifyGost3411Hash(MedRecordData.consultNote.Attachment.Data, MedRecordData.consultNote.Attachment.Hash);
         EmkClient.AddMedRecord(Global.GUID, Data.idlpu, caseStat.IdPatientMis, MedRecordData.consultNote, caseStat.IdCaseMis);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
예제 #31
0
파일: SetData.cs 프로젝트: nbIxMaN/EMKT
        public CaseStat MinCaseStatSetForCreate()
        {
            CaseStat caseStat = new CaseStat();

            caseStat.OpenDate = CaseStatData.caseStat.OpenDate;
            caseStat.IdCaseMis = CaseStatData.caseStat.IdCaseMis;
            caseStat.IdPaymentType = CaseStatData.caseStat.IdPaymentType;
            caseStat.Confidentiality = CaseStatData.caseStat.Confidentiality;
            caseStat.DoctorConfidentiality = CaseStatData.caseStat.DoctorConfidentiality;
            caseStat.CuratorConfidentiality = CaseStatData.caseStat.CuratorConfidentiality;
            caseStat.IdLpu = CaseStatData.caseStat.IdLpu;
            caseStat.IdPatientMis = CaseStatData.caseStat.IdPatientMis;
            caseStat.HistoryNumber = CaseStatData.caseStat.HistoryNumber;
            caseStat.IdTypeFromDiseaseStart = CaseStatData.caseStat.IdTypeFromDiseaseStart;
            caseStat.IdRepetition = CaseStatData.caseStat.IdRepetition;
            caseStat.IdHospChannel = CaseStatData.caseStat.IdHospChannel;

            caseStat.Author = new Participant
            {
                Doctor = MinDoctorSet()
            };

            caseStat.Authenticator = new Participant
            {
                Doctor = MinDoctorSet()
            };

            caseStat.Steps = new List<StepStat>
            {
               MinStepStatSet()
            };

            return caseStat;
        }
예제 #32
0
파일: SetData.cs 프로젝트: nbIxMaN/EMKT
        public CaseStat MinCaseStatSetForClose()
        {
            CaseStat caseStat = new CaseStat();

            caseStat.CloseDate = CaseStatData.caseStat.CloseDate;
            caseStat.IdCaseMis = CaseStatData.caseStat.IdCaseMis;
            caseStat.Confidentiality = CaseStatData.caseStat.Confidentiality;
            caseStat.DoctorConfidentiality = CaseStatData.caseStat.DoctorConfidentiality;
            caseStat.CuratorConfidentiality = CaseStatData.caseStat.CuratorConfidentiality;
            caseStat.IdLpu = CaseStatData.caseStat.IdLpu;
            caseStat.IdCaseResult = CaseStatData.caseStat.IdCaseResult;
            caseStat.Comment = CaseStatData.caseStat.Comment;
            caseStat.IdPatientMis = CaseStatData.caseStat.IdPatientMis;
            caseStat.HospResult = CaseStatData.caseStat.HospResult;

            caseStat.DoctorInCharge = MinDoctorSet();

            caseStat.Author = new Participant
            {
                Doctor = MinDoctorSet()
            };

            caseStat.Authenticator = new Participant
            {
                Doctor = MinDoctorSet()
            };

            return caseStat;
        }
예제 #33
0
        public TestStatCase(string guid, CaseStat cs)
        {
            GUID = guid.ToLower();
            if (cs != null)
            {
                caseStat = cs;
                caseBase = new TestCaseBase(guid, cs);
                if (cs.Steps != null)
                {
                    statSteps = new List<TestStatStep>();
                    foreach (StepStat i in cs.Steps)
                    {
                        statSteps.Add(new TestStatStep(i, cs.IdLpu));
                    }
                }
                if (cs.MedRecords != null)
                {
                    records = new List<TestMedRecord>();
                    foreach (object i in cs.MedRecords)
                    {
                        Service ser = i as Service;
                        if (ser != null) records.Add(new TestService(ser, cs.IdLpu));

                        TfomsInfo tfi = i as TfomsInfo;
                        if (tfi != null) records.Add(new TestTfomsInfo(tfi));

                        DeathInfo di = i as DeathInfo;
                        if (di != null) records.Add(new TestDeathInfo(di));

                        ClinicMainDiagnosis cmd = i as ClinicMainDiagnosis;
                        if ((cmd != null) && (cs.HospResult != IdDeath) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                            records.Add(new TestClinicMainDiagnosis(cmd, cs.IdLpu));

                        AnatomopathologicalClinicMainDiagnosis acmd = i as AnatomopathologicalClinicMainDiagnosis;
                        if ((acmd != null) && (cs.HospResult == IdDeath) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                            records.Add(new TestClinicMainDiagnosis(acmd, cs.IdLpu));
                        if ((cmd == null) && (acmd == null))
                        {
                            Diagnosis diag = i as Diagnosis;
                            if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType != TestDiagnosis.IdClinicMainDiagnosis))
                                records.Add(new TestDiagnosis(diag, cs.IdLpu));
                            if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                                records.Add(new TestClinicMainDiagnosis(diag, cs.IdLpu));
                        }

                        Referral r = i as Referral;
                        if (r != null) records.Add(new TestReferral(r, cs.IdLpu));

                        SickList sl = i as SickList;
                        if (sl != null) records.Add(new TestSickList(sl, cs.IdLpu));

                        DischargeSummary ds = i as DischargeSummary;
                        if (ds != null) records.Add(new TestDischargeSummary(ds, cs.IdLpu));

                        LaboratoryReport lr = i as LaboratoryReport;
                        if (lr != null) records.Add(new TestLaboratoryReport(lr, cs.IdLpu));

                        ConsultNote cn = i as ConsultNote;
                        if (cn != null) records.Add(new TestConsultNote(cn, cs.IdLpu));

                        AppointedMedication ap = i as AppointedMedication;
                        if (ap != null) records.Add(new TestAppointedMedication(ap, cs.IdLpu));

                        Form027U form = i as Form027U;
                        if (form != null) records.Add(new TestForm027U(form, cs.IdLpu));
                    }
                }
                if ((cs.IdLpu != null) && (cs.IdPatientMis != null))
                {
                    List<TestStepBase> st = TestStepBase.BuildTestStepsFromDataBase(TestCaseBase.GetCaseId(guid, cs.IdLpu, cs.IdCaseMis, TestPerson.GetPersonId(guid, cs.IdLpu, cs.IdPatientMis)), cs.IdLpu);
                    if (st != null)
                    {
                        foreach (TestStepBase i in st)
                        {
                            if (Global.IsEqual(i.doctor, null))
                                defaultStep = i;
                        }
                    }
                }
            }
        }
예제 #34
0
        public void ChangeUpdateStatCase(string guid, CaseStat cs)
        {
            GUID = guid.ToLower();
            if (cs != null)
            {
                if (cs.DeliveryCode != null)
                    this.caseStat.DeliveryCode = cs.DeliveryCode;
                if (cs.IdIntoxicationType != 0)
                    this.caseStat.IdIntoxicationType = cs.IdIntoxicationType;
                if (cs.IdPatientConditionOnAdmission != 0)
                    this.caseStat.IdPatientConditionOnAdmission = cs.IdPatientConditionOnAdmission;
                if (cs.IdTypeFromDiseaseStart != 0)
                    this.caseStat.IdTypeFromDiseaseStart = cs.IdTypeFromDiseaseStart;
                if (cs.IdTransportIntern != 0)
                    this.caseStat.IdTransportIntern = cs.IdTransportIntern;
                if (cs.IdHospChannel != 0)
                    this.caseStat.IdHospChannel = cs.IdHospChannel;
                this.caseStat.RW1Mark = cs.RW1Mark;
                this.caseStat.AIDSMark = cs.AIDSMark;
                caseBase.UpdateCaseBase(guid, cs);
                if (cs.MedRecords != null)
                {
                    List<TestMedRecord> newMedRecords = new List<TestMedRecord>();
                    TestTfomsInfo tfi = null;
                    TestClinicMainDiagnosis cmd = null;
                    TestDischargeSummary ds = null;
                    TestConsultNote cn = null;
                    TestDeathInfo tdi = null;

                    foreach (object i in cs.MedRecords)
                    {
                        Service ser = i as Service;
                        if (ser != null) newMedRecords.Add(new TestService(ser, cs.IdLpu));

                        TfomsInfo tf = i as TfomsInfo;
                        if (tf != null) tfi = new TestTfomsInfo(tf);

                        Diagnosis diag = i as Diagnosis;
                        if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType != TestDiagnosis.IdClinicMainDiagnosis))
                            newMedRecords.Add(new TestDiagnosis(diag, cs.IdLpu));

                        ClinicMainDiagnosis cd = i as ClinicMainDiagnosis;
                        if ((cd != null) && (cs.HospResult != IdDeath) && (cd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                            cmd = new TestClinicMainDiagnosis(cd, cs.IdLpu);

                        ClinicMainDiagnosis ca = i as ClinicMainDiagnosis;
                        if ((ca != null) && (cs.HospResult == IdDeath) && (ca.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                            cmd = new TestClinicMainDiagnosis(ca, cs.IdLpu);

                        Referral r = i as Referral;
                        if (r != null) newMedRecords.Add(new TestReferral(r, cs.IdLpu));

                        SickList sl = i as SickList;
                        if (sl != null) newMedRecords.Add(new TestSickList(sl, cs.IdLpu));

                        DischargeSummary pds = i as DischargeSummary;
                        if (pds != null) ds = new TestDischargeSummary(pds, cs.IdLpu);

                        LaboratoryReport lr = i as LaboratoryReport;
                        if (lr != null) newMedRecords.Add(new TestLaboratoryReport(lr, cs.IdLpu));

                        ConsultNote pcn = i as ConsultNote;
                        if (pcn != null) cn = new TestConsultNote(pcn, cs.IdLpu);

                        AppointedMedication ap = i as AppointedMedication;
                        if (ap != null) newMedRecords.Add(new TestAppointedMedication(ap, cs.IdLpu));

                        DeathInfo di = i as DeathInfo;
                        if (di != null) tdi = new TestDeathInfo(di);

                        Form027U form = i as Form027U;
                        if (form != null) newMedRecords.Add(new TestForm027U(form, cs.IdLpu)); //?
                    }
                    if (Global.GetLength(this.medRecords) != 0)
                    {
                        foreach (object i in this.medRecords)
                        {
                            TestService ser = i as TestService;
                            if (!Global.IsEqual(ser, null))
                                newMedRecords.Add(ser);

                            TestTfomsInfo tf = i as TestTfomsInfo;
                            if (!Global.IsEqual(tfi, null) && (!Global.IsEqual(tf, null)))
                                newMedRecords.Add(tf);
                            else
                                if (!Global.IsEqual(tfi, null))
                                    newMedRecords.Add(tfi);

                            TestDiagnosis diag = i as TestDiagnosis;
                            if (!Global.IsEqual(diag, null))
                                newMedRecords.Add(diag);

                            TestClinicMainDiagnosis cm = i as TestClinicMainDiagnosis;
                            if (!Global.IsEqual(cmd, null))
                                newMedRecords.Add(cmd);
                            else
                                if (!Global.IsEqual(cm, null))
                                    newMedRecords.Add(cm);

                            TestReferral r = i as TestReferral;
                            if (!Global.IsEqual(r, null))
                                newMedRecords.Add(r);

                            TestSickList sl = i as TestSickList;
                            if (!Global.IsEqual(sl, null))
                                newMedRecords.Add(sl);

                            TestDischargeSummary pds = i as TestDischargeSummary;
                            if (!Global.IsEqual(ds, null))
                                newMedRecords.Add(ds);
                            else
                                if (!Global.IsEqual(pds, null))
                                    newMedRecords.Add(pds);

                            TestLaboratoryReport lr = i as TestLaboratoryReport;
                            if (!Global.IsEqual(lr, null))
                                newMedRecords.Add(lr);

                            TestConsultNote pcn = i as TestConsultNote;
                            if (!Global.IsEqual(cn, null))
                                newMedRecords.Add(cn);
                            else
                                if (!Global.IsEqual(pcn, null))
                                    newMedRecords.Add(pcn);

                            TestAppointedMedication ap = i as TestAppointedMedication;
                            if (!Global.IsEqual(ap, null))
                                newMedRecords.Add(ap);

                            TestDeathInfo di = i as TestDeathInfo;
                            if (!Global.IsEqual(tdi, null) && (!Global.IsEqual(di, null)))
                                newMedRecords.Add(di);
                            else
                                if (!Global.IsEqual(tdi, null))
                                    newMedRecords.Add(tdi);

                            TestForm027U form = i as TestForm027U;
                            if (!Global.IsEqual(form, null))
                                newMedRecords.Add(form);
                        }
                    }
                    else
                    {
                        if (!Global.IsEqual(tfi, null))
                            newMedRecords.Add(tfi);
                        if (!Global.IsEqual(cmd, null))
                            newMedRecords.Add(cmd);
                        if (!Global.IsEqual(ds, null))
                            newMedRecords.Add(ds);
                        if (!Global.IsEqual(cn, null))
                            newMedRecords.Add(cn);
                        if (!Global.IsEqual(tdi, null))
                            newMedRecords.Add(tdi);
                    }
                    this.records = newMedRecords;
                }
            }
        }
예제 #35
0
        public static TestStatCase BuildAmbCaseFromDataBaseData(string guid, string idlpu, string mis, string patientId)
        {
            if ((guid != string.Empty) && (idlpu != string.Empty) && (mis != string.Empty))
            {
                string caseId = TestCaseBase.GetCaseId(guid, idlpu, mis, patientId);
                if (caseId != null)
                {
                    CaseStat ca = new CaseStat();
                    using (SqlConnection connection = Global.GetSqlConnection())
                    {
                        string findCase = "SELECT TOP(1) * FROM HospCase WHERE IdCase = '" + caseId + "'";
                        SqlCommand caseCommand = new SqlCommand(findCase, connection);
                        using (SqlDataReader caseReader = caseCommand.ExecuteReader())
                        {
                            while (caseReader.Read())
                            {
                                if (caseReader["DeliveredCode"].ToString() != "")
                                    ca.DeliveryCode = Convert.ToString(caseReader["DeliveredCode"]);
                                if (caseReader["IdIntoxicationType"].ToString() != "")
                                    ca.IdIntoxicationType = Convert.ToByte(caseReader["IdIntoxicationType"]);
                                if (caseReader["IdPatientConditionOnAdmission"].ToString() != "")
                                    ca.IdPatientConditionOnAdmission = Convert.ToByte(caseReader["IdPatientConditionOnAdmission"]);
                                if (caseReader["IdTypeFromDiseaseStart"].ToString() != "")
                                    ca.IdTypeFromDiseaseStart = Convert.ToByte(caseReader["IdTypeFromDiseaseStart"]);
                                if (caseReader["IdTransportIntern"].ToString() != "")
                                    ca.IdTransportIntern = Convert.ToByte(caseReader["IdTransportIntern"]);
                                if (caseReader["IdHospChannel"].ToString() != "")
                                    ca.IdHospChannel = Convert.ToByte(caseReader["IdHospChannel"]);
                                if (caseReader["RW1Mark"].ToString() != "")
                                    ca.RW1Mark = Convert.ToBoolean(caseReader["RW1Mark"]);
                                if (caseReader["AIDSMark"].ToString() != "")
                                    ca.AIDSMark = Convert.ToBoolean(caseReader["AIDSMark"]);
                                TestStatCase statcase = new TestStatCase(guid, ca);
                                statcase.caseBase = TestCaseBase.BuildBaseCaseFromDataBaseData(guid, idlpu, mis, patientId);
                                statcase.statSteps = TestStatStep.BuildStatStepsFromDataBase(caseId, ca.IdLpu);
                                List<TestStepBase> st = TestStepBase.BuildTestStepsFromDataBase(caseId, ca.IdLpu);
                                if (st != null)
                                {
                                    foreach (TestStepBase i in st)
                                    {
                                        if (Global.IsEqual(i.doctor, null))
                                            statcase.defaultStep = i;
                                    }
                                    if (!Global.IsEqual(statcase.defaultStep, null))
                                    {
                                        statcase.records = new List<TestMedRecord>();
                                        List<TestService> serv = TestService.BuildServiseFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(serv, null)) statcase.records.AddRange(serv);

                                        TestTfomsInfo forms = TestTfomsInfo.BuildTfomsInfoFromDataBaseDate(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(forms, null)) statcase.records.Add(forms);

                                        TestDeathInfo tdi = TestDeathInfo.BuildDeathInfoFromDataBaseDate(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(tdi, null)) statcase.records.Add(tdi);

                                        List<TestDiagnosis> td = TestDiagnosis.BuildDiagnosisFromDataBaseDate(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(td, null)) statcase.records.AddRange(td);

                                        TestClinicMainDiagnosis acdm = TestClinicMainDiagnosis.BuildTestClinicMainDiagnosisFromDataBaseDate(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(acdm, null)) statcase.records.Add(acdm);

                                        List<TestReferral> trl = TestReferral.BuildReferralFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(trl, null)) statcase.records.AddRange(trl);

                                        List<TestSickList> tsl = TestSickList.BuildSickListFromDataBaseData(statcase.defaultStep.idStep, patientId);
                                        if (!Global.IsEqual(tsl, null)) statcase.records.AddRange(tsl);

                                        TestDischargeSummary tds = TestDischargeSummary.BuildSickListFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(tds, null)) statcase.records.Add(tds);

                                        List<TestLaboratoryReport> tlr = TestLaboratoryReport.BuildLaboratoryReportFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(tlr, null)) statcase.records.AddRange(tlr);

                                        TestConsultNote tcn = TestConsultNote.BuildSickListFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(tcn, null)) statcase.records.Add(tcn);

                                        List<TestAppointedMedication> ap = TestAppointedMedication.BuildAppointedMedicationFromDataBaseDate(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(ap, null)) statcase.records.AddRange(ap);

                                        List<TestForm027U> form = TestForm027U.BuildForm027UFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(form, null)) statcase.records.AddRange(form);

                                        if (statcase.records.Count == 0)
                                            statcase.records = null;
                                    }
                                }
                                return statcase;
                            }
                        }
                    }
                }
            }
            return null;
        }