Exemplo n.º 1
0
        public override bool Equals(Object obj)
        {
            TestStatStep p = obj as TestStatStep;

            if ((object)p == null)
            {
                return(false);
            }
            if (this.statStep == p.statStep)
            {
                return(true);
            }
            if ((this.statStep == null) || (p.statStep == null))
            {
                return(false);
            }
            if ((this.statStep.BedNumber == p.statStep.BedNumber) &&
                (this.statStep.BedProfile == p.statStep.BedProfile) &&
                (this.statStep.DaySpend == p.statStep.DaySpend) &&
                (this.statStep.HospitalDepartmentName == p.statStep.HospitalDepartmentName) &&
                (this.statStep.IdHospitalDepartment == p.statStep.IdHospitalDepartment) &&
                (this.statStep.IdRegimen == p.statStep.IdRegimen) &&
                (this.statStep.WardNumber == p.statStep.WardNumber) &&
                Global.IsEqual(this.step, p.step) &&
                Global.IsEqual(this.medRecords, p.medRecords))
            {
                return(true);
            }
            else
            {
                this.FindMismatch(p);
                Global.errors3.Add("несовпадение TestStatStep");
                return(false);
            }
        }
Exemplo n.º 2
0
 public void AddStepToCase(string guid, string idLpu, string idPatientMis, string idCaseMis, StepBase s)
 {
     try
     {
         StepAmb sa = s as StepAmb;
         if ((object)sa != null)
         {
             client.AddStepToCase(guid, idLpu, idPatientMis, idCaseMis, s);
             TestAmbStep example = new TestAmbStep(sa, idLpu);
             if (!example.CheckStepInDataBase(guid, idPatientMis, idLpu, idCaseMis))
             {
                 Global.errors1.AddRange(Global.errors2);
             }
         }
         StepStat ss = s as StepStat;
         if ((object)ss != null)
         {
             client.AddStepToCase(guid, idLpu, idPatientMis, idCaseMis, s);
             TestStatStep example = new TestStatStep(ss, idLpu);
             if (!example.CheckStepInDataBase(guid, idPatientMis, idLpu, idCaseMis))
             {
                 Global.errors1.AddRange(Global.errors2);
             }
         }
     }
     catch (System.ServiceModel.FaultException <List <PixServiseTests.EMKServise.RequestFault> > e)
     {
         getErrors(e.Detail);
     }
     catch (System.ServiceModel.FaultException <PixServiseTests.EMKServise.RequestFault[]> e)
     {
         getErrors(e.Detail);
     }
     catch (System.ServiceModel.FaultException <PixServiseTests.EMKServise.RequestFault> e)
     {
         Global.errors1.Add(e.Detail.PropertyName + " - " + e.Detail.Message);
         getErrors(e.Detail.Errors);
     }
 }
Exemplo n.º 3
0
 private void FindMismatch(TestStatStep astep)
 {
     if (this.statStep.BedNumber != astep.statStep.BedNumber)
     {
         Global.errors3.Add("несовпадение BedNumber TestStatStep");
     }
     if (this.statStep.BedProfile != astep.statStep.BedProfile)
     {
         Global.errors3.Add("несовпадение BedProfile TestStatStep");
     }
     if (this.statStep.DaySpend != astep.statStep.DaySpend)
     {
         Global.errors3.Add("несовпадение DaySpend TestStatStep");
     }
     if (this.statStep.HospitalDepartmentName != astep.statStep.HospitalDepartmentName)
     {
         Global.errors3.Add("несовпадение HospitalDepartmentName TestStatStep");
     }
     if (this.statStep.IdHospitalDepartment != astep.statStep.IdHospitalDepartment)
     {
         Global.errors3.Add("несовпадение IdHospitalDepartment TestStatStep");
     }
     if (this.statStep.IdRegimen != astep.statStep.IdRegimen)
     {
         Global.errors3.Add("несовпадение IdRegimen TestStatStep");
     }
     if (this.statStep.WardNumber != astep.statStep.WardNumber)
     {
         Global.errors3.Add("несовпадение WardNumber TestStatStep");
     }
     if (Global.GetLength(this.medRecords) != Global.GetLength(astep.medRecords))
     {
         Global.errors3.Add("несовпадение длины MedRecords TestStatStep");
     }
     if (Global.GetLength(this.step) != Global.GetLength(astep.step))
     {
         Global.errors3.Add("несовпадение длины step TestStatStep");
     }
 }
Exemplo n.º 4
0
 public void AddStepToCase(string guid, string idLpu, string idPatientMis, string idCaseMis, StepBase s)
 {
     try
     {
         StepAmb sa = s as StepAmb;
         if ((object)sa != null)
         {
             client.AddStepToCase(guid, idLpu, idPatientMis, idCaseMis ,s);
             TestAmbStep example = new TestAmbStep(sa, idLpu);
             if (!example.CheckStepInDataBase(guid, idPatientMis, idLpu, idCaseMis))
             {
                 Global.errors1.AddRange(Global.errors2);
             }
         }
         StepStat ss = s as StepStat;
         if ((object)ss != null)
         {
             client.AddStepToCase(guid, idLpu, idPatientMis, idCaseMis, s);
             TestStatStep example = new TestStatStep(ss, idLpu);
             if (!example.CheckStepInDataBase(guid, idPatientMis, idLpu, idCaseMis))
                 Global.errors1.AddRange(Global.errors2);
         }
     }
     catch (System.ServiceModel.FaultException<List<PixServiseTests.EMKServise.RequestFault>> e)
     {
         getErrors(e.Detail);
     }
     catch (System.ServiceModel.FaultException<PixServiseTests.EMKServise.RequestFault[]> e)
     {
         getErrors(e.Detail);
     }
     catch (System.ServiceModel.FaultException<PixServiseTests.EMKServise.RequestFault> e)
     {
         Global.errors1.Add(e.Detail.PropertyName + " - " + e.Detail.Message);
         getErrors(e.Detail.Errors);
     }
 }
Exemplo n.º 5
0
 private void FindMismatch(TestStatStep astep)
 {
     if (this.statStep.BedNumber != astep.statStep.BedNumber)
         Global.errors3.Add("несовпадение BedNumber TestStatStep");
     if (this.statStep.BedProfile != astep.statStep.BedProfile)
         Global.errors3.Add("несовпадение BedProfile TestStatStep");
     if (this.statStep.DaySpend != astep.statStep.DaySpend)
         Global.errors3.Add("несовпадение DaySpend TestStatStep");
     if (this.statStep.HospitalDepartmentName != astep.statStep.HospitalDepartmentName)
         Global.errors3.Add("несовпадение HospitalDepartmentName TestStatStep");
     if (this.statStep.IdHospitalDepartment != astep.statStep.IdHospitalDepartment)
         Global.errors3.Add("несовпадение IdHospitalDepartment TestStatStep");
     if (this.statStep.IdRegimen != astep.statStep.IdRegimen)
         Global.errors3.Add("несовпадение IdRegimen TestStatStep");
     if (this.statStep.WardNumber != astep.statStep.WardNumber)
         Global.errors3.Add("несовпадение WardNumber TestStatStep");
     if (Global.GetLength(this.medRecords) != Global.GetLength(astep.medRecords))
         Global.errors3.Add("несовпадение длины MedRecords TestStatStep");
     if (Global.GetLength(this.step) != Global.GetLength(astep.step))
         Global.errors3.Add("несовпадение длины step TestStatStep");
 }
Exemplo n.º 6
0
 public static List<TestStatStep> BuildStatStepsFromDataBase(string idCase, string caseLpu)
 {
     List<TestStatStep> statSteps = new List<TestStatStep>();
     if (idCase != string.Empty)
     {
         List<TestStepBase> steps = TestStepBase.BuildTestStepsFromDataBase(idCase, caseLpu);
         using (SqlConnection connection = Global.GetSqlConnection())
         {
             foreach (TestStepBase i in steps)
             {
                 string findSteps = "SELECT * FROM HospStep WHERE IdStep = '" + i.idStep + "'";
                 SqlCommand stepsCommand = new SqlCommand(findSteps, connection);
                 using (SqlDataReader stepsReader = stepsCommand.ExecuteReader())
                 {
                     while (stepsReader.Read())
                     {
                         StepStat sa = new StepStat();
                         if (stepsReader["BedNo"].ToString() != "")
                             sa.BedNumber = Convert.ToString(stepsReader["BedNo"]);
                         else
                             sa.BedNumber = null;
                         if (stepsReader["IdBedProfile"].ToString() != "")
                             sa.BedProfile = Convert.ToByte(stepsReader["IdBedProfile"]);
                         else
                             sa.BedProfile = 0;
                         if (stepsReader["DaySpend"].ToString() != "")
                             sa.DaySpend = Convert.ToUInt16(stepsReader["DaySpend"]);
                         else
                             sa.DaySpend = 0;
                         if (stepsReader["HospitalDepartment"].ToString() != "")
                             sa.HospitalDepartmentName = Convert.ToString(stepsReader["HospitalDepartment"]);
                         else
                             sa.HospitalDepartmentName = null;
                         if (stepsReader["IdHospitalDepartment"].ToString() != "")
                             sa.IdHospitalDepartment = Convert.ToString(stepsReader["IdHospitalDepartment"]);
                         else
                             sa.IdHospitalDepartment = null;
                         if (stepsReader["IdRegimenType"].ToString() != "")
                             sa.IdRegimen = Convert.ToByte(stepsReader["IdRegimenType"]);
                         else
                             sa.IdRegimen = 0;
                         if (stepsReader["WardNumber"].ToString() != "")
                             sa.WardNumber = Convert.ToString(stepsReader["WardNumber"]);
                         else
                             sa.WardNumber = null;
                         TestStatStep st = new TestStatStep(sa, caseLpu);
                         st.step = i;
                         st.records = new List<TestMedRecord>();
                         List<TestService> s = TestService.BuildServiseFromDataBaseData(i.idStep);
                         if (!Global.IsEqual(s, null))
                             st.records.AddRange(s);
                         List<TestAppointedMedication> am = TestAppointedMedication.BuildAppointedMedicationFromDataBaseDate(i.idStep);
                         if (!Global.IsEqual(am, null))
                             st.records.AddRange(am);
                         List<TestDiagnosis> diag = TestDiagnosis.BuildDiagnosisFromDataBaseDate(i.idStep);
                         if (!Global.IsEqual(diag, null))
                             st.records.AddRange(diag);
                         TestClinicMainDiagnosis acdm = TestClinicMainDiagnosis.BuildTestClinicMainDiagnosisFromDataBaseDate(i.idStep);
                         if (!Global.IsEqual(acdm, null))
                             st.records.Add(acdm);
                         List<TestReferral> trl = TestReferral.BuildReferralFromDataBaseData(i.idStep);
                         if (!Global.IsEqual(trl, null))
                             st.records.AddRange(trl);
                         List<TestLaboratoryReport> tlr = TestLaboratoryReport.BuildLaboratoryReportFromDataBaseData(i.idStep);
                         if (!Global.IsEqual(tlr, null))
                             st.records.AddRange(tlr);
                         if (st.records.Count == 0)
                             st.records = null;
                         statSteps.Add(st);
                     }
                 }
             }
         }
     }
     if (statSteps.Count != 0)
         return statSteps;
     else
         return null;
 }
Exemplo n.º 7
0
        static public List <TestStatStep> BuildStatStepsFromDataBase(string idCase, string caseLpu)
        {
            List <TestStatStep> statSteps = new List <TestStatStep>();

            if (idCase != string.Empty)
            {
                List <TestStepBase> steps = TestStepBase.BuildTestStepsFromDataBase(idCase, caseLpu);
                using (SqlConnection connection = Global.GetSqlConnection())
                {
                    foreach (TestStepBase i in steps)
                    {
                        string     findSteps    = "SELECT * FROM HospStep WHERE IdStep = '" + i.idStep + "'";
                        SqlCommand stepsCommand = new SqlCommand(findSteps, connection);
                        using (SqlDataReader stepsReader = stepsCommand.ExecuteReader())
                        {
                            while (stepsReader.Read())
                            {
                                StepStat sa = new StepStat();
                                if (stepsReader["BedNo"].ToString() != "")
                                {
                                    sa.BedNumber = Convert.ToString(stepsReader["BedNo"]);
                                }
                                else
                                {
                                    sa.BedNumber = null;
                                }
                                if (stepsReader["IdBedProfile"].ToString() != "")
                                {
                                    sa.BedProfile = Convert.ToByte(stepsReader["IdBedProfile"]);
                                }
                                else
                                {
                                    sa.BedProfile = 0;
                                }
                                if (stepsReader["DaySpend"].ToString() != "")
                                {
                                    sa.DaySpend = Convert.ToUInt16(stepsReader["DaySpend"]);
                                }
                                else
                                {
                                    sa.DaySpend = 0;
                                }
                                if (stepsReader["HospitalDepartment"].ToString() != "")
                                {
                                    sa.HospitalDepartmentName = Convert.ToString(stepsReader["HospitalDepartment"]);
                                }
                                else
                                {
                                    sa.HospitalDepartmentName = null;
                                }
                                if (stepsReader["IdHospitalDepartment"].ToString() != "")
                                {
                                    sa.IdHospitalDepartment = Convert.ToString(stepsReader["IdHospitalDepartment"]);
                                }
                                else
                                {
                                    sa.IdHospitalDepartment = null;
                                }
                                if (stepsReader["IdRegimenType"].ToString() != "")
                                {
                                    sa.IdRegimen = Convert.ToByte(stepsReader["IdRegimenType"]);
                                }
                                else
                                {
                                    sa.IdRegimen = 0;
                                }
                                if (stepsReader["WardNumber"].ToString() != "")
                                {
                                    sa.WardNumber = Convert.ToString(stepsReader["WardNumber"]);
                                }
                                else
                                {
                                    sa.WardNumber = null;
                                }
                                TestStatStep st = new TestStatStep(sa, caseLpu);
                                st.step    = i;
                                st.records = new List <TestMedRecord>();
                                List <TestService> s = TestService.BuildServiseFromDataBaseData(i.idStep);
                                if (!Global.IsEqual(s, null))
                                {
                                    st.records.AddRange(s);
                                }
                                List <TestAppointedMedication> am = TestAppointedMedication.BuildAppointedMedicationFromDataBaseDate(i.idStep);
                                if (!Global.IsEqual(am, null))
                                {
                                    st.records.AddRange(am);
                                }
                                List <TestDiagnosis> diag = TestDiagnosis.BuildDiagnosisFromDataBaseDate(i.idStep);
                                if (!Global.IsEqual(diag, null))
                                {
                                    st.records.AddRange(diag);
                                }
                                TestClinicMainDiagnosis acdm = TestClinicMainDiagnosis.BuildTestClinicMainDiagnosisFromDataBaseDate(i.idStep);
                                if (!Global.IsEqual(acdm, null))
                                {
                                    st.records.Add(acdm);
                                }
                                List <TestReferral> trl = TestReferral.BuildReferralFromDataBaseData(i.idStep);
                                if (!Global.IsEqual(trl, null))
                                {
                                    st.records.AddRange(trl);
                                }
                                List <TestLaboratoryReport> tlr = TestLaboratoryReport.BuildLaboratoryReportFromDataBaseData(i.idStep);
                                if (!Global.IsEqual(tlr, null))
                                {
                                    st.records.AddRange(tlr);
                                }
                                if (st.records.Count == 0)
                                {
                                    st.records = null;
                                }
                                statSteps.Add(st);
                            }
                        }
                    }
                }
            }
            if (statSteps.Count != 0)
            {
                return(statSteps);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 8
0
        public bool CheckStepInDataBase(string guid, string patientMis, string idLpu, string caseMis)
        {
            TestStatStep tss = TestStatStep.BuildStatStepsFromDataBase(guid, patientMis, idLpu, caseMis, this.step.step.IdStepMis);

            return(this == tss);
        }
Exemplo n.º 9
0
        static public TestStatCase BuildAmbCaseFromDataBaseData(string guid, string idlpu, string mis, string patientId)
        {
            if ((guid != string.Empty) && (idlpu != string.Empty) && (mis != string.Empty))
            {
                string caseId = TestCaseBase.GetCaseId(guid, idlpu, mis, patientId);
                if (caseId != null)
                {
                    CaseStat ca = new CaseStat();
                    using (SqlConnection connection = Global.GetSqlConnection())
                    {
                        string     findCase    = "SELECT TOP(1) * FROM HospCase WHERE IdCase = '" + caseId + "'";
                        SqlCommand caseCommand = new SqlCommand(findCase, connection);
                        using (SqlDataReader caseReader = caseCommand.ExecuteReader())
                        {
                            while (caseReader.Read())
                            {
                                if (caseReader["DeliveredCode"].ToString() != "")
                                {
                                    ca.DeliveryCode = Convert.ToString(caseReader["DeliveredCode"]);
                                }
                                if (caseReader["IdIntoxicationType"].ToString() != "")
                                {
                                    ca.IdIntoxicationType = Convert.ToByte(caseReader["IdIntoxicationType"]);
                                }
                                if (caseReader["IdPatientConditionOnAdmission"].ToString() != "")
                                {
                                    ca.IdPatientConditionOnAdmission = Convert.ToByte(caseReader["IdPatientConditionOnAdmission"]);
                                }
                                if (caseReader["IdTypeFromDiseaseStart"].ToString() != "")
                                {
                                    ca.IdTypeFromDiseaseStart = Convert.ToByte(caseReader["IdTypeFromDiseaseStart"]);
                                }
                                if (caseReader["IdTransportIntern"].ToString() != "")
                                {
                                    ca.IdTransportIntern = Convert.ToByte(caseReader["IdTransportIntern"]);
                                }
                                if (caseReader["IdHospChannel"].ToString() != "")
                                {
                                    ca.IdHospChannel = Convert.ToByte(caseReader["IdHospChannel"]);
                                }
                                if (caseReader["RW1Mark"].ToString() != "")
                                {
                                    ca.RW1Mark = Convert.ToBoolean(caseReader["RW1Mark"]);
                                }
                                if (caseReader["AIDSMark"].ToString() != "")
                                {
                                    ca.AIDSMark = Convert.ToBoolean(caseReader["AIDSMark"]);
                                }
                                TestStatCase statcase = new TestStatCase(guid, ca);
                                statcase.caseBase  = TestCaseBase.BuildBaseCaseFromDataBaseData(guid, idlpu, mis, patientId);
                                statcase.statSteps = TestStatStep.BuildStatStepsFromDataBase(caseId, ca.IdLpu);
                                List <TestStepBase> st = TestStepBase.BuildTestStepsFromDataBase(caseId, ca.IdLpu);
                                if (st != null)
                                {
                                    foreach (TestStepBase i in st)
                                    {
                                        if (Global.IsEqual(i.doctor, null))
                                        {
                                            statcase.defaultStep = i;
                                        }
                                    }
                                    if (!Global.IsEqual(statcase.defaultStep, null))
                                    {
                                        statcase.records = new List <TestMedRecord>();
                                        List <TestService> serv = TestService.BuildServiseFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(serv, null))
                                        {
                                            statcase.records.AddRange(serv);
                                        }

                                        TestTfomsInfo forms = TestTfomsInfo.BuildTfomsInfoFromDataBaseDate(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(forms, null))
                                        {
                                            statcase.records.Add(forms);
                                        }

                                        TestDeathInfo tdi = TestDeathInfo.BuildDeathInfoFromDataBaseDate(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(tdi, null))
                                        {
                                            statcase.records.Add(tdi);
                                        }

                                        List <TestDiagnosis> td = TestDiagnosis.BuildDiagnosisFromDataBaseDate(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(td, null))
                                        {
                                            statcase.records.AddRange(td);
                                        }

                                        TestClinicMainDiagnosis acdm = TestClinicMainDiagnosis.BuildTestClinicMainDiagnosisFromDataBaseDate(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(acdm, null))
                                        {
                                            statcase.records.Add(acdm);
                                        }

                                        List <TestReferral> trl = TestReferral.BuildReferralFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(trl, null))
                                        {
                                            statcase.records.AddRange(trl);
                                        }

                                        List <TestSickList> tsl = TestSickList.BuildSickListFromDataBaseData(statcase.defaultStep.idStep, patientId);
                                        if (!Global.IsEqual(tsl, null))
                                        {
                                            statcase.records.AddRange(tsl);
                                        }

                                        TestDischargeSummary tds = TestDischargeSummary.BuildSickListFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(tds, null))
                                        {
                                            statcase.records.Add(tds);
                                        }

                                        List <TestLaboratoryReport> tlr = TestLaboratoryReport.BuildLaboratoryReportFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(tlr, null))
                                        {
                                            statcase.records.AddRange(tlr);
                                        }

                                        TestConsultNote tcn = TestConsultNote.BuildSickListFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(tcn, null))
                                        {
                                            statcase.records.Add(tcn);
                                        }

                                        List <TestAppointedMedication> ap = TestAppointedMedication.BuildAppointedMedicationFromDataBaseDate(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(ap, null))
                                        {
                                            statcase.records.AddRange(ap);
                                        }

                                        List <TestForm027U> form = TestForm027U.BuildForm027UFromDataBaseData(statcase.defaultStep.idStep);
                                        if (!Global.IsEqual(form, null))
                                        {
                                            statcase.records.AddRange(form);
                                        }

                                        if (statcase.records.Count == 0)
                                        {
                                            statcase.records = null;
                                        }
                                    }
                                }
                                return(statcase);
                            }
                        }
                    }
                }
            }
            return(null);
        }