public override void Populate(object filter) { int index = -1; _Evento = ServiceCalls.GetMedicalEvent(MedicalEventId); txtEvolution.Text = _Evento.Evolucion; txtMotivo.Text = _Evento.Motivo; lblProfesional.Text = String.Concat(_Evento.NombreApellidoProfesional, " (", _Evento.NombreEspesialidad, ")"); patientMedicamentViewListBindingSource.DataSource = _Evento.PatientMedicaments; gridView_Medicaments.RefreshData(); if (_Evento.IdTipoConsulta.HasValue) { index = cmbTipoConsulta.Properties.GetDataSourceRowIndex("IdParametro", _Evento.IdTipoConsulta); cmbTipoConsulta.ItemIndex = index; cmbTipoConsulta.Refresh(); } _Evento.DetailView_Diagnosis = _Evento.MedicalEventDetail_ViewList.Get_Diagnosis(); _Evento.DetailView_MetodosComplementarios = _Evento.MedicalEventDetail_ViewList.Get_Metodo_Complementarios(); uC_EventDetailsGrid_Diagnosis.Populate(_Evento); uC_EventDetailsGrid_MetComplementario.Populate(_Evento); base.Populate(filter); }
string Create_Doc() { if (_Event == null) { return(string.Empty); } StringBuilder strTableTows = null; ParametroBE wParam; MedicalEventBE wMedicalEvent = ServiceCalls.GetMedicalEvent(_Event.MedicalEventId); StringBuilder t = new StringBuilder(template); t.Replace("[PROFESIONAL]", String.Concat(wMedicalEvent.NombreApellidoProfesional, " (", wMedicalEvent.NombreEspesialidad, ")")); t.Replace("[INST]", wMedicalEvent.InstitucionRazonSocial); t.Replace("[FECHA]", wMedicalEvent.CreatedDate.ToShortDateString()); if (!string.IsNullOrEmpty(wMedicalEvent.Motivo)) { t.Replace("[MOTIVO]", wMedicalEvent.Motivo); } else { t.Replace("[MOTIVO]", "<br />"); } if (!string.IsNullOrEmpty(wMedicalEvent.Evolucion)) { t.Replace("[EVOLUCION]", wMedicalEvent.Evolucion); } else { t.Replace("[EVOLUCION]", "<br />"); } PMOFile pmo = null; if (!String.IsNullOrEmpty(wMedicalEvent.PMOQuirurgico)) { pmo = ServiceCalls.PMOFileList.Where(p => p.Code.Equals(wMedicalEvent.PMOQuirurgico.Trim())).FirstOrDefault(); if (pmo != null) { t.Replace("[PMO_QUIR]", string.Concat(pmo.Description, "<br />")); t.Replace("[pmo_quir_med_display]", "table"); } } else { t.Replace("[PMO_QUIR]", "<br />"); t.Replace("[pmo_quir_med_display]", "none"); } if (wMedicalEvent.DetailView_MetodosComplementarios.Count != 0) { tRowMedicamentTemplate = " <tr style=\"height: 30px\"> <td>[DESC]</td> <td>[OBS]</td> </tr>"; strTableTows = new StringBuilder(); foreach (var det in wMedicalEvent.DetailView_MetodosComplementarios) { strTableTows.AppendLine(tRowMedicamentTemplate); strTableTows.Replace("[DESC]", det.Desc); strTableTows.Replace("[OBS]", det.Observations); } t.Replace("[MetodoComplementario]", string.Concat(strTableTows.ToString(), "<br />")); } else { t.Replace("[MetodoComplementario]", "<br />"); } if (wMedicalEvent.DetailView_Diagnosis.Count != 0) { tRowMedicamentTemplate = " <tr style=\"height: 30px\"> <td>[DESC]</td> <td>[OBS]</td> <td>[ALERT]</td> </tr>"; strTableTows = new StringBuilder(); foreach (var det in wMedicalEvent.DetailView_Diagnosis) { strTableTows.AppendLine(tRowMedicamentTemplate); strTableTows.Replace("[DESC]", det.Desc); strTableTows.Replace("[OBS]", det.Observations); strTableTows.Replace("[ALERT]", det.RelevanceTypeName); } t.Replace("[DIAG]", string.Concat(strTableTows.ToString(), "<br />")); } else { t.Replace("[DIAG]", "<br />"); } if (wMedicalEvent.IdTipoConsulta.HasValue) { wParam = ServiceCalls.TipoEventoMedicoList.Where(p => p.IdParametro.Equals(Convert.ToInt32(wMedicalEvent.IdTipoConsulta))).FirstOrDefault(); if (wParam != null) { t.Replace("[TIPOCONSULTA]", wParam.Nombre); } } else { t.Replace("[TIPOCONSULTA]", "<br />"); } t.Replace("[ESP]", wMedicalEvent.NombreEspesialidad); tRowMedicamentTemplate = " <tr style=\"height: 30px\"> <td>[Date]</td> <td>[MedicamentName]</td> <td>[Status]</td> <td>[NombreProfesional]</td> </tr>"; strTableTows = new StringBuilder(); foreach (PatientMedicament_ViewBE med in wMedicalEvent.PatientMedicaments) { strTableTows.AppendLine(tRowMedicamentTemplate); strTableTows.Replace("[MedicamentName]", med.MedicamentName); strTableTows.Replace("[Date]", med.CreatedDate.ToShortDateString()); strTableTows.Replace("[Status]", med.StatusDescription); strTableTows.Replace("[NombreProfesional]", med.NombreProfesional); } if (wMedicalEvent.PatientMedicaments.Count != 0) { t.Replace("[MEDICAMENTOS]", strTableTows.ToString()); t.Replace("[tbl_med_display]", "table"); } else { t.Replace("[MEDICAMENTOS]", String.Empty); t.Replace("[tbl_med_display]", "none"); } //chkDefinitivo.Checked = wMedicalEvent.IsDefinitive; //_Evento.PatientMedicaments; return(t.ToString()); }