Exemplo n.º 1
0
        private void print_Click(object sender, EventArgs e)
        {
            saveObject();
            ITemplateProcessor processor = TemplateProcessorManager.getProcessorByObjectType(DdtEpicrisis.NAME);
            string             path      = processor.processTemplate(service, hospitalitySession.ObjectId, objectId, new Dictionary <string, string>());

            TemplatesUtils.ShowDocument(path);
        }
Exemplo n.º 2
0
 private void printBtn_Click(object sender, EventArgs e)
 {
     if (Save())
     {
         ITemplateProcessor processor = TemplateProcessorManager.getProcessorByObjectType(DdtJournal.NAME);
         string             path      = processor.processTemplate(service, hospitalitySession.ObjectId, journalDayId, null);
         TemplatesUtils.ShowDocument(path);
     }
 }
Exemplo n.º 3
0
        private void requestBtnClik(object sender, EventArgs e)
        {
            Save();
            ITemplateProcessor processor = TemplateProcessorManager.getProcessorByObjectType("request_blood");

            if (processor != null)
            {
                string path = processor.processTemplate(service, hospitalSession?.ObjectId, transfusion?.ObjectId, new Dictionary <string, string>());
                TemplatesUtils.ShowDocument(path);
            }
        }
Exemplo n.º 4
0
 private void printBtn_Click(object sender, EventArgs e)
 {
     if (Save())
     {
         ITemplateProcessor processor = TemplateProcessorManager.getProcessorByObjectType(DdtConsilium.NAME);
         if (processor != null)
         {
             string path = processor.processTemplate(service, hospitalitySession.ObjectId, consiliumId, new Dictionary <string, string>());
             TemplatesUtils.ShowDocument(path);
         }
     }
 }
Exemplo n.º 5
0
        private void printBtn_Click(object sender, EventArgs e)
        {
            int           rowCount = patientHistoryGrid.Rows.Count;
            DdvPatient    patient  = service.GetDdvPatientService().GetById(hospitalitySession.Patient);
            List <string> paths    = new List <string>();

            if (printTitlePage.Checked)
            {
                List <string> prePaths = new List <string>();
                Dictionary <string, string> titleDict = new Dictionary <string, string>();
                titleDict.Add("{mednumber}", patient.MedCode);
                titleDict.Add("{admission_date}", hospitalitySession.AdmissionDate.ToShortDateString());
                titleDict.Add("{leaving_date}", DateTime.Now.ToShortDateString());
                titleDict.Add("{med_policy}", patient.Oms);
                titleDict.Add("{room}", hospitalitySession.RoomCell);
                titleDict.Add("{daysinhospital}", (DateTime.Now.Year - hospitalitySession.AdmissionDate.Year) + "");
                DdtSerology serology = service.GetDdtSerologyService().GetByHospitalSession(hospitalitySession.ObjectId);
                titleDict.Add("{blood_n}", serology?.BloodType);
                titleDict.Add("{rhesus}", serology?.RhesusFactor);
                titleDict.Add("{height}", patient.High + "");
                titleDict.Add("{weight}", patient.Weight + "");
                titleDict.Add("{patient_full_name}", patient.FullName);
                titleDict.Add("{sex}", patient.Sex ? "мужской" : "женский");
                titleDict.Add("{passport}", patient.PassportSerial + " " + patient.PassportNum + " " + patient.PassportIssuePlace + " " + patient.PassportDate.ToShortDateString());
                titleDict.Add("{age}", (DateTime.Now.Year - patient.Birthdate.Year) + "");
                titleDict.Add("{birthdate}", patient.Birthdate.ToShortDateString());
                titleDict.Add("{address}", patient.Address);
                DdtAnamnesis firstIspection = service.GetDdtAnamnesisService().GetByHospitalSessionId(hospitalitySession.ObjectId);
                titleDict.Add("{diagnosis_first}", firstIspection?.Diagnosis);
                titleDict.Add("{diagnosis_last}", hospitalitySession.Diagnosis);

                prePaths.Add(TemplatesUtils.FillTemplate(Directory.GetCurrentDirectory() + "\\Templates\\" + "title.docx", titleDict));
                paths.Add(TemplatesUtils.MergeFiles(prePaths.ToArray(), true, null));
            }
            foreach (DataGridViewRow row in patientHistoryGrid.Rows)
            {
                bool checkd = (bool)row.Cells[0].Value;
                if (checkd)
                {
                    ITemplateProcessor te = TemplateProcessorManager.getProcessorByObjectType((string)row.Cells[2].Value);
                    if (te != null)
                    {
                        string pathFile = te.processTemplate(service, hospitalitySession.ObjectId, (string)row.Cells[3].Value, null);
                        paths.Add(pathFile);
                    }
                }
            }
            string resultFileName = TemplatesUtils.getTempFileName("История болезни", patient.FullName);
            string resultPath     = TemplatesUtils.MergeFiles(paths.ToArray(), false, resultFileName);

            TemplatesUtils.ShowDocument(resultPath);
        }
Exemplo n.º 6
0
        private void consentBtnClik(object sender, EventArgs e)
        {
            //if (Save())
            //{
            ITemplateProcessor processor = TemplateProcessorManager.getProcessorByObjectType("transfusion_consent");

            if (processor != null)
            {
                string path = processor.processTemplate(service, hospitalSession?.ObjectId, patient?.ObjectId, new Dictionary <string, string>());
                TemplatesUtils.ShowDocument(path);
            }
            //}
        }
Exemplo n.º 7
0
        private void printBtn_Click(object sender, EventArgs e)
        {
            if (validate())
            {
                Save();

                ITemplateProcessor processor  = TemplateProcessorManager.getProcessorByObjectType(DdtJournal.NAME);
                string             path       = processor.processTemplate(service, hospitalitySession.ObjectId, journalDayId, null);
                DdvPatient         patient    = service.GetDdvPatientService().GetById(hospitalitySession.Patient);
                string             resultName = TemplatesUtils.getTempFileName("Журнал", patient.FullName);
                string             result     = TemplatesUtils.MergeFiles(new string[] { path }, false, resultName);
                TemplatesUtils.ShowDocument(result);
            }
        }
Exemplo n.º 8
0
 private void printBtn_Click(object sender, EventArgs e)
 {
     lock (syncLock)
     {
         if (Save())
         {
             ITemplateProcessor te = TemplateProcessorManager.getProcessorByObjectType(DdtAnamnesis.NAME);
             if (te != null)
             {
                 string path = te.processTemplate(service, hospitalSession.ObjectId, anamnesis.ObjectId, null);
                 TemplatesUtils.ShowDocument(path);
             }
         }
     }
 }
Exemplo n.º 9
0
        private void printBtn_Click(object sender, EventArgs e)
        {
            Save();

            ITemplateProcessor tp = TemplateProcessorManager.getProcessorByObjectType(DdtInspection.NAME);

            if (tp != null)
            {
                Dictionary <string, String> values = new Dictionary <string, string>();

                DdvDoctor doctor = (DdvDoctor)cardioDoctorBox.SelectedItem;
                if (doctor != null)
                {
                    values.Add("{doctor.who.short}", doctor.ShortName);
                }

                string filled = tp.processTemplate(service, hospitalitySession.ObjectId, inspectionObj.ObjectId, values);
                TemplatesUtils.ShowDocument(filled);
            }
        }