示例#1
0
 static public TestReferral BuildReferralFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string findR = "SELECT * FROM public.referral WHERE id_referral = '" + idReferral + "'";
         // string findR = "select id_patient_person from public.referral";
         NpgsqlCommand Rcommand = new NpgsqlCommand(findR, connection);
         using (NpgsqlDataReader RReader = Rcommand.ExecuteReader())
         {
             while (RReader.Read())
             {
                 TestReferral r = new TestReferral();
                 r.evInfo = TestEventsInfo.BuildAdditionalFromDataBaseData(idReferral);
                 if (RReader["id_patient_person"] != DBNull.Value)
                 {
                     r.patient = TestPatient.BuildPatientFromDataBaseData(RReader["id_patient_person"].ToString(), RReader["id_patient_source_mo_mis"].ToString());
                 }
                 r.refInfo   = TestReferralInfo.BuildPersonFromDataBaseData(idReferral);
                 r.refSourse = TestReferralSource.BuildSourceFromDataBaseData(idReferral);
                 r.refSurvey = TestReferralSurvey.BuildAdditionalFromDataBaseData(idReferral);
                 r.refTarget = TestReferralTarget.BuildTargetFromDataBaseData(idReferral);
                 return(r);
             }
         }
     }
     return(null);
 }
示例#2
0
 public static TestEventsInfo BuildAdditionalFromDataBaseData(string idReferral)
 {
     TestEventsInfo p = new TestEventsInfo();
     p.cancellation = TestCancellation.BuildCancellationFromDataBaseData(idReferral);
     p.source = TestEventSource.BuildSourceFromDataBaseData(idReferral);
     p.target = TestEventTarget.BuildTargetFromDataBaseData(idReferral);
     return p;
 }
示例#3
0
        static public TestEventsInfo BuildAdditionalFromDataBaseData(string idReferral)
        {
            TestEventsInfo p = new TestEventsInfo();

            p.cancellation = TestCancellation.BuildCancellationFromDataBaseData(idReferral);
            p.source       = TestEventSource.BuildSourceFromDataBaseData(idReferral);
            p.target       = TestEventTarget.BuildTargetFromDataBaseData(idReferral);
            return(p);
        }
示例#4
0
 private void FindMismatch(TestEventsInfo r)
 {
     if (Global.GetLength(this.cancellation) != Global.GetLength(r.cancellation))
         Global.errors3.Add("Несовпадение длины cancellation TestEventsInfo");
     if (Global.GetLength(this.source) != Global.GetLength(r.source))
         Global.errors3.Add("Несовпадение длины source TestEventsInfo");
     if (Global.GetLength(this.target) != Global.GetLength(r.target))
         Global.errors3.Add("Несовпадение длины target TestEventsInfo");
 }
示例#5
0
 public TestReferral(Referral r, string idLpu = "")
 {
     evInfo    = new TestEventsInfo(r.EventsInfo);
     patient   = new TestPatient(r.Patient);
     refInfo   = new TestReferralInfo(r.ReferralInfo);
     refSurvey = new TestReferralSurvey(r.ReferralSurvey);
     refSourse = new TestReferralSource(r.Source);
     refTarget = new TestReferralTarget(r.Target);
 }
示例#6
0
 public TestReferral(Referral r, string idLpu = "")
 {
     evInfo = new TestEventsInfo(r.EventsInfo);
     patient = new TestPatient(r.Patient);
     refInfo = new TestReferralInfo(r.ReferralInfo);
     refSurvey = new TestReferralSurvey(r.ReferralSurvey);
     refSourse = new TestReferralSource(r.Source);
     refTarget = new TestReferralTarget(r.Target);
 }
示例#7
0
 private void FindMismatch(TestEventsInfo r)
 {
     if (Global.GetLength(this.cancellation) != Global.GetLength(r.cancellation))
     {
         Global.errors3.Add("Несовпадение длины cancellation TestEventsInfo");
     }
     if (Global.GetLength(this.source) != Global.GetLength(r.source))
     {
         Global.errors3.Add("Несовпадение длины source TestEventsInfo");
     }
     if (Global.GetLength(this.target) != Global.GetLength(r.target))
     {
         Global.errors3.Add("Несовпадение длины target TestEventsInfo");
     }
 }
示例#8
0
        public override bool Equals(Object obj)
        {
            TestEventsInfo p = obj as TestEventsInfo;

            if ((Global.IsEqual(this.cancellation, p?.cancellation)) &&
                (Global.IsEqual(this.source, p?.source)) &&
                (Global.IsEqual(this.target, p?.target)))
            {
                return(true);
            }
            else
            {
                this.FindMismatch(p);
                Global.errors3.Add("несовпадение TestEventsInfo");
                return(false);
            }
        }