public TestMainDiagnosis(MainDiagnosis r) { diagnos = r; diagnosisInfo = new TestDiagnosisInfo(diagnos.DiagnosisInfo); foreach (DiagnosisInfo i in diagnos.ComplicationDiagnosis) compDiagnosis.Add(new TestDiagnosisInfo(i)); }
static public TestDiagnosisInfo BuildTestMainDiagnosisInfoFromDataBaseData(string idReferral) { using (NpgsqlConnection connection = Global.GetSqlConnection()) { //опять DiagnosedDateSpecified, что с этим делать? //ещё есть какой-то idDiagnosisStatus и idLpu, так же idDiagnosisContainer - это не diagnosisType? string finddiagnosis = "SELECT * FROM public.diagnosis WHERE id_referral = '" + idReferral + "' AND id_diagnosis_container = '" + complication + "')"; NpgsqlCommand person = new NpgsqlCommand(finddiagnosis, connection); using (NpgsqlDataReader diagnosisReader = person.ExecuteReader()) { while (diagnosisReader.Read()) { DiagnosisInfo diag = new DiagnosisInfo(); if (diagnosisReader["comment"] != DBNull.Value) { diag.Comment = Convert.ToString(diagnosisReader["comment"]); } if (diagnosisReader["diagnosis_date"] != DBNull.Value) { diag.DiagnosedDate = Convert.ToDateTime(diagnosisReader["diagnosis_date"]); } TestDiagnosisInfo tDiag = new TestDiagnosisInfo(diag); if (diagnosisReader["id_mkb_code"] != DBNull.Value) { tDiag.mkbCode = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(diagnosisReader["id_mkb_code"])); } return(tDiag); } } } return(null); }
public static List<TestDiagnosisInfo> BuildTestComplicationDiagnosisInfoFromDataBaseData(string idReferral) { List<TestDiagnosisInfo> diagnosis = new List<TestDiagnosisInfo>(); using (NpgsqlConnection connection = Global.GetSqlConnection()) { //опять DiagnosedDateSpecified, что с этим делать? //ещё есть какой-то idDiagnosisStatus и idLpu, так же idDiagnosisContainer - это не diagnosisType? string finddiagnosis = "SELECT * FROM public.diagnosis WHERE id_referral = '" + idReferral + "' AND id_diagnosis_container = '" + complication + "')"; NpgsqlCommand person = new NpgsqlCommand(finddiagnosis, connection); using (NpgsqlDataReader diagnosisReader = person.ExecuteReader()) { while (diagnosisReader.Read()) { DiagnosisInfo diag = new DiagnosisInfo(); if (diagnosisReader["comment"].ToString() != "") diag.Comment = Convert.ToString(diagnosisReader["comment"]); if (diagnosisReader["diagnosis_date"].ToString() != "") diag.DiagnosedDate = Convert.ToDateTime(diagnosisReader["diagnosis_date"]); TestDiagnosisInfo tDiag = new TestDiagnosisInfo(diag); if (diagnosisReader["id_mkb_code"].ToString() != "") tDiag.mkbCode = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(diagnosisReader["id_mkb_code"])); diagnosis.Add(tDiag); } } } if (diagnosis.Count != 0) return diagnosis; else return null; }
public override bool Equals(Object obj) { TestDiagnosisInfo p = obj as TestDiagnosisInfo; if ((object)p == null) { return(false); } if (this.diagnosisInfo == p.diagnosisInfo) { return(true); } if ((this.diagnosisInfo == null) || (p.diagnosisInfo == null)) { return(false); } if ((this.diagnosisInfo.Comment == p.diagnosisInfo.Comment) && (this.diagnosisInfo.DiagnosedDate == p.diagnosisInfo.DiagnosedDate) && (Global.IsEqual(this.diagnosisType, p.diagnosisType)) && (Global.IsEqual(this.mkbCode, p.mkbCode))) { return(true); } else { this.FindMismatch(p); Global.errors3.Add("несовпадение TestDiagnosisInfo"); return(false); } }
public TestMainDiagnosis(MainDiagnosis r) { diagnos = r; diagnosisInfo = new TestDiagnosisInfo(diagnos.DiagnosisInfo); foreach (DiagnosisInfo i in diagnos.ComplicationDiagnosis) { compDiagnosis.Add(new TestDiagnosisInfo(i)); } }
static public List <TestMainDiagnosis> BuildTestMainDiagnosisInfoFromDataBaseData(string idReferral) { List <TestMainDiagnosis> tdi = new List <TestMainDiagnosis>(); TestMainDiagnosis md = new TestMainDiagnosis(new MainDiagnosis()); md.diagnosisInfo = TestDiagnosisInfo.BuildTestMainDiagnosisInfoFromDataBaseData(idReferral); md.compDiagnosis = TestDiagnosisInfo.BuildTestComplicationDiagnosisInfoFromDataBaseData(idReferral); tdi.Add(md); return((tdi.Count != 0) ? tdi : null); }
public TestMainDiagnosis(MainDiagnosis r) { diagnos = r; diagnosisInfo = new TestDiagnosisInfo(diagnos.DiagnosisInfo); if ((diagnos.ComplicationDiagnosis != null) && (diagnos.ComplicationDiagnosis.Length != 0)) { compDiagnosis = new List<TestDiagnosisInfo>(); foreach (DiagnosisInfo i in diagnos.ComplicationDiagnosis) compDiagnosis.Add(new TestDiagnosisInfo(i)); } }
public TestMainDiagnosis(MainDiagnosis r) { diagnos = r; diagnosisInfo = new TestDiagnosisInfo(diagnos.DiagnosisInfo); if ((diagnos.ComplicationDiagnosis != null) && (diagnos.ComplicationDiagnosis.Length != 0)) { compDiagnosis = new List <TestDiagnosisInfo>(); foreach (DiagnosisInfo i in diagnos.ComplicationDiagnosis) { compDiagnosis.Add(new TestDiagnosisInfo(i)); } } }
private void FindMismatch(TestDiagnosisInfo r) { if (this.diagnosisInfo.Comment != r.diagnosisInfo.Comment) { Global.errors3.Add("Несовпадение Comment TestDiagnosisInfo"); } if (this.diagnosisInfo.DiagnosedDate != r.diagnosisInfo.DiagnosedDate) { Global.errors3.Add("Несовпадение DiagnosedDate TestDiagnosisInfo"); } if (Global.GetLength(this.diagnosisType) != Global.GetLength(r.diagnosisType)) { Global.errors3.Add("Несовпадение длины diagnosisInfo TestDiagnosisInfo"); } if (Global.GetLength(this.mkbCode) != Global.GetLength(r.mkbCode)) { Global.errors3.Add("Несовпадение длины ComplicationDiagnosis TestDiagnosisInfo"); } }
static public TestDiagnosisInfo BuildTestMainDiagnosisInfoFromDataBaseData(string idReferral, string idLpu) { if (idLpu != "") { using (NpgsqlConnection connection = Global.GetSqlConnection()) { string finddiagnosis = "SELECT * FROM public.diagnosis WHERE id_referral = '" + idReferral + "' AND id_diagnosis_container = '" + complication + "' AND id_lpu = '" + idLpu + "'"; NpgsqlCommand person = new NpgsqlCommand(finddiagnosis, connection); using (NpgsqlDataReader diagnosisReader = person.ExecuteReader()) { while (diagnosisReader.Read()) { DiagnosisInfo diag = new DiagnosisInfo(); if (diagnosisReader["comment"] != DBNull.Value) { diag.Comment = Convert.ToString(diagnosisReader["comment"]); } if (diagnosisReader["diagnosis_date"] != DBNull.Value) { diag.DiagnosedDate = Convert.ToDateTime(diagnosisReader["diagnosis_date"]); } TestDiagnosisInfo tDiag = new TestDiagnosisInfo(diag); if (diagnosisReader["id_diagnosis_status"] != DBNull.Value) { tDiag.diagnosisType = TestCoding.BuildCodingFromDataBaseData( diagnosisReader["id_diagnosis_status"].ToString()); } if (diagnosisReader["id_mkb_code"] != DBNull.Value) { tDiag.mkbCode = TestCoding.BuildCodingFromDataBaseData( Convert.ToString(diagnosisReader["id_mkb_code"])); } return(tDiag); } } } } return(null); }
public static TestDiagnosisInfo BuildTestMainDiagnosisInfoFromDataBaseData(string idReferral, string idLpu) { if (idLpu != "") { using (NpgsqlConnection connection = Global.GetSqlConnection()) { string finddiagnosis = "SELECT * FROM public.diagnosis WHERE id_referral = '" + idReferral + "' AND id_diagnosis_container = '" + complication + "' AND id_lpu = '" + idLpu + "'"; NpgsqlCommand person = new NpgsqlCommand(finddiagnosis, connection); using (NpgsqlDataReader diagnosisReader = person.ExecuteReader()) { while (diagnosisReader.Read()) { DiagnosisInfo diag = new DiagnosisInfo(); if (diagnosisReader["comment"] != DBNull.Value) diag.Comment = Convert.ToString(diagnosisReader["comment"]); if (diagnosisReader["diagnosis_date"] != DBNull.Value) diag.DiagnosedDate = Convert.ToDateTime(diagnosisReader["diagnosis_date"]); TestDiagnosisInfo tDiag = new TestDiagnosisInfo(diag); if (diagnosisReader["id_diagnosis_status"] != DBNull.Value) tDiag.diagnosisType = TestCoding.BuildCodingFromDataBaseData( diagnosisReader["id_diagnosis_status"].ToString()); if (diagnosisReader["id_mkb_code"] != DBNull.Value) tDiag.mkbCode = TestCoding.BuildCodingFromDataBaseData( Convert.ToString(diagnosisReader["id_mkb_code"])); return tDiag; } } } } return null; }
private void FindMismatch(TestDiagnosisInfo r) { if (this.diagnosisInfo.Comment != r.diagnosisInfo.Comment) Global.errors3.Add("Несовпадение Comment TestDiagnosisInfo"); if (this.diagnosisInfo.DiagnosedDate != r.diagnosisInfo.DiagnosedDate) Global.errors3.Add("Несовпадение DiagnosedDate TestDiagnosisInfo"); if (Global.GetLength(this.diagnosisType) != Global.GetLength(r.diagnosisType)) Global.errors3.Add("Несовпадение длины diagnosisInfo TestDiagnosisInfo"); if (Global.GetLength(this.mkbCode) != Global.GetLength(r.mkbCode)) Global.errors3.Add("Несовпадение длины ComplicationDiagnosis TestDiagnosisInfo"); }