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); } }
public TestReferral(Referral r, string idLpu = "") { referral = r; attachment = new TestAttachment(r.Attachment); doctor = new TestDoctor(r.Author, idLpu); departmentHead = new TestDoctor(r.DepartmentHead, idLpu); }
public override bool Equals(Object obj) { TestDoctor p = obj as TestDoctor; if ((object)p == null) { return(false); } if (this.doctor == p.doctor) { return(true); } if ((this.doctor == null) || (p.doctor == null)) { return(false); } if ((this.doctor.IdLpu == p.doctor.IdLpu) && (this.doctor.IdPosition == p.doctor.IdPosition) && (this.doctor.IdSpeciality == p.doctor.IdSpeciality) && Global.IsEqual(person, p.person)) { return(true); } else { this.FindMismatch(p); Global.errors3.Add("несовпадение TestDoctor"); return(false); } }
static public TestClinicMainDiagnosis BuildTestClinicMainDiagnosisFromDataBaseDate(string idStep) { using (SqlConnection connection = Global.GetSqlConnection()) { string findTD = "SELECT TOP(1) * FROM Diagnosis WHERE IdDiagnosis = (SELECT MAX(IdDiagnosis) FROM Diagnosis WHERE IdStep = '" + idStep + "' AND IdDiagnosisType = '" + TestDiagnosis.IdClinicMainDiagnosis + "' AND IdParentDiagnosis is NULL)"; SqlCommand TDcommand = new SqlCommand(findTD, connection); using (SqlDataReader TDReader = TDcommand.ExecuteReader()) { while (TDReader.Read()) { if (TDReader["IdParentDiagnosis"].ToString() == "") { ClinicMainDiagnosis d = new ClinicMainDiagnosis(); TestClinicMainDiagnosis td = new TestClinicMainDiagnosis(d); td._diagnosis = TestDiagnosis.BuildDiagnosisFromDataBaseDate(idStep, TDReader["IdDiagnosis"].ToString()); td.diagnosInfo = TestDiagnosisInfo.BuildDiagnosisFromDataBaseDate(TDReader["IdDiagnosis"].ToString()); if (TDReader["IdDiagnosedDoctor"].ToString() != "") { td.doctor = TestDoctor.BuildTestDoctorFromDataBase(TDReader["IdDiagnosedDoctor"].ToString()); } return(td); } } } } return(null); }
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); } }
public TestRecommendation(Recommendation r, string idLpu = "") { if (r != null) { recommendation = r; doctor = new TestDoctor(r.Doctor, idLpu); } }
public TestForm027U(Form027U r, string idLpu = "") { if (r != null) { form027U = r; attachment = new TestAttachment(r.Attachment); doctor = new TestDoctor(r.Author, idLpu); } }
public TestDiagnosis(Diagnosis d, string idLpu = "") { if (d != null) { document = d; info = new TestDiagnosisInfo(d.DiagnosisInfo); doctor = new TestDoctor(d.Doctor, idLpu); } }
public TestDischargeSummary(DischargeSummary r, string idLpu = "") { if (r != null) { dischargeSummary = r; attachment = new TestAttachment(r.Attachment); doctor = new TestDoctor(r.Author, idLpu); } }
public TestLaboratoryReport(LaboratoryReport r, string idLpu = "") { if (r != null) { laboratoryReport = r; attachment = new TestAttachment(r.Attachment); doctor = new TestDoctor(r.Author, idLpu); } }
public TestStepBase(StepBase s, string caseLpu) { if (s != null) step = s; if (s.Doctor != null) { doctor = new TestDoctor(s.Doctor, caseLpu); } }
public TestConsultNote(ConsultNote r, string idLpu = "") { if (r != null) { consultNote = r; attachment = new TestAttachment(r.Attachment); doctor = new TestDoctor(r.Author, idLpu); } }
public TestParticipant(Participant d, string idLpu = "") { if (d != null) { if (d.Doctor != null) doctor = new TestDoctor(d.Doctor, idLpu); participant = d; } }
public TestCaseBase(string guid, CaseBase cb) { GUID = guid.ToLower(); if (cb != null) { caseBase = cb; if (caseBase.OpenDate == null) { caseBase.OpenDate = DateTime.MinValue; } if (caseBase.CloseDate == null) { caseBase.CloseDate = DateTime.MinValue; } } if (cb.Author != null) { autor = new TestParticipant(cb.Author, cb.IdLpu); if (autor.doctor.doctor.IdLpu == null) { autor.doctor.doctor.IdLpu = cb.IdLpu; } } if (cb.Authenticator != null) { authenticator = new TestParticipant(cb.Authenticator, cb.IdLpu); if (authenticator.doctor.doctor.IdLpu == null) { authenticator.doctor.doctor.IdLpu = cb.IdLpu; } } if (cb.LegalAuthenticator != null) { legalAuthenticator = new TestParticipant(cb.LegalAuthenticator, cb.IdLpu); if (legalAuthenticator.doctor.doctor.IdLpu == null) { legalAuthenticator.doctor.doctor.IdLpu = cb.IdLpu; } } if (cb.DoctorInCharge != null) { doctorInCharge = new TestDoctor(cb.DoctorInCharge, cb.IdLpu); if (doctorInCharge.doctor.IdLpu == null) { doctorInCharge.doctor.IdLpu = cb.IdLpu; } } if (cb.Guardian != null) { guardian = new TestGuardian(cb.Guardian); } if (cb.IdPatientMis != null) { patient = TestPatient.BuildPatientFromDataBaseData(guid, cb.IdLpu, cb.IdPatientMis); } }
public TestClinicMainDiagnosis(Diagnosis d, string idLpu = "") { if (d != null) { if (d.DiagnosisInfo != null) diagnosInfo = new TestDiagnosisInfo(d.DiagnosisInfo); if (d.Doctor != null) doctor = new TestDoctor(d.Doctor, idLpu); } }
static public TestParticipant BuildTestParticipantFromDataBase(string idCase, string idDoctor, byte idPersonRole) { Participant p = new Participant(); p.IdRole = idPersonRole; TestParticipant part = new TestParticipant(p); part.doctor = TestDoctor.BuildTestDoctorFromDataBase(idDoctor); return(part); }
public TestStepBase(StepBase s, string caseLpu) { if (s != null) { step = s; } if (s.Doctor != null) { doctor = new TestDoctor(s.Doctor, caseLpu); } }
public TestParticipant(Participant d, string idLpu = "") { if (d != null) { if (d.Doctor != null) { doctor = new TestDoctor(d.Doctor, idLpu); } participant = d; } }
public bool CheckDoctorInDataBase(string mis) { TestDoctor doc = TestDoctor.BuildTestDoctorFromDataBase(mis); if (this != doc) { this.FindMismatch(doc); return(false); } return(true); }
public TestSickList(SickList r, string idLpu = "") { if (r != null) { sickList = r; attachment = new TestAttachment(r.Attachment); if (r.Author != null) doctor = new TestDoctor(r.Author, idLpu); if (r.SickListInfo.Caregiver != null) guardian = new TestGuardian(r.SickListInfo.Caregiver); } }
public TestClinicMainDiagnosis(Diagnosis d, string idLpu = "") { if (d != null) { if (d.DiagnosisInfo != null) { diagnosInfo = new TestDiagnosisInfo(d.DiagnosisInfo); } if (d.Doctor != null) { doctor = new TestDoctor(d.Doctor, idLpu); } } }
public TestSickList(SickList r, string idLpu = "") { if (r != null) { sickList = r; attachment = new TestAttachment(r.Attachment); if (r.Author != null) { doctor = new TestDoctor(r.Author, idLpu); } if (r.SickListInfo.Caregiver != null) { guardian = new TestGuardian(r.SickListInfo.Caregiver); } } }
public TestClinicMainDiagnosis(ClinicMainDiagnosis d, string idLpu = "") { if (d != null) { if (d.DiagnosisInfo != null) diagnosInfo = new TestDiagnosisInfo(d.DiagnosisInfo); if (d.Complications != null) { _diagnosis = new List<TestDiagnosis>(); foreach (Diagnosis i in d.Complications) _diagnosis.Add(new TestDiagnosis(i, idLpu)); } if (d.Doctor != null) doctor = new TestDoctor(d.Doctor, idLpu); } }
public TestDispensaryOne(DispensaryOne r, string idLpu = "") { if (r != null) { dispansaryOne = r; attachment = new TestAttachment(r.Attachment); doctor = new TestDoctor(r.Author, idLpu); hdDoctor = new TestDoctor(r.HealthGroup.Doctor, idLpu); if (r.Recommendations != null) { recom = new List<TestRecommendation>(); foreach(Recommendation i in r.Recommendations) { recom.Add(new TestRecommendation(i, idLpu)); } } } }
public TestDispensaryOne(DispensaryOne r, string idLpu = "") { if (r != null) { dispansaryOne = r; attachment = new TestAttachment(r.Attachment); doctor = new TestDoctor(r.Author, idLpu); hdDoctor = new TestDoctor(r.HealthGroup.Doctor, idLpu); if (r.Recommendations != null) { recom = new List <TestRecommendation>(); foreach (Recommendation i in r.Recommendations) { recom.Add(new TestRecommendation(i, idLpu)); } } } }
static public List <TestDiagnosis> BuildDiagnosisFromDataBaseDate(string IdStep, string IdParentDiagnosis = "") { List <TestDiagnosis> tdList = new List <TestDiagnosis>(); if (IdStep != "") { using (SqlConnection connection = Global.GetSqlConnection()) { string findTD = ""; if (IdParentDiagnosis == "") { findTD = "SELECT * FROM Diagnosis WHERE IdStep = '" + IdStep + "' AND IdDiagnosisType <> '" + IdClinicMainDiagnosis + "' AND IdParentDiagnosis IS NULL"; } else { findTD = "SELECT * FROM Diagnosis WHERE IdStep = '" + IdStep + "' AND IdDiagnosisType <> '" + IdClinicMainDiagnosis + "' AND IdParentDiagnosis = '" + IdParentDiagnosis + "'"; } SqlCommand TDcommand = new SqlCommand(findTD, connection); using (SqlDataReader TDReader = TDcommand.ExecuteReader()) { while (TDReader.Read()) { Diagnosis d = new Diagnosis(); TestDiagnosis td = new TestDiagnosis(d); td.info = TestDiagnosisInfo.BuildDiagnosisFromDataBaseDate(TDReader["IdDiagnosis"].ToString()); if (TDReader["IdDiagnosedDoctor"].ToString() != "") { td.doctor = TestDoctor.BuildTestDoctorFromDataBase(TDReader["IdDiagnosedDoctor"].ToString()); } tdList.Add(td); } } } } if (tdList.Count != 0) { return(tdList); } else { return(null); } }
static public List <TestRecommendation> BuildSickListFromDataBaseData(string idDispensaryStage1) { List <TestRecommendation> llr = new List <TestRecommendation>(); if (idDispensaryStage1 != "") { using (SqlConnection connection = Global.GetSqlConnection()) { string findR = "SELECT * FROM Recommendation WHERE idDispensaryStage1 = '" + idDispensaryStage1 + "'"; SqlCommand Rcommand = new SqlCommand(findR, connection); using (SqlDataReader RReader = Rcommand.ExecuteReader()) { while (RReader.Read()) { Recommendation r = new Recommendation(); if (RReader["Text"].ToString() != "") { r.Text = RReader["Text"].ToString(); } if (RReader["Date"].ToString() != "") { r.Date = Convert.ToDateTime(RReader["Date"]); } TestRecommendation tr = new TestRecommendation(r); if (RReader["IdDoctor"].ToString() != "") { tr.doctor = TestDoctor.BuildTestDoctorFromDataBase(RReader["IdDoctor"].ToString()); } llr.Add(tr); } } } } if (llr.Count != 0) { return(llr); } else { return(null); } }
public static TestDoctor BuildTestDoctorFromDataBase(string doctorId) { if (doctorId != null) { using (SqlConnection connection = Global.GetSqlConnection()) { string findDoctor = "SELECT TOP(1) * FROM Doctor, nsi.DoctorSpec WHERE Doctor.IdDoctor = '" + doctorId + "' AND Doctor.IdSpeciality = nsi.DoctorSpec.IdSpeciality"; SqlCommand doc = new SqlCommand(findDoctor, connection); using (SqlDataReader doctorReader = doc.ExecuteReader()) { while (doctorReader.Read()) { string IdPerson = Convert.ToString(doctorReader["IdPerson"]); MedicalStaff ms = new MedicalStaff(); ms.IdPosition = Convert.ToUInt16(doctorReader["IdPosition"]); ms.IdSpeciality = Convert.ToUInt16(doctorReader["Code"]); ms.IdLpu = Convert.ToString(doctorReader["IdLpu"]); if (Data.type == Type.oid) { string findIdInstitutionalString = "SELECT TOP(1) * FROM Institution WHERE IdInstitution = '" + ms.IdLpu + "'"; using (SqlConnection connection2 = Global.GetSqlConnection()) { SqlCommand IdInstitution = new SqlCommand(findIdInstitutionalString, connection2); using (SqlDataReader IdInstitutional = IdInstitution.ExecuteReader()) { while (IdInstitutional.Read()) { ms.IdLpu = IdInstitutional["IdFedNsi"].ToString(); } } } } TestDoctor p = new TestDoctor(ms); p.person = TestPerson.BuildPersonFromDataBaseData(IdPerson); return p; } } } } return null; }
static public TestDoctor BuildTestDoctorFromDataBase(string doctorId) { if (doctorId != null) { using (SqlConnection connection = Global.GetSqlConnection()) { string findDoctor = "SELECT TOP(1) * FROM Doctor, nsi.DoctorSpec WHERE Doctor.IdDoctor = '" + doctorId + "' AND Doctor.IdSpeciality = nsi.DoctorSpec.IdSpeciality"; SqlCommand doc = new SqlCommand(findDoctor, connection); using (SqlDataReader doctorReader = doc.ExecuteReader()) { while (doctorReader.Read()) { string IdPerson = Convert.ToString(doctorReader["IdPerson"]); MedicalStaff ms = new MedicalStaff(); ms.IdPosition = Convert.ToUInt16(doctorReader["IdPosition"]); ms.IdSpeciality = Convert.ToUInt16(doctorReader["Code"]); ms.IdLpu = Convert.ToString(doctorReader["IdLpu"]); if (Data.type == Type.oid) { string findIdInstitutionalString = "SELECT TOP(1) * FROM Institution WHERE IdInstitution = '" + ms.IdLpu + "'"; using (SqlConnection connection2 = Global.GetSqlConnection()) { SqlCommand IdInstitution = new SqlCommand(findIdInstitutionalString, connection2); using (SqlDataReader IdInstitutional = IdInstitution.ExecuteReader()) { while (IdInstitutional.Read()) { ms.IdLpu = IdInstitutional["IdFedNsi"].ToString(); } } } } TestDoctor p = new TestDoctor(ms); p.person = TestPerson.BuildPersonFromDataBaseData(IdPerson); return(p); } } } } return(null); }
public TestAppointedMedication(AppointedMedication a, string idLpu = "") { if (a != null) { document = a; if (a.CourseDose != null) { courseDose = new TestQuantity(a.CourseDose); } if (a.DayDose != null) { dayDose = new TestQuantity(a.DayDose); } if (a.OneTimeDose != null) { oneTimeDose = new TestQuantity(a.OneTimeDose); } doctor = new TestDoctor(a.Doctor, idLpu); } }
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 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); }
public TestCaseBase(string guid, CaseBase cb) { GUID = guid.ToLower(); if (cb != null) { caseBase = cb; if (caseBase.OpenDate == null) caseBase.OpenDate = DateTime.MinValue; if (caseBase.CloseDate == null) caseBase.CloseDate = DateTime.MinValue; } if (cb.Author != null) { autor = new TestParticipant(cb.Author, cb.IdLpu); if (autor.doctor.doctor.IdLpu == null) autor.doctor.doctor.IdLpu = cb.IdLpu; } if (cb.Authenticator != null) { authenticator = new TestParticipant(cb.Authenticator, cb.IdLpu); if (authenticator.doctor.doctor.IdLpu == null) authenticator.doctor.doctor.IdLpu = cb.IdLpu; } if (cb.LegalAuthenticator != null) { legalAuthenticator = new TestParticipant(cb.LegalAuthenticator, cb.IdLpu); if (legalAuthenticator.doctor.doctor.IdLpu == null) legalAuthenticator.doctor.doctor.IdLpu = cb.IdLpu; } if (cb.DoctorInCharge != null) { doctorInCharge = new TestDoctor(cb.DoctorInCharge, cb.IdLpu); if (doctorInCharge.doctor.IdLpu == null) doctorInCharge.doctor.IdLpu = cb.IdLpu; } if (cb.Guardian != null) guardian = new TestGuardian(cb.Guardian); if (cb.IdPatientMis != null) patient = TestPatient.BuildPatientFromDataBaseData(guid, cb.IdLpu, cb.IdPatientMis); }
public TestClinicMainDiagnosis(ClinicMainDiagnosis d, string idLpu = "") { if (d != null) { if (d.DiagnosisInfo != null) { diagnosInfo = new TestDiagnosisInfo(d.DiagnosisInfo); } if (d.Complications != null) { _diagnosis = new List <TestDiagnosis>(); foreach (Diagnosis i in d.Complications) { _diagnosis.Add(new TestDiagnosis(i, idLpu)); } } if (d.Doctor != null) { doctor = new TestDoctor(d.Doctor, idLpu); } } }
private void FindMismatch(TestDoctor d) { if (d.doctor != null) { if (this.doctor.IdLpu != d.doctor.IdLpu) { Global.errors3.Add("Несовпадение IdLpu TestDoctor"); } if (this.doctor.IdPosition != d.doctor.IdPosition) { Global.errors3.Add("Несовпадение IdPosition TestDoctor"); } if (this.doctor.IdSpeciality != d.doctor.IdSpeciality) { Global.errors3.Add("Несовпадение IdSpeciality TestDoctor"); } if (Global.GetLength(this.person) != Global.GetLength(d.person)) { Global.errors3.Add("Несовпадение длины person TestDoctor"); } } }
public void UpdateCaseBase(string guid, CaseBase cb) { if (guid != "") { GUID = guid.ToLower(); } if (cb != null) { if (cb.CloseDate != DateTime.MinValue) { this.caseBase.CloseDate = cb.CloseDate; } if (cb.Comment != "") { this.caseBase.Comment = cb.Comment; } if (cb.Confidentiality != 0) { this.caseBase.Confidentiality = cb.Confidentiality; } if (cb.CuratorConfidentiality != 0) { this.caseBase.CuratorConfidentiality = cb.CuratorConfidentiality; } if (cb.DoctorConfidentiality != 0) { this.caseBase.DoctorConfidentiality = cb.DoctorConfidentiality; } if (cb.HistoryNumber != "") { this.caseBase.HistoryNumber = cb.HistoryNumber; } if (cb.IdCaseAidType != 0) { this.caseBase.IdCaseAidType = cb.IdCaseAidType; } if (cb.IdCaseMis != "") { this.caseBase.IdCaseMis = cb.IdCaseMis; } if (cb.IdCaseResult != 0) { this.caseBase.IdCaseResult = cb.IdCaseResult; } if (cb.IdLpu != "") { this.caseBase.IdLpu = cb.IdLpu; } if (cb.IdPaymentType != 0) { this.caseBase.IdPaymentType = cb.IdPaymentType; } if (cb.OpenDate != DateTime.MinValue) { this.caseBase.OpenDate = cb.OpenDate; } if (cb.Author != null) { autor = new TestParticipant(cb.Author, cb.IdLpu); if (autor.doctor.doctor.IdLpu == null) { autor.doctor.doctor.IdLpu = cb.IdLpu; } } if (cb.Authenticator != null) { authenticator = new TestParticipant(cb.Authenticator, cb.IdLpu); if (authenticator.doctor.doctor.IdLpu == null) { authenticator.doctor.doctor.IdLpu = cb.IdLpu; } } if (cb.LegalAuthenticator != null) { legalAuthenticator = new TestParticipant(cb.LegalAuthenticator, cb.IdLpu); if (legalAuthenticator.doctor.doctor.IdLpu == null) { legalAuthenticator.doctor.doctor.IdLpu = cb.IdLpu; } } if (cb.DoctorInCharge != null) { doctorInCharge = new TestDoctor(cb.DoctorInCharge, cb.IdLpu); if (doctorInCharge.doctor.IdLpu == null) { doctorInCharge.doctor.IdLpu = cb.IdLpu; } } if (cb.Guardian != null) { guardian = new TestGuardian(cb.Guardian); } if (cb.IdPatientMis != null) { patient = TestPatient.BuildPatientFromDataBaseData(guid, cb.IdLpu, cb.IdPatientMis); } } }
public void UpdateCaseBase(string guid, CaseBase cb) { if (guid != "") GUID = guid.ToLower(); if (cb != null) { if (cb.CloseDate != DateTime.MinValue) this.caseBase.CloseDate = cb.CloseDate; if (cb.Comment != "") this.caseBase.Comment = cb.Comment; if (cb.Confidentiality != 0) this.caseBase.Confidentiality = cb.Confidentiality; if (cb.CuratorConfidentiality != 0) this.caseBase.CuratorConfidentiality = cb.CuratorConfidentiality; if (cb.DoctorConfidentiality != 0) this.caseBase.DoctorConfidentiality = cb.DoctorConfidentiality; if (cb.HistoryNumber != "") this.caseBase.HistoryNumber = cb.HistoryNumber; if (cb.IdCaseAidType != 0) this.caseBase.IdCaseAidType = cb.IdCaseAidType; if (cb.IdCaseMis != "") this.caseBase.IdCaseMis = cb.IdCaseMis; if (cb.IdCaseResult != 0) this.caseBase.IdCaseResult = cb.IdCaseResult; if (cb.IdLpu != "") this.caseBase.IdLpu = cb.IdLpu; if (cb.IdPaymentType != 0) this.caseBase.IdPaymentType = cb.IdPaymentType; if (cb.OpenDate != DateTime.MinValue) this.caseBase.OpenDate = cb.OpenDate; if (cb.Author != null) { autor = new TestParticipant(cb.Author, cb.IdLpu); if (autor.doctor.doctor.IdLpu == null) autor.doctor.doctor.IdLpu = cb.IdLpu; } if (cb.Authenticator != null) { authenticator = new TestParticipant(cb.Authenticator, cb.IdLpu); if (authenticator.doctor.doctor.IdLpu == null) authenticator.doctor.doctor.IdLpu = cb.IdLpu; } if (cb.LegalAuthenticator != null) { legalAuthenticator = new TestParticipant(cb.LegalAuthenticator, cb.IdLpu); if (legalAuthenticator.doctor.doctor.IdLpu == null) legalAuthenticator.doctor.doctor.IdLpu = cb.IdLpu; } if (cb.DoctorInCharge != null) { doctorInCharge = new TestDoctor(cb.DoctorInCharge, cb.IdLpu); if (doctorInCharge.doctor.IdLpu == null) doctorInCharge.doctor.IdLpu = cb.IdLpu; } if (cb.Guardian != null) guardian = new TestGuardian(cb.Guardian); if (cb.IdPatientMis != null) patient = TestPatient.BuildPatientFromDataBaseData(guid, cb.IdLpu, cb.IdPatientMis); } }
static public List <TestStepBase> BuildTestStepsFromDataBase(string idCase, string stepLpu) { List <TestStepBase> steps = new List <TestStepBase>(); if (idCase != string.Empty) { using (SqlConnection connection = Global.GetSqlConnection()) { string findSteps = "SELECT * FROM Step WHERE IdCase = '" + idCase + "'"; SqlCommand stepsCommand = new SqlCommand(findSteps, connection); using (SqlDataReader stepsReader = stepsCommand.ExecuteReader()) { while (stepsReader.Read()) { StepBase sb = new StepBase(); if (stepsReader["Comment"].ToString() != "") { sb.Comment = Convert.ToString(stepsReader["Comment"]); } else { sb.Comment = null; } if (stepsReader["DateEnd"].ToString() != "") { sb.DateEnd = Convert.ToDateTime(stepsReader["DateEnd"]); } else { sb.DateEnd = DateTime.MinValue; } if (stepsReader["DateStart"].ToString() != "") { sb.DateStart = Convert.ToDateTime(stepsReader["DateStart"]); } else { sb.DateStart = DateTime.MinValue; } if (stepsReader["IdPaymentType"].ToString() != "") { sb.IdPaymentType = Convert.ToByte(stepsReader["IdPaymentType"]); } else { sb.IdPaymentType = 0; } if (stepsReader["IdStepMis"].ToString() != "") { sb.IdStepMis = Convert.ToString(stepsReader["IdStepMis"]); } else { sb.IdStepMis = null; } TestStepBase step = new TestStepBase(sb, stepLpu); if (stepsReader["IdDoctor"].ToString() != "") { step.doctor = TestDoctor.BuildTestDoctorFromDataBase(stepsReader["IdDoctor"].ToString()); } else { step.doctor = null; } step.idStep = Convert.ToString(stepsReader["IdStep"]); steps.Add(step); } } } } if (steps.Count != 0) { return(steps); } else { return(null); } }
static public TestCaseBase BuildBaseCaseFromDataBaseData(string guid, string idlpu, string mis, string idPerson) { //idPerson = TestPerson.GetPersonId(guid, idlpu, idPerson); string caseId = GetCaseId(guid, idlpu, mis, idPerson); if (caseId != null) { using (SqlConnection connection = Global.GetSqlConnection()) { string IdDoctor = ""; string IdGuardian = ""; int idCaseT = 0; bool isCanceld = false; CaseBase p = new CaseBase(); string findCase = "SELECT TOP(1) * FROM \"Case\" WHERE IdCase = '" + caseId + "'"; SqlCommand caseCommand = new SqlCommand(findCase, connection); using (SqlDataReader caseReader = caseCommand.ExecuteReader()) { while (caseReader.Read()) { if (caseReader["CloseDate"].ToString() != "") { p.CloseDate = Convert.ToDateTime(caseReader["CloseDate"]); } else { p.CloseDate = DateTime.MinValue; } if (caseReader["Comment"].ToString() != "") { p.Comment = Convert.ToString(caseReader["Comment"]); } else { p.Comment = null; } if (caseReader["HistoryNumber"].ToString() != "") { p.HistoryNumber = Convert.ToString(caseReader["HistoryNumber"]); } else { p.HistoryNumber = null; } if (caseReader["IdCaseAidType"].ToString() != "") { p.IdCaseAidType = Convert.ToByte(caseReader["IdCaseAidType"]); } else { p.IdCaseAidType = 0; } if (caseReader["IdCaseMis"].ToString() != "") { p.IdCaseMis = Convert.ToString(caseReader["IdCaseMis"]); } else { p.IdCaseMis = null; } if (caseReader["IdCaseResult"].ToString() != "") { p.IdCaseResult = Convert.ToByte(caseReader["IdCaseResult"]); } else { p.IdCaseResult = 0; } if (caseReader["IdCasePaymentType"].ToString() != "") { p.IdPaymentType = Convert.ToByte(caseReader["IdCasePaymentType"]); } else { p.IdPaymentType = 0; } if (caseReader["OpenDate"].ToString() != "") { p.OpenDate = Convert.ToDateTime(caseReader["OpenDate"]); } else { p.OpenDate = DateTime.MinValue; } if (caseReader["IDDoctor"].ToString() != "") { IdDoctor = Convert.ToString(caseReader["IDDoctor"]); } if (caseReader["IdGuardian"].ToString() != "") { IdGuardian = Convert.ToString(caseReader["IDGuardian"]); } if (caseReader["IdCaseType"].ToString() != "") { idCaseT = Convert.ToInt32(caseReader["IdCaseType"]); } isCanceld = Convert.ToBoolean(caseReader["IsCancelled"]); } } findCase = "SELECT * FROM mm_AccessRole2Case WHERE IdCase = '" + caseId + "'"; caseCommand = new SqlCommand(findCase, connection); using (SqlDataReader caseReader = caseCommand.ExecuteReader()) { while (caseReader.Read()) { switch (caseReader["IdAccessRole"].ToString()) { case "1": p.Confidentiality = Convert.ToByte(caseReader["IdPrivacyLevel"]); break; case "2": p.DoctorConfidentiality = Convert.ToByte(caseReader["IdPrivacyLevel"]); break; case "3": p.CuratorConfidentiality = Convert.ToByte(caseReader["IdPrivacyLevel"]); break; } } } p.IdCaseMis = mis; p.IdLpu = idlpu; TestCaseBase cb = new TestCaseBase(guid, p); cb.idCaseType = idCaseT; cb.isCanceld = isCanceld; if (IdDoctor != "") { cb.doctorInCharge = TestDoctor.BuildTestDoctorFromDataBase(IdDoctor); } else { cb.doctorInCharge = null; } if (IdGuardian != "") { cb.guardian = TestGuardian.BuildTestGuardianFromDataBase(IdGuardian, idPerson); } else { cb.guardian = null; } if (idPerson != "") { cb.patient = TestPatient.BuildPatientFromDataBaseData(patientId: idPerson); } else { cb.patient = null; } findCase = "SELECT * FROM mm_Author2Case WHERE IdCase = '" + caseId + "'"; caseCommand = new SqlCommand(findCase, connection); using (SqlDataReader caseReader = caseCommand.ExecuteReader()) { while (caseReader.Read()) { switch (caseReader["IdAuthorshipType"].ToString()) { case "1": cb.autor = TestParticipant.BuildTestParticipantFromDataBase(caseId, Convert.ToString(caseReader["IdDoctor"]), 1); break; case "3": cb.authenticator = TestParticipant.BuildTestParticipantFromDataBase(caseId, Convert.ToString(caseReader["IdDoctor"]), 3); break; case "4": cb.legalAuthenticator = TestParticipant.BuildTestParticipantFromDataBase(caseId, Convert.ToString(caseReader["IdDoctor"]), 4); break; } } } return(cb); } } return(null); }
private void FindMismatch(TestDoctor d) { if (d.doctor != null) { if (this.doctor.IdLpu != d.doctor.IdLpu) Global.errors3.Add("Несовпадение IdLpu TestDoctor"); if (this.doctor.IdPosition != d.doctor.IdPosition) Global.errors3.Add("Несовпадение IdPosition TestDoctor"); if (this.doctor.IdSpeciality != d.doctor.IdSpeciality) Global.errors3.Add("Несовпадение IdSpeciality TestDoctor"); if (Global.GetLength(this.person) != Global.GetLength(d.person)) Global.errors3.Add("Несовпадение длины person TestDoctor"); } }