public void AddMedRecord(string guid, string idLpu, string idPatientMis, MedRecord mr, string idCaseMis = "") { try { client.AddMedRecord(guid, idLpu, idPatientMis, idCaseMis, mr); TestMasterCase tmc = TestMasterCase.BuildTestMasterCase(guid, idLpu, idPatientMis, idCaseMis); if (Global.IsEqual(tmc, null)) { Global.errors1.Add("Case " + idCaseMis + " не найден в базе данных"); } else if (!tmc.CheckDocumentInCase(mr, idLpu)) { Global.errors1.Add("Не добавлен"); } } catch (System.ServiceModel.FaultException <List <PixServiseTests.EMKServise.RequestFault> > e) { getErrors(e.Detail); } catch (System.ServiceModel.FaultException <PixServiseTests.EMKServise.RequestFault[]> e) { getErrors(e.Detail); } catch (System.ServiceModel.FaultException <PixServiseTests.EMKServise.RequestFault> e) { Global.errors1.Add(e.Detail.PropertyName + " - " + e.Detail.Message); getErrors(e.Detail.Errors); } }
public static TestMasterCase BuildTestMasterCase(string guid, string idlpu, string patientIdmis, string mis = "") { if ((guid != string.Empty) && (idlpu != string.Empty) && (patientIdmis != string.Empty)) { string patientId = TestPerson.GetPersonId(guid, idlpu, patientIdmis); string caseId = TestCaseBase.GetCaseId(guid, idlpu, mis, patientId); if (caseId != null) { TestMasterCase mcase = new TestMasterCase(); mcase.caseBase = TestCaseBase.BuildBaseCaseFromDataBaseData(guid, idlpu, mis, patientId); List<TestStepBase> st = TestStepBase.BuildTestStepsFromDataBase(caseId, idlpu); if (st != null) { foreach (TestStepBase i in st) { if (Global.IsEqual(i.doctor, null)) mcase.defaultStep = i; } if (!Global.IsEqual(mcase.defaultStep, null)) { mcase.records = new List<TestMedRecord>(); List<TestService> serv = TestService.BuildServiseFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(serv, null)) mcase.records.AddRange(serv); TestTfomsInfo forms = TestTfomsInfo.BuildTfomsInfoFromDataBaseDate(mcase.defaultStep.idStep); if (!Global.IsEqual(forms, null)) mcase.records.Add(forms); TestDeathInfo tdi = TestDeathInfo.BuildDeathInfoFromDataBaseDate(mcase.defaultStep.idStep); if (!Global.IsEqual(tdi, null)) mcase.records.Add(tdi); List<TestDiagnosis> td = TestDiagnosis.BuildDiagnosisFromDataBaseDate(mcase.defaultStep.idStep); if (!Global.IsEqual(td, null)) mcase.records.AddRange(td); TestClinicMainDiagnosis acdm = TestClinicMainDiagnosis.BuildTestClinicMainDiagnosisFromDataBaseDate(mcase.defaultStep.idStep); if (!Global.IsEqual(acdm, null)) mcase.records.Add(acdm); List<TestReferral> trl = TestReferral.BuildReferralFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(trl, null)) mcase.records.AddRange(trl); List<TestSickList> tsl = TestSickList.BuildSickListFromDataBaseData(mcase.defaultStep.idStep, patientId); if (!Global.IsEqual(tsl, null)) mcase.records.AddRange(tsl); TestDischargeSummary tds = TestDischargeSummary.BuildSickListFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(tds, null)) mcase.records.Add(tds); List<TestLaboratoryReport> tlr = TestLaboratoryReport.BuildLaboratoryReportFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(tlr, null)) mcase.records.AddRange(tlr); TestConsultNote tcn = TestConsultNote.BuildSickListFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(tcn, null)) mcase.records.Add(tcn); TestDispensaryOne d1 = TestDispensaryOne.BuildSickListFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(d1, null)) mcase.records.Add(d1); List<TestAppointedMedication> ap = TestAppointedMedication.BuildAppointedMedicationFromDataBaseDate(mcase.defaultStep.idStep); if (!Global.IsEqual(ap, null)) mcase.records.AddRange(ap); List<TestForm027U> form = TestForm027U.BuildForm027UFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(form, null)) mcase.records.AddRange(form); } } return mcase; } } return null; }
public static TestMasterCase BuildTestMasterCase(string guid, string idlpu, string patientIdmis, string mis = "") { if ((guid != string.Empty) && (idlpu != string.Empty) && (patientIdmis != string.Empty)) { string patientId = TestPerson.GetPersonId(guid, idlpu, patientIdmis); string caseId = TestCaseBase.GetCaseId(guid, idlpu, mis, patientId); if (caseId != null) { TestMasterCase mcase = new TestMasterCase(); mcase.caseBase = TestCaseBase.BuildBaseCaseFromDataBaseData(guid, idlpu, mis, patientId); List <TestStepBase> st = TestStepBase.BuildTestStepsFromDataBase(caseId, idlpu); if (st != null) { foreach (TestStepBase i in st) { if (Global.IsEqual(i.doctor, null)) { mcase.defaultStep = i; } } if (!Global.IsEqual(mcase.defaultStep, null)) { mcase.records = new List <TestMedRecord>(); List <TestService> serv = TestService.BuildServiseFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(serv, null)) { mcase.records.AddRange(serv); } TestTfomsInfo forms = TestTfomsInfo.BuildTfomsInfoFromDataBaseDate(mcase.defaultStep.idStep); if (!Global.IsEqual(forms, null)) { mcase.records.Add(forms); } TestDeathInfo tdi = TestDeathInfo.BuildDeathInfoFromDataBaseDate(mcase.defaultStep.idStep); if (!Global.IsEqual(tdi, null)) { mcase.records.Add(tdi); } List <TestDiagnosis> td = TestDiagnosis.BuildDiagnosisFromDataBaseDate(mcase.defaultStep.idStep); if (!Global.IsEqual(td, null)) { mcase.records.AddRange(td); } TestClinicMainDiagnosis acdm = TestClinicMainDiagnosis.BuildTestClinicMainDiagnosisFromDataBaseDate(mcase.defaultStep.idStep); if (!Global.IsEqual(acdm, null)) { mcase.records.Add(acdm); } List <TestReferral> trl = TestReferral.BuildReferralFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(trl, null)) { mcase.records.AddRange(trl); } List <TestSickList> tsl = TestSickList.BuildSickListFromDataBaseData(mcase.defaultStep.idStep, patientId); if (!Global.IsEqual(tsl, null)) { mcase.records.AddRange(tsl); } TestDischargeSummary tds = TestDischargeSummary.BuildSickListFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(tds, null)) { mcase.records.Add(tds); } List <TestLaboratoryReport> tlr = TestLaboratoryReport.BuildLaboratoryReportFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(tlr, null)) { mcase.records.AddRange(tlr); } TestConsultNote tcn = TestConsultNote.BuildSickListFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(tcn, null)) { mcase.records.Add(tcn); } TestDispensaryOne d1 = TestDispensaryOne.BuildSickListFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(d1, null)) { mcase.records.Add(d1); } List <TestAppointedMedication> ap = TestAppointedMedication.BuildAppointedMedicationFromDataBaseDate(mcase.defaultStep.idStep); if (!Global.IsEqual(ap, null)) { mcase.records.AddRange(ap); } List <TestForm027U> form = TestForm027U.BuildForm027UFromDataBaseData(mcase.defaultStep.idStep); if (!Global.IsEqual(form, null)) { mcase.records.AddRange(form); } } } return(mcase); } } return(null); }