Beispiel #1
0
        public static void UpdateMedicalEvent(MedicalEventBE medicalEvent, Guid createdUserId)
        {

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {

                MedicalEvent medicalEvent_db = dc.MedicalEvents.Where(p => p.MedicalEventId.Equals(medicalEvent.MedicalEventId)).FirstOrDefault<MedicalEvent>();


                medicalEvent_db.MedicalEventId_Parent = medicalEvent.MedicalEventId_Parent;
                medicalEvent_db.ProfesionalId = medicalEvent.ProfesionalId;

                medicalEvent_db.PatientId = medicalEvent.PatientId;

                medicalEvent_db.IdEspesialidad = medicalEvent.IdEspesialidad;
                medicalEvent_db.IdTipoConsulta = medicalEvent.IdTipoConsulta;

                medicalEvent_db.Motivo = medicalEvent.Motivo;
      
                medicalEvent_db.Evolucion = medicalEvent.Evolucion;

   
                medicalEvent_db.MetodoComplementario = medicalEvent.MetodoComplementario;
                medicalEvent_db.AppointmentId = medicalEvent.AppointmentId;
                medicalEvent_db.HealthInstitutionId = medicalEvent.HealthInstitutionId;
                //medicalEvent_db.CreatedDate = System.DateTime.Now;
                //medicalEvent_db.CreatedUserId = createdUserId;
                dc.SaveChanges();

            }
        }
Beispiel #2
0
        public static int CreateMedicalEvent(MedicalEventBE medicalEvent, Guid createdUserId)
        {

            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {

                MedicalEvent medicalEvent_db = new MedicalEvent();


                medicalEvent_db.MedicalEventId_Parent = medicalEvent.MedicalEventId_Parent;
                medicalEvent_db.ProfesionalId = medicalEvent.ProfesionalId;

                medicalEvent_db.PatientId = medicalEvent.PatientId;

                medicalEvent_db.IdEspesialidad = medicalEvent.IdEspesialidad;
                medicalEvent_db.IdTipoConsulta = medicalEvent.IdTipoConsulta;

                medicalEvent_db.Motivo = medicalEvent.Motivo;
   
                medicalEvent_db.MetodoComplementario = medicalEvent.MetodoComplementario;
                medicalEvent_db.Evolucion = medicalEvent.Evolucion;
                medicalEvent_db.AppointmentId = medicalEvent.AppointmentId;

                medicalEvent_db.CreatedDate = System.DateTime.Now;
                medicalEvent_db.CreatedUserId = createdUserId;
                medicalEvent_db.HealthInstitutionId = medicalEvent.HealthInstitutionId;

                dc.MedicalEvents.AddObject(medicalEvent_db);
                dc.SaveChanges();
                return medicalEvent_db.MedicalEventId;
            }
        }
Beispiel #3
0
        public override void Populate(object filter)
        {
            int index = -1;

            _Evento           = Controller.GetMedicalEvent(MedicalEventId);
            txtEvolution.Text = _Evento.Evolucion;
            txtMotivo.Text    = _Evento.Motivo;

            lblProfesional.Text = String.Concat(_Evento.NombreApellidoProfecional, "  (", _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);
        }
        public frm_ManageMedicament(MedicalEventBE pCurrentEvent)
        {
            InitializeComponent();

            currentEvent = pCurrentEvent;

        }
        public frm_EventDetails_Diagnosis(MedicalEventBE medicalEevent)
        {
            InitializeComponent();
            colColEnabled.FilterMode = DevExpress.XtraGrid.ColumnFilterMode.Value;
            colColEnabled.FilterInfo = new ColumnFilterInfo("[ColEnabled] = true");
            //---------------MedicalEventDetailType---------------
            //12000	CEI10-Diagnosis                                   
            //12001	Tratamiento TTO                                   
            //12002	Metodo Complementarios                            
            //12003	Rehabilitación                                    

            ParametroList items = new ParametroList();

            items.Add(new ParametroBE { Nombre = Enum.GetName(typeof(CommonValuesEnum), CommonValuesEnum.Ninguno), IdParametro = (int)CommonValuesEnum.Ninguno });
            items.Add(new ParametroBE(870, "Relevante actual"));
            items.Add(new ParametroBE(871, "Relevante Crónico"));
            items.Add(new ParametroBE(872, "Presuntivo"));
            parametroBEBindingSource.DataSource = items;

           
            this.CurentEvent = medicalEevent;


            

        }
Beispiel #6
0
        public static int CreateMedicalEvent(MedicalEventBE medicalEvent, Guid createdUserId)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                MedicalEvent medicalEvent_db = new MedicalEvent();


                medicalEvent_db.MedicalEventId_Parent = medicalEvent.MedicalEventId_Parent;
                medicalEvent_db.ProfesionalId         = medicalEvent.ProfesionalId;

                medicalEvent_db.PatientId = medicalEvent.PatientId;

                medicalEvent_db.IdEspesialidad = medicalEvent.IdEspesialidad;
                medicalEvent_db.IdTipoConsulta = medicalEvent.IdTipoConsulta;

                medicalEvent_db.Motivo = medicalEvent.Motivo;

                medicalEvent_db.MetodoComplementario = medicalEvent.MetodoComplementario;
                medicalEvent_db.Evolucion            = medicalEvent.Evolucion;
                medicalEvent_db.AppointmentId        = medicalEvent.AppointmentId;

                medicalEvent_db.CreatedDate         = System.DateTime.Now;
                medicalEvent_db.CreatedUserId       = createdUserId;
                medicalEvent_db.HealthInstitutionId = medicalEvent.HealthInstitutionId;

                dc.MedicalEvents.AddObject(medicalEvent_db);
                dc.SaveChanges();
                return(medicalEvent_db.MedicalEventId);
            }
        }
Beispiel #7
0
        public static void UpdateMedicalEvent(MedicalEventBE medicalEvent, Guid createdUserId)
        {
            using (Health.Back.BE.HealthEntities dc = new Health.Back.BE.HealthEntities(Common.CnnString_Entities))
            {
                MedicalEvent medicalEvent_db = dc.MedicalEvents.Where(p => p.MedicalEventId.Equals(medicalEvent.MedicalEventId)).FirstOrDefault <MedicalEvent>();


                medicalEvent_db.MedicalEventId_Parent = medicalEvent.MedicalEventId_Parent;
                medicalEvent_db.ProfesionalId         = medicalEvent.ProfesionalId;

                medicalEvent_db.PatientId = medicalEvent.PatientId;

                medicalEvent_db.IdEspesialidad = medicalEvent.IdEspesialidad;
                medicalEvent_db.IdTipoConsulta = medicalEvent.IdTipoConsulta;

                medicalEvent_db.Motivo = medicalEvent.Motivo;

                medicalEvent_db.Evolucion = medicalEvent.Evolucion;


                medicalEvent_db.MetodoComplementario = medicalEvent.MetodoComplementario;
                medicalEvent_db.AppointmentId        = medicalEvent.AppointmentId;
                medicalEvent_db.HealthInstitutionId  = medicalEvent.HealthInstitutionId;
                //medicalEvent_db.CreatedDate = System.DateTime.Now;
                //medicalEvent_db.CreatedUserId = createdUserId;
                dc.SaveChanges();
            }
        }
Beispiel #8
0
        public override void Populate(object filter)
        {
            int index = -1;
            _Evento = Controller.GetMedicalEvent(MedicalEventId);
            txtEvolution.Text = _Evento.Evolucion;
            txtMotivo.Text = _Evento.Motivo;
          
            lblProfesional.Text = String.Concat(_Evento.NombreApellidoProfecional, "  (", _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);
        }
Beispiel #9
0
        public override void Populate(object filter)
        {
            _Evento = frmPatientAtencion.GetInstance(this).MedicalEvent;

            cmbTipoConsulta.Properties.DataSource = Controller.TipoEventoMedicoList;
            cmbTipoConsulta.Refresh();

            //this.cEI10ComboBindingSource.DataSource = Controller.CEI_10ComboList;

            //this.pMOFileListBindingSource.DataSource = Controller.PMOFileList.Where(p =>
            //    (p.Type.Equals((int)PMOEnum.Diagnostico_Imagenes) ||
            //    p.Type.Equals((int)PMOEnum.Odontológicas) ||
            //    p.Type.Equals((int)PMOEnum.Diagnostico_Analisis_Clinico)) &&
            //    p.HasChild.Equals(false)).OrderBy(p => p.Id);

            //var pmo = Controller.PMOFileList.Where(p =>
            //      (p.Type.Equals((int)PMOEnum.Diagnostico_Imagenes) ||
            //      p.Type.Equals((int)PMOEnum.Odontológicas) ||
            //      p.Type.Equals((int)PMOEnum.Diagnostico_Analisis_Clinico)) &&
            //      p.HasChild.Equals(false)).OrderBy(p => p.Id);

            //Int32 c = pmo.Count();
            //this.pMOFileListBindingSource.DataSource = pmo;


            this.pMOFileListBindingSource_Quirurgico.DataSource = Controller.PMOFileList.Where(p =>
                                                                                               p.Type.Equals((int)PMOEnum.Quirurgicas) && p.HasChild.Equals(false)).OrderBy(p => p.Id);


            _Evento.PatientMedicaments = Controller.RetrivePatientMedicaments(Controller.CurrentPatient.PatientId, null);

            //Nunca traera del evento _Event dado que es recientemente creado y no posee aun Detalles

            if (_Evento.DetailView_Diagnosis == null)
            {
                _Evento.DetailView_Diagnosis = new MedicalEventDetail_ViewList();
            }

            if (_Evento.DetailView_MetodosComplementarios == null)
            {
                _Evento.DetailView_MetodosComplementarios = new MedicalEventDetail_ViewList();
            }

            //Medicamentos
            patientMedicamentViewListBindingSource.DataSource = _Evento.PatientMedicaments;
            gridView_Medicaments.RefreshData();

            //Diagnosis
            uC_EventDetailsGrid_Diagnosis.Populate(_Evento);
            //MetComplementario
            uC_EventDetailsGrid_MetComplementario.Populate(_Evento);

            base.Populate(filter);
        }
Beispiel #10
0
        public override void Populate(object filter)
        {
            _Evento = frmPatientAtencion.GetInstance(this).MedicalEvent;

            cmbTipoConsulta.Properties.DataSource = ServiceCalls.TipoEventoMedicoList;
            cmbTipoConsulta.Refresh();

            //this.cEI10ComboBindingSource.DataSource = Controller.CEI_10ComboList;

            //this.pMOFileListBindingSource.DataSource = Controller.PMOFileList.Where(p => 
            //    (p.Type.Equals((int)PMOEnum.Diagnostico_Imagenes) ||
            //    p.Type.Equals((int)PMOEnum.Odontológicas) ||
            //    p.Type.Equals((int)PMOEnum.Diagnostico_Analisis_Clinico)) && 
            //    p.HasChild.Equals(false)).OrderBy(p => p.Id);

            //var pmo = Controller.PMOFileList.Where(p =>
            //      (p.Type.Equals((int)PMOEnum.Diagnostico_Imagenes) ||
            //      p.Type.Equals((int)PMOEnum.Odontológicas) ||
            //      p.Type.Equals((int)PMOEnum.Diagnostico_Analisis_Clinico)) &&
            //      p.HasChild.Equals(false)).OrderBy(p => p.Id);

            //Int32 c = pmo.Count();
            //this.pMOFileListBindingSource.DataSource = pmo;


            this.pMOFileListBindingSource_Quirurgico.DataSource = ServiceCalls.PMOFileList.Where(p =>
                p.Type.Equals((int)PMOEnum.Quirurgicas) && p.HasChild.Equals(false)).OrderBy(p => p.Id);


            _Evento.PatientMedicaments = ServiceCalls.RetrivePatientMedicaments(ServiceCalls.CurrentPatient.PatientId, null);

            //Nunca traera del evento _Event dado que es recientemente creado y no posee aun Detalles

            if (_Evento.DetailView_Diagnosis == null)
                _Evento.DetailView_Diagnosis = new MedicalEventDetail_ViewList();

            if (_Evento.DetailView_MetodosComplementarios == null)
                _Evento.DetailView_MetodosComplementarios = new MedicalEventDetail_ViewList();

            //Medicamentos
            patientMedicamentViewListBindingSource.DataSource = _Evento.PatientMedicaments;
            gridView_Medicaments.RefreshData();

            //Diagnosis
            uC_EventDetailsGrid_Diagnosis.Populate(_Evento);
            //MetComplementario
            uC_EventDetailsGrid_MetComplementario.Populate(_Evento);

            base.Populate(filter);
        }
        public override void Populate(object filter)
        {
            medicalEvent = (MedicalEventBE)filter;
            if (DetailType.Equals(MedicalEventDetailType.CEI10_Diagnosis))
                medicalEventDetailViewListBindingSource.DataSource = medicalEvent.DetailView_Diagnosis;

            if (DetailType.Equals(MedicalEventDetailType.Metodo_Complementarios))
                medicalEventDetailViewListBindingSource.DataSource = medicalEvent.DetailView_MetodosComplementarios;


            if (DetailType.Equals(MedicalEventDetailType.Quirurgico))
                medicalEventDetailViewListBindingSource.DataSource = medicalEvent.DetailView_Quirurgicos;
            gridView_Details.RefreshData();
        }
Beispiel #12
0
        public static void UpdateMedicalEvent(MedicalEventBE medicalEvent)
        {
            UpdatePatientEventReq req = new UpdatePatientEventReq();

            req.BusinessData = medicalEvent;

            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();
            req.ContextInformation.AppId  = Controller.CurrentHealthInstitution.HealthInstitutionId.ToString();

            UpdatePatientEventRes res = req.ExecuteService <UpdatePatientEventReq, UpdatePatientEventRes>(req);

            if (res.Error != null)
            {
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);
            }
        }
Beispiel #13
0
        public static int CreateMedicalEvent(MedicalEventBE medicalEvent)
        {
            CreatePatientEventReq req = new CreatePatientEventReq();

            req.BusinessData = medicalEvent;

            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();
            req.ContextInformation.AppId  = ServiceCalls.CurrentHealthInstitution.HealthInstitutionId.ToString();

            CreatePatientEventRes res = req.ExecuteService <CreatePatientEventReq, CreatePatientEventRes>(req);

            if (res.Error != null)
            {
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);
            }

            return(res.BusinessData.EventId);
        }
Beispiel #14
0
        public override void Populate(object filter)
        {
            medicalEvent = (MedicalEventBE)filter;
            if (DetailType.Equals(MedicalEventDetailType.CEI10_Diagnosis))
            {
                medicalEventDetailViewListBindingSource.DataSource = medicalEvent.DetailView_Diagnosis;
            }

            if (DetailType.Equals(MedicalEventDetailType.Metodo_Complementarios))
            {
                medicalEventDetailViewListBindingSource.DataSource = medicalEvent.DetailView_MetodosComplementarios;
            }


            if (DetailType.Equals(MedicalEventDetailType.Quirurgico))
            {
                medicalEventDetailViewListBindingSource.DataSource = medicalEvent.DetailView_Quirurgicos;
            }
            gridView_Details.RefreshData();
        }
        public frm_EventDetails_MetodoComplementario(MedicalEventBE medicalEevent)
        {
            InitializeComponent();

            //---------------MedicalEventDetailType---------------
            //12000	CEI10-Diagnosis                                   
            //12001	Tratamiento TTO                                   
            //12002	Metodo Complementarios                            
            //12003	Rehabilitación                                    

            ParametroList items = new ParametroList();

            items.Add(new ParametroBE { Nombre = Enum.GetName(typeof(CommonValuesEnum), CommonValuesEnum.Ninguno), IdParametro = (int)CommonValuesEnum.Ninguno });
            items.Add(new ParametroBE(870, "Relevante actual"));
            items.Add(new ParametroBE(871, "Relevante Crónico"));
            items.Add(new ParametroBE(872, "Presuntivo"));
            parametroBEBindingSource.DataSource = items;

           
            this.CurentEvent = medicalEevent;
        }
        /// <summary>
        /// Carga Dominios relacionados entre al objeto _RelatedDomains que esta bindiado a la grilla
        /// </summary>
        void Populate(out Exception ex)
        {
            ex = null;

            try
            {
                _PatientAllergy             = ServiceCalls.GetPatientAllergy(ServiceCalls.CurrentPatient.PatientId);
                _PatientMedicament_ViewList = ServiceCalls.RetrivePatientMedicaments(ServiceCalls.CurrentPatient.PatientId, null);
                _MedicalEventAlert_ViewList = ServiceCalls.RetriveMedicalEventAlert(ServiceCalls.CurrentPatient.PatientId, null, false);
                if (MedicalEvent == null)
                {
                    MedicalEvent = new MedicalEventBE();
                    MedicalEvent.MedicalEventId = -1;
                    if (this._Appointment != null)
                    {
                        MedicalEvent.AppointmentId = this._Appointment.AppointmentId;
                    }


                    MedicalEvent.ProfesionalId       = ServiceCalls.CurrentProfesional.IdProfesional;
                    MedicalEvent.IdEspesialidad      = ServiceCalls.CurrentProfesional.IdEspecialidad.Value;
                    MedicalEvent.PatientId           = ServiceCalls.CurrentPatient.PatientId;
                    MedicalEvent.PatientMedicaments  = _PatientMedicament_ViewList;
                    MedicalEvent.HealthInstitutionId = ServiceCalls.CurrentHealthInstitution.HealthInstitutionId;

                    MedicalEvent.MedicalEventId = ServiceCalls.CreateMedicalEvent(MedicalEvent);
                }
                else
                {
                    MedicalEvent.PatientMedicaments = _PatientMedicament_ViewList;
                }
            }
            catch (Exception err)
            {
                err.Source = "Origen de datos";
                ex         = err;
            }
        }
        public frm_EventDetails_Diagnosis(MedicalEventBE medicalEevent)
        {
            InitializeComponent();

            //---------------MedicalEventDetailType---------------
            //12000	CEI10-Diagnosis
            //12001	Tratamiento TTO
            //12002	Metodo Complementarios
            //12003	Rehabilitación

            ParametroList items = new ParametroList();

            items.Add(new ParametroBE {
                Nombre = Enum.GetName(typeof(CommonValuesEnum), CommonValuesEnum.Ninguno), IdParametro = (int)CommonValuesEnum.Ninguno
            });
            items.Add(new ParametroBE(870, "Relevante actual"));
            items.Add(new ParametroBE(871, "Relevante Crónico"));
            items.Add(new ParametroBE(872, "Presuntivo"));
            parametroBEBindingSource.DataSource = items;


            this.CurentEvent = medicalEevent;
        }
        public frm_EventDetails_MetodoComplementario(MedicalEventBE medicalEevent)
        {
            InitializeComponent();
            colColEnabled.FilterMode = DevExpress.XtraGrid.ColumnFilterMode.Value;
            colColEnabled.FilterInfo = new ColumnFilterInfo("[ColEnabled] = true");
            //---------------MedicalEventDetailType---------------
            //12000	CEI10-Diagnosis
            //12001	Tratamiento TTO
            //12002	Metodo Complementarios
            //12003	Rehabilitación

            ParametroList items = new ParametroList();

            items.Add(new ParametroBE {
                Nombre = Enum.GetName(typeof(CommonValuesEnum), CommonValuesEnum.Ninguno), IdParametro = (int)CommonValuesEnum.Ninguno
            });
            items.Add(new ParametroBE(870, "Relevante actual"));
            items.Add(new ParametroBE(871, "Relevante Crónico"));
            items.Add(new ParametroBE(872, "Presuntivo"));
            parametroBEBindingSource.DataSource = items;


            this.CurentEvent = medicalEevent;
        }
        /// <summary>
        /// Carga Dominios relacionados entre al objeto _RelatedDomains que esta bindiado a la grilla
        /// </summary>
        void Populate(out Exception ex)
        {
            ex = null;

            try
            {
                _PatientAllergy = Controller.GetPatientAllergy(Controller.CurrentPatient.PatientId);
                _PatientMedicament_ViewList = Controller.RetrivePatientMedicaments(Controller.CurrentPatient.PatientId, null);
                _MedicalEventAlert_ViewList = Controller.RetriveMedicalEventAlert(Controller.CurrentPatient.PatientId,null, false);
                if (MedicalEvent == null)
                {
                    MedicalEvent = new MedicalEventBE();
                    MedicalEvent.MedicalEventId = -1;
                    if (this._Appointment != null)
                        MedicalEvent.AppointmentId = this._Appointment.AppointmentId;


                    MedicalEvent.ProfesionalId = Controller.CurrentProfesional.IdProfesional;
                    MedicalEvent.IdEspesialidad = Controller.CurrentProfesional.IdEspecialidad.Value;
                    MedicalEvent.PatientId = Controller.CurrentPatient.PatientId;
                    MedicalEvent.PatientMedicaments = _PatientMedicament_ViewList;
                    MedicalEvent.HealthInstitutionId = Controller.CurrentHealthInstitution.HealthInstitutionId;

                    MedicalEvent.MedicalEventId = Controller.CreateMedicalEvent(MedicalEvent);
                }
                else
                {
                    MedicalEvent.PatientMedicaments = _PatientMedicament_ViewList;
                }

            }
            catch (Exception err)
            {
                err.Source = "Origen de datos";
                ex = err;
            }
        }
Beispiel #20
0
        public static void UpdateMedicalEvent(MedicalEventBE medicalEvent)
        {
            UpdatePatientEventReq req = new UpdatePatientEventReq();

            req.BusinessData = medicalEvent;

            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();
            req.ContextInformation.AppId = Controller.CurrentHealthInstitution.HealthInstitutionId.ToString();

            UpdatePatientEventRes res = req.ExecuteService<UpdatePatientEventReq, UpdatePatientEventRes>(req);

            if (res.Error != null)
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);


        }
        public frm_ManageMedicament(MedicalEventBE pCurrentEvent)
        {
            InitializeComponent();

            currentEvent = pCurrentEvent;
        }
Beispiel #22
0
        string Create_Doc()
        {
            if (_Event == null)
            {
                return(string.Empty);
            }
            StringBuilder strTableTows = null;
            ParametroBE   wParam;

            MedicalEventBE wMedicalEvent = Controller.GetMedicalEvent(_Event.MedicalEventId);

            StringBuilder t = new StringBuilder(template);

            t.Replace("[PROFESIONAL]", String.Concat(wMedicalEvent.NombreApellidoProfecional, "  (", 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 = Controller.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 = Controller.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());
        }
Beispiel #23
0
        /// <summary>
        /// Obtiene Medical event y medicamentos con full detalles.
        /// Utiliza SP: MedicalEvent_g
        /// </summary>
        /// <param name="pMedicalEventId"></param>
        /// <returns></returns>
        public static MedicalEventBE GetEvent(int pMedicalEventId)
        {
            Database  wDatabase = null;
            DbCommand wCmd      = null;


            MedicalEventBE wMedicalEven = null;

            wDatabase = DatabaseFactory.CreateDatabase(Common.CnnStringName);
            wCmd      = wDatabase.GetStoredProcCommand("MedicalEvent_g");
            wDatabase.AddInParameter(wCmd, "MedicalEventId", System.Data.DbType.Int32, pMedicalEventId);

            IDataReader reader = wDatabase.ExecuteReader(wCmd);



            #region Fill MedicalEven
            while (reader.Read())
            {
                wMedicalEven = new MedicalEventBE();

                if (reader["CreatedDate"] != DBNull.Value)
                {
                    wMedicalEven.CreatedDate = Convert.ToDateTime(reader["CreatedDate"]);
                }
                if (reader["IdTipoConsulta"] != DBNull.Value)
                {
                    wMedicalEven.IdTipoConsulta = Convert.ToInt32(reader["IdTipoConsulta"]);
                }
                wMedicalEven.Motivo             = reader["Motivo"].ToString().Trim();
                wMedicalEven.NombreEspesialidad = reader["NombreEspesialidad"].ToString().Trim();
                wMedicalEven.Evolucion          = reader["Evolucion"].ToString().Trim();

                wMedicalEven.NombreApellidoProfesional = reader["Profesional"].ToString();

                wMedicalEven.InstitucionRazonSocial = reader["RazonSocial"].ToString();
                if (reader["HealthInstitutionId"] != DBNull.Value)
                {
                    wMedicalEven.HealthInstitutionId = new Guid(reader["HealthInstitutionId"].ToString());
                }
            }
            #endregion

            #region Fill PatientMedicament View
            reader.NextResult();
            wMedicalEven.PatientMedicaments = new PatientMedicament_ViewList();
            PatientMedicament_ViewBE wPatientMedicament_View = null;
            while (reader.Read())
            {
                wPatientMedicament_View             = new PatientMedicament_ViewBE();
                wPatientMedicament_View.CreatedDate = Convert.ToDateTime(reader["CreatedDate"]);
                if (reader["DaysCount"] != DBNull.Value)
                {
                    wPatientMedicament_View.DaysCount = Convert.ToInt16(reader["DaysCount"]);
                }

                wPatientMedicament_View.Dosis                  = reader["Dosis"].ToString().Trim();
                wPatientMedicament_View.Enabled                = Convert.ToBoolean(reader["Enabled"]);
                wPatientMedicament_View.Status                 = Convert.ToInt32(reader["Status"]);
                wPatientMedicament_View.MedicamentName         = reader["MedicamentName"].ToString();
                wPatientMedicament_View.MedicamentPresentation = reader["MedicamentPresentation"].ToString();
                wPatientMedicament_View.NombreProfesional      = reader["NombreProfesional"].ToString();
                if (reader["Periodicity_hours"] != DBNull.Value)
                {
                    wPatientMedicament_View.Periodicity_hours = Convert.ToInt16(reader["Periodicity_hours"]);
                }

                wPatientMedicament_View.NombreProfesional   = reader["NombreProfesional"].ToString().Trim();
                wPatientMedicament_View.ApellidoProfesional = reader["ApellidoProfesional"].ToString().Trim();

                wMedicalEven.PatientMedicaments.Add(wPatientMedicament_View);
            }



            #endregion

            #region Fill Details
            reader.NextResult();

            wMedicalEven.MedicalEventDetail_ViewList = new MedicalEventDetail_ViewList();
            MedicalEventDetail_ViewBE wMedicalEventDetail_ViewBE = null;
            while (reader.Read())
            {
                wMedicalEventDetail_ViewBE            = new MedicalEventDetail_ViewBE();
                wMedicalEventDetail_ViewBE.Id         = Convert.ToInt32(reader["Id"]);
                wMedicalEventDetail_ViewBE.Code       = reader["Code"].ToString().Trim();
                wMedicalEventDetail_ViewBE.DetailType = Convert.ToInt16(reader["DetailType"]);
                if (reader["RelevanceType"] != DBNull.Value)
                {
                    wMedicalEventDetail_ViewBE.RelevanceTypeName = reader["RelevanceTypeName"].ToString().Trim();
                    wMedicalEventDetail_ViewBE.RelevanceType     = Convert.ToInt16(reader["RelevanceType"]);
                }
                wMedicalEventDetail_ViewBE.Desc         = reader["Desc"].ToString();
                wMedicalEventDetail_ViewBE.Observations = reader["Observations"].ToString();

                wMedicalEven.MedicalEventDetail_ViewList.Add(wMedicalEventDetail_ViewBE);
            }

            #endregion


            reader.Dispose();

            return(wMedicalEven);
        }
Beispiel #24
0
        /// <summary>
        /// Obtiene Medical event y medicamentos con full detalles.
        /// Utiliza SP: MedicalEvent_g
        /// </summary>
        /// <param name="pMedicalEventId"></param>
        /// <returns></returns>
        public static MedicalEventBE GetEvent(int pMedicalEventId)
        {

            Database wDatabase = null;
            DbCommand wCmd = null;


            MedicalEventBE wMedicalEven = null;

            wDatabase = DatabaseFactory.CreateDatabase(Common.CnnStringName);
            wCmd = wDatabase.GetStoredProcCommand("MedicalEvent_g");
            wDatabase.AddInParameter(wCmd, "MedicalEventId", System.Data.DbType.Int32, pMedicalEventId);

            IDataReader reader = wDatabase.ExecuteReader(wCmd);

           

            #region Fill MedicalEven
            while (reader.Read())
            {
                wMedicalEven = new MedicalEventBE();

                if (reader["CreatedDate"] != DBNull.Value)
                    wMedicalEven.CreatedDate = Convert.ToDateTime(reader["CreatedDate"]);
                if (reader["IdTipoConsulta"] != DBNull.Value)
                    wMedicalEven.IdTipoConsulta = Convert.ToInt32(reader["IdTipoConsulta"]);
                wMedicalEven.Motivo = reader["Motivo"].ToString().Trim();
                wMedicalEven.NombreEspesialidad = reader["NombreEspesialidad"].ToString().Trim();
                wMedicalEven.Evolucion = reader["Evolucion"].ToString().Trim();
                
                wMedicalEven.NombreApellidoProfesional = reader["Profesional"].ToString();

                wMedicalEven.InstitucionRazonSocial = reader["RazonSocial"].ToString();
                if (reader["HealthInstitutionId"] != DBNull.Value)
                    wMedicalEven.HealthInstitutionId = new Guid(reader["HealthInstitutionId"].ToString());
            }
            #endregion

            #region Fill PatientMedicament View
            reader.NextResult();
            wMedicalEven.PatientMedicaments = new PatientMedicament_ViewList();
            PatientMedicament_ViewBE wPatientMedicament_View = null;
            while (reader.Read())
            {
                wPatientMedicament_View = new PatientMedicament_ViewBE();
                wPatientMedicament_View.CreatedDate = Convert.ToDateTime(reader["CreatedDate"]);
                if (reader["DaysCount"] != DBNull.Value)
                    wPatientMedicament_View.DaysCount = Convert.ToInt16(reader["DaysCount"]);

                wPatientMedicament_View.Dosis = reader["Dosis"].ToString().Trim();
                wPatientMedicament_View.Enabled = Convert.ToBoolean(reader["Enabled"]);
                wPatientMedicament_View.Status = Convert.ToInt32(reader["Status"]);
                wPatientMedicament_View.MedicamentName = reader["MedicamentName"].ToString();
                wPatientMedicament_View.MedicamentPresentation = reader["MedicamentPresentation"].ToString();
                wPatientMedicament_View.NombreProfesional = reader["NombreProfesional"].ToString();
                if (reader["Periodicity_hours"] != DBNull.Value)
                    wPatientMedicament_View.Periodicity_hours = Convert.ToInt16(reader["Periodicity_hours"]);

                wPatientMedicament_View.NombreProfesional = reader["NombreProfesional"].ToString().Trim();
                wPatientMedicament_View.ApellidoProfesional = reader["ApellidoProfesional"].ToString().Trim();

                wMedicalEven.PatientMedicaments.Add(wPatientMedicament_View);
            }



            #endregion

            #region Fill Details
            reader.NextResult();

            wMedicalEven.MedicalEventDetail_ViewList = new MedicalEventDetail_ViewList();
            MedicalEventDetail_ViewBE wMedicalEventDetail_ViewBE = null;
            while (reader.Read())
            {
                wMedicalEventDetail_ViewBE = new MedicalEventDetail_ViewBE();
                wMedicalEventDetail_ViewBE.Id = Convert.ToInt32(reader["Id"]);
                wMedicalEventDetail_ViewBE.Code = reader["Code"].ToString().Trim();
                wMedicalEventDetail_ViewBE.DetailType = Convert.ToInt16(reader["DetailType"]);
                if (reader["RelevanceType"] != DBNull.Value)
                {
                    wMedicalEventDetail_ViewBE.RelevanceTypeName = reader["RelevanceTypeName"].ToString().Trim();
                    wMedicalEventDetail_ViewBE.RelevanceType = Convert.ToInt16(reader["RelevanceType"]);
                }
                wMedicalEventDetail_ViewBE.Desc = reader["Desc"].ToString();
                wMedicalEventDetail_ViewBE.Observations = reader["Observations"].ToString();
                
                wMedicalEven.MedicalEventDetail_ViewList.Add(wMedicalEventDetail_ViewBE);
            }

            #endregion


            reader.Dispose();

            return wMedicalEven;

        }
Beispiel #25
0
        public static int CreateMedicalEvent(MedicalEventBE medicalEvent)
        {
            CreatePatientEventReq req = new CreatePatientEventReq();

            req.BusinessData = medicalEvent;

            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();
            req.ContextInformation.AppId = ServiceCalls.CurrentHealthInstitution.HealthInstitutionId.ToString();

            CreatePatientEventRes res = req.ExecuteService<CreatePatientEventReq, CreatePatientEventRes>(req);

            if (res.Error != null)
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);

            return res.BusinessData.EventId;
        }