private void SetFormText() { DdvPatient patient = service.GetDdvPatientService().GetById(hospitalSession.Patient); if (patient != null) { Text = "Переливание"; Text += " " + patient.ShortName; if (!String.IsNullOrEmpty(patient.BloodGroup)) { Text += " Группа крови " + patient.BloodGroup; } if (!String.IsNullOrEmpty(patient.RHFactor)) { Text += " Рензус-фактор " + patient.RHFactor; } if (!String.IsNullOrEmpty(patient.Kell)) { Text += " Келл " + patient.Kell; } if (!String.IsNullOrEmpty(patient.Phenotype)) { Text += " Фенотип " + patient.Phenotype; } } }
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 += "СД "; } } }
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); }
private void initTitle() { if (DdtBloodAnalysis.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "Клинический анализ крови"; } else if (DdtUrineAnalysis.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "Анализ мочи"; } else if (DdtKag.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "КАГ"; } else if (DdtEkg.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "ЭКГ"; } else if (DdtEgds.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "ЭГДС"; } else if (DdtUzi.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "УЗИ"; } else if (DdtXRay.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "Рентген/КТ"; } else if (DdtHolter.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "Холтер/СМАД"; } else if (DdtSpecialistConclusion.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "Заключение специалистов"; } else if (DdtCoagulogram.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "Коагулограмма"; } else if (DdtHormones.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "Гормоны"; } else if (DdtHormones.NAME.Equals(typeName, StringComparison.Ordinal)) { this.Text = "Онкомаркеры"; } DdtHospital hospital = service.GetDdtHospitalService().GetById(hospitalitySession.ObjectId); DdvPatient patient = service.GetDdvPatientService().GetById(hospital.Patient); if (patient != null) { this.Text += " " + patient.ShortName; } }
public ProtocolsManipulation(DdvPatient patient, int manipulationType) { this.patient = patient; this.manipulationType = manipulationType; InitializeComponent(); initializeDoctorsBox(); initializeBody(); }
public Death(DdtHospital hospitalSession, DdvPatient patient) { this.hospitalSession = hospitalSession; this.patient = patient; InitializeComponent(); IDdvDoctorService service = DbDataService.GetInstance().GetDdvDoctorService(); ControlUtils.InitDoctorsByGroupName(service, doctorsBox, "cardioreanimation_department"); doctorsBox.SelectedValue = hospitalSession.CuringDoctor; }
private void InitControls() { if (hospital == null) { return; } DdvPatient patient = service.GetDdvPatientService().GetById(hospital.Patient); addressTxt.Text = patient.Address; patientLastName.Text = patient.LastName; patientFirstName.Text = patient.FirstName; patientSecondName.Text = patient.MiddleName; medCodeTxt.Text = patient.MedCode; phoneTxt.Text = patient.Phone; snilsTxt.Text = patient.Snils; omsTxt.Text = patient.Oms; passportDataTxt.Value = patient.PassportDate; passportIssuePlaceTxt.Text = patient.PassportIssuePlace; passportNumTxt.Text = patient.PassportNum; passportSerialTxt.Text = patient.PassportSerial; weightTxt.Text = patient.Weight.ToString(CultureInfo.InvariantCulture); highTxt.Text = patient.High.ToString(CultureInfo.InvariantCulture); patientBirthDate.Value = patient.Birthdate; sdBtn.Checked = patient.Sd; maleChb.Checked = patient.Sex; femaleChb.Checked = !patient.Sex; patientReceiptDate.Value = hospital.AdmissionDate; patientReceiptTime.Text = hospital.AdmissionDate.TimeOfDay.ToString(); DdvDoctor docDuty = service.GetDdvDoctorService().GetById(hospital.CuringDoctor); dutyCardioBox.SelectedIndex = dutyCardioBox.FindStringExact(docDuty.ShortName); DdvDoctor docCuring = service.GetDdvDoctorService().GetById(hospital.DutyDoctor); cardioDocBox.SelectedIndex = cardioDocBox.FindStringExact(docCuring.ShortName); DdvDoctor docSubstitution = service.GetDdvDoctorService().GetById(hospital.SubstitutionDoctor); subDoctorBox.SelectedIndex = subDoctorBox.FindStringExact(docSubstitution.ShortName); DdvDoctor directorCardioReanim = service.GetDdvDoctorService().GetById(hospital.DirCardioReanimDoctor); directorCardioReanimBox.SelectedIndex = directorCardioReanimBox.FindStringExact(directorCardioReanim.ShortName); DdvDoctor anesthetistDoctor = service.GetDdvDoctorService().GetById(hospital.AnesthetistDoctor); anesthetistComboBox.SelectedIndex = anesthetistComboBox.FindStringExact(anesthetistDoctor.ShortName); roomTxt.Text = hospital.RoomCell; }
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); }
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; } }
public IList <DdvPatient> GetAll() { IList <DdvPatient> list = new List <DdvPatient>(); using (dynamic connection = connectionFactory.GetConnection()) { String sql = "SELECT dss_address, r_object_id, dss_full_name, dss_middle_name, dss_passport_num, " + "dss_first_name, dsd_weight, dss_snils, r_creation_date, dss_last_name, dss_passport_date, " + "r_modify_date, dss_phone, dss_passport_serial, dss_oms, dss_short_name, dsdt_birthdate, " + "dsb_sd, dss_med_code, dss_passport_issue_place, dsd_high, dsb_sex, " + "dss_blood_group, dss_rh_factor, dss_kell, dss_phenotype FROM ddv_patient"; Logger.Debug(CultureInfo.CurrentCulture, "SQL: {0}", sql); Npgsql.NpgsqlCommand command = new Npgsql.NpgsqlCommand(sql, connection); using (DbDataReader reader = command.ExecuteReader()) { while (reader.Read()) { DdvPatient obj = new DdvPatient(); obj.Address = reader.IsDBNull(0) ? null : reader.GetString(0); obj.ObjectId = reader.IsDBNull(1) ? null : reader.GetString(1); obj.FullName = reader.IsDBNull(2) ? null : reader.GetString(2); obj.MiddleName = reader.IsDBNull(3) ? null : reader.GetString(3); obj.PassportNum = reader.IsDBNull(4) ? null : reader.GetString(4); obj.FirstName = reader.IsDBNull(5) ? null : reader.GetString(5); obj.Weight = reader.IsDBNull(6) ? -1 : reader.GetFloat(6); obj.Snils = reader.IsDBNull(7) ? null : reader.GetString(7); obj.CreationDate = reader.IsDBNull(8) ? DateTime.MinValue : reader.GetDateTime(8); obj.LastName = reader.IsDBNull(9) ? null : reader.GetString(9); obj.PassportDate = reader.IsDBNull(10) ? DateTime.MinValue : reader.GetDateTime(10); obj.ModifyDate = reader.IsDBNull(11) ? DateTime.MinValue : reader.GetDateTime(11); obj.Phone = reader.IsDBNull(12) ? null : reader.GetString(12); obj.PassportSerial = reader.IsDBNull(13) ? null : reader.GetString(13); obj.Oms = reader.IsDBNull(14) ? null : reader.GetString(14); obj.ShortName = reader.IsDBNull(15) ? null : reader.GetString(15); obj.Birthdate = reader.IsDBNull(16) ? DateTime.MinValue : reader.GetDateTime(16); obj.Sd = reader.GetBoolean(17); obj.MedCode = reader.IsDBNull(18) ? null : reader.GetString(18); obj.PassportIssuePlace = reader.IsDBNull(19) ? null : reader.GetString(19); obj.High = reader.IsDBNull(20) ? -1 : reader.GetFloat(20); obj.Sex = reader.GetBoolean(21); obj.BloodGroup = reader.IsDBNull(22) ? null : reader.GetString(22); obj.RHFactor = reader.IsDBNull(23) ? null : reader.GetString(23); obj.Kell = reader.IsDBNull(24) ? null : reader.GetString(24); obj.Phenotype = reader.IsDBNull(25) ? null : reader.GetString(25); list.Add(obj); } } } return(list); }
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 deadConstatationItem_Click(object sender, EventArgs e) { IEnumerator it = hospitalPatientsTbl.SelectedRows.GetEnumerator(); if (it.MoveNext()) { DataGridViewRow row = (DataGridViewRow)it.Current; DataGridViewCell cell = row.Cells[0]; string value = cell.Value.ToString(); DdtHospital hospitalSession = service.GetDdtHospitalService().GetById(value); DdvPatient patient = service.GetDdvPatientService().GetById(hospitalSession.Patient); Death form = new Death(hospitalSession, patient); form.ShowDialog(); } }
private void initJournals() { DdvPatient patient = service.GetDdvPatientService().GetById(hospitalitySession.Patient); if (patient != null) { Text += " " + patient.ShortName; } List <DdtJournal> journals = service.GetDdtJournalService().GetByJournalDayId(journalDayId); foreach (DdtJournal j in journals) { journalContainer.Controls.Add(new JournalNoKAGControl(this, j.ObjectId, j.JournalType, null)); } }
public string processTemplate(IDbDataService service, string hospitalitySession, string objectId, Dictionary <string, string> aditionalValues) { Dictionary <string, string> values = null; if (aditionalValues != null) { values = new Dictionary <string, string>(aditionalValues); } else { values = new Dictionary <string, string>(); } DdtInspection obj = service.GetDdtInspectionService().GetById(objectId); values.Add("{date}", obj.InspectionDate.ToShortDateString()); values.Add("{time}", obj.InspectionDate.ToShortTimeString()); values.Add("{patient.diagnosis}", obj.Diagnosis); values.Add("{complaints}", obj.Complaints); values.Add("{inspection}", obj.Inspection); values.Add("{kateter}", obj.KateterPlacement); values.Add("{result}", obj.InspectionResult); DdvPatient patient = service.GetDdvPatientService().GetById(obj.Patient); values.Add("{patient.initials}", patient == null ? "" : patient.ShortName); values.Add("{patient.age}", patient == null ? "" : (DateTime.Now.Year - patient.Birthdate.Year) + ""); if (!values.ContainsKey("{doctor.who.short}")) { DdvDoctor doc = service.GetDdvDoctorService().GetById(obj.Doctor); values.Add("{doctor.who.short}", doc == null ? "" : doc.ShortName); } IList <DdvDoctor> heads = service.GetDdvDoctorService().GetByGroupName("cardioreanimation_department_head"); if (heads.Count != 0) { DdvDoctor head = heads[0]; values.Add("{doctor.head.short}", head.ShortName); } PutAnalysisData(values, service, obj.ObjectId); string resultFileName = TemplatesUtils.getTempFileName("Ежедневный осмотр", patient.FullName); return(TemplatesUtils.FillTemplate(Directory.GetCurrentDirectory() + "\\Templates\\" + TEMPLATE_FILE_NAME, values, resultFileName)); }
public ReleasePatient(IDbDataService service, DdtHospital hospitalitySession, string epicrisisId) { this.service = service; this.epicrisisId = epicrisisId; this.hospitalitySession = hospitalitySession; releasePatientInfo = new DdtReleasePatient(); releasePatientInfo.HospitalitySession = hospitalitySession.ObjectId; releasePatientInfo.Doctor = hospitalitySession.DutyDoctor; releasePatientInfo.Patient = hospitalitySession.Patient; InitializeComponent(); DdvPatient patient = service.GetDdvPatientService().GetById(hospitalitySession.Patient); if (patient != null) { Text += " " + patient.ShortName; } }
public string processTemplate(IDbDataService service, string hospitalitySession, string objectId, Dictionary <string, string> aditionalValues) { Dictionary <string, string> values = null; if (aditionalValues != null) { values = new Dictionary <string, string>(aditionalValues); } else { values = new Dictionary <string, string>(); } DdtConsilium obj = service.GetDdtConsiliumService().GetById(objectId); values.Add(@"{consilium.date}", DateTime.Now.ToString("dd.MM.yyyy")); values.Add(@"{consilium.time}", DateTime.Now.ToString("HH:mm")); values.Add(@"{consilium.members}", GetMembersInString(service, objectId)); values.Add(@"{admin}", obj?.DutyAdminName); values.Add(@"{doctor.who}", GetDoctorInString(service, obj.Doctor)); values.Add(@"{consilium.goal}", obj.Goal); DdvPatient patient = service.GetDdvPatientService().GetById(obj.Patient); values.Add(@"{patient.initials}", patient.ShortName); values.Add(@"{patient.age}", (DateTime.Now.Year - patient.Birthdate.Year) + ""); values.Add(@"{patient.diagnosis}", obj.Diagnosis); values.Add(@"{consilium.decision}", obj.Decision); values.Add(@"{journal}", obj.Dynamics); PutAnalysisData(values, service, obj.ObjectId); if (values.ContainsKey("{on_ekg}")) { values.Remove("{on_ekg}"); } if (values.ContainsKey("{on_blood}")) { values.Remove("{on_blood}"); } values.Add("{on_ekg}", "ЭКГ в ОКР:"); values.Add("{on_blood}", "В анализах крови: "); return(TemplatesUtils.FillTemplate(Directory.GetCurrentDirectory() + "\\Templates\\" + TemplateFileName, values, TemplatesUtils.getTempFileName("Консилиум", patient.FullName))); }
private void initControls(string inspectionObjId) { ControlUtils.InitDoctorsByGroupName(service.GetDdvDoctorService(), cardioDoctorBox, "cardioreanimation_department"); cardioDoctorBox.SelectedValue = hospitalitySession.CuringDoctor; kagContainer.Visible = false; DdvPatient patient = service.GetDdvPatientService().GetById(hospitalitySession.Patient); if (patient != null) { Text += " " + patient.ShortName; } inspectionObj = service.GetDdtInspectionService().GetById(inspectionObjId); DateTime startDate = inspectionObj == null ? DateTime.Now : inspectionObj.InspectionDate; DdtJournal kagJournal = CommonUtils.ResolveKagJournal(service, startDate, hospitalitySession.ObjectId); if (inspectionObj != null) { complaintsTxt.Text = inspectionObj.Complaints; diagnosisTxt.Text = inspectionObj.Diagnosis; inspectionTxt.Text = inspectionObj.Inspection; resultTxt.Text = inspectionObj.InspectionResult; kateterPlacementTxt.Text = inspectionObj.KateterPlacement; } else { if (kagJournal != null) { diagnosisTxt.Text = kagJournal.Diagnosis; DdtVariousSpecConcluson releaseConclusion = service.GetDdtVariousSpecConclusonService().GetByParentId(kagJournal.ObjectId); if (releaseConclusion != null) { inspectionTxt.Text = releaseConclusion.SpecialistConclusion; } } else { diagnosisTxt.Text = hospitalitySession.Diagnosis; } } initKag(service, kagJournal); }
public string processTemplate(IDbDataService service, string hospitalitySession, string objectId, Dictionary <string, string> aditionalValues) { Dictionary <string, string> values = null; if (aditionalValues != null) { values = new Dictionary <string, string>(aditionalValues); } else { values = new Dictionary <string, string>(); } values.Add(@"{date}", DateTime.Now.ToString("dd.MM.yyyy")); DdvPatient patient = service.GetDdvPatientService().GetById(objectId); values.Add(@"{patient}", patient.FullName); return(TemplatesUtils.FillTemplate(Directory.GetCurrentDirectory() + "\\Templates\\" + TemplateFileName, values)); }
public static void fillAmbulanceLetterTemplate(IDbDataService service, string templateFileName, string hospitalSessionId, Dictionary <string, string> values) { DdtHospital hospitalSession = service.GetDdtHospitalService().GetById(hospitalSessionId); DdvDoctor doc = service.GetDdvDoctorService().GetById(hospitalSession.CuringDoctor); DdvPatient 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()); string resultName = getTempFileName("Письмо для скорой", patient?.FullName); TemplatesUtils.FillTemplateAndShow(Directory.GetCurrentDirectory() + "\\Templates\\" + templateFileName, values, resultName); }
private void InitControls() { if (!string.IsNullOrEmpty(objectId)) { DdvPatient patient = service.GetDdvPatientService().GetById(hospitalitySession.Patient); if (patient != null) { Text += " " + patient.ShortName; } DdtEpicrisis epicrisis = service.GetDdtEpicrisisService().GetById(objectId); if (epicrisis != null) { diagnosisTxt.Text = epicrisis.Diagnosis; epicrisisDateTxt.Value = epicrisis.EpicrisisDate; refreshGrid(); } } else { diagnosisTxt.Text = hospitalitySession.Diagnosis; } }
private void InitPatientInfo() { patient = service.GetDdvPatientService().GetById(hospitalSession.Patient); if (patient != null) { patientInitialsLbl.Text = patient.ShortName; if (anamnesis == null) { if (patient.Sd) { IList <DdtCure> medicineTemplates = service.GetDdtCureService().GetListByTemplate("sd"); foreach (DdtCure cure in medicineTemplates) { DdtIssuedMedicine med = new DdtIssuedMedicine(); med.Cure = cure.ObjectId; AddIssuedMedicine(med, cure); } } } } }
private void initProtocol() { DdvPatient patient = service.GetDdvPatientService().GetById(hospitalitySession.Patient); if (patient != null) { Text += " " + patient.ShortName; } DdtAlcoProtocol protocol = service.GetDdtAlcoProtocolService().GetByHospitalSession(hospitalitySession.ObjectId); if (protocol != null) { behaviorTxt.Text = protocol.Behavior; bioTxt.Text = protocol.Bio; breatheTxt.Text = protocol.Breathe; conclusionTxt.Text = protocol.Conclusion; docsTxt.Text = protocol.Docs; drunkTxt.Text = protocol.Drunk; eyesTxt.Text = protocol.Eyes; illnessTxt.Text = protocol.Illness; lookTxt.Text = protocol.Look; mimicsTxt.Text = protocol.Mimics; motionTxt.Text = protocol.Motions; nistagmTxt.Text = protocol.Nistagm; orientationTxt.Text = protocol.Orientation; pressureTxt.Text = protocol.Pressure; priborTxt.Text = protocol.Pribor; pulseTxt.Text = protocol.Pulse; skinTxt.Text = protocol.Skin; smellTxt.Text = protocol.Smell; speechTxt.Text = protocol.Speech; touchNoseTxt.Text = protocol.TouchNose; trembleTxt.Text = protocol.Tremble; trubTxt.Text = protocol.Trub; walkTxt.Text = protocol.Walk; causeTxt.Text = protocol.Cause; } }
private void trombolizisPrintBtn_Click(object sender, EventArgs e) { if (doctorOkrCB.SelectedIndex < 0) { MessageBox.Show("Введены не все данные на форме!", "Предупреждение!", MessageBoxButtons.OK); return; } string templatePath = Directory.GetCurrentDirectory() + "\\Templates\\trombolisis_template.doc"; Dictionary <string, string> values = new Dictionary <string, string>(); DdvPatient patientView = DbDataService.GetInstance().GetDdvPatientService().GetById(patient.ObjectId); if (patient != null) { values.Add(@"{patient.full_name}", patientView.FullName); values.Add(@"{patient.med_code}", patient.MedCode); values.Add(@"{patient.initials}", patientView.ShortName); } values.Add(@"{date}", dateCtrl.Text); values.Add(@"{time}", timeCtrl.Text); values.Add(@"{doctor.who}", doctorOkrCB.Text); TemplatesUtils.FillTemplateAndShow(templatePath, values, null); }
private void InitControls() { curingDoc = service.GetDdvDoctorService().GetById(hospitalitySession?.CuringDoctor); ControlUtils.InitDoctorsByGroupName(service.GetDdvDoctorService(), adminTxt, "duty_administrators"); DdvPatient patient = service.GetDdvPatientService().GetById(hospitalitySession.Patient); if (patient != null) { Text += " " + patient.ShortName; } diagnosisTxt0.Text = hospitalitySession.Diagnosis; if (!string.IsNullOrEmpty(consiliumId)) { DdtConsilium consilium = service.GetDdtConsiliumService().GetById(consiliumId); if (consilium != null) { goalTxt.Text = consilium.Goal; dynamicsTxt.Text = consilium.Dynamics; adminTxt.SelectedIndex = adminTxt.FindStringExact(consilium.DutyAdminName); diagnosisTxt0.Text = consilium.Diagnosis; decisionTxt.Text = consilium.Decision; IList <DdtConsiliumRelation> consiliumRelations = service.GetDdtConsiliumRelationService().GetConsiliumRelationsByConsiliumId(consilium.ObjectId); InitMembersByRelations(service, consiliumRelations); } } else { DdtAnamnesis anamnesis = service.GetDdtAnamnesisService().GetByHospitalSessionId(hospitalitySession.ObjectId); if (anamnesis != null) { diagnosisTxt0.Text = anamnesis.Diagnosis; } IList <DdtConsiliumGroupMember> defaultGroupMembers = service.GetDdtConsiliumGroupMemberService().GetDefault(); InitDefaultMembers(service, defaultGroupMembers); } }
public string processTemplate(IDbDataService service, string hospitalitySession, string objectId, Dictionary <string, string> aditionalValues) { Dictionary <string, string> values = null; if (aditionalValues != null) { values = new Dictionary <string, string>(aditionalValues); } else { values = new Dictionary <string, string>(); } DdtAnamnesis anamnesis = service.GetDdtAnamnesisService().GetById(objectId); values.Add("{allergy}", anamnesis.AnamnesisAllergy); values.Add("{complaints}", anamnesis.Complaints); values.Add("{anamnesis}", anamnesis.AnamnesisMorbi); values.Add("{chronicle}", anamnesis.AccompanyingIllnesses); values.Add("{epid}", anamnesis.AnamnesisEpid); values.Add("{alco}", anamnesis.DrugsIntoxication); values.Add("{st_presens}", anamnesis.StPresens); values.Add("{respiratory_system}", anamnesis.RespiratorySystem); values.Add("{cardiovascular}", anamnesis.CardiovascularSystem); values.Add("{digestive_system}", anamnesis.DigestiveSystem); values.Add("{urinary_system}", anamnesis.UrinarySystem); values.Add("{nervous_system}", anamnesis.NervousSystem); values.Add("{past_surgeries}", anamnesis.PastSurgeries); values.Add("{operation_cause}", anamnesis.OperationCause); values.Add("{diagnosis}", anamnesis.Diagnosis); values.Add("{justification}", anamnesis.DiagnosisJustification); DdvDoctor doc = service.GetDdvDoctorService().GetById(anamnesis.Doctor); values.Add("{cardio}", doc.ShortName); PutAnalysisData(values, service, anamnesis.ObjectId); StringBuilder builder = new StringBuilder(); DdtIssuedMedicineList medList = service.GetDdtIssuedMedicineListService().GetListByParentId(anamnesis?.ObjectId); if (medList != null) { IList <DdtIssuedMedicine> med = service.GetDdtIssuedMedicineService().GetListByMedicineListId(medList.ObjectId); for (int i = 0; i < med.Count; i++) { DdtCure cure = service.GetDdtCureService().GetById(med[i].Cure); if (cure != null) { builder.Append(cure.Name).Append('\n'); } } } values.Add("{issued_medicine}", builder.ToString()); StringBuilder actionsBuilder = new StringBuilder(); IList <DdtIssuedAction> actions = service.GetDdtIssuedActionService().GetListByParentId(objectId); for (int i = 0; i < actions.Count; i++) { actionsBuilder.Append(i + 1).Append(". "); actionsBuilder.Append(actions[i].Action).Append('\n'); } values.Add("{issued_actions}", actionsBuilder.ToString()); DdtHospital hospital = service.GetDdtHospitalService().GetById(hospitalitySession); values.Add("{date}", hospital.AdmissionDate.ToShortDateString() + " " + hospital.AdmissionDate.ToShortTimeString()); DdvPatient patient = service.GetDdvPatientService().GetById(hospital.Patient); string resultName = TemplatesUtils.getTempFileName("Первичный осмотр", patient.FullName); return(TemplatesUtils.FillTemplate(Directory.GetCurrentDirectory() + "\\Templates\\" + TEMPLATE_FILE_NAME, values, resultName)); }
public string processTemplate(IDbDataService service, string hospitalitySession, string objectId, Dictionary <string, string> aditionalValues) { Dictionary <string, string> values = null; if (aditionalValues != null) { values = new Dictionary <string, string>(aditionalValues); } else { values = new Dictionary <string, string>(); } DdtTransfusion transfusion = service.GetDdtTransfusionService().GetById(objectId); DdtHospital hospital = service.GetDdtHospitalService().GetById(hospitalitySession); DdvPatient patient = service.GetDdvPatientService().GetById(hospital.Patient); DdtBloodAnalysis bloodAnalysis = service.GetDdtBloodAnalysisService().GetById(transfusion.BloodAnalysis); values.Add(@"{name}", patient.FullName); values.Add(@"{age}", (DateTime.Now.Year - patient.Birthdate.Year) + ""); values.Add(@"{historycard}", patient.MedCode); values.Add(@"{diagnosis}", hospital.Diagnosis); values.Add(@"{blood}", patient.BloodGroup); values.Add(@"{rh}", patient.RHFactor); values.Add(@"{kell}", patient.Kell); values.Add(@"{phenotype}", patient.Phenotype); values.Add(@"{indications}", "гемическая гипоксия"); values.Add(@"{meduim}", transfusion?.TransfusionMedium); values.Add(@"{doctor}", GetDoctorInString(service, transfusion?.Doctor)); values.Add(@"{transfusionDate}", transfusion?.TransfusionDate.ToShortDateString()); string mediumNames = ""; string mediumCounts = ""; String[] transfusionMediumArray = transfusion.TransfusionMedium.Split(','); foreach (String mediumWithCount in transfusionMediumArray) { String[] mediumArray = mediumWithCount.Split(':'); string mediumName = mediumArray[0]; string mediumCount = mediumArray[1]; switch (mediumName) { case "Blood": mediumName = "Кровь"; break; case "Plasma": mediumName = "Плазма"; break; case "Albumin": continue; case "Platelet": mediumName = "Тромбоцит"; break; } mediumNames += string.IsNullOrEmpty(mediumNames) ? mediumName : ", " + mediumName; mediumCounts += string.IsNullOrEmpty(mediumCounts) ? mediumCount + " дозы" : ", " + mediumCount + " дозы"; } values.Add(@"{mediumNames}", mediumNames); values.Add(@"{mediumCounts}", mediumCounts); values.Add(@"{Hemog}", bloodAnalysis.Hemoglobin); values.Add(@"{Hemat}", "пусто"); values.Add(@"{aptt}", "пусто"); values.Add(@"{inr}", "пусто"); return(TemplatesUtils.FillTemplate(Directory.GetCurrentDirectory() + "\\Templates\\" + TemplateFileName, values)); }
private void admisPatient_Click(object sender, EventArgs e) { if (!GetIsValid()) { MessageBox.Show("Заполните поля помеченные жирным шрифтом!", "Warning", MessageBoxButtons.OK); return; } DdvPatient patient = service.GetDdvPatientService().GetById(hospital?.Patient); if (patient == null) { patient = new DdvPatient(); } patient.Address = addressTxt.Text.Trim(); patient.LastName = patientLastName.Text.Trim(); patient.MiddleName = patientSecondName.Text.Trim(); patient.FirstName = patientFirstName.Text.Trim(); patient.MedCode = medCodeTxt.Text.Trim(); patient.Phone = phoneTxt.Text; patient.Snils = snilsTxt.Text; patient.Oms = omsTxt.Text; patient.PassportDate = passportDataTxt.Value; patient.PassportIssuePlace = passportIssuePlaceTxt.Text; patient.PassportNum = passportNumTxt.Text; patient.PassportSerial = passportSerialTxt.Text; patient.Sd = sdBtn.Checked; patient.Sex = maleChb.Checked; if (!string.IsNullOrEmpty(weightTxt.Text)) { patient.Weight = (float)Double.Parse(weightTxt.Text.Trim()); } if (!string.IsNullOrEmpty(highTxt.Text)) { patient.High = (float)Double.Parse(highTxt.Text.Trim()); } patient.Birthdate = DateTime.ParseExact(patientBirthDate.Text.Trim(), "dd.MM.yyyy", CultureInfo.InvariantCulture); String patientId = service.GetDdtPatientService().Save(patient); if (hospital == null) { hospital = new DdtHospital(); hospital.Patient = patientId; } hospital.Active = true; hospital.AdmissionDate = CommonUtils.ConstructDateWIthTime(patientReceiptDate.Value, patientReceiptTime.Value); DdvDoctor docDuty = (DdvDoctor)cardioDocBox.SelectedItem; hospital.DutyDoctor = docDuty.ObjectId; DdvDoctor docCuring = (DdvDoctor)dutyCardioBox.SelectedItem; hospital.CuringDoctor = docCuring.ObjectId; DdvDoctor docSubstitution = (DdvDoctor)subDoctorBox.SelectedItem; hospital.SubstitutionDoctor = docSubstitution.ObjectId; DdvDoctor directorCardioReanim = (DdvDoctor)directorCardioReanimBox.SelectedItem; hospital.DirCardioReanimDoctor = directorCardioReanim.ObjectId; DdvDoctor anesthetistDoctor = (DdvDoctor)anesthetistComboBox.SelectedItem; hospital.AnesthetistDoctor = anesthetistDoctor.ObjectId; hospital.RoomCell = roomTxt.Text ?? roomTxt.Text.Trim(); service.GetDdtHospitalService().Save(hospital); //todo перенести в статусную строку Close(); }
public string processTemplate(IDbDataService service, string hospitalitySession, string objectId, Dictionary <string, string> aditionalValues) { Dictionary <string, string> values = null; if (aditionalValues != null) { values = new Dictionary <string, string>(aditionalValues); } else { values = new Dictionary <string, string>(); } DdtEpicrisis obj = service.GetDdtEpicrisisService().GetById(objectId); values.Add("{diagnosis}", obj.Diagnosis); values.Add("{date}", obj.EpicrisisDate.ToShortDateString()); DdvPatient patient = service.GetDdvPatientService().GetById(obj.Patient); values.Add("{patient.initials}", patient == null ? "" : patient.ShortName); values.Add("{patient.age}", patient == null ? "" : (DateTime.Now.Year - patient.Birthdate.Year) + ""); DdtHospital hospital = service.GetDdtHospitalService().GetById(hospitalitySession); values.Add("{patient.admission_date}", hospital.AdmissionDate.ToShortDateString()); DdtAnamnesis anamnesis = service.GetDdtAnamnesisService().GetByHospitalSessionId(hospital.ObjectId); values.Add("{complaints}", anamnesis == null ? " " : anamnesis.Complaints); values.Add("{anamnesis}", anamnesis == null ? " " : anamnesis.AnamnesisMorbi); StringBuilder inspectonBld = new StringBuilder(); inspectonBld.Append(CompileValue("St.Presens", anamnesis?.StPresens)); inspectonBld.Append(CompileValue("Органы дыхания", anamnesis?.RespiratorySystem)); inspectonBld.Append(CompileValue("Сердечно-сосудистая система", anamnesis?.CardiovascularSystem)); inspectonBld.Append(CompileValue("Органы пищеварения", anamnesis?.DigestiveSystem)); values.Add("{inspection}", anamnesis == null ? " " : inspectonBld.ToString()); DdtSerology serology = service.GetDdtSerologyService().GetByHospitalSession(hospital.ObjectId); StringBuilder serologyBld = new StringBuilder(); if (serology != null) { serologyBld.Append(CompileValue("Группа крови", serology.BloodType)); serologyBld.Append(CompileValue("Резус-фактор", serology.RhesusFactor)); serologyBld.Append(CompileValue("RW", serology.Rw)); } values.Add("{serology}", serology == null ? " " : serologyBld.ToString()); PutAnalysisData(values, service, obj.ObjectId); StringBuilder bloodStr = new StringBuilder(); if (serology != null) { bloodStr.Append(CompileValue("KELL-ag", serology.KellAg)); bloodStr.Append(CompileValue("HBs ag", serology.HbsAg)); bloodStr.Append(CompileValue("Anti HCV крови", serology.AntiHcv)); bloodStr.Append(CompileValue("HIV", serology.Hiv)); } if (obj.EpicrisisType == (int)DdtEpicrisisDsiType.TRANSFER) { DdtTransfer transfer = service.GetDdtTransferService().GetByHospitalSession(hospitalitySession); if (transfer != null) { values.Add("{destination}", transfer.Destination); values.Add("{contact}", transfer.Contacts); values.Add("{transport_justification}", transfer.TransferJustification); values.Add("{patient.release_date}", transfer.StartDate.ToShortDateString()); } } else if (obj.EpicrisisType == (int)DdtEpicrisisDsiType.DEATH) { values.Add("{conclusion}", " "); } DdvDoctor doc = service.GetDdvDoctorService().GetById(obj.Doctor); values.Add("{doctor.who.short}", doc.ShortName); DdvDoctor surgery = service.GetDdvDoctorService().GetById(hospital.DutyDoctor); values.Add("{surgery}", surgery?.ShortName + "\n"); DdvDoctor anest = service.GetDdvDoctorService().GetById(hospital.AnesthetistDoctor); values.Add("{anestesiolog}", anest?.ShortName); string resultFileName = TemplatesUtils.getTempFileName("Эпикриз", patient.FullName); return(TemplatesUtils.FillTemplate(Directory.GetCurrentDirectory() + "\\Templates\\" + getTemplateName(obj), values, resultFileName)); }
public Resuscitation(DdvPatient patient) { this.patient = patient; InitializeComponent(); CommonUtils.InitDoctorsByGroupComboboxValues(DbDataService.GetInstance(), doctorsBox, "cardioreanimation_department"); }