Exemplo n.º 1
0
        public bool CheckDocumentInCase(MedRecord i, string idLpu)
        {
            TestMedRecord doc = null;

            Service serv = i as Service;

            if (serv != null)
            {
                doc = new TestService(serv);
            }

            TfomsInfo tfi = i as TfomsInfo;

            if (tfi != null)
            {
                doc = new TestTfomsInfo(tfi);
            }

            DeathInfo di = i as DeathInfo;

            if (di != null)
            {
                doc = new TestDeathInfo(di);
            }

            Diagnosis diag = i as Diagnosis;

            if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType != TestDiagnosis.IdClinicMainDiagnosis))
            {
                doc = new TestDiagnosis(diag, idLpu);
            }

            ClinicMainDiagnosis cmd = i as ClinicMainDiagnosis;

            if ((cmd != null) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
            {
                doc = new TestClinicMainDiagnosis(cmd, idLpu);
            }

            AnatomopathologicalClinicMainDiagnosis acmd = i as AnatomopathologicalClinicMainDiagnosis;

            if ((acmd != null) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
            {
                doc = new TestClinicMainDiagnosis(acmd, idLpu);
            }

            Referral r = i as Referral;

            if (r != null)
            {
                doc = new TestReferral(r, idLpu);
            }

            SickList sl = i as SickList;

            if (sl != null)
            {
                doc = new TestSickList(sl, idLpu);
            }

            DischargeSummary ds = i as DischargeSummary;

            if (ds != null)
            {
                doc = new TestDischargeSummary(ds, idLpu);
            }

            LaboratoryReport lr = i as LaboratoryReport;

            if (lr != null)
            {
                doc = new TestLaboratoryReport(lr, idLpu);
            }

            ConsultNote cn = i as ConsultNote;

            if (cn != null)
            {
                doc = new TestConsultNote(cn, idLpu);
            }

            DispensaryOne d1 = i as DispensaryOne;

            if ((d1 != null) && (caseBase.idCaseType == dispensaryId))
            {
                doc = new TestDispensaryOne(d1, idLpu);
            }

            AppointedMedication ap = i as AppointedMedication;

            if (ap != null)
            {
                doc = new TestAppointedMedication(ap, idLpu);
            }

            Form027U form = i as Form027U;

            if (form != null)
            {
                doc = new TestForm027U(form, idLpu);
            }

            if (Global.IsEqual(doc, null))
            {
                Global.errors1.Add("Документ не найден");
                return(true);
            }

            foreach (TestMedRecord document in this.medRecords)
            {
                if (Global.IsEqual(doc, document))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        public TestStatCase(string guid, CaseStat cs)
        {
            GUID = guid.ToLower();
            if (cs != null)
            {
                caseStat = cs;
                caseBase = new TestCaseBase(guid, cs);
                if (cs.Steps != null)
                {
                    statSteps = new List <TestStatStep>();
                    foreach (StepStat i in cs.Steps)
                    {
                        statSteps.Add(new TestStatStep(i, cs.IdLpu));
                    }
                }
                if (cs.MedRecords != null)
                {
                    records = new List <TestMedRecord>();
                    foreach (object i in cs.MedRecords)
                    {
                        Service ser = i as Service;
                        if (ser != null)
                        {
                            records.Add(new TestService(ser, cs.IdLpu));
                        }

                        TfomsInfo tfi = i as TfomsInfo;
                        if (tfi != null)
                        {
                            records.Add(new TestTfomsInfo(tfi));
                        }

                        DeathInfo di = i as DeathInfo;
                        if (di != null)
                        {
                            records.Add(new TestDeathInfo(di));
                        }

                        ClinicMainDiagnosis cmd = i as ClinicMainDiagnosis;
                        if ((cmd != null) && (cs.HospResult != IdDeath) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                        {
                            records.Add(new TestClinicMainDiagnosis(cmd, cs.IdLpu));
                        }

                        AnatomopathologicalClinicMainDiagnosis acmd = i as AnatomopathologicalClinicMainDiagnosis;
                        if ((acmd != null) && (cs.HospResult == IdDeath) && (cmd.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                        {
                            records.Add(new TestClinicMainDiagnosis(acmd, cs.IdLpu));
                        }
                        if ((cmd == null) && (acmd == null))
                        {
                            Diagnosis diag = i as Diagnosis;
                            if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType != TestDiagnosis.IdClinicMainDiagnosis))
                            {
                                records.Add(new TestDiagnosis(diag, cs.IdLpu));
                            }
                            if ((diag != null) && (diag.DiagnosisInfo.IdDiagnosisType == TestDiagnosis.IdClinicMainDiagnosis))
                            {
                                records.Add(new TestClinicMainDiagnosis(diag, cs.IdLpu));
                            }
                        }

                        Referral r = i as Referral;
                        if (r != null)
                        {
                            records.Add(new TestReferral(r, cs.IdLpu));
                        }

                        SickList sl = i as SickList;
                        if (sl != null)
                        {
                            records.Add(new TestSickList(sl, cs.IdLpu));
                        }

                        DischargeSummary ds = i as DischargeSummary;
                        if (ds != null)
                        {
                            records.Add(new TestDischargeSummary(ds, cs.IdLpu));
                        }

                        LaboratoryReport lr = i as LaboratoryReport;
                        if (lr != null)
                        {
                            records.Add(new TestLaboratoryReport(lr, cs.IdLpu));
                        }

                        ConsultNote cn = i as ConsultNote;
                        if (cn != null)
                        {
                            records.Add(new TestConsultNote(cn, cs.IdLpu));
                        }

                        AppointedMedication ap = i as AppointedMedication;
                        if (ap != null)
                        {
                            records.Add(new TestAppointedMedication(ap, cs.IdLpu));
                        }

                        Form027U form = i as Form027U;
                        if (form != null)
                        {
                            records.Add(new TestForm027U(form, cs.IdLpu));
                        }
                    }
                }
                if ((cs.IdLpu != null) && (cs.IdPatientMis != null))
                {
                    List <TestStepBase> st = TestStepBase.BuildTestStepsFromDataBase(TestCaseBase.GetCaseId(guid, cs.IdLpu, cs.IdCaseMis, TestPerson.GetPersonId(guid, cs.IdLpu, cs.IdPatientMis)), cs.IdLpu);
                    if (st != null)
                    {
                        foreach (TestStepBase i in st)
                        {
                            if (Global.IsEqual(i.doctor, null))
                            {
                                defaultStep = i;
                            }
                        }
                    }
                }
            }
        }