Beispiel #1
0
 public static TestEventTarget BuildTargetFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string findPatient = "SELECT id_case_aid_form, id_case_aid_place, id_case_aid_type, case_close_date, case_open_date, reception_appoint_date 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())
         {
             EventTarget p = new EventTarget();
             while (personFromDataBase.Read())
             {
                 //что делать с IsReferralReviwedSpecified, Lpu, ReceptionAppointComment, ReceptionAppointTime, ReferralReviewDate и RefferalCreatedDate?
                 if (personFromDataBase["case_close_date"] != DBNull.Value)
                     p.CaseCloseDate = Convert.ToDateTime(personFromDataBase["case_close_date"]);
                 if (personFromDataBase["case_open_date"] != DBNull.Value)
                     p.CaseOpenDate = Convert.ToDateTime(personFromDataBase["case_open_date"]);
                 if (personFromDataBase["reception_appoint_date"] != DBNull.Value)
                     p.ReceptionAppointDate = Convert.ToDateTime(personFromDataBase["reception_appoint_date"]);
                 TestEventTarget pers = new TestEventTarget(p);
                 if (personFromDataBase["id_case_aid_form"] != DBNull.Value)
                     pers.caseAidForm = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_case_aid_form"]));
                 if (personFromDataBase["id_case_aid_place"] != DBNull.Value)
                     pers.caseAidPlace = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_case_aid_place"]));
                 if (personFromDataBase["id_case_aid_type"] != DBNull.Value)
                     pers.caseAidType = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_case_aid_type"]));
                 return pers;
             }
         }
     }
     return null;
 }
Beispiel #2
0
 public TestEventsInfo(EventsInfo r)
 {
     info = r ?? new EventsInfo();
     cancellation = new TestCancellation(info.Cancellation);
     source = new TestEventSource(info.Source);
     target = new TestEventTarget(info.Target);
 }
Beispiel #3
0
        public override bool Equals(Object obj)
        {
            TestEventTarget p = obj as TestEventTarget;

            if (p == null)
            {
                return(false);
            }
            if ((this.target.CaseCloseDate == p.target.CaseCloseDate) &&
                (this.target.CaseOpenDate == p.target.CaseOpenDate) &&
                (this.target.IsReferralReviwed == p.target.IsReferralReviwed) &&
                (this.target.ReceptionAppointComment == p.target.ReceptionAppointComment) &&
                (this.target.ReceptionAppointDate == p.target.ReceptionAppointDate) &&
                (this.target.ReceptionAppointTime == p.target.ReceptionAppointTime) &&
                (this.target.ReferralReviewDate == p.target.ReferralReviewDate) &&
                (this.target.RefferalCreatedDate == p.target.RefferalCreatedDate) &&
                (Global.IsEqual(this.caseAidForm, p.caseAidForm)) &&
                (Global.IsEqual(this.caseAidPlace, p.caseAidPlace)) &&
                (Global.IsEqual(this.caseAidType, p.caseAidType)) &&
                (Global.IsEqual(this.lpu, p.lpu)))
            {
                return(true);
            }
            else
            {
                this.FindMismatch(p);
                Global.errors3.Add("несовпадение TestEventTarget");
                return(false);
            }
        }
Beispiel #4
0
 public TestEventsInfo(EventsInfo r)
 {
     info         = r ?? new EventsInfo();
     cancellation = new TestCancellation(info.Cancellation);
     source       = new TestEventSource(info.Source);
     target       = new TestEventTarget(info.Target);
 }
Beispiel #5
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);
        }
Beispiel #6
0
 public TestEventsInfo(EventsInfo r)
 {
     if (r != null)
         info = r;
     else
         info = new EventsInfo();
     cancellation = new TestCancellation(info.Cancellation);
     source = new TestEventSource(info.Source);
     target = new TestEventTarget(info.Target);
 }
Beispiel #7
0
 private void FindMismatch(TestEventTarget r)
 {
     if (this.target.CaseCloseDate != r.target.CaseCloseDate)
     {
         Global.errors3.Add("Несовпадение CaseCloseDate TestEventTarget");
     }
     if (this.target.CaseOpenDate != r.target.CaseOpenDate)
     {
         Global.errors3.Add("Несовпадение CaseOpenDate TestEventTarget");
     }
     if (this.target.IsReferralReviwed != r.target.IsReferralReviwed)
     {
         Global.errors3.Add("Несовпадение IsReferralReviwed TestEventTarget");
     }
     if (this.target.ReceptionAppointComment != r.target.ReceptionAppointComment)
     {
         Global.errors3.Add("Несовпадение ReceptionAppointComment TestEventTarget");
     }
     if (this.target.ReceptionAppointDate != r.target.ReceptionAppointDate)
     {
         Global.errors3.Add("Несовпадение ReceptionAppointDate TestEventTarget");
     }
     if (this.target.ReceptionAppointTime != r.target.ReceptionAppointTime)
     {
         Global.errors3.Add("Несовпадение ReceptionAppointTime TestEventTarget");
     }
     if (this.target.ReferralReviewDate != r.target.ReferralReviewDate)
     {
         Global.errors3.Add("Несовпадение ReferralReviewDate TestEventTarget");
     }
     if (this.target.RefferalCreatedDate != r.target.RefferalCreatedDate)
     {
         Global.errors3.Add("Несовпадение RefferalCreatedDate TestEventTarget");
     }
     if (Global.GetLength(this.caseAidForm) != Global.GetLength(r.caseAidForm))
     {
         Global.errors3.Add("Несовпадение длинны caseAidForm TestEventTarget");
     }
     if (Global.GetLength(this.caseAidPlace) != Global.GetLength(r.caseAidPlace))
     {
         Global.errors3.Add("Несовпадение длинны caseAidPlace TestEventTarget");
     }
     if (Global.GetLength(this.caseAidType) != Global.GetLength(r.caseAidType))
     {
         Global.errors3.Add("Несовпадение длинны caseAidType TestEventTarget");
     }
     if (Global.GetLength(this.lpu) != Global.GetLength(r.lpu))
     {
         Global.errors3.Add("Несовпадение длинны lpu TestEventTarget");
     }
 }
Beispiel #8
0
 public TestEventsInfo(EventsInfo r)
 {
     if (r != null)
     {
         info = r;
     }
     else
     {
         info = new EventsInfo();
     }
     cancellation = new TestCancellation(info.Cancellation);
     source       = new TestEventSource(info.Source);
     target       = new TestEventTarget(info.Target);
 }
Beispiel #9
0
 static public TestEventTarget BuildTargetFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string        findPatient = "SELECT id_case_aid_form, id_case_aid_place, id_case_aid_type, case_close_date, case_open_date, reception_appoint_date 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())
         {
             EventTarget p = new EventTarget();
             while (personFromDataBase.Read())
             {
                 //что делать с IsReferralReviwedSpecified, Lpu, ReceptionAppointComment, ReceptionAppointTime, ReferralReviewDate и RefferalCreatedDate?
                 if (personFromDataBase["case_close_date"] != DBNull.Value)
                 {
                     p.CaseCloseDate = Convert.ToDateTime(personFromDataBase["case_close_date"]);
                 }
                 if (personFromDataBase["case_open_date"] != DBNull.Value)
                 {
                     p.CaseOpenDate = Convert.ToDateTime(personFromDataBase["case_open_date"]);
                 }
                 if (personFromDataBase["reception_appoint_date"] != DBNull.Value)
                 {
                     p.ReceptionAppointDate = Convert.ToDateTime(personFromDataBase["reception_appoint_date"]);
                 }
                 TestEventTarget pers = new TestEventTarget(p);
                 if (personFromDataBase["id_case_aid_form"] != DBNull.Value)
                 {
                     pers.caseAidForm = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_case_aid_form"]));
                 }
                 if (personFromDataBase["id_case_aid_place"] != DBNull.Value)
                 {
                     pers.caseAidPlace = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_case_aid_place"]));
                 }
                 if (personFromDataBase["id_case_aid_type"] != DBNull.Value)
                 {
                     pers.caseAidType = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_case_aid_type"]));
                 }
                 return(pers);
             }
         }
     }
     return(null);
 }
Beispiel #10
0
 private void FindMismatch(TestEventTarget r)
 {
     if (this.target.CaseCloseDate != r.target.CaseCloseDate)
         Global.errors3.Add("Несовпадение CaseCloseDate TestEventTarget");
     if (this.target.CaseOpenDate != r.target.CaseOpenDate)
         Global.errors3.Add("Несовпадение CaseOpenDate TestEventTarget");
     if (this.target.IsReferralReviwed != r.target.IsReferralReviwed)
         Global.errors3.Add("Несовпадение IsReferralReviwed TestEventTarget");
     if (this.target.ReceptionAppointComment != r.target.ReceptionAppointComment)
         Global.errors3.Add("Несовпадение ReceptionAppointComment TestEventTarget");
     if (this.target.ReceptionAppointDate != r.target.ReceptionAppointDate)
         Global.errors3.Add("Несовпадение ReceptionAppointDate TestEventTarget");
     if (this.target.ReceptionAppointTime != r.target.ReceptionAppointTime)
         Global.errors3.Add("Несовпадение ReceptionAppointTime TestEventTarget");
     if (this.target.ReferralReviewDate != r.target.ReferralReviewDate)
         Global.errors3.Add("Несовпадение ReferralReviewDate TestEventTarget");
     if (this.target.RefferalCreatedDate!= r.target.RefferalCreatedDate)
         Global.errors3.Add("Несовпадение RefferalCreatedDate TestEventTarget");
     if (Global.GetLength(this.caseAidForm) != Global.GetLength(r.caseAidForm))
         Global.errors3.Add("Несовпадение длинны caseAidForm TestEventTarget");
     if (Global.GetLength(this.caseAidPlace) != Global.GetLength(r.caseAidPlace))
         Global.errors3.Add("Несовпадение длинны caseAidPlace TestEventTarget");
     if (Global.GetLength(this.caseAidType) != Global.GetLength(r.caseAidType))
         Global.errors3.Add("Несовпадение длинны caseAidType TestEventTarget");
     if (Global.GetLength(this.lpu) != Global.GetLength(r.lpu))
         Global.errors3.Add("Несовпадение длинны lpu TestEventTarget");
 }