private void OpenDeathProtocol(object sender, EventArgs e) { if (getIsNotValid()) { MessageBox.Show("Введены не все данные на форме!", "Предупреждение!", MessageBoxButtons.OK); return; } string templatePath = Directory.GetCurrentDirectory() + "\\Templates\\death_template.doc"; Dictionary <string, string> values = new Dictionary <string, string>(); values.Add(@"{date}", deathDateTxt.Value.ToString("MM.dd.yyyy")); values.Add(@"{time}", deathTimeCtrl.Text); DdvDoctor doc = (DdvDoctor)doctorsBox.SelectedItem; values.Add(@"{doctor.who.short}", doc != null ? doc.ShortName: ""); values.Add( "{patient.passport_info}", string.Format(CultureInfo.CurrentCulture, "{0} {1}, выдан {2} {3}", patient.PassportSerial, patient.PassportNum, patient.PassportDate.ToShortDateString(), patient.PassportIssuePlace) ); values.Add(@"{doctor.appointment_name}", ""); values.Add(@"{patient.full_name}", patient.FullName); values.Add(@"{patient.birthdate}", patient.Birthdate != null ? patient.Birthdate.ToShortDateString(): ""); values.Add(@"{patient.sex}", patient.Sex ? "мужской" : "женский"); values.Add(@"{patient.medcode}", patient.MedCode); values.Add(@"{doctor.who}", doc != null ? doc.FullName: ""); TemplatesUtils.FillTemplateAndShow(templatePath, values, TemplatesUtils.getTempFileName("Констатация смерти", patient.FullName)); }
private void OpenReanimationProtocol(object sender, EventArgs e) { if (getIsNotValid()) { MessageBox.Show("Введены не все данные на форме!", "Предупреждение!", MessageBoxButtons.OK); return; } string templatePath = Directory.GetCurrentDirectory() + "\\Templates\\reanim_operations_template.doc"; Dictionary <string, string> values = new Dictionary <string, string>(); values.Add(@"{death.date}", deathDateTxt.Text); values.Add(@"{death.time}", deathTimeCtrl.Text); DdvDoctor doc = (DdvDoctor)doctorsBox.SelectedItem; values.Add(@"{doctor.who.short}", doc == null ? "" : doc.ShortName); DateTime deathTime = CommonUtils.ConstructDateWIthTime(deathDateTxt.Value, deathTimeCtrl.Value); for (int i = 0; i < 10; i++) { deathTime = deathTime.AddMinutes(-5.0); values.Add(@"{time" + i + "}", deathTime.ToShortTimeString()); } TemplatesUtils.FillTemplateAndShow(templatePath, values, TemplatesUtils.getTempFileName("Реанимационные действия", patient.FullName)); }
private void printBtn_Click(object sender, EventArgs e) { SaveIssuedMedicine(); Dictionary <string, string> values = new Dictionary <string, string>(); DdtIssuedMedicineList medList = service.GetDdtIssuedMedicineListService().GetById(issuedMedId); DdtHospital hospitalSession = service.GetDdtHospitalService().GetById(hospitalitySession.ObjectId); DdvDoctor doc = null; DdvDoctor nurse = null; DdvDoctor director = null; DdvDoctor pharma = null; DdvPatient patient = null; if (medList != null) { doc = service.GetDdvDoctorService().GetById(medList.Doctor); nurse = service.GetDdvDoctorService().GetById(medList.Nurse); director = service.GetDdvDoctorService().GetById(medList.Director); pharma = service.GetDdvDoctorService().GetById(medList.Pharmacologist); patient = service.GetDdvPatientService().GetById(medList.Patient); } values.Add(@"{doctor.who.short}", doc?.ShortName); values.Add(@"{patient.diagnosis}", diagnosisTxt.Text); values.Add(@"{patient.age}", patient != null? DateTime.Now.Year - patient.Birthdate.Year + "": ""); values.Add(@"{admission.date}", hospitalSession.AdmissionDate.ToShortDateString()); values.Add(@"{patient.historycard}", patient?.MedCode); values.Add(@"{patient.fullname}", patient?.FullName); values.Add(@"{kag}", kagBtn.Checked ? shortlyOperationTxt.Text : ""); values.Add(@"{nurse}", nurse?.ShortName); values.Add(@"{doctor.pharma}", pharma?.ShortName); values.Add(@"{doctor.director}", director?.ShortName); values.Add(@"{room}", hospitalitySession.RoomCell); values.Add(@"{cell}", ""); values.Add(@"{diet}", "НКД"); values.Add(@"{date}", DateTime.Now.ToShortDateString()); //todo переписать,когда будет время. Сделать добавление в таблицу строчек автоматом for (int i = 0; i < 19; i++) { string value = ""; if (i < medicineList.Count) { DdtCure cure = service.GetDdtCureService().GetById(medicineList[i].Cure); value = cure.Name; } values.Add(@"{issued_medicine_" + i + "}", value); } string templatePath = Directory.GetCurrentDirectory() + "\\Templates\\issued_medicine_template.doc"; TemplatesUtils.FillTemplateAndShow(templatePath, values, TemplatesUtils.getTempFileName("Назначения", patient.FullName)); }
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); }
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); } }
private void printBtn_Click(object sender, EventArgs e) { if (getIsNotValid()) { MessageBox.Show("Введены не все данные на форме!", "Предупреждение!", MessageBoxButtons.OK); return; } string templatePath = Directory.GetCurrentDirectory() + "\\Templates\\eit_template.doc"; Dictionary <string, string> values = new Dictionary <string, string>(); values.Add(@"{body}", bodyArea.Text); values.Add(@"{doctor.who}", doctorsBox.Text); TemplatesUtils.FillTemplateAndShow(templatePath, values, TemplatesUtils.getTempFileName("Протокол ЭИТ", "")); }