Example #1
0
        public tramasDto GetTrama(ref OperationResult objOperationResult, string _tramaId)
        {
            try
            {
                SigesoftEntitiesModel dbContext    = new SigesoftEntitiesModel();
                tramasDto             objDtoEntity = null;

                var objEntity = (from a in dbContext.tramas
                                 where a.v_TramaId == _tramaId
                                 select a).FirstOrDefault();

                if (objEntity != null)
                {
                    objDtoEntity = tramasAssembler.ToDTO(objEntity);
                }

                objOperationResult.Success = 1;
                return(objDtoEntity);
            }
            catch (Exception ex)
            {
                objOperationResult.Success          = 0;
                objOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
                return(null);
            }
        }
Example #2
0
        public void AddTramas(ref OperationResult pobjOperationResult, tramasDto pobjDtoEntity, List <string> ClientSession)
        {
            string NewId = "(No generado)";

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();
                tramas objEntity = tramasAssembler.ToEntity(pobjDtoEntity);

                objEntity.d_InsertDate   = DateTime.Now;
                objEntity.i_InsertUserId = Int32.Parse(ClientSession[2]);
                objEntity.i_IsDeleted    = 0;
                // Autogeneramos el Pk de la tabla
                int intNodeId = int.Parse(ClientSession[0]);
                NewId = Common.Utils.GetNewId(intNodeId, Utils.GetNextSecuentialId(intNodeId, 360), "TR");;
                objEntity.v_TramaId = NewId;

                dbContext.AddTotramas(objEntity);
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "TRAMA", "v_TramaId=" + NewId.ToString(), Success.Ok, null);
                return;
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.CREACION, "TRAMA", "v_TramaId=" + NewId.ToString(), Success.Failed, pobjOperationResult.ExceptionMessage);
                return;
            }
        }
Example #3
0
        public void UpdateTrama(ref OperationResult pobjOperationResult, tramasDto pobjDtoEntity, List <string> ClientSession)
        {
            //mon.IsActive = true;

            try
            {
                SigesoftEntitiesModel dbContext = new SigesoftEntitiesModel();

                // Obtener la entidad fuente
                var objEntitySource = (from a in dbContext.tramas
                                       where a.v_TramaId == pobjDtoEntity.v_TramaId
                                       select a).FirstOrDefault();

                // Crear la entidad con los datos actualizados
                pobjDtoEntity.i_IsDeleted    = 0;
                pobjDtoEntity.d_UpdateDate   = DateTime.Now;
                pobjDtoEntity.i_UpdateUserId = Int32.Parse(ClientSession[2]);
                tramas objEntity = tramasAssembler.ToEntity(pobjDtoEntity);

                // Copiar los valores desde la entidad actualizada a la Entidad Fuente
                dbContext.tramas.ApplyCurrentValues(objEntity);

                // Guardar los cambios
                dbContext.SaveChanges();

                pobjOperationResult.Success = 1;
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "TRAMA", "v_TramaId=" + objEntity.v_TramaId.ToString(), Success.Ok, null);

                return;
            }
            catch (Exception ex)
            {
                pobjOperationResult.Success          = 0;
                pobjOperationResult.ExceptionMessage = Common.Utils.ExceptionFormatter(ex);
                // Llenar entidad Log
                LogBL.SaveLog(ClientSession[0], ClientSession[1], ClientSession[2], LogEventType.ACTUALIZACION, "TRAMA", "v_TramaId=" + pobjDtoEntity.v_TramaId.ToString(), Success.Failed, pobjOperationResult.ExceptionMessage);

                return;
            }
        }
        private void btnGrabar_Click(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();
            Cie10MF         _cie10MF           = new Cie10MF();

            //TramasBL _tramasBL = new TramasBL();
            //var cie10 = txtCie10.Text;
            //if (int.Parse(cbGenero.SelectedValue.ToString()) == (int)Gender.MASCULINO)
            //{
            //    var cie10Masculino = _cie10MF.Femeninos.ToList().Find(x => x == cie10);
            //    if (cie10Masculino != null)
            //    {
            //        if (cie10Masculino.Length > 0)
            //        {
            //            MessageBox.Show("El diagnóstico elegido pertenece solo al género FEMENINO.", "VALIDACIÓN", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            //            return;
            //        }
            //    }

            //}
            //else if (int.Parse(cbGenero.SelectedValue.ToString()) == (int)Gender.FEMENINO)
            //{
            //    var cie10Femenino = _cie10MF.Masculinos.ToList().Find(x => x == cie10);
            //    if (cie10Femenino != null)
            //    {
            //        if (cie10Femenino.Length > 0)
            //        {
            //            MessageBox.Show("El diagnóstico elegido pertenece solo al género MASCULINO.", "VALIDACIÓN", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            //            return;
            //        }
            //    }

            //}

            _tramaDto = new tramasDto();
            if (_mode == "New")
            {
                bool result = true;
                if (_tabName == "Ambulatorio" || _tabName == "Emergencia" || _tabName == "Hospitalización")
                {
                    //
                    var cie10 = txtCie10.Text;
                    if (int.Parse(cbGenero.SelectedValue.ToString()) == (int)Gender.MASCULINO)
                    {
                        var cie10Masculino = _cie10MF.Femeninos.ToList().Find(x => x == cie10);
                        if (cie10Masculino != null)
                        {
                            if (cie10Masculino.Length > 0)
                            {
                                MessageBox.Show("El diagnóstico elegido pertenece solo al género FEMENINO.", "VALIDACIÓN", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                return;
                            }
                        }
                    }
                    else if (int.Parse(cbGenero.SelectedValue.ToString()) == (int)Gender.FEMENINO)
                    {
                        var cie10Femenino = _cie10MF.Masculinos.ToList().Find(x => x == cie10);
                        if (cie10Femenino != null)
                        {
                            if (cie10Femenino.Length > 0)
                            {
                                MessageBox.Show("El diagnóstico elegido pertenece solo al género MASCULINO.", "VALIDACIÓN", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                return;
                            }
                        }
                    }
                    //
                    _tramaDto.v_TipoRegistro = _tabName;
                    _tramaDto.d_FechaIngreso = dtpFechaIngreso.Value;
                    if (cbGenero.SelectedValue.ToString() == "-1" || cbRangoEdad.SelectedValue.ToString() == "-1" || cbDx.Text == "")
                    {
                        MessageBox.Show("Completar los campos vacíos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    _tramaDto.i_Genero       = int.Parse(cbGenero.SelectedValue.ToString());
                    _tramaDto.i_GrupoEtario  = int.Parse(cbRangoEdad.SelectedValue.ToString());
                    _tramaDto.v_DiseasesName = cbDx.Text;
                    _tramaDto.v_CIE10Id      = txtCie10.Text;
                    if (_tabName == "Hospitalización")
                    {
                        if (cbUPS.Text == "" || cbFallecido.SelectedValue.ToString() == "-1")
                        {
                            MessageBox.Show("No dejar campos vacíos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            result = false;
                            return;
                        }
                        if (result == true)
                        {
                            _tramaDto.d_FechaAlta     = dtpFechaAlta.Value;
                            _tramaDto.i_UPS           = int.Parse(txtUpsId_1.Text);
                            _tramaDto.i_Procedimiento = int.Parse(cbFallecido.SelectedValue.ToString());//Cambiar procedimiento por fallecido
                        }
                    }
                    _tramasBL.AddTramas(ref objOperationResult, _tramaDto, Globals.ClientSession.GetAsList());
                }
                else if (_tabName == "Procedimientos / Cirugía")
                {
                    _tramaDto.v_TipoRegistro = _tabName;
                    _tramaDto.d_FechaIngreso = dtpFechaProced.Value;
                    _tramaDto.i_UPS          = int.Parse(txtUpsId_2.Text);
                    if (cbProcedimiento.Text == "" || cbEspecialidades.Text == "")
                    {
                        MessageBox.Show("No dejar campos vacíos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    _tramaDto.i_Programacion = int.Parse(cbProgramacion.SelectedValue.ToString());
                    _tramaDto.i_TipoCirugia  = int.Parse(cbTipoCirugia.SelectedValue.ToString());
                    if (txtHrsProg.Text != "")
                    {
                        _tramaDto.i_HorasProg  = int.Parse(txtHrsProg.Text);
                        _tramaDto.i_HorasEfect = int.Parse(txtHrsEfect.Text);
                        _tramaDto.i_HorasActo  = int.Parse(txtHrsAct.Text);
                    }

                    _tramaDto.i_Procedimiento = int.Parse(txtProcedId.Text);
                    _tramasBL.AddTramas(ref objOperationResult, _tramaDto, Globals.ClientSession.GetAsList());
                }
                else if (_tabName == "Partos")
                {
                    _tramaDto.v_TipoRegistro = _tabName;
                    _tramaDto.d_FechaIngreso = dtpFechaParto.Value;
                    if (cbTipoParto.SelectedValue.ToString() == "-1" || cbTipoNacimiento.SelectedValue.ToString() == "-1" || cbTipoComplicacion.SelectedValue.ToString() == "-1")
                    {
                        MessageBox.Show("No dejar campos vacíos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    _tramaDto.i_TipoParto        = int.Parse(cbTipoParto.SelectedValue.ToString());
                    _tramaDto.i_TipoNacimiento   = int.Parse(cbTipoNacimiento.SelectedValue.ToString());
                    _tramaDto.i_TipoComplicacion = int.Parse(cbTipoComplicacion.SelectedValue.ToString());
                    _tramasBL.AddTramas(ref objOperationResult, _tramaDto, Globals.ClientSession.GetAsList());
                }
                MessageBox.Show("Registro Exitoso", "Validación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else if (_mode == "Edit")
            {
                var _getTrama = _tramasBL.GetTrama(ref objOperationResult, _tramaId);
                if (_tabName == "Ambulatorio" || _tabName == "Emergencia" || _tabName == "Hospitalización")
                {
                    //
                    var cie10 = txtCie10.Text;
                    if (int.Parse(cbGenero.SelectedValue.ToString()) == (int)Gender.MASCULINO)
                    {
                        var cie10Masculino = _cie10MF.Femeninos.ToList().Find(x => x == cie10);
                        if (cie10Masculino != null)
                        {
                            if (cie10Masculino.Length > 0)
                            {
                                MessageBox.Show("El diagnóstico elegido pertenece solo al género FEMENINO.", "VALIDACIÓN", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                return;
                            }
                        }
                    }
                    else if (int.Parse(cbGenero.SelectedValue.ToString()) == (int)Gender.FEMENINO)
                    {
                        var cie10Femenino = _cie10MF.Masculinos.ToList().Find(x => x == cie10);
                        if (cie10Femenino != null)
                        {
                            if (cie10Femenino.Length > 0)
                            {
                                MessageBox.Show("El diagnóstico elegido pertenece solo al género MASCULINO.", "VALIDACIÓN", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                return;
                            }
                        }
                    }
                    //

                    bool result = true;
                    _tramaDto.v_TramaId      = _tramaId;
                    _tramaDto.v_TipoRegistro = _tabName;
                    _tramaDto.d_FechaIngreso = dtpFechaIngreso.Value;
                    if (cbGenero.SelectedValue.ToString() == "-1" || cbRangoEdad.SelectedValue.ToString() == "-1" || cbDx.Text == "")
                    {
                        MessageBox.Show("Completar los campos vacíos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    _tramaDto.i_Genero       = int.Parse(cbGenero.SelectedValue.ToString());
                    _tramaDto.i_GrupoEtario  = int.Parse(cbRangoEdad.SelectedValue.ToString());
                    _tramaDto.v_DiseasesName = cbDx.Text;
                    _tramaDto.v_CIE10Id      = txtCie10.Text;
                    if (_tabName == "Hospitalización")
                    {
                        if (cbUPS.Text == "" || cbFallecido.SelectedValue.ToString() == "-1")
                        {
                            MessageBox.Show("No dejar campos vacíos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            result = false;
                            return;
                        }
                        if (result == true)
                        {
                            _tramaDto.d_FechaAlta     = dtpFechaAlta.Value;
                            _tramaDto.i_UPS           = int.Parse(txtUpsId_1.Text);
                            _tramaDto.i_Procedimiento = int.Parse(cbFallecido.SelectedValue.ToString());//Cambiar procedimiento por fallecido
                        }
                    }
                    _tramaDto.d_InsertDate   = _getTrama.d_InsertDate.Value;
                    _tramaDto.i_InsertUserId = _getTrama.i_InsertUserId;
                    _tramasBL.UpdateTrama(ref objOperationResult, _tramaDto, Globals.ClientSession.GetAsList());
                }
                else if (_tabName == "Procedimientos / Cirugía")
                {
                    _tramaDto.v_TramaId      = _tramaId;
                    _tramaDto.v_TipoRegistro = _tabName;
                    _tramaDto.d_FechaIngreso = dtpFechaProced.Value;
                    _tramaDto.i_UPS          = int.Parse(txtUpsId_2.Text);
                    if (cbProcedimiento.Text == "" || cbEspecialidades.Text == "")
                    {
                        MessageBox.Show("No dejar campos vacíos", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    _tramaDto.i_Programacion = int.Parse(cbProgramacion.SelectedValue.ToString());
                    _tramaDto.i_TipoCirugia  = int.Parse(cbTipoCirugia.SelectedValue.ToString());
                    if (txtHrsProg.Text != "")
                    {
                        _tramaDto.i_HorasProg  = int.Parse(txtHrsProg.Text);
                        _tramaDto.i_HorasEfect = int.Parse(txtHrsEfect.Text);
                        _tramaDto.i_HorasActo  = int.Parse(txtHrsAct.Text);
                    }

                    _tramaDto.i_Procedimiento = int.Parse(txtProcedId.Text);

                    _tramaDto.d_InsertDate   = _getTrama.d_InsertDate.Value;
                    _tramaDto.i_InsertUserId = _getTrama.i_InsertUserId;
                    _tramasBL.UpdateTrama(ref objOperationResult, _tramaDto, Globals.ClientSession.GetAsList());
                }
                else if (_tabName == "Partos")
                {
                    _tramaDto.v_TramaId          = _tramaId;
                    _tramaDto.v_TipoRegistro     = _tabName;
                    _tramaDto.d_FechaIngreso     = dtpFechaParto.Value;
                    _tramaDto.i_TipoParto        = int.Parse(cbTipoParto.SelectedValue.ToString());
                    _tramaDto.i_TipoNacimiento   = int.Parse(cbTipoNacimiento.SelectedValue.ToString());
                    _tramaDto.i_TipoComplicacion = int.Parse(cbTipoComplicacion.SelectedValue.ToString());

                    _tramaDto.d_InsertDate   = _getTrama.d_InsertDate.Value;
                    _tramaDto.i_InsertUserId = _getTrama.i_InsertUserId;
                    _tramasBL.UpdateTrama(ref objOperationResult, _tramaDto, Globals.ClientSession.GetAsList());
                }
                MessageBox.Show("Actualización Exitosa", "Validación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            //frmTramasSusalud frmTramas = new frmTramasSusalud();
            //frmTramas.btnFilter_Click(sender, e);
        }
        private void frmRegistroEmAmHos_Load(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();

            if (_mode == "New")
            {
                #region Carga Groupbox
                if (_tabName == "Ambulatorio" || _tabName == "Emergencia")
                {
                    uegbAmb.Visible           = true;
                    uegbHospi.Visible         = false;
                    uegbProcedimiento.Visible = false;
                    uegbParto.Visible         = false;
                    uegbCirugia.Visible       = false;
                    #region Lista de Diagnosticos

                    cbDx.Select();

                    cbDx.DataSource            = lista;
                    cbDx.DisplayMember         = "v_Name";
                    cbDx.ValueMember           = "v_CIE10Id";
                    cbDx.AutoCompleteMode      = Infragistics.Win.AutoCompleteMode.Suggest;
                    cbDx.AutoSuggestFilterMode = Infragistics.Win.AutoSuggestFilterMode.Contains;
                    this.cbDx.DropDownWidth    = 550;
                    cbDx.DisplayLayout.Bands[0].Columns[0].Width = 400;
                    cbDx.DisplayLayout.Bands[0].Columns[1].Width = 40;
                    #endregion
                    Utils.LoadDropDownList(cbGenero, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 100, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbRangoEdad, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 347, null), DropDownListAction.Select);
                    dtpFechaIngreso.Value = _fechaload;
                    cbGenero.Text         = _genero;
                    cbRangoEdad.Text      = _edad;
                }
                else if (_tabName == "Hospitalización")
                {
                    uegbAmb.Visible           = true;
                    uegbHospi.Visible         = true;
                    uegbProcedimiento.Visible = false;
                    uegbParto.Visible         = false;
                    uegbCirugia.Visible       = false;
                    #region Lista de Diagnosticos

                    cbDx.Select();
                    cbDx.DataSource            = lista;
                    cbDx.DisplayMember         = "v_Name";
                    cbDx.ValueMember           = "v_CIE10Id";
                    cbDx.AutoCompleteMode      = Infragistics.Win.AutoCompleteMode.Suggest;
                    cbDx.AutoSuggestFilterMode = Infragistics.Win.AutoSuggestFilterMode.Contains;
                    this.cbDx.DropDownWidth    = 550;
                    cbDx.DisplayLayout.Bands[0].Columns[0].Width = 400;
                    cbDx.DisplayLayout.Bands[0].Columns[1].Width = 40;
                    #endregion
                    Utils.LoadDropDownList(cbGenero, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 100, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbRangoEdad, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 347, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbFallecido, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 111, null), DropDownListAction.Select);
                    #region Lista de UPS - Especialidades
                    cbUPS.Select();

                    cbUPS.DataSource            = listaUps;
                    cbUPS.DisplayMember         = "v_Value1";
                    cbUPS.ValueMember           = "i_ParameterId";
                    cbUPS.AutoCompleteMode      = Infragistics.Win.AutoCompleteMode.Suggest;
                    cbUPS.AutoSuggestFilterMode = Infragistics.Win.AutoSuggestFilterMode.Contains;
                    this.cbUPS.DropDownWidth    = 590;
                    cbUPS.DisplayLayout.Bands[0].Columns[0].Width = 550;
                    cbUPS.DisplayLayout.Bands[0].Columns[1].Width = 40;

                    #endregion
                    dtpFechaIngreso.Value = _fechaload;
                    cbGenero.Text         = _genero;
                    cbRangoEdad.Text      = _edad;
                }
                else if (_tabName == "Procedimientos / Cirugía")
                {
                    uegbAmb.Visible            = false;
                    uegbHospi.Visible          = false;
                    uegbProcedimiento.Visible  = true;
                    uegbParto.Visible          = false;
                    uegbCirugia.Visible        = true;
                    uegbProcedimiento.Location = new Point(7, 4);
                    uegbCirugia.Location       = new Point(9, 135);
                    #region Lista de Procedimientos

                    cbProcedimiento.Select();

                    cbProcedimiento.DataSource            = listaproc;
                    cbProcedimiento.DisplayMember         = "v_Value1";
                    cbProcedimiento.ValueMember           = "i_ParameterId";
                    cbProcedimiento.AutoCompleteMode      = Infragistics.Win.AutoCompleteMode.Suggest;
                    cbProcedimiento.AutoSuggestFilterMode = Infragistics.Win.AutoSuggestFilterMode.Contains;
                    this.cbProcedimiento.DropDownWidth    = 590;
                    cbProcedimiento.DisplayLayout.Bands[0].Columns[0].Width = 550;
                    cbProcedimiento.DisplayLayout.Bands[0].Columns[1].Width = 40;
                    #endregion
                    //combo especialidades
                    cbEspecialidades.Select();

                    cbEspecialidades.DataSource            = listaUps;
                    cbEspecialidades.DisplayMember         = "v_Value1";
                    cbEspecialidades.ValueMember           = "i_ParameterId";
                    cbEspecialidades.AutoCompleteMode      = Infragistics.Win.AutoCompleteMode.Suggest;
                    cbEspecialidades.AutoSuggestFilterMode = Infragistics.Win.AutoSuggestFilterMode.Contains;
                    this.cbEspecialidades.DropDownWidth    = 590;
                    cbEspecialidades.DisplayLayout.Bands[0].Columns[0].Width = 550;
                    cbEspecialidades.DisplayLayout.Bands[0].Columns[1].Width = 40;
                    Utils.LoadDropDownList(cbProgramacion, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 353, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbTipoCirugia, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 354, null), DropDownListAction.Select);
                    dtpFechaIngreso.Value = _fechaload;
                    cbGenero.Text         = _genero;
                    cbRangoEdad.Text      = _edad;
                }
                else if (_tabName == "Partos")
                {
                    uegbAmb.Visible           = false;
                    uegbHospi.Visible         = false;
                    uegbProcedimiento.Visible = false;
                    uegbParto.Visible         = true;
                    uegbCirugia.Visible       = false;
                    uegbParto.Location        = new Point(7, 4);
                    Utils.LoadDropDownList(cbTipoParto, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 350, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbTipoNacimiento, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 351, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbTipoComplicacion, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 352, null), DropDownListAction.Select);
                    dtpFechaIngreso.Value = _fechaload;
                    cbGenero.Text         = _genero;
                    cbRangoEdad.Text      = _edad;
                }

                #endregion
            }
            else if (_mode == "Edit")
            {
                _tramaDto = _tramasBL.GetTrama(ref objOperationResult, _tramaId);

                #region Carga Groupbox
                if (_tabName == "Ambulatorio" || _tabName == "Emergencia")
                {
                    uegbAmb.Visible           = true;
                    uegbHospi.Visible         = false;
                    uegbProcedimiento.Visible = false;
                    uegbParto.Visible         = false;
                    uegbCirugia.Visible       = false;

                    Utils.LoadDropDownList(cbGenero, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 100, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbRangoEdad, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 347, null), DropDownListAction.Select);

                    dtpFechaIngreso.Value     = _tramaDto.d_FechaIngreso.Value;
                    cbGenero.SelectedValue    = _tramaDto.i_Genero.ToString();
                    cbRangoEdad.SelectedValue = _tramaDto.i_GrupoEtario.ToString();

                    #region Lista de Diagnosticos
                    cbDx.DataSource            = lista;
                    cbDx.DisplayMember         = "v_Name";
                    cbDx.ValueMember           = "v_CIE10Id";
                    cbDx.AutoCompleteMode      = Infragistics.Win.AutoCompleteMode.Suggest;
                    cbDx.AutoSuggestFilterMode = Infragistics.Win.AutoSuggestFilterMode.Contains;
                    this.cbDx.DropDownWidth    = 550;
                    cbDx.DisplayLayout.Bands[0].Columns[0].Width = 400;
                    cbDx.DisplayLayout.Bands[0].Columns[1].Width = 40;
                    if (!string.IsNullOrEmpty(_tramaDto.v_DiseasesName))
                    {
                        cbDx.Text = _tramaDto.v_DiseasesName;
                    }
                    #endregion

                    txtCie10.Text = _tramaDto.v_CIE10Id;
                }
                else if (_tabName == "Hospitalización")
                {
                    uegbAmb.Visible           = true;
                    uegbHospi.Visible         = true;
                    uegbProcedimiento.Visible = false;
                    uegbParto.Visible         = false;
                    uegbCirugia.Visible       = false;

                    Utils.LoadDropDownList(cbGenero, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 100, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbRangoEdad, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 347, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbFallecido, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 111, null), DropDownListAction.Select);

                    dtpFechaIngreso.Value     = _tramaDto.d_FechaIngreso.Value;
                    cbGenero.SelectedValue    = _tramaDto.i_Genero.ToString();
                    cbRangoEdad.SelectedValue = _tramaDto.i_GrupoEtario.ToString();
                    cbFallecido.SelectedValue = _tramaDto.i_Procedimiento.ToString();
                    txtUpsId_1.Text           = _tramaDto.i_UPS.ToString();
                    dtpFechaAlta.Value        = _tramaDto.d_FechaAlta.Value;

                    #region Lista de Diagnosticos

                    cbDx.DataSource            = lista;
                    cbDx.DisplayMember         = "v_Name";
                    cbDx.ValueMember           = "v_CIE10Id";
                    cbDx.AutoCompleteMode      = Infragistics.Win.AutoCompleteMode.Suggest;
                    cbDx.AutoSuggestFilterMode = Infragistics.Win.AutoSuggestFilterMode.Contains;
                    this.cbDx.DropDownWidth    = 550;
                    cbDx.DisplayLayout.Bands[0].Columns[0].Width = 400;
                    cbDx.DisplayLayout.Bands[0].Columns[1].Width = 40;
                    if (!string.IsNullOrEmpty(_tramaDto.v_DiseasesName))
                    {
                        cbDx.Text = _tramaDto.v_DiseasesName;
                    }
                    #endregion
                    txtCie10.Text = _tramaDto.v_CIE10Id;

                    #region Lista de UPS - Especialidades
                    //cbUPS.Select();

                    cbUPS.DataSource            = listaUps;
                    cbUPS.DisplayMember         = "v_Value1";
                    cbUPS.ValueMember           = "i_ParameterId";
                    cbUPS.AutoCompleteMode      = Infragistics.Win.AutoCompleteMode.Suggest;
                    cbUPS.AutoSuggestFilterMode = Infragistics.Win.AutoSuggestFilterMode.Contains;
                    this.cbUPS.DropDownWidth    = 590;
                    cbUPS.DisplayLayout.Bands[0].Columns[0].Width = 550;
                    cbUPS.DisplayLayout.Bands[0].Columns[1].Width = 40;
                    if (!string.IsNullOrEmpty(_tramaDto.i_UPS.ToString()))
                    {
                        cbUPS.Text = _tramaDto.i_UPS.ToString();
                    }
                    #endregion
                }
                else if (_tabName == "Procedimientos / Cirugía")
                {
                    uegbAmb.Visible            = false;
                    uegbHospi.Visible          = false;
                    uegbProcedimiento.Visible  = true;
                    uegbParto.Visible          = false;
                    uegbCirugia.Visible        = true;
                    uegbProcedimiento.Location = new Point(7, 4);
                    uegbCirugia.Location       = new Point(9, 135);

                    Utils.LoadDropDownList(cbProgramacion, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 353, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbTipoCirugia, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 354, null), DropDownListAction.Select);

                    dtpFechaProced.Value         = _tramaDto.d_FechaIngreso.Value;
                    txtUpsId_2.Text              = _tramaDto.i_UPS.ToString();
                    txtProcedId.Text             = _tramaDto.i_Procedimiento.ToString();
                    cbProgramacion.SelectedValue = _tramaDto.i_Programacion.ToString();
                    cbTipoCirugia.SelectedValue  = _tramaDto.i_TipoCirugia.ToString();
                    txtHrsProg.Text              = _tramaDto.i_HorasProg.ToString();
                    txtHrsEfect.Text             = _tramaDto.i_HorasEfect.ToString();
                    txtHrsAct.Text = _tramaDto.i_HorasActo.ToString();

                    #region Lista de Procedimientos

                    cbProcedimiento.DataSource            = listaproc;
                    cbProcedimiento.DisplayMember         = "v_Value1";
                    cbProcedimiento.ValueMember           = "i_ParameterId";
                    cbProcedimiento.AutoCompleteMode      = Infragistics.Win.AutoCompleteMode.Suggest;
                    cbProcedimiento.AutoSuggestFilterMode = Infragistics.Win.AutoSuggestFilterMode.Contains;
                    this.cbProcedimiento.DropDownWidth    = 590;
                    cbProcedimiento.DisplayLayout.Bands[0].Columns[0].Width = 550;
                    cbProcedimiento.DisplayLayout.Bands[0].Columns[1].Width = 40;
                    if (!string.IsNullOrEmpty(_tramaDto.i_Procedimiento.ToString()))
                    {
                        cbProcedimiento.Text = _tramaDto.i_Procedimiento.ToString();
                    }
                    #endregion
                    //combo especialidades
                    //cbEspecialidades.Select();

                    cbEspecialidades.DataSource            = listaUps;
                    cbEspecialidades.DisplayMember         = "v_Value1";
                    cbEspecialidades.ValueMember           = "i_ParameterId";
                    cbEspecialidades.AutoCompleteMode      = Infragistics.Win.AutoCompleteMode.Suggest;
                    cbEspecialidades.AutoSuggestFilterMode = Infragistics.Win.AutoSuggestFilterMode.Contains;
                    this.cbEspecialidades.DropDownWidth    = 590;
                    cbEspecialidades.DisplayLayout.Bands[0].Columns[0].Width = 550;
                    cbEspecialidades.DisplayLayout.Bands[0].Columns[1].Width = 40;
                    if (!string.IsNullOrEmpty(_tramaDto.i_UPS.ToString()))
                    {
                        cbEspecialidades.Text = _tramaDto.i_UPS.ToString();
                    }
                }
                else if (_tabName == "Partos")
                {
                    uegbAmb.Visible           = false;
                    uegbHospi.Visible         = false;
                    uegbProcedimiento.Visible = false;
                    uegbParto.Visible         = true;
                    uegbCirugia.Visible       = false;
                    uegbParto.Location        = new Point(7, 4);

                    Utils.LoadDropDownList(cbTipoParto, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 350, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbTipoNacimiento, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 351, null), DropDownListAction.Select);
                    Utils.LoadDropDownList(cbTipoComplicacion, "Value1", "Id", BLL.Utils.GetSystemParameterForCombo(ref objOperationResult, 352, null), DropDownListAction.Select);

                    dtpFechaParto.Value              = _tramaDto.d_FechaIngreso.Value;
                    cbTipoParto.SelectedValue        = _tramaDto.i_TipoParto.ToString();
                    cbTipoNacimiento.SelectedValue   = _tramaDto.i_TipoNacimiento.ToString();
                    cbTipoComplicacion.SelectedValue = _tramaDto.i_TipoComplicacion.ToString();
                }
                #endregion
            }
        }