Esempio n. 1
0
        public IssuedMedicine(IDbDataService service, DdtHospital hospitalitySession, string issuedMedId)
        {
            this.service            = service;
            this.hospitalitySession = hospitalitySession;
            this.issuedMedId        = issuedMedId;
            InitializeComponent();

            ControlUtils.InitDoctorsByGroupName(service.GetDdvDoctorService(), clinicalPharmacologistBox, "clinical_pharmacologists");
            ControlUtils.InitDoctorsByGroupName(service.GetDdvDoctorService(), nurseBox, "nurses");
            ControlUtils.InitDoctorsByGroupName(service.GetDdvDoctorService(), cardioReanimBox, "cardioreanimation_department");
            ControlUtils.InitDoctorsByGroupNameAndOrder(service.GetDdvDoctorService(), directorBox, "cardioreanimation_department", "default.cardioreanimation_department_head");

            InitIssuedCure();

            DdvPatient patient = service.GetDdvPatientService().GetById(hospitalitySession.Patient);

            if (patient != null)
            {
                Text += " " + patient.ShortName;
                if (patient.Sd && (diagnosisTxt.Text == null || !diagnosisTxt.Text.Contains("СД")))
                {
                    diagnosisTxt.Text += "СД ";
                }
            }
        }
Esempio n. 2
0
        public static void fillBlankTemplate(IDbDataService service, string templateFileName, string hospitalSessionId, Dictionary <string, string> values)
        {
            DdtHospital hospitalSession = service.GetDdtHospitalService().GetById(hospitalSessionId);
            DdvPatient  patient         = null;

            if (hospitalSession != null)
            {
                DdvDoctor doc = service.GetDdvDoctorService().GetById(hospitalSession.CuringDoctor);
                patient = service.GetDdvPatientService().GetById(hospitalSession.Patient);

                values.Add(@"{doctor.who.short}", doc.ShortName);
                values.Add(@"{patient.initials}", patient.ShortName);
                values.Add(@"{patient.birthdate}", patient.Birthdate.ToShortDateString());
                values.Add(@"{patient.diagnosis}", hospitalSession.Diagnosis);
                values.Add(@"{patient.age}", DateTime.Now.Year - patient.Birthdate.Year + "");
                values.Add(@"{admission.date}", hospitalSession.AdmissionDate.ToShortDateString());
                values.Add(@"{patient.historycard}", patient.MedCode);
                values.Add(@"{doctor.who}", doc.FullName);
                values.Add(@"{patient.fullname}", patient.FullName);
                values.Add(@"{date}", DateTime.Now.ToShortDateString());

                IList <DdvDoctor> allGroupsDoc = service.GetDdvDoctorService().GetByGroupName("cardioreanimation_department_head");
                doc = allGroupsDoc.Count > 0 ? allGroupsDoc[0] : null;
                values.Add(@"{doctor.io.department}", doc?.ShortName);

                allGroupsDoc.Clear();
                allGroupsDoc = service.GetDdvDoctorService().GetByGroupName("therapy_deputy_head");
                doc          = allGroupsDoc.Count > 0 ? allGroupsDoc[0] : null;
                values.Add(@"{doctor.io.hospital}", doc?.ShortName);
            }
            string resultName = getTempFileName("Бланк", patient?.FullName);

            TemplatesUtils.FillTemplateAndShow(Directory.GetCurrentDirectory() + "\\Templates\\" + templateFileName, values, resultName);
        }
Esempio n. 3
0
 public AmbulanceLetters(IDbDataService service, DdtHospital hospitalitySession)
 {
     this.service            = service;
     this.hospitalitySession = hospitalitySession;
     InitializeComponent();
     ControlUtils.InitDoctorsByGroupNameAndOrder(service.GetDdvDoctorService(), doctorsBox, "cardioreanimation_department", "default.cardioreanimation_department_head");
 }
        private void PutBloodData(Dictionary <string, string> values, IDbDataService service, string objId)
        {
            IList <DdtBloodAnalysis> bloods   = service.GetDdtBloodAnalysisService().GetByParentId(objId);
            StringBuilder            bloodStr = new StringBuilder();

            foreach (DdtBloodAnalysis blood in bloods)
            {
                bloodStr.Append(" от ").Append(blood.AnalysisDate.ToShortDateString()).Append(": ");

                bloodStr.Append(CompileValue("АЛТ", blood.Alt));
                bloodStr.Append(CompileValue("Креатинин", blood.Creatinine));
                bloodStr.Append(CompileValue("АСТ", blood.Ast));
                bloodStr.Append(CompileValue("Холестерин", blood.Cholesterol));
                bloodStr.Append(CompileValue("Гемоглобин", blood.Hemoglobin));
                bloodStr.Append(CompileValue("Лейкоциты", blood.Leucocytes));
                bloodStr.Append(CompileValue("Амилаза", blood.Amylase));
                bloodStr.Append(CompileValue("Бил. Общ.", blood.Bil));
                bloodStr.Append(CompileValue("Хлор", blood.Chlorine));
                bloodStr.Append(CompileValue("Железо", blood.Iron));
                bloodStr.Append(CompileValue("КФК", blood.Kfk));
                bloodStr.Append(CompileValue("КФК-МВ", blood.KfkMv));
                bloodStr.Append(CompileValue("Тромбоциты", blood.Platelets));
                bloodStr.Append(CompileValue("Калий", blood.Potassium));
                bloodStr.Append(CompileValue("Белок", blood.Protein));
                bloodStr.Append(CompileValue("ЩФ", blood.Schf));
                bloodStr.Append(CompileValue("Натрий", blood.Sodium));
                bloodStr.Append(CompileValue("СРБ", blood.Srp));
                bloodStr.Append(". ");
            }

            values.Add("{on_blood}", bloods.Count > 0 ? "Анализы крови " : "");
            values.Add("{blood}", bloodStr.ToString() + (bloods.Count > 0 ? "\n" : ""));
        }
Esempio n. 5
0
        private string GetMembersInString(IDbDataService service, string consiliumId)
        {
            IList <DdtConsiliumRelation> consiluimRelations = service.GetDdtConsiliumRelationService().GetConsiliumRelationsByConsiliumId(consiliumId);

            Dictionary <int, String>          memberToOrder = new Dictionary <int, String>();
            SortedDictionary <String, String> sortedMembers = new SortedDictionary <String, String>();

            foreach (DdtConsiliumRelation relation in consiluimRelations)
            {
                DdtConsiliumGroupMember groupMember = service.GetDdtConsiliumGroupMemberService().GetById(relation.Member);
                DdtConsiliumGroup       group       = service.GetDdtConsiliumGroupService().GetById(groupMember.Group);
                DdvDoctor doctor = service.GetDdvDoctorService().GetById(groupMember.Doctor);

                if (!sortedMembers.ContainsKey(group.Level + " " + group.Name + " " + doctor.ShortName))
                {
                    sortedMembers.Add(group.Level + " " + group.Name + " " + doctor.ShortName, group.Name + " " + groupMember.Name + " " + doctor.ShortName);
                }
            }

            StringBuilder str = new StringBuilder();

            foreach (KeyValuePair <String, String> kvp in sortedMembers)
            {
                if (str.Length > 0)
                {
                    str.Append('\n');
                }
                str.Append(kvp.Value);
            }

            return(str.ToString());
        }
Esempio n. 6
0
        private void InitDefaultMembers(IDbDataService service, IList <DdtConsiliumGroupMember> defaultGroupMembers)
        {
            for (int i = 0; i < defaultGroupMembers.Count; i++)
            {
                if (doctorsContainer.Controls.Count <= i)
                {
                    doctorsContainer.Controls.Add(CommonUtils.CopyControl(dotorInfoPnl0, doctorsContainer.Controls.Count));
                }

                ComboBox cbApp = (ComboBox)CommonUtils.FindControl(doctorsContainer, "appointmentTxt" + i);
                cbApp.SelectedIndexChanged += new System.EventHandler(this.appointmentTxt0_SelectedIndexChanged);
                ControlUtils.InitConsiliumGroupsComboboxValues(service.GetDdtConsiliumGroupService(), cbApp);

                DdtConsiliumGroup group = service.GetDdtConsiliumGroupService().GetById(defaultGroupMembers[i].Group);
                if (group != null)
                {
                    cbApp.SelectedIndex = cbApp.FindStringExact(group.Name);
                    ComboBox cbDoctor = (ComboBox)CommonUtils.FindControl(doctorsContainer, "doctorWho" + i);
                    ControlUtils.InitDoctorsByConsiliumGroupId(service.GetDdvDoctorService(), cbDoctor, group.ObjectId);
                    cbDoctor.SelectedValue = defaultGroupMembers[i].Doctor;
                }

                //Control c = CommonUtils.FindControl(doctorsContainer, "objectIdLbl" + i);
                //c.Text = defaultMembers[i].ObjectId;
                Button b = (Button)CommonUtils.FindControl(doctorsContainer, "removeBtn" + i);
                b.Visible = true;
                b.Click  += new System.EventHandler(this.removeBtn0_Click);
            }
        }
Esempio n. 7
0
 public AlcoIntoxication(IDbDataService service, DdtHospital hospitalitySession)
 {
     this.service            = service;
     this.hospitalitySession = hospitalitySession;
     InitializeComponent();
     initProtocol();
 }
Esempio n. 8
0
 public void Show(int x, int y, Control parent, string attrName, OnCompleteListener listener)
 {
     this.service  = DbDataService.GetInstance();
     this.attrName = attrName;
     this.listener = listener;
     Show(parent, x, y);
 }
Esempio n. 9
0
        internal static void InitDoctorsByGroupComboboxValues(IDbDataService service, ComboBox cb, string groupName)
        {
            string query = @"SELECT d.r_object_id, d.dss_full_name, d.dss_middle_name, d.dss_first_name, d.r_modify_date, d.dss_short_name, d.r_creation_date, d.dss_last_name FROM ddv_doctor d, dm_group_users gr WHERE gr.dss_group_name='" + groupName + "' AND gr.dsid_doctor_id=d.r_object_id";

            cb.DataSource    = service.GetDdvDoctorService().GetByQuery(query);
            cb.ValueMember   = "ObjectId";
            cb.DisplayMember = "ShortName";
        }
Esempio n. 10
0
 internal static void SetDoctorsComboboxDefaultValue(IDbDataService service, ComboBox cb, string dsidCuringDoctor)
 {
     if (!string.IsNullOrEmpty(dsidCuringDoctor))
     {
         DdvDoctor doctor = service.GetDdvDoctorService().GetById(dsidCuringDoctor);
         cb.SelectedIndex = cb.FindStringExact(doctor.ShortName);
     }
 }
Esempio n. 11
0
 public Shell(IComponentContext container, IDbDataService dbDataservice,
              ILoggingService logger)
 {
     _container   = container;
     _dataService = dbDataservice;
     _logger      = logger;
     _logger.SetName("$safeprojectname$");
 }
 public PreoperativeEpicrisiscs(IDbDataService service, DdtHospital hospitalitySession, string objectId)
 {
     this.hospitalitySession = hospitalitySession;
     this.objectId           = objectId;
     this.service            = service;
     InitializeComponent();
     InitControls();
 }
        public AuthMiddleware(OwinMiddleware next, ILoggingService logger,
                              IDbDataService dbData) : base(next)
        {
            _logger = logger;
            _dbData = dbData;

            _logger.SetName("$safeprojectname$");
        }
Esempio n. 14
0
        public Serology(IDbDataService service, DdtHospital hospitalitySession)
        {
            this.service            = service;
            this.hospitalitySession = hospitalitySession;

            serology = service.GetDdtSerologyService().GetByHospitalSession(hospitalitySession.ObjectId);
            InitializeComponent();
            InitBoxes();
        }
Esempio n. 15
0
        internal static void InitDoctorsComboboxValues(IDbDataService service, ComboBox cb, string whereCnd)
        {
            cb.Items.Clear();
            string            query   = @"SELECT r_object_id, dss_full_name, dss_middle_name, dss_first_name, r_modify_date, dss_short_name, r_creation_date, dss_last_name FROM ddv_doctor " + (string.IsNullOrEmpty(whereCnd) ? "" : (" WHERE " + whereCnd));
            IList <DdvDoctor> doctors = service.GetDdvDoctorService().GetByQuery(query);

            cb.DataSource    = doctors;
            cb.ValueMember   = "ObjectId";
            cb.DisplayMember = "ShortName";
        }
Esempio n. 16
0
        internal static void InitCureComboboxValuesByTypeId(IDbDataService service, ComboBox cb, string cureTypeId)
        {
            cb.SelectedIndex = -1;
            cb.Items.Clear();
            IList <DdtCure> cureList = service.GetDdtCureService().GetListByCureTypeId(cureTypeId);

            cb.Items.AddRange(cureList.ToArray());
            cb.ValueMember   = "ObjectId";
            cb.DisplayMember = "Name";
        }
Esempio n. 17
0
 internal DdtIssuedAction getObject(IDbDataService service)
 {
     if (!string.IsNullOrEmpty(issuedActionTxt.Text))
     {
         DdtIssuedAction result = service.GetDdtIssuedActionService().GetById(objectId) ?? new DdtIssuedAction();
         result.Action = issuedActionTxt.Text;
         return(result);
     }
     return(null);
 }
Esempio n. 18
0
 public XRayControl(string objectId, IAnalysisContainer container, bool additional)
 {
     this.service    = DbDataService.GetInstance();
     this.objectId   = objectId;
     this.isEditable = !additional;
     this.container  = container;
     InitializeComponent();
     initControls();
     hasChanges = false;
     isNew      = string.IsNullOrEmpty(objectId);
 }
Esempio n. 19
0
        public PatientList(IDbDataService service, bool admin)
        {
            this.service = service;
            this.admin   = admin;

            System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
            InitializeComponent();
            this.hospitalPatientsTbl.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;

            adminToolStripMenuItem.Visible = admin;
        }
        private void PutHolterData(Dictionary <string, string> values, IDbDataService service, string objId)
        {
            IList <DdtHolter> lholterobj = service.GetDdtHolterService().GetByParentId(objId);
            StringBuilder     holterBld  = new StringBuilder();

            foreach (DdtHolter obj in lholterobj)
            {
                holterBld.Append(" от ").Append(obj.AnalysisDate.ToShortDateString()).Append(": ").Append(obj.Holter).Append(".");
            }
            values.Add("{on_holter}", lholterobj.Count > 0 ? "Холтер:" : "");
            values.Add("{holter}", holterBld.ToString() + (lholterobj.Count > 0 ? "\n" : ""));
        }
        private void PutEkgData(Dictionary <string, string> values, IDbDataService service, string objId)
        {
            IList <DdtEkg> ekg    = service.GetDdtEkgService().GetByParentId(objId);
            StringBuilder  ekgBld = new StringBuilder();

            foreach (DdtEkg ekk in ekg)
            {
                ekgBld.Append(" от ").Append(ekk.AnalysisDate.ToShortDateString()).Append(": ").Append(ekk.Ekg).Append(".");
            }
            values.Add("{on_ekg}", ekg.Count > 0 ? "ЭКГ:" : "");
            values.Add("{ekg}", ekgBld.ToString() + (ekg.Count > 0 ? "\n" : ""));
        }
Esempio n. 22
0
        internal static void InitCureTypeComboboxValues(IDbDataService service, ComboBox cb)
        {
            cb.Items.Clear();
            IList <DdtCureType> cureList = service.GetDdtCureTypeService().GetAll();

            foreach (DdtCureType obj in cureList)
            {
                cb.Items.Add(obj);
            }
            cb.ValueMember   = "ObjectId";
            cb.DisplayMember = "Name";
        }
Esempio n. 23
0
 public PatientAdmission(IDbDataService service, DdtHospital hospital)
 {
     this.service  = service;
     this.hospital = hospital;
     InitializeComponent();
     System.Drawing.Size halfScreenSize = new System.Drawing.Size(SystemInformation.PrimaryMonitorSize.Width / 2,
                                                                  SystemInformation.PrimaryMonitorSize.Height);
     this.patientBaseInfoBox.MaximumSize = halfScreenSize;
     this.lordOfTheCotBox.MaximumSize    = halfScreenSize;
     InitDutyDoctors();
     InitControls();
 }
 internal void PutAnalysisData(Dictionary <string, string> values, IDbDataService service, string parentId)
 {
     PutBloodData(values, service, parentId);
     PutEkgData(values, service, parentId);
     PutSpecialistData(values, service, parentId);
     PutKagData(values, service, parentId);
     PutHolterData(values, service, parentId);
     PutUziData(values, service, parentId);
     PutCoagulogrammData(values, service, parentId);
     PutEgdsData(values, service, parentId);
     PutUrineData(values, service, parentId);
     PutXRayData(values, service, parentId);
 }
Esempio n. 25
0
        public PatientsHistory(IDbDataService service, DdtHospital hospitalitySession)
        {
            this.service            = service;
            this.hospitalitySession = hospitalitySession;
            InitializeComponent();
            this.patientHistoryGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
            DdvPatient patient = service.GetDdvPatientService().GetById(hospitalitySession.Patient);

            if (patient != null)
            {
                Text += " " + patient.ShortName;
            }
        }
Esempio n. 26
0
        public Inspection(IDbDataService service, DdtHospital hospitalitySession, string id)
        {
            this.service            = service;
            this.hospitalitySession = hospitalitySession;
            SilentSaver.setForm(this);
            InitializeComponent();
            initControls(id);
            List <string> validTypes = new List <string>()
            {
                "ddt_blood_analysis", "ddt_ekg", "ddt_urine_analysis", "ddt_egds", "ddt_xray", "ddt_holter", "ddt_specialist_conclusion", "ddt_uzi"
            };

            analysisTabControl1.init(hospitalitySession, inspectionObj?.ObjectId, DdtInspection.NAME, validTypes);
        }
        private void PutEgdsData(Dictionary <string, string> values, IDbDataService service, string objId)
        {
            IList <DdtEgds> egdss   = service.GetDdtEgdsService().GetByParentId(objId);
            StringBuilder   egdsBld = new StringBuilder();

            foreach (DdtEgds egds in egdss)
            {
                egdsBld.Append(" от ").Append(egds.AnalysisDate.ToShortDateString()).Append(": ");
                egdsBld.Append(CompileValue("", egds.Egds));
                egdsBld.Append(". ");
            }
            values.Add("{on_egds}", egdss.Count > 0 ? "На ЭГДС:" : "");
            values.Add("{egds}", egdsBld.ToString() + (egdss.Count > 0 ? "\n" : ""));
        }
Esempio n. 28
0
        private void initCardioConslusions(IDbDataService service)
        {
            IList <DdtJournal> cardioConclusions = service.GetDdtJournalService().GetByJournalDayId(journalDayId);

            for (int i = 0; i < cardioConclusions.Count; i++)
            {
                if (dutyCardioContainer.Controls.Count <= i)
                {
                    JournalKAGControl control = new JournalKAGControl(this, cardioConclusions[i].ObjectId, false);
                    //control.Anchor = AnchorStyles.Right;
                    dutyCardioContainer.Controls.Add(control);
                }
            }
        }
Esempio n. 29
0
        public Consilium(IDbDataService service, DdtHospital hospitalitySession, string consiliumId)
        {
            this.service            = service;
            this.hospitalitySession = hospitalitySession;
            this.consiliumId        = consiliumId;
            InitializeComponent();
            InitControls();
            List <string> validTypes = new List <string>()
            {
                "ddt_blood_analysis", "ddt_kag", "ddt_ekg", "ddt_urine_analysis", "ddt_egds", "ddt_xray", "ddt_holter", "ddt_specialist_conclusion", "ddt_uzi"
            };

            analysisTabControl1.init(hospitalitySession, consiliumId, DdtConsilium.NAME, validTypes);
            SilentSaver.setForm(this);
        }
Esempio n. 30
0
        internal static DdtJournal ResolveKagJournal(IDbDataService service, DateTime incpectionDate, string sessionId)
        {
            string startDateQuery = @"SELECT dsdt_inspection_date FROM " + DdtInspection.NAME + " WHERE dsid_hospitality_session='" + sessionId + "'" +
                                    " AND dsdt_inspection_date<to_timestamp('" + incpectionDate.ToShortDateString() + " " + incpectionDate.ToLongTimeString() + "', 'DD.MM.YYYY HH24:MI:SS') ORDER BY dsdt_inspection_date DESC";
            DateTime startDate = service.GetTime(startDateQuery);

            return(service.GetDdtJournalService().GetObject(@"SELECT jrn.r_object_id, jrn.dss_diagnosis, jrn.dss_chss, jrn.dss_chdd, jrn.r_creation_date, 
                jrn.dss_complaints, jrn.dss_surgeon_exam, jrn.dss_ekg, jrn.dsdt_admission_date, jrn.dss_monitor, jrn.dss_rhythm, jrn.dsid_journal_day, 
                jrn.dss_ps, jrn.dss_ad, jrn.r_modify_date, jrn.dss_cardio_exam, jrn.dsi_journal_type, jrn.dsb_good_rhythm, jrn.dsb_release_journal, 
                jrn.dss_journal, jrn.dsid_doctor, jrn.dsb_freeze, jrn.dsd_weight FROM ddt_journal jrn, ddt_journal_day jd " +
                                                            " WHERE jd.r_object_id=jrn.dsid_journal_day AND jd.dsid_hospitality_session='" + sessionId + "'" +
                                                            " AND jd.dsi_journal_type=" + (int)DdtJournalDsiType.AfterKag +
                                                            (startDate != default(DateTime) ? (" AND jrn.dsdt_admission_date>=to_timestamp('" + startDate.ToShortDateString() + " " + startDate.ToLongTimeString() + "', 'dd.mm.yyyy HH24:mi:ss')") : "") +
                                                            " AND jrn.dsdt_admission_date<=to_timestamp('" + incpectionDate.ToShortDateString() + " " + incpectionDate.ToLongTimeString() + "', 'dd.mm.yyyy HH24:mi:ss')"));
        }