Пример #1
0
 public static TestReferralSurvey BuildAdditionalFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string findPatient = "SELECT id_survey_organ, survey_comment, id_survey_type 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())
         {
             Survey p = new Survey();
             while (personFromDataBase.Read())
             {
                 //что делать с DateSpecified и Мисами?
                 if (personFromDataBase["survey_comment"] != DBNull.Value)
                     p.Comment = Convert.ToString(personFromDataBase["survey_comment"]);
                 TestReferralSurvey pers = new TestReferralSurvey(p);
                 pers.additional = TestAdditional.BuildAdditionalFromDataBaseData(idReferral);
                 if (personFromDataBase["id_survey_organ"] != DBNull.Value)
                     pers.surveyOrgan = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_survey_organ"]));
                 if (personFromDataBase["id_survey_type"] != DBNull.Value)
                     pers.surveyType = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_survey_type"]));
                 return pers;
             }
         }
     }
     return null;
 }
Пример #2
0
        public override bool Equals(Object obj)
        {
            TestReferralSurvey p = obj as TestReferralSurvey;

            if ((object)p == null)
            {
                return(false);
            }
            if (this.survey == p.survey)
            {
                return(true);
            }
            if ((this.survey == null) || (p.survey == null))
            {
                return(false);
            }
            if ((this.survey.Comment == p.survey.Comment) &&
                (Global.IsEqual(this.additional, p.additional)) &&
                (Global.IsEqual(this.surveyOrgan, p.surveyOrgan)) &&
                (Global.IsEqual(this.surveyType, p.surveyType)))
            {
                return(true);
            }
            else
            {
                this.FindMismatch(p);
                Global.errors3.Add("несовпадение TestReferralSurvey");
                return(false);
            }
        }
Пример #3
0
 static public TestReferralSurvey BuildAdditionalFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string        findPatient = "SELECT id_survey_organ, survey_comment, id_referral, id_survey_type 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())
         {
             Survey p = new Survey();
             while (personFromDataBase.Read())
             {
                 //что делать с DateSpecified и Мисами?
                 if (personFromDataBase["survey_comment"] != DBNull.Value)
                 {
                     p.Comment = Convert.ToString(personFromDataBase["survey_comment"]);
                 }
                 TestReferralSurvey pers = new TestReferralSurvey(p);
                 if (personFromDataBase["id_referral"] != DBNull.Value)
                 {
                     pers.additional = TestAdditional.BuildAdditionalFromDataBaseData(Convert.ToString(personFromDataBase["id_referral"]));
                 }
                 if (personFromDataBase["id_survey_organ"] != DBNull.Value)
                 {
                     pers.surveyOrgan = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_survey_organ"]));
                 }
                 if (personFromDataBase["id_survey_type"] != DBNull.Value)
                 {
                     pers.surveyType = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_survey_type"]));
                 }
                 return(pers);
             }
         }
     }
     return(null);
 }
Пример #4
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);
 }
Пример #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(TestReferralSurvey r)
 {
     if (this.survey.Comment != r.survey.Comment)
     {
         Global.errors3.Add("Несовпадение Comment TestReferralSurvey");
     }
     if (Global.GetLength(this.additional) != Global.GetLength(r.additional))
     {
         Global.errors3.Add("Несовпадение длинны additional TestReferralSurvey");
     }
     if (Global.GetLength(this.surveyOrgan) != Global.GetLength(r.surveyOrgan))
     {
         Global.errors3.Add("Несовпадение длинны surveyOrgan TestReferralSurvey");
     }
     if (Global.GetLength(this.surveyType) != Global.GetLength(r.surveyType))
     {
         Global.errors3.Add("Несовпадение длинны surveyType TestReferralSurvey");
     }
 }
Пример #8
0
 private void FindMismatch(TestReferralSurvey r)
 {
     if (this.survey.Comment != r.survey.Comment)
         Global.errors3.Add("Несовпадение Comment TestReferralSurvey");
     if (Global.GetLength(this.additional) != Global.GetLength(r.additional))
         Global.errors3.Add("Несовпадение длинны additional TestReferralSurvey");
     if (Global.GetLength(this.surveyOrgan) != Global.GetLength(r.surveyOrgan))
         Global.errors3.Add("Несовпадение длинны surveyOrgan TestReferralSurvey");
     if (Global.GetLength(this.surveyType) != Global.GetLength(r.surveyType))
         Global.errors3.Add("Несовпадение длинны surveyType TestReferralSurvey");
 }