Beispiel #1
0
 internal void UpdateTestPerson(Person p)
 {
     if (p.BirthDate != null)
     {
         this.person.BirthDate = p.BirthDate;
     }
     if (p.IdPatientMis != null)
     {
         this.person.IdPatientMis = p.IdPatientMis;
     }
     if (p.HumanName != null)
     {
         if (p.HumanName.FamilyName != null)
         {
             this.person.HumanName.FamilyName = p.HumanName.FamilyName;
         }
         if (p.HumanName.GivenName != null)
         {
             this.person.HumanName.GivenName = p.HumanName.GivenName;
         }
         if (p.HumanName.MiddleName != null)
         {
             this.person.HumanName.MiddleName = p.HumanName.MiddleName;
         }
     }
     if (p.Sex != null)
     {
         this.sex = new TestCoding(p.Sex);
     }
 }
Beispiel #2
0
 static public TestDiagnosisInfo BuildTestMainDiagnosisInfoFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         //опять DiagnosedDateSpecified, что с этим делать?
         //ещё есть какой-то idDiagnosisStatus и idLpu, так же idDiagnosisContainer - это не diagnosisType?
         string        finddiagnosis = "SELECT * FROM public.diagnosis WHERE id_referral = '" + idReferral + "' AND id_diagnosis_container = '" + complication + "')";
         NpgsqlCommand person        = new NpgsqlCommand(finddiagnosis, connection);
         using (NpgsqlDataReader diagnosisReader = person.ExecuteReader())
         {
             while (diagnosisReader.Read())
             {
                 DiagnosisInfo diag = new DiagnosisInfo();
                 if (diagnosisReader["comment"] != DBNull.Value)
                 {
                     diag.Comment = Convert.ToString(diagnosisReader["comment"]);
                 }
                 if (diagnosisReader["diagnosis_date"] != DBNull.Value)
                 {
                     diag.DiagnosedDate = Convert.ToDateTime(diagnosisReader["diagnosis_date"]);
                 }
                 TestDiagnosisInfo tDiag = new TestDiagnosisInfo(diag);
                 if (diagnosisReader["id_mkb_code"] != DBNull.Value)
                 {
                     tDiag.mkbCode = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(diagnosisReader["id_mkb_code"]));
                 }
                 return(tDiag);
             }
         }
     }
     return(null);
 }
Beispiel #3
0
        static public List <TestPrivilege> BuildPrivilegeFromDataBaseData(string idPerson)
        {
            List <TestPrivilege> priveleges = new List <TestPrivilege>();

            using (NpgsqlConnection connection = Global.GetSqlConnection())
            {
                string        findPriviledge = "SELECT * FROM public.priviledge WHERE id_person = '" + idPerson + "'";
                NpgsqlCommand person         = new NpgsqlCommand(findPriviledge, connection);
                using (NpgsqlDataReader contactReader = person.ExecuteReader())
                {
                    while (contactReader.Read())
                    {
                        //что делать с DateSpecified?
                        Privilege priv = new Privilege();
                        if (contactReader["date_start"] != DBNull.Value)
                        {
                            priv.StartDate = Convert.ToDateTime(contactReader["date_start"]);
                        }
                        if (contactReader["date_end"] != DBNull.Value)
                        {
                            priv.EndDate = Convert.ToDateTime(contactReader["date_end"]);
                        }
                        TestPrivilege privilege = new TestPrivilege(priv);
                        if (contactReader["id_priviledge_code"] != DBNull.Value)
                        {
                            privilege.privilegeType = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(contactReader["id_priviledge_code"]));
                        }
                        priveleges.Add(privilege);
                    }
                }
            }
            return((priveleges.Count != 0) ? priveleges : null);
        }
Beispiel #4
0
 internal void UpdateTestReferralTarget(ReferralTarget t)
 {
     if ((t.Doctors != null) && (t.Doctors.Length != 0))
     {
         if (this.doctors == null)
         {
             docs = new List <TestDoctor>();
         }
         foreach (Doctor i in t.Doctors)
         {
             docs.Add(new TestDoctor(i));
         }
     }
     if ((t.MainDiagnosis != null) && (t.MainDiagnosis.Length != 0))
     {
         if (this.mainDiagnosis == null)
         {
             diag = new List <TestMainDiagnosis>();
         }
         foreach (MainDiagnosis i in t.MainDiagnosis)
         {
             diag.Add(new TestMainDiagnosis(i));
         }
     }
     if (t.Lpu != null)
     {
         lpu = new TestCoding(t.Lpu);
     }
 }
Beispiel #5
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 #6
0
 public TestReferralTarget(ReferralTarget r)
 {
     if (r != null)
     {
         target = r;
     }
     else
     {
         target = new ReferralTarget();
     }
     if ((target.Doctors != null) && (target.Doctors.Length != 0))
     {
         docs = new List <TestDoctor>();
         foreach (Doctor i in target.Doctors)
         {
             docs.Add(new TestDoctor(i));
         }
     }
     if ((target.MainDiagnosis != null) && (target.MainDiagnosis.Length != 0))
     {
         diag = new List <TestMainDiagnosis>();
         foreach (MainDiagnosis i in target.MainDiagnosis)
         {
             diag.Add(new TestMainDiagnosis(i));
         }
     }
     if (target.Lpu != null)
     {
         lpu = new TestCoding(target.Lpu);
     }
 }
Beispiel #7
0
 public TestEventTarget(EventTarget r)
 {
     if (r != null)
     {
         target = r;
     }
     else
     {
         target = new EventTarget();
     }
     if (target.CaseAidForm != null)
     {
         caseAidForm = new TestCoding(target.CaseAidForm);
     }
     if (target.CaseAidPlace != null)
     {
         caseAidPlace = new TestCoding(target.CaseAidPlace);
     }
     if (target.CaseAidType != null)
     {
         caseAidType = new TestCoding(target.CaseAidType);
     }
     if (target.Lpu != null)
     {
         lpu = new TestCoding(target.Lpu);
     }
 }
Beispiel #8
0
 public TestDocument(DocumentDto d)
 {
     document = d;
     documentType = new TestCoding(document.DocumentType);
     provider = new TestCoding(document.Provider);
     regionCode = new TestCoding(document.RegionCode);
 }
Beispiel #9
0
        static public List <TestContact> BuildContactsFromDataBaseData(string idPerson)
        {
            List <TestContact> contacts = new List <TestContact>();

            using (NpgsqlConnection connection = Global.GetSqlConnection())
            {
                string        findPatient = "SELECT * FROM public.Contact WHERE id_person = '" + idPerson + "'";
                NpgsqlCommand person      = new NpgsqlCommand(findPatient, connection);
                using (NpgsqlDataReader contactReader = person.ExecuteReader())
                {
                    while (contactReader.Read())
                    {
                        ContactDto cont = new ContactDto();
                        if (contactReader["contact_value"] != DBNull.Value)
                        {
                            cont.ContactValue = Convert.ToString(contactReader["contact_value"]);
                        }
                        TestContact contact = new TestContact(cont);
                        if (contactReader["id_contact_type"] != DBNull.Value)
                        {
                            contact.contactType = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(contactReader["id_contact_type"]));
                        }
                        contacts.Add(contact);
                    }
                }
            }
            return((contacts.Count != 0) ? contacts : null);
        }
Beispiel #10
0
 public TestDocument(DocumentDto d)
 {
     document     = d;
     documentType = new TestCoding(document.DocumentType);
     provider     = new TestCoding(document.Provider);
     regionCode   = new TestCoding(document.RegionCode);
 }
Beispiel #11
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 #12
0
 public TestDoctor(Doctor r)
 {
     doctor = r;
     if ((doctor.ContactDtos != null) && (doctor.ContactDtos.Length != 0))
     {
         cnts = new List <TestContact>();
         foreach (ContactDto i in doctor.ContactDtos)
         {
             cnts.Add(new TestContact(i));
         }
     }
     if (doctor.Lpu != null)
     {
         lpu = new TestCoding(doctor.Lpu);
     }
     if (doctor.Person != null)
     {
         person = new TestPerson(doctor.Person);
     }
     if (doctor.Position != null)
     {
         position = new TestCoding(doctor.Position);
     }
     if (doctor.Role != null)
     {
         role = new TestCoding(doctor.Role);
     }
     if (doctor.Speciality != null)
     {
         speciality = new TestCoding(doctor.Speciality);
     }
 }
Beispiel #13
0
        static public List <TestAddress> BuildAdressesFromDataBaseData(string idPerson)
        {
            List <TestAddress> addresses = new List <TestAddress>();

            using (NpgsqlConnection connection = Global.GetSqlConnection())
            {
                string        findIdAdresses = "SELECT * FROM public.address WHERE id_person = '" + idPerson + "'";
                NpgsqlCommand IdAddresses    = new NpgsqlCommand(findIdAdresses, connection);
                using (NpgsqlDataReader addressesReader = IdAddresses.ExecuteReader())
                {
                    while (addressesReader.Read())
                    {
                        AddressDto address = new AddressDto();
                        if (addressesReader["address"] != DBNull.Value)
                        {
                            address.StringAddress = Convert.ToString(addressesReader["address"]);
                        }
                        TestAddress a = new TestAddress(address);
                        if (addressesReader["id_address_type"] != DBNull.Value)
                        {
                            a.addressType = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(addressesReader["id_address_type"]));
                        }
                        addresses.Add(a);
                    }
                }
            }
            return((addresses.Count != 0) ? addresses : null);
        }
Beispiel #14
0
 //как искать?
 static public TestCancellation BuildCancellationFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string        findPatient = "SELECT cancellation_date, cancellation_reason_comment, id_cancellation_code, id_cancellation_reason 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())
         {
             CancellationData p = new CancellationData();
             while (personFromDataBase.Read())
             {
                 if (personFromDataBase["cancellation_date"] != DBNull.Value)
                 {
                     p.Date = Convert.ToDateTime(personFromDataBase["cancellation_date"]);
                 }
                 if (personFromDataBase["cancellation_reason_comment"] != DBNull.Value)
                 {
                     p.ReasonComment = Convert.ToString(personFromDataBase["cancellation_reason_comment"]);
                 }
                 TestCancellation pers = new TestCancellation(p);
                 if (personFromDataBase["id_cancellation_code"] != DBNull.Value)
                 {
                     pers.source = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_cancellation_code"]));
                 }
                 if (personFromDataBase["id_cancellation_reason"] != DBNull.Value)
                 {
                     pers.source = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_cancellation_reason"]));
                 }
                 return(pers);
             }
         }
     }
     return(null);
 }
Beispiel #15
0
        public override bool Equals(Object obj)
        {
            TestCoding p = obj as TestCoding;

            if ((object)p == null)
            {
                return(false);
            }
            if (this.coding == p.coding)
            {
                return(true);
            }
            if ((this.coding == null) || (p.coding == null))
            {
                return(false);
            }
            if ((this.coding.Code == p.coding.Code) &&
                (this.coding.System == p.coding.System) &&
                (this.coding.Version == p.coding.Version))
            {
                return(true);
            }
            else
            {
                this.FindMismatch(p);
                Global.errors3.Add("несовпадение TestCoding");
                return(false);
            }
        }
Beispiel #16
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())
             {
                 //referral_creation_date должен быть тут в Date!
                 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);
                 if (personFromDataBase["id_source_lpu"] != DBNull.Value)
                 {
                     pers.lpu = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_source_lpu"]));
                 }
                 return(pers);
             }
         }
     }
     return(new TestReferralSource(null));
 }
Beispiel #17
0
 public TestReferralSource(ReferralSource r)
 {
     if (r != null)
     {
         sourse = r;
     }
     else
     {
         sourse = new ReferralSource();
     }
     if ((sourse.Doctors != null) && (sourse.Doctors.Length != 0))
     {
         docs = new List <TestDoctor>();
         foreach (Doctor i in sourse.Doctors)
         {
             docs.Add(new TestDoctor(i));
         }
     }
     if ((sourse.MainDiagnosis != null) && (sourse.MainDiagnosis.Length != 0))
     {
         diag = new List <TestMainDiagnosis>();
         foreach (MainDiagnosis i in sourse.MainDiagnosis)
         {
             diag.Add(new TestMainDiagnosis(i));
         }
     }
     if (sourse.Lpu != null)
     {
         lpu = new TestCoding(sourse.Lpu);
     }
 }
Beispiel #18
0
 public TestPrivilege(Privilege p)
 {
     privilege = p;
     if (privilege.PrivilegeType != null)
     {
         privilegeType = new TestCoding(privilege.PrivilegeType);
     }
 }
Beispiel #19
0
 public TestContact(ContactDto c)
 {
     contact = c;
     if (contact.ContactType != null)
     {
         contactType = new TestCoding(contact.ContactType);
     }
 }
Beispiel #20
0
 public TestDiagnosisInfo(DiagnosisInfo r)
 {
     diagnosisInfo = r;
     if (diagnosisInfo.DiagnosisType != null)
         diagnosisType = new TestCoding(diagnosisInfo.DiagnosisType);
     if (diagnosisInfo.MkbCode != null)
         mkbCode = new TestCoding(diagnosisInfo.MkbCode);
 }
Beispiel #21
0
 public TestEventTarget(EventTarget r)
 {
     target = r ?? new EventTarget();
     caseAidForm = new TestCoding(target.CaseAidForm);
     caseAidPlace = new TestCoding(target.CaseAidPlace);
     caseAidType = new TestCoding(target.CaseAidType);
     lpu = new TestCoding(target.Lpu);
 }
Beispiel #22
0
 public TestPerson(Person p)
 {
     person = p;
     if (person.Sex != null)
     {
         sex = new TestCoding(person.Sex);
     }
 }
Beispiel #23
0
 public TestEventTarget(EventTarget r)
 {
     target       = r ?? new EventTarget();
     caseAidForm  = new TestCoding(target.CaseAidForm);
     caseAidPlace = new TestCoding(target.CaseAidPlace);
     caseAidType  = new TestCoding(target.CaseAidType);
     lpu          = new TestCoding(target.Lpu);
 }
Beispiel #24
0
 public TestAddress(AddressDto a)
 {
     if (a == null)
     {
         return;
     }
     address     = a;
     addressType = new TestCoding(address.AddressType);
 }
Beispiel #25
0
        static public List <TestDoctor> BuildDoctorFromDataBaseData(string idReferral)
        {
            List <TestDoctor> docs = new List <TestDoctor>();

            using (NpgsqlConnection c = Global.GetSqlConnection())
            {
                string        findDoctorsIds = "SELECT * FROM public.referral_doctor WHERE id_referral = '" + idReferral + "'";
                NpgsqlCommand fd             = new NpgsqlCommand(findDoctorsIds, c);
                using (NpgsqlDataReader idr = fd.ExecuteReader())
                {
                    if (idr["id_doctor"] != DBNull.Value)
                    {
                        string idDoctor = idr["id_doctor"].ToString();
                        using (NpgsqlConnection connection = Global.GetSqlConnection())
                        {
                            string        findDoctor = "SELECT * FROM public.doctor WHERE id_doctor = '" + idDoctor + "' ORDER BY id_doctor DESC LIMIT 1";
                            NpgsqlCommand doc        = new NpgsqlCommand(findDoctor, connection);
                            using (NpgsqlDataReader doctorFromDataBase = doc.ExecuteReader())
                            {
                                Doctor p = new Doctor();
                                while (doctorFromDataBase.Read())
                                {
                                    TestDoctor doctor = new TestDoctor(p);
                                    if (doctorFromDataBase["id_doctor_role"] != DBNull.Value)
                                    {
                                        doctor.role = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(doctorFromDataBase["id_doctor_role"]));
                                    }
                                    if (doctorFromDataBase["id_doctor_speciality"] != DBNull.Value)
                                    {
                                        doctor.speciality = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(doctorFromDataBase["id_doctor_speciality"]));
                                    }
                                    if (doctorFromDataBase["id_lpu"] != DBNull.Value)
                                    {
                                        doctor.lpu = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(doctorFromDataBase["id_lpu"]));
                                    }
                                    if (doctorFromDataBase["id_position"] != DBNull.Value)
                                    {
                                        doctor.position = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(doctorFromDataBase["id_position"]));
                                    }
                                    if (doctorFromDataBase["id_person"] != DBNull.Value)
                                    {
                                        doctor.person = TestPerson.BuildPersonFromDataBaseData(Convert.ToString(doctorFromDataBase["id_person"]), Convert.ToString(doctorFromDataBase["id_doctor_mis"]));
                                    }
                                    if (doctorFromDataBase["id_person"] != DBNull.Value)
                                    {
                                        doctor.cnts = TestContact.BuildContactsFromDataBaseData(Convert.ToString(doctorFromDataBase["id_person"]));
                                    }
                                    docs.Add(doctor);
                                }
                            }
                        }
                    }
                }
            }
            return((docs.Count != 0) ? docs : null);
        }
Beispiel #26
0
 public TestDocument(DocumentDto d)
 {
     document = d;
     if (document.DocumentType != null)
         documentType = new TestCoding(document.DocumentType);
     if (document.Provider != null)
         provider = new TestCoding(document.Provider);
     if (document.RegionCode != null)
         regionCode = new TestCoding(document.RegionCode);
 }
Beispiel #27
0
 public TestReferralSource(ReferralSource r)
 {
     sourse = r ?? new ReferralSource();
     if (sourse.Doctors != null)
         foreach (Doctor i in sourse.Doctors)
             docs.Add(new TestDoctor(i));
     if (sourse.MainDiagnosis != null)
         foreach (MainDiagnosis i in sourse.MainDiagnosis)
             diag.Add(new TestMainDiagnosis(i));
     lpu = new TestCoding(sourse.Lpu);
 }
Beispiel #28
0
 public TestCancellation(CancellationData r)
 {
     if (r != null)
         cancellation = r;
     else
         cancellation = new CancellationData();
     if (cancellation.CancellationSource != null)
         source = new TestCoding(cancellation.CancellationSource);
     if (cancellation.CancellationReason != null)
         reason = new TestCoding(cancellation.CancellationReason);
 }
Beispiel #29
0
 public TestReferralInfo(ReferralInfo r)
 {
     info = r ?? new ReferralInfo();
     cancellation = new TestCancellation(info.Cancellation);
     if (info.MqReferralStatus != null)
         mqReferralStatus = new TestCoding(info.MqReferralStatus);
     if (info.ProfileMedService != null)
         profileMedService = new TestCoding(info.ProfileMedService);
     if (info.ReferralType != null)
         referralType = new TestCoding(info.ReferralType);
 }
Beispiel #30
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 #31
0
 public TestDiagnosisInfo(DiagnosisInfo r)
 {
     diagnosisInfo = r;
     if (diagnosisInfo.DiagnosisType != null)
     {
         diagnosisType = new TestCoding(diagnosisInfo.DiagnosisType);
     }
     if (diagnosisInfo.MkbCode != null)
     {
         mkbCode = new TestCoding(diagnosisInfo.MkbCode);
     }
 }
Beispiel #32
0
 public TestDoctor(Doctor r)
 {
     doctor = r;
     if (doctor.ContactDtos != null)
         foreach (ContactDto i in doctor.ContactDtos)
             cnts.Add(new TestContact(i));
     lpu = new TestCoding(doctor.Lpu);
     person = new TestPerson(doctor.Person);
     position = new TestCoding(doctor.Position);
     role = new TestCoding(doctor.Role);
     speciality = new TestCoding(doctor.Speciality);
 }
Beispiel #33
0
        static public List <TestDocument> BuildDocumentsFromDataBaseData(string idPerson)
        {
            List <TestDocument> documents = new List <TestDocument>();

            using (NpgsqlConnection connection = Global.GetSqlConnection())
            {
                string        findDocument = "SELECT * FROM public.documents WHERE id_person = '" + idPerson + "'";
                NpgsqlCommand person       = new NpgsqlCommand(findDocument, connection);
                using (NpgsqlDataReader documentReader = person.ExecuteReader())
                {
                    while (documentReader.Read())
                    {
                        //Что делать с DateSpecified?
                        DocumentDto doc = new DocumentDto();
                        if (documentReader["docn"] != DBNull.Value)
                        {
                            doc.DocN = Convert.ToString(documentReader["docn"]);
                        }
                        if (documentReader["docs"] != DBNull.Value)
                        {
                            doc.DocS = Convert.ToString(documentReader["docs"]);
                        }
                        if (documentReader["expired_date"] != DBNull.Value)
                        {
                            doc.ExpiredDate = Convert.ToDateTime(documentReader["expired_date"]);
                        }
                        if (documentReader["issued_date"] != DBNull.Value)
                        {
                            doc.IssuedDate = Convert.ToDateTime(documentReader["issued_date"]);
                        }
                        if (documentReader["provider_name"] != DBNull.Value)
                        {
                            doc.ProviderName = Convert.ToString(documentReader["provider_name"]);
                        }
                        TestDocument document = new TestDocument(doc);
                        if (documentReader["id_document_type"] != DBNull.Value)
                        {
                            document.documentType = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(documentReader["id_document_type"]));
                        }
                        if (documentReader["id_provider"] != DBNull.Value)
                        {
                            document.provider = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(documentReader["id_provider"]));
                        }
                        if (documentReader["id_region_code"] != DBNull.Value)
                        {
                            document.regionCode = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(documentReader["id_region_code"]));
                        }
                        documents.Add(document);
                    }
                }
            }
            return((documents.Count != 0) ? documents : null);
        }
Beispiel #34
0
 public void UpdateTestEventTarget(EventTarget e)
 {
     if (e.CaseCloseDate != null)
     {
         this.target.CaseCloseDate = e.CaseCloseDate;
     }
     if (e.CaseOpenDate != null)
     {
         this.target.CaseOpenDate = e.CaseOpenDate;
     }
     if (e.IsReferralReviwed != null)
     {
         this.target.IsReferralReviwed = e.IsReferralReviwed;
     }
     if (e.ReceptionAppointComment != null)
     {
         this.target.ReceptionAppointComment = e.ReceptionAppointComment;
     }
     if (e.ReceptionAppointDate != null)
     {
         this.target.ReceptionAppointDate = e.ReceptionAppointDate;
     }
     if (e.ReceptionAppointTime != null)
     {
         this.target.ReceptionAppointTime = e.ReceptionAppointTime;
     }
     if (e.ReferralReviewDate != null)
     {
         this.target.ReferralReviewDate = e.ReferralReviewDate;
     }
     if (e.RefferalCreatedDate != null)
     {
         this.target.RefferalCreatedDate = e.RefferalCreatedDate;
     }
     if (e.CaseAidForm != null)
     {
         this.caseAidForm = new TestCoding(e.CaseAidForm);
     }
     if (e.CaseAidPlace != null)
     {
         this.caseAidPlace = new TestCoding(e.CaseAidPlace);
     }
     if (e.CaseAidType != null)
     {
         this.caseAidType = new TestCoding(e.CaseAidType);
     }
     if (e.Lpu != null)
     {
         this.lpu = new TestCoding(e.Lpu);
     }
 }
Beispiel #35
0
 public TestEventTarget(EventTarget r)
 {
     if (r != null)
         target = r;
     else
         target = new EventTarget();
     if (target.CaseAidForm != null)
         caseAidForm = new TestCoding(target.CaseAidForm);
     if (target.CaseAidPlace != null)
         caseAidPlace = new TestCoding(target.CaseAidPlace);
     if (target.CaseAidType != null)
         caseAidType = new TestCoding(target.CaseAidType);
     if (target.Lpu != null)
         lpu = new TestCoding(target.Lpu);
 }
Beispiel #36
0
 private void FindMismatch(TestCoding r)
 {
     if (this.Code != r.Code)
     {
         Global.errors3.Add("Несовпадение Code TestCoding");
     }
     if (this.System != r.System)
     {
         Global.errors3.Add("Несовпадение System TestCoding");
     }
     if (this.Version != r.Version)
     {
         Global.errors3.Add("Несовпадение Version TestCoding");
     }
 }
Beispiel #37
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);
 }
Beispiel #38
0
 public TestDoctor(Doctor r)
 {
     doctor = r;
     if (doctor.ContactDtos != null)
     {
         foreach (ContactDto i in doctor.ContactDtos)
         {
             cnts.Add(new TestContact(i));
         }
     }
     lpu        = new TestCoding(doctor.Lpu);
     person     = new TestPerson(doctor.Person);
     position   = new TestCoding(doctor.Position);
     role       = new TestCoding(doctor.Role);
     speciality = new TestCoding(doctor.Speciality);
 }
Beispiel #39
0
 public TestDocument(DocumentDto d)
 {
     document = d;
     if (document.DocumentType != null)
     {
         documentType = new TestCoding(document.DocumentType);
     }
     if (document.Provider != null)
     {
         provider = new TestCoding(document.Provider);
     }
     if (document.RegionCode != null)
     {
         regionCode = new TestCoding(document.RegionCode);
     }
 }
Beispiel #40
0
 static public TestReferralTarget BuildTargetFromDataBaseData(string idReferral)
 {
     using (NpgsqlConnection connection = Global.GetSqlConnection())
     {
         string        findPatient = "SELECT id_target_lpu_case_mis, is_referral_review_target_mo, reception_appoint_additional_comment, reception_appoint_time_comment, referral_review_date_target_mo, id_target_lpu, 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())
         {
             ReferralTarget p = new ReferralTarget();
             while (personFromDataBase.Read())
             {
                 //что делать с DateSpecified и Мисами?
                 if (personFromDataBase["id_target_lpu_case_mis"] != DBNull.Value)
                 {
                     p.IdCaseMis = Convert.ToString(personFromDataBase["id_source_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);
                 if (personFromDataBase["id_target_lpu"] != DBNull.Value)
                 {
                     pers.lpu = TestCoding.BuildCodingFromDataBaseData(Convert.ToString(personFromDataBase["id_target_lpu"]));
                 }
                 return(pers);
             }
         }
     }
     return(null);
 }
Beispiel #41
0
 public TestDoctor(Doctor r)
 {
     doctor = r;
     if ((doctor.ContactDtos != null) && (doctor.ContactDtos.Length != 0))
     {
         cnts = new List<TestContact>();
         foreach (ContactDto i in doctor.ContactDtos)
             cnts.Add(new TestContact(i));
     }
     if (doctor.Lpu != null)
         lpu = new TestCoding(doctor.Lpu);
     if (doctor.Person != null)
         person = new TestPerson(doctor.Person);
     if (doctor.Position != null)
         position = new TestCoding(doctor.Position);
     if (doctor.Role != null)
         role = new TestCoding(doctor.Role);
     if (doctor.Speciality != null)
         speciality = new TestCoding(doctor.Speciality);
 }
Beispiel #42
0
 public TestReferralSource(ReferralSource r)
 {
     if (r != null)
         sourse = r;
     else
         sourse = new ReferralSource();
     if ((sourse.Doctors != null) && (sourse.Doctors.Length != 0))
     {
         docs = new List<TestDoctor>();
         foreach (Doctor i in sourse.Doctors)
             docs.Add(new TestDoctor(i));
     }
     if ((sourse.MainDiagnosis != null) && (sourse.MainDiagnosis.Length != 0))
     {
         diag = new List<TestMainDiagnosis>();
         foreach (MainDiagnosis i in sourse.MainDiagnosis)
             diag.Add(new TestMainDiagnosis(i));
     }
     if (sourse.Lpu != null)
         lpu = new TestCoding(sourse.Lpu);
 }
Beispiel #43
0
 public TestPrivilege(Privilege p)
 {
     privilege = p;
     privilegeType = new TestCoding(privilege.PrivilegeType);
 }
Beispiel #44
0
 internal void UpdateTestReferralSurvey(Survey r)
 {
     if (r.Comment != null)
         this.survey.Comment = r.Comment;
     if (r.Additional != null)
         this.additional.UpdateTestAdditional(r.Additional);
     if (r.SurveyOrgan != null)
         this.surveyOrgan = new TestCoding(r.SurveyOrgan);
     if (r.SurveyType != null)
         this.surveyType = new TestCoding(r.SurveyType);
 }
Beispiel #45
0
 public TestPerson(Person p)
 {
     person = p;
     if (person.Sex != null)
         sex = new TestCoding(person.Sex);
 }
Beispiel #46
0
 public void UpdateTestReferralInfo(ReferralInfo r)
 {
     if (r != null)
     {
         if (r.Comment != null)
             this.info.Comment = r.Comment;
         if (r.Date != null)
             this.info.Date = r.Date;
         if (r.IdMq != null)
             this.info.IdMq = r.IdMq;
         if (r.Priority != null)
             this.info.Priority = r.Priority;
         if (r.Reason != null)
             this.info.Reason = r.Reason;
         if (r.Cancellation != null)
             this.cancellation = new TestCancellation(r.Cancellation);
         if (r.MqReferralStatus != null)
             this.mqReferralStatus = new TestCoding(r.MqReferralStatus);
         if (r.ProfileMedService != null)
             this.mqReferralStatus = new TestCoding(r.ProfileMedService);
         if (r.ReferralType != null)
             this.referralType = new TestCoding(r.ReferralType);
     }
 }
Beispiel #47
0
 public TestCancellation(CancellationData r)
 {
     cancellation = r ?? new CancellationData();
     source = new TestCoding(cancellation.CancellationSource);
     reason = new TestCoding(cancellation.CancellationReason);
 }
Beispiel #48
0
 public void UpdateTestEventTarget(EventTarget e)
 {
     if (e.CaseCloseDate != null)
         this.target.CaseCloseDate = e.CaseCloseDate;
     if (e.CaseOpenDate != null)
         this.target.CaseOpenDate = e.CaseOpenDate;
     if (e.IsReferralReviwed != null)
         this.target.IsReferralReviwed = e.IsReferralReviwed;
     if (e.ReceptionAppointComment != null)
         this.target.ReceptionAppointComment = e.ReceptionAppointComment;
     if (e.ReceptionAppointDate != null)
         this.target.ReceptionAppointDate = e.ReceptionAppointDate;
     if (e.ReceptionAppointTime != null)
         this.target.ReceptionAppointTime = e.ReceptionAppointTime;
     if (e.ReferralReviewDate != null)
         this.target.ReferralReviewDate = e.ReferralReviewDate;
     if (e.RefferalCreatedDate != null)
         this.target.RefferalCreatedDate = e.RefferalCreatedDate;
     if (e.CaseAidForm != null)
         this.caseAidForm = new TestCoding(e.CaseAidForm);
     if (e.CaseAidPlace != null)
         this.caseAidPlace = new TestCoding(e.CaseAidPlace);
     if (e.CaseAidType != null)
         this.caseAidType = new TestCoding(e.CaseAidType);
     if (e.Lpu != null)
         this.lpu = new TestCoding(e.Lpu);
 }
Beispiel #49
0
 public TestAddress(AddressDto a)
 {
     if (a == null) return;
     address = a;
     addressType = new TestCoding(address.AddressType);
 }
Beispiel #50
0
 internal void UpdateTestPerson(Person p)
 {
     if (p.BirthDate != null)
         this.person.BirthDate = p.BirthDate;
     if (p.IdPatientMis != null)
         this.person.IdPatientMis = p.IdPatientMis;
     if (p.HumanName != null)
     {
         if (p.HumanName.FamilyName != null)
             this.person.HumanName.FamilyName = p.HumanName.FamilyName;
         if (p.HumanName.GivenName != null)
             this.person.HumanName.GivenName = p.HumanName.GivenName;
         if (p.HumanName.MiddleName != null)
             this.person.HumanName.MiddleName = p.HumanName.MiddleName;
     }
     if (p.Sex != null)
         this.sex = new TestCoding(p.Sex);
 }
Beispiel #51
0
 internal void UpdateTestReferralSource(ReferralSource s)
 {
     if ((s.Doctors != null) && (s.Doctors.Length != 0))
     {
         if (this.doctors == null)
             docs = new List<TestDoctor>();
         foreach (Doctor i in s.Doctors)
             docs.Add(new TestDoctor(i));
     }
     if ((s.MainDiagnosis != null) && (s.MainDiagnosis.Length != 0))
     {
         if (this.mainDiagnosis == null)
             diag = new List<TestMainDiagnosis>();
         foreach (MainDiagnosis i in s.MainDiagnosis)
             diag.Add(new TestMainDiagnosis(i));
     }
     if (s.Lpu != null)
         lpu = new TestCoding(s.Lpu);
 }
Beispiel #52
0
 public TestDiagnosisInfo(DiagnosisInfo r)
 {
     diagnosisInfo = r;
     diagnosisType = new TestCoding(diagnosisInfo.DiagnosisType);
     mkbCode = new TestCoding(diagnosisInfo.MkbCode);
 }
Beispiel #53
0
 public TestContact(ContactDto c)
 {
     contact = c;
     contactType = new TestCoding(contact.ContactType);
 }
Beispiel #54
0
 public TestContact(ContactDto c)
 {
     contact = c;
     if (contact.ContactType != null)
         contactType = new TestCoding(contact.ContactType);
 }
Beispiel #55
0
 private void FindMismatch(TestCoding r)
 {
     if (this.coding.Code != r.coding.Code)
         Global.errors3.Add("Несовпадение Code TestCoding");
     if (this.coding.System!= r.coding.System)
         Global.errors3.Add("Несовпадение System TestCoding");
     if (this.coding.Version!= r.coding.Version)
         Global.errors3.Add("Несовпадение Version TestCoding");
 }