static public List <TestLaboratoryReport> BuildLaboratoryReportFromDataBaseData(string idStep) { List <TestLaboratoryReport> llr = new List <TestLaboratoryReport>(); if (idStep != "") { List <TestAttachment> lta = TestAttachment.BuildTestAttacmentFromDataBase(idStep, idLaboratoryReport); if (lta != null) { foreach (TestAttachment i in lta) { LaboratoryReport r = new LaboratoryReport(); r.CreationDate = i.CreationDate; r.Header = i.DocHead; TestLaboratoryReport tr = new TestLaboratoryReport(r); tr.attachment = i; tr.doctor = TestDoctor.BuildTestDoctorFromDataBase(i.IdDoctor); llr.Add(tr); } } } if (llr.Count != 0) { return(llr); } else { return(null); } }
static public List <TestForm027U> BuildForm027UFromDataBaseData(string idStep) { List <TestForm027U> form = new List <TestForm027U>(); if (idStep != "") { List <TestAttachment> lta = TestAttachment.BuildTestAttacmentFromDataBase(idStep, idForm027U); if (lta != null) { foreach (TestAttachment i in lta) { Form027U r = new Form027U(); r.CreationDate = i.CreationDate; r.Header = i.DocHead; TestForm027U tr = new TestForm027U(r); tr.attachment = i; tr.doctor = TestDoctor.BuildTestDoctorFromDataBase(i.IdDoctor); form.Add(tr); } } } if (form.Count != 0) { return(form); } else { return(null); } }
static public TestDischargeSummary BuildSickListFromDataBaseData(string idStep) { if (idStep != "") { List <TestAttachment> lta = TestAttachment.BuildTestAttacmentFromDataBase(idStep, idEpicrisis); if (lta != null) { foreach (TestAttachment i in lta) { DischargeSummary r = new DischargeSummary(); r.CreationDate = i.CreationDate; r.Header = i.DocHead; TestDischargeSummary tr = new TestDischargeSummary(r); tr.attachment = i; tr.doctor = TestDoctor.BuildTestDoctorFromDataBase(i.IdDoctor); return(tr); } } } return(null); }
static public TestConsultNote BuildSickListFromDataBaseData(string idStep) { if (idStep != "") { List <TestAttachment> lta = TestAttachment.BuildTestAttacmentFromDataBase(idStep, idConsultNote); if (lta != null) { foreach (TestAttachment i in lta) { ConsultNote r = new ConsultNote(); r.CreationDate = i.CreationDate; r.Header = i.DocHead; TestConsultNote tr = new TestConsultNote(r); tr.attachment = i; tr.doctor = TestDoctor.BuildTestDoctorFromDataBase(i.IdDoctor); return(tr); } } } return(null); }
static public List <TestSickList> BuildSickListFromDataBaseData(string idStep, string patientId) { List <TestSickList> tsl = new List <TestSickList>(); if (idStep != "") { List <TestAttachment> lta = TestAttachment.BuildTestAttacmentFromDataBase(idStep, idSickList); if (lta != null) { foreach (TestAttachment i in lta) { using (SqlConnection connection = Global.GetSqlConnection()) { string findSL = "SELECT * FROM SickList WHERE IdMedDocument = '" + i.idMedDocument + "'"; SqlCommand SLcommand = new SqlCommand(findSL, connection); using (SqlDataReader SLReader = SLcommand.ExecuteReader()) { while (SLReader.Read()) { SickList r = new SickList(); r.SickListInfo = new SickListInfo(); if (SLReader["Number"].ToString() != "") { r.SickListInfo.Number = Convert.ToString(SLReader["Number"]); } if (SLReader["DateStart"].ToString() != "") { r.SickListInfo.DateStart = Convert.ToDateTime(SLReader["DateStart"]); } if (SLReader["DateEnd"].ToString() != "") { r.SickListInfo.DateEnd = Convert.ToDateTime(SLReader["DateEnd"]); } if (SLReader["IdRDisabilityDocStatus"].ToString() != "") { r.SickListInfo.DisabilityDocState = Convert.ToByte(SLReader["IdRDisabilityDocStatus"]); } if (SLReader["IdRDisabilityDocReason"].ToString() != "") { r.SickListInfo.DisabilityDocReason = Convert.ToByte(SLReader["IdRDisabilityDocReason"]); } if (SLReader["IsPatient"].ToString() != "") { r.SickListInfo.IsPatientTaker = Convert.ToBoolean(SLReader["IsPatient"]); } r.CreationDate = i.CreationDate; r.Header = i.DocHead; TestSickList tr = new TestSickList(r); tr.attachment = i; tr.doctor = TestDoctor.BuildTestDoctorFromDataBase(i.IdDoctor); if (SLReader["IdCareGiver"].ToString() != "") { tr.guardian = TestGuardian.BuildTestGuardianFromDataBase(SLReader["IdCareGiver"].ToString(), patientId); } tsl.Add(tr); } } } } } } if (tsl.Count != 0) { return(tsl); } else { return(null); } }
//public TestReferral(ReferralDto r) //{ // referral = new Referral // { // ReferralInfo = new ReferralInfo // { // IdReferralType = Convert.ToByte(r.IdReferralType), // IdReferralMis = r.IdReferralMis, // IssuedDateTime = r.IssuedDateTime, // //r.IdUrgencyType; // MkbCode = r.MkbCode, // Reason = r.Reason // }, // IdSourceLpu = r.IdSourceLpu, // IdTargetLpu = r.IdTargetLpu, // //r.IdLPU; // }; // attachment = new TestAttachment(new MedDocument.DocumentAttachment()); // doctor = TestDoctor.BuildTestDoctorFromDataBase(r.IdDoctorRef); // departmentHead = TestDoctor.BuildTestDoctorFromDataBase(r.IdRefDepartmentHead); //} static public List <TestReferral> BuildReferralFromDataBaseData(string idStep) { List <TestReferral> trl = new List <TestReferral>(); if (idStep != "") { List <TestAttachment> lta = TestAttachment.BuildTestAttacmentFromDataBase(idStep, idReferral); if (lta != null) { foreach (TestAttachment i in lta) { using (SqlConnection connection = Global.GetSqlConnection()) { string findR = "SELECT * FROM Referral WHERE IdMedDocument = '" + i.idMedDocument + "'"; SqlCommand Rcommand = new SqlCommand(findR, connection); using (SqlDataReader RReader = Rcommand.ExecuteReader()) { while (RReader.Read()) { Referral r = new Referral(); r.ReferralInfo = new ReferralInfo(); if (RReader["MkbCode"].ToString() != "") { r.ReferralInfo.MkbCode = Convert.ToString(RReader["MkbCode"]); } if (RReader["IdSourceLpu"].ToString() != "") { r.IdSourceLpu = Global.GetIdIdLpu(Convert.ToString(RReader["IdSourceLpu"])); } if (RReader["IdTargetLpu"].ToString() != "") { r.IdTargetLpu = Global.GetIdIdLpu(Convert.ToString(RReader["IdTargetLpu"])); } if (RReader["Reason"].ToString() != "") { r.ReferralInfo.Reason = Convert.ToString(RReader["Reason"]); } if (RReader["IdReferralMIS"].ToString() != "") { r.ReferralInfo.IdReferralMis = Convert.ToString(RReader["IdReferralMIS"]); } if (RReader["IdReferralType"].ToString() != "") { r.ReferralInfo.IdReferralType = Convert.ToByte(RReader["IdReferralType"]); } if (RReader["IssuedDateTime"].ToString() != "") { r.ReferralInfo.IssuedDateTime = Convert.ToDateTime(RReader["IssuedDateTime"]); } if (RReader["IdHospitalizationOrder"].ToString() != "") { r.ReferralInfo.HospitalizationOrder = Convert.ToByte(RReader["IdHospitalizationOrder"]); } if (RReader["ReferralId"].ToString() != "") { r.ReferralID = Convert.ToString(RReader["ReferralId"]); } if (RReader["RelatedId"].ToString() != "") { r.RelatedID = Convert.ToString(RReader["RelatedId"]); } r.CreationDate = i.CreationDate; r.Header = i.DocHead; //Тут нет ReferalId и referedId TestReferral tr = new TestReferral(r); tr.attachment = i; if (RReader["IdRefDepartmentHead"].ToString() != "") { tr.departmentHead = TestDoctor.BuildTestDoctorFromDataBase((RReader["IdRefDepartmentHead"]).ToString()); } tr.doctor = TestDoctor.BuildTestDoctorFromDataBase(i.IdDoctor); trl.Add(tr); } } } } } } if (trl.Count != 0) { return(trl); } else { return(null); } }
static public TestDispensaryOne BuildSickListFromDataBaseData(string idStep) { if (idStep != "") { List <TestAttachment> lta = TestAttachment.BuildTestAttacmentFromDataBase(idStep, idDispensaryOne); if (lta != null) { foreach (TestAttachment i in lta) { using (SqlConnection connection = Global.GetSqlConnection()) { string findDO = "SELECT TOP(1) * FROM DispensaryStage1, DispensaryStage1HealthGroup WHERE DispensaryStage1.idDispensaryStage1 = (SELECT MAX(idDispensaryStage1) FROM DispensaryStage1 WHERE IdMedDocument = '" + i.idMedDocument + "') AND DispensaryStage1.idDispensaryStage1 = DispensaryStage1HealthGroup.idDispensaryStage1"; SqlCommand DOcommand = new SqlCommand(findDO, connection); using (SqlDataReader DOReader = DOcommand.ExecuteReader()) { while (DOReader.Read()) { DispensaryOne r = new DispensaryOne(); r.HealthGroup = new HealthGroup(); r.HealthGroup.HealthGroupInfo = new HealthGroupInfo(); if (DOReader["IsGuested"].ToString() != "") { r.IsGuested = Convert.ToBoolean(DOReader["IsGuested"]); } if (DOReader["HasExtraResearchRefferal"].ToString() != "") { r.HasExtraResearchRefferal = Convert.ToBoolean(DOReader["HasExtraResearchRefferal"]); } if (DOReader["IsUnderObservation"].ToString() != "") { r.IsUnderObservation = Convert.ToBoolean(DOReader["IsUnderObservation"]); } if (DOReader["HasExpertCareRefferal"].ToString() != "") { r.HasExpertCareRefferal = Convert.ToBoolean(DOReader["HasExpertCareRefferal"]); } if (DOReader["HasPrescribeCure"].ToString() != "") { r.HasPrescribeCure = Convert.ToBoolean(DOReader["HasPrescribeCure"]); } if (DOReader["HasHealthResortRefferal"].ToString() != "") { r.HasHealthResortRefferal = Convert.ToBoolean(DOReader["HasHealthResortRefferal"]); } if (DOReader["HasSecondStageRefferal"].ToString() != "") { r.HasSecondStageRefferal = Convert.ToBoolean(DOReader["HasSecondStageRefferal"]); } if (DOReader["IdHealthGroup"].ToString() != "") { r.HealthGroup.HealthGroupInfo.IdHealthGroup = Convert.ToByte(DOReader["IdHealthGroup"]); } if (DOReader["Date"].ToString() != "") { r.HealthGroup.HealthGroupInfo.Date = Convert.ToDateTime(DOReader["Date"]); } r.Header = i.DocHead; r.CreationDate = i.CreationDate; TestDispensaryOne tdo = new TestDispensaryOne(r); if (DOReader["IdDoctor"].ToString() != "") { tdo.hdDoctor = TestDoctor.BuildTestDoctorFromDataBase((DOReader["IdDoctor"]).ToString()); } if (DOReader["idDispensaryStage1"].ToString() != "") { tdo.recom = TestRecommendation.BuildSickListFromDataBaseData(DOReader["idDispensaryStage1"].ToString()); } tdo.doctor = TestDoctor.BuildTestDoctorFromDataBase(i.IdDoctor); tdo.attachment = i; return(tdo); } } } } } } return(null); }