示例#1
0
        public PgDataService(IDbConnectionFactory connectionFactory)
        {
            this.connectionFactory = connectionFactory;

            ddtReleasePatientService     = new PgDdtReleasePatientService(connectionFactory);
            ddtIssuedMedicineListService = new PgDdtIssuedMedicineListService(connectionFactory);
            ddtIssuedActionService       = new PgDdtIssuedActionService(connectionFactory);
            ddtValuesService             = new PgDdtValuesService(connectionFactory);
            ddtInspectionService         = new PgDdtInspectionService(connectionFactory);
            ddtOncologicMarkersService   = new PgDdtOncologicMarkersService(connectionFactory);
            ddvPatientService            = new PgDdvPatientService(connectionFactory);
            ddtHormonesService           = new PgDdtHormonesService(connectionFactory);
            ddtHolterService             = new PgDdtHolterService(connectionFactory);
            ddtJournalService            = new PgDdtJournalService(connectionFactory);
            ddtJournalDayService         = new PgDdtJournalDayService(connectionFactory);
            ddtCureService                   = new PgDdtCureService(connectionFactory);
            ddtConsiliumService              = new PgDdtConsiliumService(connectionFactory);
            ddtPatientService                = new PgDdtPatientService(connectionFactory);
            ddtBloodAnalysisService          = new PgDdtBloodAnalysisService(connectionFactory);
            ddtXrayService                   = new PgDdtXrayService(connectionFactory);
            ddtEkgService                    = new PgDdtEkgService(connectionFactory);
            ddtSerologyService               = new PgDdtSerologyService(connectionFactory);
            ddtEpicrisisService              = new PgDdtEpicrisisService(connectionFactory);
            dssDdtDoctorService              = new PgDdtDoctorService(connectionFactory);
            ddtConsiliumGroupMemberService   = new PgDdtConsiliumGroupMemberService(connectionFactory);
            ddtAnamnesisService              = new PgDdtAnamnesisService(connectionFactory);
            ddvDoctorService                 = new PgDdvDoctorService(connectionFactory);
            ddtEgdsService                   = new PgDdtEgdsService(connectionFactory);
            ddtSpecialistConclusionService   = new PgDdtSpecialistConclusionService(connectionFactory);
            ddtHistoryService                = new PgDdtHistoryService(connectionFactory);
            ddvActiveHospitalPatientsService = new PgDdvActiveHospitalPatientsService(connectionFactory);
            ddtUrineAnalysisService          = new PgDdtUrineAnalysisService(connectionFactory);
            ddtKagService                    = new PgDdtKagService(connectionFactory);
            ddtHospitalService               = new PgDdtHospitalService(connectionFactory);
            ddtTransferService               = new PgDdtTransferService(connectionFactory);
            ddtConsiliumGroupService         = new PgDdtConsiliumGroupService(connectionFactory);
            ddtAlcoProtocolService           = new PgDdtAlcoProtocolService(connectionFactory);
            ddvHistoryService                = new PgDdvHistoryService(connectionFactory);
            ddtCureTypeService               = new PgDdtCureTypeService(connectionFactory);
            dmGroupUsersService              = new PgDmGroupUsersService(connectionFactory);
            ddtIssuedMedicineService         = new PgDdtIssuedMedicineService(connectionFactory);
            dmGroupService                   = new PgDmGroupService(connectionFactory);
            ddtCoagulogramService            = new PgDdtCoagulogramService(connectionFactory);
            ddvAllDiagnosisService           = new PgDdvAllDiagnosisService(connectionFactory);
            ddtConsiliumRelationService      = new PgDdtConsiliumRelationService(connectionFactory);
            ddtUziService                    = new PgDdtUziService(connectionFactory);
            ddtVariousSpecConclusonService   = new PgDdtVariousSpecConclusonService(connectionFactory);
            ddtRelationService               = new PgDdtRelationService(connectionFactory);            ddtTansfusionService = new PgDdtTransfusionService(connectionFactory);
        }
示例#2
0
        private void seeDeeper(Control container, string type)
        {
            if (container == null)
            {
                return;
            }
            ControlCollection coll = container.Controls;
            IEnumerator       it   = coll.GetEnumerator();

            while (it.MoveNext())
            {
                Control control = (Control)it.Current;
                if (control == null)
                {
                    break;
                }
                else if (control is IDocbaseControl)
                {
                    ((IDocbaseControl)control).saveObject(hospitalSession, parentId, parentType);
                    string id = ((IDocbaseControl)control).getObjectId();
                    IDdtRelationService relationService = DbDataService.GetInstance().GetDdtRelationService();
                    if (id != null && parentId != null && parentType != null && relationService.GetByParentAndChildIds(parentId, id) == null)
                    {
                        DdtRelation relation = new DdtRelation();
                        relation.Parent    = parentId;
                        relation.Child     = id;
                        relation.ChildType = type;
                        relationService.Save(relation);
                    }
                }
                else
                {
                    seeDeeper(control, type);
                }
            }
        }
示例#3
0
        public bool Save()
        {
            if (!getIsValid())
            {
                return(false);
            }

            service.GetDdtHospitalService().Save(hospitalitySession);

            DdtJournalDay journalDay = null;

            if (!string.IsNullOrEmpty(journalDayId))
            {
                journalDay = service.GetDdtJournalDayService().GetById(journalDayId);
            }
            else
            {
                journalDay                    = new DdtJournalDay();
                journalDay.JournalType        = 1;
                journalDay.HospitalitySession = hospitalitySession.ObjectId;
                journalDay.Patient            = hospitalitySession.Patient;
                journalDay.JournalType        = (int)DdtJournalDsiType.AfterKag;
                //journal.Complaints = "Жалоб на момент осмотра не предъявляет.";
            }
            journalDay.AdmissionDate = CommonUtils.ConstructDateWIthTime(admissionDateTxt.Value, admissionTimeTxt.Value);
            DdvDoctor doc = (DdvDoctor)journalDocBox.SelectedItem;

            journalDay.Doctor    = doc == null ? hospitalitySession.DutyDoctor : doc.ObjectId;
            journalDay.Diagnosis = afterKagDiagnosisTxt.Text;
            journalDayId         = service.GetDdtJournalDayService().Save(journalDay);

            DdtVariousSpecConcluson cardioVascularConc = service.GetDdtVariousSpecConclusonService().GetByParentId(journalDayId);

            if (cardioVascularConc == null)
            {
                cardioVascularConc        = new DdtVariousSpecConcluson();
                cardioVascularConc.Parent = journalDayId;
            }
            cardioVascularConc.AdmissionDate        = CommonUtils.ConstructDateWIthTime(cardioDate.Value, cardioTime.Value);
            cardioVascularConc.SpecialistConclusion = surgeryInspectationTxt.Text;
            cardioVascularConc.AdditionalInfo1      = chddSurgeryTxt.Text;
            cardioVascularConc.AdditionalInfo3      = adSurgeryTxt.Text;
            cardioVascularConc.AdditionalInfo2      = chssSurgeryTxt.Text;
            cardioVascularConc.AdditionalInfo4      = (string)cardioVascularBox.SelectedValue;
            service.GetDdtVariousSpecConclusonService().Save(cardioVascularConc);

            if (!string.IsNullOrEmpty(kagDiagnosisTxt.Text))
            {
                DdtKag kag = service.GetDdtKagService().GetById(kagId);
                if (kag == null)
                {
                    kag                    = new DdtKag();
                    kag.Doctor             = hospitalitySession.CuringDoctor;
                    kag.HospitalitySession = hospitalitySession.ObjectId;
                    kag.Patient            = hospitalitySession.Patient;
                    DateTime admissionDateTime = CommonUtils.ConstructDateWIthTime(admissionDateTxt.Value, admissionTimeTxt.Value);
                    kag.AnalysisDate = admissionDateTime.AddMinutes(-75);
                    kag.StartTime    = admissionDateTime.AddMinutes(-75);
                    kag.EndTime      = admissionDateTime.AddMinutes(-15);
                    kag.KagAction    = kagDiagnosisTxt.Text;
                    kagId            = service.GetDdtKagService().Save(kag);

                    IDdtRelationService relationService = DbDataService.GetInstance().GetDdtRelationService();
                    if (kagId != null && relationService.GetByParentAndChildIds(journalDayId, kagId) == null)
                    {
                        DdtRelation relation = new DdtRelation();
                        relation.Parent    = journalDayId;
                        relation.Child     = kagId;
                        relation.ChildType = DdtJournal.NAME;
                        relationService.Save(relation);
                    }
                }
            }

            for (int i = 0; i < dutyCardioContainer.Controls.Count; i++)
            {
                JournalKAGControl journalCtrl = (JournalKAGControl)dutyCardioContainer.Controls[i];
                journalCtrl.saveObject(hospitalitySession, journalDayId, DdtJournal.NAME);
            }

            analysisTabControl1.save(journalDayId, DdtJournal.NAME);
            return(true);
        }