Beispiel #1
0
        public override bool Equals(Object obj)
        {
            TestAdditional p = obj as TestAdditional;

            if ((object)p == null)
            {
                return(false);
            }
            if (this.additional == p.additional)
            {
                return(true);
            }
            if ((this.additional == null) || (p.additional == null))
            {
                return(false);
            }
            if ((this.additional.AllergyIodine == p.additional.AllergyIodine) &&
                (this.additional.Height == p.additional.Height) &&
                (this.additional.Weight == p.additional.Weight))
            {
                return(true);
            }
            else
            {
                this.FindMismatch(p);
                Global.errors3.Add("несовпадение TestAdditional");
                return(false);
            }
        }
Beispiel #2
0
 static public TestAdditional BuildAdditionalFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string        findPatient = "SELECT patient_allergy_iodine, patient_hight, patient_weight 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())
         {
             Additional p = new Additional();
             while (personFromDataBase.Read())
             {
                 //что делать с DateSpecified и Мисами?
                 if (personFromDataBase["patient_allergy_iodine"] != DBNull.Value)
                 {
                     p.AllergyIodine = Convert.ToString(personFromDataBase["patient_allergy_iodine"]);
                 }
                 if (personFromDataBase["patient_hight"] != DBNull.Value)
                 {
                     p.Height = Convert.ToString(personFromDataBase["patient_hight"]);
                 }
                 if (personFromDataBase["patient_weight"] != DBNull.Value)
                 {
                     p.Weight = Convert.ToString(personFromDataBase["patient_weight"]);
                 }
                 TestAdditional pers = new TestAdditional(p);
                 return(pers);
             }
         }
     }
     return(null);
 }
Beispiel #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);
 }
Beispiel #4
0
 public TestReferralSurvey(Survey r)
 {
     survey      = r ?? new Survey();
     additional  = new TestAdditional(survey.Additional);
     surveyOrgan = new TestCoding(survey.SurveyOrgan);
     surveyType  = new TestCoding(survey.SurveyType);
 }
Beispiel #5
0
 public static TestAdditional BuildAdditionalFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string findPatient = "SELECT patient_allergy_iodine, patient_hight, patient_weight 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())
         {
             Additional p = new Additional();
             while (personFromDataBase.Read())
             {
                 //что делать с DateSpecified и Мисами?
                 if (personFromDataBase["patient_allergy_iodine"] != DBNull.Value)
                     p.AllergyIodine = Convert.ToString(personFromDataBase["patient_allergy_iodine"]);
                 if (personFromDataBase["patient_hight"] != DBNull.Value)
                     p.Height = Convert.ToString(personFromDataBase["patient_hight"]);
                 if (personFromDataBase["patient_weight"] != DBNull.Value)
                     p.Weight = Convert.ToString(personFromDataBase["patient_weight"]);
                 TestAdditional pers = new TestAdditional(p);
                 return pers;
             }
         }
     }
     return null;
 }
Beispiel #6
0
 public TestReferralSurvey(Survey r)
 {
     if (r != null)
         survey = r;
     else
         survey = new Survey();
     additional = new TestAdditional(survey.Additional);
     if (survey.SurveyOrgan != null)
         surveyOrgan = new TestCoding(survey.SurveyOrgan);
     if (survey.SurveyType != null)
         surveyType = new TestCoding(survey.SurveyType);
 }
Beispiel #7
0
 private void FindMismatch(TestAdditional r)
 {
     if (this.additional.AllergyIodine != r.additional.AllergyIodine)
     {
         Global.errors3.Add("Несовпадение AllergyIodine TestAdditional");
     }
     if (this.additional.Height != r.additional.Height)
     {
         Global.errors3.Add("Несовпадение Height TestAdditional");
     }
     if (this.additional.Weight != r.additional.Weight)
     {
         Global.errors3.Add("Несовпадение Weight TestAdditional");
     }
 }
Beispiel #8
0
 public TestReferralSurvey(Survey r)
 {
     if (r != null)
     {
         survey = r;
     }
     else
     {
         survey = new Survey();
     }
     additional = new TestAdditional(survey.Additional);
     if (survey.SurveyOrgan != null)
     {
         surveyOrgan = new TestCoding(survey.SurveyOrgan);
     }
     if (survey.SurveyType != null)
     {
         surveyType = new TestCoding(survey.SurveyType);
     }
 }
Beispiel #9
0
 private void FindMismatch(TestAdditional r)
 {
     if (this.additional.AllergyIodine != r.additional.AllergyIodine)
         Global.errors3.Add("Несовпадение AllergyIodine TestAdditional");
     if (this.additional.Height != r.additional.Height)
         Global.errors3.Add("Несовпадение Height TestAdditional");
     if (this.additional.Weight != r.additional.Weight)
         Global.errors3.Add("Несовпадение Weight TestAdditional");
 }