Ejemplo n.º 1
0
 static public TestClinicMainDiagnosis BuildTestClinicMainDiagnosisFromDataBaseDate(string idStep)
 {
     using (SqlConnection connection = Global.GetSqlConnection())
     {
         string     findTD    = "SELECT TOP(1) * FROM Diagnosis WHERE IdDiagnosis = (SELECT MAX(IdDiagnosis) FROM Diagnosis WHERE IdStep = '" + idStep + "' AND IdDiagnosisType = '" + TestDiagnosis.IdClinicMainDiagnosis + "' AND IdParentDiagnosis is NULL)";
         SqlCommand TDcommand = new SqlCommand(findTD, connection);
         using (SqlDataReader TDReader = TDcommand.ExecuteReader())
         {
             while (TDReader.Read())
             {
                 if (TDReader["IdParentDiagnosis"].ToString() == "")
                 {
                     ClinicMainDiagnosis     d  = new ClinicMainDiagnosis();
                     TestClinicMainDiagnosis td = new TestClinicMainDiagnosis(d);
                     td._diagnosis  = TestDiagnosis.BuildDiagnosisFromDataBaseDate(idStep, TDReader["IdDiagnosis"].ToString());
                     td.diagnosInfo = TestDiagnosisInfo.BuildDiagnosisFromDataBaseDate(TDReader["IdDiagnosis"].ToString());
                     if (TDReader["IdDiagnosedDoctor"].ToString() != "")
                     {
                         td.doctor = TestDoctor.BuildTestDoctorFromDataBase(TDReader["IdDiagnosedDoctor"].ToString());
                     }
                     return(td);
                 }
             }
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
 public TestDiagnosis(Diagnosis d, string idLpu = "")
 {
     if (d != null)
     {
         document = d;
         info     = new TestDiagnosisInfo(d.DiagnosisInfo);
         doctor   = new TestDoctor(d.Doctor, idLpu);
     }
 }
Ejemplo n.º 3
0
 public TestDiagnosis(Diagnosis d, string idLpu = "")
 {
     if (d != null)
     {
         document = d;
         info = new TestDiagnosisInfo(d.DiagnosisInfo);
         doctor = new TestDoctor(d.Doctor, idLpu);
     }
 }
Ejemplo n.º 4
0
 public TestClinicMainDiagnosis(Diagnosis d, string idLpu = "")
 {
     if (d != null)
     {
         if (d.DiagnosisInfo != null)
             diagnosInfo = new TestDiagnosisInfo(d.DiagnosisInfo);
         if (d.Doctor != null)
             doctor = new TestDoctor(d.Doctor, idLpu);
     }
 }
Ejemplo n.º 5
0
 public TestClinicMainDiagnosis(Diagnosis d, string idLpu = "")
 {
     if (d != null)
     {
         if (d.DiagnosisInfo != null)
         {
             diagnosInfo = new TestDiagnosisInfo(d.DiagnosisInfo);
         }
         if (d.Doctor != null)
         {
             doctor = new TestDoctor(d.Doctor, idLpu);
         }
     }
 }
Ejemplo n.º 6
0
 public TestClinicMainDiagnosis(ClinicMainDiagnosis d, string idLpu = "")
 {
     if (d != null)
     {
         if (d.DiagnosisInfo != null)
             diagnosInfo = new TestDiagnosisInfo(d.DiagnosisInfo);
         if (d.Complications != null)
         {
             _diagnosis = new List<TestDiagnosis>();
             foreach (Diagnosis i in d.Complications)
                 _diagnosis.Add(new TestDiagnosis(i, idLpu));
         }
         if (d.Doctor != null)
             doctor = new TestDoctor(d.Doctor, idLpu);
     }
 }
Ejemplo n.º 7
0
 private void FindMismatch(TestDiagnosisInfo td)
 {
     if (this.info.Comment != td.info.Comment)
     {
         Global.errors3.Add("Несовпадение Comment TestDiagnosisInfo");
     }
     if (this.info.DiagnosedDate != td.info.DiagnosedDate)
     {
         Global.errors3.Add("Несовпадение DiagnosedDate TestDiagnosisInfo");
     }
     if (this.info.DiagnosisChangeReason != td.info.DiagnosisChangeReason)
     {
         Global.errors3.Add("Несовпадение DiagnosisChangeReason DiagnosisChangeReason");
     }
     if (this.info.DiagnosisStage != td.info.DiagnosisStage)
     {
         Global.errors3.Add("Несовпадение DiagnosisStage TestDiagnosisInfo");
     }
     if (this.info.IdDiagnosisType != td.info.IdDiagnosisType)
     {
         Global.errors3.Add("Несовпадение IdDiagnosisType TestDiagnosisInfo");
     }
     if (this.info.IdDiseaseType != td.info.IdDiseaseType)
     {
         Global.errors3.Add("Несовпадение IdDiseaseType TestDiagnosisInfo");
     }
     if (this.info.IdDispensaryState != td.info.IdDispensaryState)
     {
         Global.errors3.Add("Несовпадение IdDispensaryState TestDiagnosisInfo");
     }
     if (this.info.IdTraumaType != td.info.IdTraumaType)
     {
         Global.errors3.Add("Несовпадение IdTraumaType TestDiagnosisInfo");
     }
     if (this.info.MedicalStandard != td.info.MedicalStandard)
     {
         Global.errors3.Add("Несовпадение MedicalStandard TestDiagnosisInfo");
     }
     if (this.info.MESImplementationFeature != td.info.MESImplementationFeature)
     {
         Global.errors3.Add("Несовпадение MESImplementationFeature TestDiagnosisInfo");
     }
     if (this.info.MkbCode != td.info.MkbCode)
     {
         Global.errors3.Add("Несовпадение MkbCode TestDiagnosisInfo");
     }
 }
Ejemplo n.º 8
0
        static public List <TestDiagnosis> BuildDiagnosisFromDataBaseDate(string IdStep, string IdParentDiagnosis = "")
        {
            List <TestDiagnosis> tdList = new List <TestDiagnosis>();

            if (IdStep != "")
            {
                using (SqlConnection connection = Global.GetSqlConnection())
                {
                    string findTD = "";
                    if (IdParentDiagnosis == "")
                    {
                        findTD = "SELECT * FROM Diagnosis WHERE IdStep = '" + IdStep + "' AND IdDiagnosisType <> '" + IdClinicMainDiagnosis + "' AND IdParentDiagnosis IS NULL";
                    }
                    else
                    {
                        findTD = "SELECT * FROM Diagnosis WHERE IdStep = '" + IdStep + "' AND IdDiagnosisType <> '" + IdClinicMainDiagnosis + "' AND IdParentDiagnosis = '" + IdParentDiagnosis + "'";
                    }
                    SqlCommand TDcommand = new SqlCommand(findTD, connection);
                    using (SqlDataReader TDReader = TDcommand.ExecuteReader())
                    {
                        while (TDReader.Read())
                        {
                            Diagnosis     d  = new Diagnosis();
                            TestDiagnosis td = new TestDiagnosis(d);
                            td.info = TestDiagnosisInfo.BuildDiagnosisFromDataBaseDate(TDReader["IdDiagnosis"].ToString());
                            if (TDReader["IdDiagnosedDoctor"].ToString() != "")
                            {
                                td.doctor = TestDoctor.BuildTestDoctorFromDataBase(TDReader["IdDiagnosedDoctor"].ToString());
                            }
                            tdList.Add(td);
                        }
                    }
                }
            }
            if (tdList.Count != 0)
            {
                return(tdList);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 9
0
 public TestClinicMainDiagnosis(ClinicMainDiagnosis d, string idLpu = "")
 {
     if (d != null)
     {
         if (d.DiagnosisInfo != null)
         {
             diagnosInfo = new TestDiagnosisInfo(d.DiagnosisInfo);
         }
         if (d.Complications != null)
         {
             _diagnosis = new List <TestDiagnosis>();
             foreach (Diagnosis i in d.Complications)
             {
                 _diagnosis.Add(new TestDiagnosis(i, idLpu));
             }
         }
         if (d.Doctor != null)
         {
             doctor = new TestDoctor(d.Doctor, idLpu);
         }
     }
 }
Ejemplo n.º 10
0
        public override bool Equals(Object obj)
        {
            TestDiagnosisInfo p = obj as TestDiagnosisInfo;

            if ((object)p == null)
            {
                return(false);
            }
            if (this.info == p.info)
            {
                return(true);
            }
            if ((this.info == null) || (p.info == null))
            {
                return(false);
            }
            if ((this.info.Comment == p.info.Comment) &&
                (this.info.DiagnosedDate == p.info.DiagnosedDate) &&
                (this.info.DiagnosisChangeReason == p.info.DiagnosisChangeReason) &&
                (this.info.DiagnosisStage == p.info.DiagnosisStage) &&
                (this.info.IdDiagnosisType == p.info.IdDiagnosisType) &&
                (this.info.IdDiseaseType == p.info.IdDiseaseType) &&
                (this.info.IdDispensaryState == p.info.IdDispensaryState) &&
                (this.info.IdTraumaType == p.info.IdTraumaType) &&
                (this.info.MedicalStandard == p.info.MedicalStandard) &&
                (this.info.MESImplementationFeature == p.info.MESImplementationFeature) &&
                (this.info.MkbCode == p.info.MkbCode))
            {
                return(true);
            }
            else
            {
                this.FindMismatch(p);
                Global.errors3.Add("несовпадение TestDiagnosisInfo");
                return(false);
            }
        }
Ejemplo n.º 11
0
 private void FindMismatch(TestDiagnosisInfo td)
 {
     if (this.info.Comment != td.info.Comment)
         Global.errors3.Add("Несовпадение Comment TestDiagnosisInfo");
     if (this.info.DiagnosedDate != td.info.DiagnosedDate)
         Global.errors3.Add("Несовпадение DiagnosedDate TestDiagnosisInfo");
     if (this.info.DiagnosisChangeReason != td.info.DiagnosisChangeReason)
         Global.errors3.Add("Несовпадение DiagnosisChangeReason DiagnosisChangeReason");
     if (this.info.DiagnosisStage != td.info.DiagnosisStage)
         Global.errors3.Add("Несовпадение DiagnosisStage TestDiagnosisInfo");
     if (this.info.IdDiagnosisType != td.info.IdDiagnosisType)
         Global.errors3.Add("Несовпадение IdDiagnosisType TestDiagnosisInfo");
     if (this.info.IdDiseaseType != td.info.IdDiseaseType)
         Global.errors3.Add("Несовпадение IdDiseaseType TestDiagnosisInfo");
     if (this.info.IdDispensaryState != td.info.IdDispensaryState)
         Global.errors3.Add("Несовпадение IdDispensaryState TestDiagnosisInfo");
     if (this.info.IdTraumaType != td.info.IdTraumaType)
         Global.errors3.Add("Несовпадение IdTraumaType TestDiagnosisInfo");
     if (this.info.MedicalStandard != td.info.MedicalStandard)
         Global.errors3.Add("Несовпадение MedicalStandard TestDiagnosisInfo");
     if (this.info.MESImplementationFeature != td.info.MESImplementationFeature)
         Global.errors3.Add("Несовпадение MESImplementationFeature TestDiagnosisInfo");
     if (this.info.MkbCode != td.info.MkbCode)
         Global.errors3.Add("Несовпадение MkbCode TestDiagnosisInfo");
 }