Ejemplo n.º 1
0
        public override bool Equals(Object obj)
        {
            TestMainDiagnosis p = obj as TestMainDiagnosis;

            if ((object)p == null)
            {
                return(false);
            }
            if (this.diagnos == p.diagnos)
            {
                return(true);
            }
            if ((this.diagnos == null) || (p.diagnos == null))
            {
                return(false);
            }
            if ((Global.IsEqual(this.diagnosisInfo, p.diagnosisInfo)) &&
                (Global.IsEqual(this.ComplicationDiagnosis, p.ComplicationDiagnosis)))
            {
                return(true);
            }
            else
            {
                this.FindMismatch(p);
                Global.errors3.Add("несовпадение TestMainDiagnosis");
                return(false);
            }
        }
Ejemplo n.º 2
0
 static public TestReferralSource BuildSourceFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string        findPatient = "SELECT id_source_lpu_case_mis, id_referral_source_mo_mis, id_source_lpu FROM public.referral WHERE id_referral = '" + idReferral + "' ORDER BY id_referral DESC LIMIT 1";
         NpgsqlCommand person      = new NpgsqlCommand(findPatient, connection);
         using (NpgsqlDataReader personFromDataBase = person.ExecuteReader())
         {
             ReferralSource p = new ReferralSource();
             while (personFromDataBase.Read())
             {
                 if (personFromDataBase["id_source_lpu_case_mis"] != DBNull.Value)
                 {
                     p.IdCaseMis = Convert.ToString(personFromDataBase["id_source_lpu_case_mis"]);
                 }
                 if (personFromDataBase["id_referral_source_mo_mis"] != DBNull.Value)
                 {
                     p.IdReferralMis = Convert.ToString(personFromDataBase["id_referral_source_mo_mis"]);
                 }
                 TestReferralSource pers = new TestReferralSource(p);
                 pers.lpu  = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_source_lpu"]));
                 pers.docs = TestDoctor.BuildDoctorFromDataBaseData(idReferral, Convert.ToString(personFromDataBase["id_source_lpu"]));
                 pers.diag = TestMainDiagnosis.BuildTestMainDiagnosisInfoFromDataBaseData(idReferral, Convert.ToString(personFromDataBase["id_source_lpu"]));
                 return(pers);
             }
         }
     }
     return(new TestReferralSource(null));
 }
Ejemplo n.º 3
0
 public static 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;
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 private void FindMismatch(TestMainDiagnosis r)
 {
     if (Global.GetLength(this.diagnosisInfo) != Global.GetLength(r.diagnosisInfo))
     {
         Global.errors3.Add("Несовпадение длины diagnosisInfo TestMainDiagnosis");
     }
     if (Global.GetLength(this.ComplicationDiagnosis) != Global.GetLength(r.ComplicationDiagnosis))
     {
         Global.errors3.Add("Несовпадение длины ComplicationDiagnosis TestMainDiagnosis");
     }
 }
Ejemplo n.º 6
0
 static public TestReferralTarget BuildTargetFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string        findPatient = "SELECT id_target_lpu, is_referral_review_target_mo, referral_review_date_target_mo, reception_appoint_date, reception_appoint_time_comment, reception_appoint_additional_comment, id_target_lpu_case_mis FROM public.referral WHERE id_referral = '" + idReferral + "' ORDER BY record_created DESC LIMIT 1";
         NpgsqlCommand person      = new NpgsqlCommand(findPatient, connection);
         using (NpgsqlDataReader personFromDataBase = person.ExecuteReader())
         {
             ReferralTarget p = new ReferralTarget();
             while (personFromDataBase.Read())
             {
                 //зачем тут диагнозы и доктора и ReferralReviewDate и IsReferralReviewed?
                 if (personFromDataBase["id_target_lpu_case_mis"] != DBNull.Value)
                 {
                     p.IdCaseMis = Convert.ToString(personFromDataBase["id_target_lpu_case_mis"]);
                 }
                 if (personFromDataBase["is_referral_review_target_mo"] != DBNull.Value)
                 {
                     p.IsReferralReviewed = Convert.ToBoolean(personFromDataBase["is_referral_review_target_mo"]);
                 }
                 if (personFromDataBase["reception_appoint_additional_comment"] != DBNull.Value)
                 {
                     p.ReceptionAppointComment = Convert.ToString(personFromDataBase["reception_appoint_additional_comment"]);
                 }
                 if (personFromDataBase["reception_appoint_time_comment"] != DBNull.Value)
                 {
                     p.ReceptionAppointTime = Convert.ToString(personFromDataBase["reception_appoint_time_comment"]);
                 }
                 if (personFromDataBase["reception_appoint_date"] != DBNull.Value)
                 {
                     p.ReceptionAppointDate = Convert.ToDateTime(personFromDataBase["reception_appoint_date"]);
                 }
                 if (personFromDataBase["referral_review_date_target_mo"] != DBNull.Value)
                 {
                     p.ReferralReviewDate = Convert.ToDateTime(personFromDataBase["referral_review_date_target_mo"]);
                 }
                 TestReferralTarget pers = new TestReferralTarget(p);
                 pers.lpu  = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_target_lpu"]));
                 pers.docs = TestDoctor.BuildDoctorFromDataBaseData(idReferral,
                                                                    Convert.ToString(personFromDataBase["id_target_lpu"]));
                 pers.diag = TestMainDiagnosis.BuildTestMainDiagnosisInfoFromDataBaseData(idReferral,
                                                                                          Convert.ToString(personFromDataBase["id_target_lpu"]));
                 return(pers);
             }
         }
     }
     return(null);
 }
Ejemplo n.º 7
0
 private void FindMismatch(TestMainDiagnosis r)
 {
     if (Global.GetLength(this.diagnosisInfo) != Global.GetLength(r.diagnosisInfo))
         Global.errors3.Add("Несовпадение длины diagnosisInfo TestMainDiagnosis");
     if (Global.GetLength(this.ComplicationDiagnosis) != Global.GetLength(r.ComplicationDiagnosis))
         Global.errors3.Add("Несовпадение длины ComplicationDiagnosis TestMainDiagnosis");
 }