Exemple #1
0
        private void BtnRegistra_Click(object sender, EventArgs e)
        {
            LogicaCuenta oLCuenta = new LogicaCuenta();
            Cuenta       cuenta   = new Cuenta();

            cuenta.Nombre          = CampNombre.Text;
            cuenta.PrimerApellido  = CampPrimerApellido.Text;
            cuenta.SegundoApellido = CampSegundoApellido.Text;
            cuenta.Clave           = CampClave.Text.Trim(' ');
            cuenta.Dni             = CampDni.Text;
            cuenta.Especialidad    = CampEspecialidad.Text;
            cuenta.CodigoPro       = CampCodigo.Text;
            try
            {
                if (oLCuenta.CrearCuenta(cuenta, CampAutorizacion.Text))
                {
                    MessageBox.Show("Registro Finalizado", "Mensaje");
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Advertencia");
            }
        }
Exemple #2
0
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            LogicaCuenta oLCuenta = new LogicaCuenta();

            try
            {
                oLCuenta.ActualizarClave(Cuenta, CampNueva.Text, CampAntigua.Text);

                this.Close();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message, "Advertencia");
            }
        }
Exemple #3
0
        //update_examen_single
        private void BtnSave_Click(object sender, EventArgs e)
        {
            LogicaExamen enlace = new LogicaExamen();

            try
            {
                LogicaCuenta oLCuenta = new LogicaCuenta();
                GetTabRespuestas(examenes[idExamenSelected]);
                enlace.ValidarExamenes(examenes[idExamenSelected]);
                enlace.GuardarExamen(examenes[idExamenSelected]);
                Cuenta account = oLCuenta.ObtenerCuenta(examenes[idExamenSelected].IdCuenta);
                LabelUsuarioLast.Text = (account.Nombre + " " + account.PrimerApellido).ToUpper() + " (" + account.Dni + ")";

                ConfiguracionExamen.GetInstance().Changed = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Advertencia");
            }
        }
        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            LogicaCuenta logica     = new LogicaCuenta();
            Cuenta       cuentaTemp = new Cuenta();

            cuentaTemp.IdData          = Cuenta.IdData;
            cuentaTemp.Nombre          = CampNombre.Text;
            cuentaTemp.PrimerApellido  = CampPrimerApellido.Text;
            cuentaTemp.SegundoApellido = CampSegundoApellido.Text;
            cuentaTemp.Dni             = CampDni.Text;
            cuentaTemp.Especialidad    = CampEspecialidad.Text;
            cuentaTemp.CodigoPro       = CampCodigo.Text;
            cuentaTemp.Clave           = "asdlel23ld";
            try
            {
                logica.ActualizarCuenta(cuentaTemp);
                this.Close();
            } catch (Exception ex) {
                MessageBox.Show(ex.Message, "Advertencia");
            }
        }
Exemple #5
0
        private void RellenarExamenesEnTabla()
        {
            LogicaCuenta oLCuenta     = new LogicaCuenta();
            LogicaExamen enlaceExamen = new LogicaExamen();

            if (ordenes.Count > 0)
            {
                tabla.Clear();

                Cuenta account;

                examenesGeneral = new Dictionary <int, Examen>();
                Orden orden = ordenes[(int)ComboBoxOrden.SelectedValue];
                Dictionary <int, Examen> temp = enlaceExamen.RecuperarExamenes(orden);
                foreach (Examen ex in temp.Values)
                {
                    if (ex.Estado == Examen.EstadoExamen.Terminado)
                    {
                        this.SuspendLayout();
                        examenesGeneral.Add(ex.IdData, ex);
                        DataRow row = tabla.NewRow();
                        row[0] = ex.IdOrdenDetalle; //Orden Detalle
                        row[1] = ex.IdData;         //Examen
                        String nombrePaquete   = ControlSistemaInterno.ListaAnalisis.GetInstance().GetAnalisisById(orden.Detalle[ex.IdOrdenDetalle].IdDataPaquete).Nombre;
                        String nombrePlantilla = Plantillas.GetInstance().GetPlantilla(ex.IdPlantilla).Nombre;
                        row[2]  = (nombrePaquete == nombrePlantilla) ? nombrePaquete : (nombrePaquete + ":" + nombrePlantilla);
                        account = oLCuenta.ObtenerCuenta(ex.IdCuenta);
                        row[3]  = (account.Nombre + account.PrimerApellido).ToUpper() + " (" + account.Dni + ")";
                        row[4]  = ex.UltimaModificacion;
                        row[5]  = orden.IdData;
                        tabla.Rows.Add(row);
                        this.ResumeLayout(false);
                    }
                }

                BtnPrint.Visible = examenesGeneral.Count > 0;
            }
        }
Exemple #6
0
        private void CargarPlantillaEnPanel(Examen examen)
        {
            LogicaCuenta oLCuenta  = new LogicaCuenta();
            Plantilla    plantilla = Plantillas.GetInstance().GetPlantilla(examen.IdPlantilla);

            CheckEstado.Checked = Convert.ToBoolean((int)examen.Estado);
            LabelExamen.Text    = Plantillas.GetInstance().Coleccion()[examen.IdPlantilla].Nombre;

            Cuenta account = oLCuenta.ObtenerCuenta(examen.IdCuenta);

            LabelUsuarioLast.Text = (account.Nombre + account.PrimerApellido).ToUpper() + " (" + account.Dni + ")";


            this.SuspendLayout();
            List <ExamenEditorFila> filas = new List <ExamenEditorFila>();

            panelActual = new ExamenEditorContenedor(PanelExamen.Width - 10, PanelExamen.Height - 10);
            PanelExamen.SuspendLayout();

            ExamenEditorFila  filaForm  = null;
            ExamenEditorItem  itemForm  = null;
            ExamenEditorGrupo grupoForm = null;
            PlantillaItem     item;
            int posicion = 0;

            for (int indice = 0; indice < plantilla.Filas.Count; indice++)
            {
                if (PlantillaFila.PlantillaFilaTipo.Agrupada == plantilla.Filas[indice].Tipo)
                {
                    PlantillaFilaGrupo filaGrupo = (PlantillaFilaGrupo)plantilla.Filas[indice];
                    filaForm = new ExamenEditorFila(panelActual.Width - 10, 25);
                    filaForm.SuspendLayout();
                    filaForm.Tipo = ExamenEditorFila.TipoForm.Grupo;
                    grupoForm     = new ExamenEditorGrupo(filaForm.Width - 5, 0);
                    grupoForm.SuspendLayout();
                    grupoForm.Location = new Point(0, 0);
                    grupoForm.Nombre   = filaGrupo.Nombre;
                    List <ExamenEditorItem> items = new List <ExamenEditorItem>();
                    for (int j = 0; j < filaGrupo.Items.Count; j++)
                    {
                        item     = filaGrupo.Items[j];
                        itemForm = new ExamenEditorItem(grupoForm.Width - 20, 25, item.TieneUnidad);

                        itemForm.SuspendLayout();
                        itemForm.TabIndex = posicion;
                        posicion++;
                        itemForm.IdItem    = item.IdData;
                        itemForm.Nombre    = item.Nombre;
                        itemForm.TipoDato  = item.TipoDato;
                        itemForm.TipoCampo = item.TipoCampo;
                        if (item.TipoCampo == TipoCampo.Lista)
                        {
                            itemForm.Opciones = item.OpcionesByIndice;
                        }
                        else if (item.TipoCampo == TipoCampo.Texto)
                        {
                            filaForm.Height = 80;
                            itemForm.Height = 80;
                        }

                        if (item.TipoDato == TipoDato.Entero || item.TipoDato == TipoDato.Bool)
                        {
                            itemForm.RegEx = DiccionarioGeneral.GetInstance().Expression[(int)item.TipoDato];
                        }
                        if (item.TieneUnidad)
                        {
                            itemForm.Unidad = item.Unidad;
                        }
                        itemForm.Location = new Point(10, 20);
                        items.Add(itemForm);
                        itemForm.ResumeLayout(false);
                    }
                    grupoForm.Items = items;
                    filaForm.Grupo  = grupoForm;
                    filas.Add(filaForm);
                    grupoForm.ResumeLayout(false);
                    filaForm.ResumeLayout(false);
                }
                else
                {
                    item     = ((PlantillaFilaSimple)plantilla.Filas[indice]).Item;
                    filaForm = new ExamenEditorFila(panelActual.Width - 10, 25);
                    filaForm.SuspendLayout();
                    filaForm.Location = new Point(10, 10);
                    filaForm.Tipo     = ExamenEditorFila.TipoForm.Item;

                    itemForm = new ExamenEditorItem(filaForm.Width - 5, 25, item.TieneUnidad);

                    itemForm.SuspendLayout();
                    itemForm.Location = new Point(0, 0);
                    itemForm.IdItem   = item.IdData;
                    itemForm.Nombre   = item.Nombre;
                    itemForm.TabIndex = posicion;
                    posicion++;
                    itemForm.TipoCampo = item.TipoCampo;
                    itemForm.TipoDato  = item.TipoDato;
                    if (item.TipoCampo == TipoCampo.Lista)
                    {
                        itemForm.Opciones = item.OpcionesByIndice;
                    }
                    else if (item.TipoCampo == TipoCampo.Texto)
                    {
                        filaForm.Height = 80;
                        itemForm.Height = 80;
                    }
                    if (item.TieneUnidad)
                    {
                        itemForm.Unidad = item.Unidad;
                    }
                    filaForm.Item = itemForm;
                    filas.Add(filaForm);
                    itemForm.ResumeLayout(false);
                    filaForm.ResumeLayout(false);
                }
            }

            panelActual.Filas = filas;
            PanelExamen.Controls.Add(panelActual);
            PanelExamen.ResumeLayout(false);
            this.ResumeLayout(false);
        }
Exemple #7
0
        public FormatoImpresion CrearAllDocumento(Dictionary <int, Examen> examenes, Orden orden, float tamañoFuente, Size tamañoPag)
        {
            LogicaPaciente   oLPaciente   = new LogicaPaciente();
            Clasificador     clasificador = new Clasificador();
            FormatoImpresion formato;

            tamañoPag.Height = tamañoPag.Height / 2;
            tamañoPag.Width  = tamañoPag.Width / 2;
            Paciente paciente = oLPaciente.ObtenerPerfilPorId(orden.IdPaciente);

            int      idLastResponsable = 0;
            DateTime tempTime          = DateTime.MinValue;

            foreach (Examen ex in examenes.Values)
            {
                Area area = (Area)Plantillas.GetInstance().GetPlantilla(ex.IdPlantilla).Area;
                repositorio[area].Add(ex.IdData);
                if (ex.UltimaModificacion >= tempTime)
                {
                    tempTime          = ex.UltimaModificacion;
                    idLastResponsable = ex.IdCuenta;
                }
            }


            //CONSTRUCCION DE CABECERA
            formato = new FormatoImpresion();
            FormatoImpresionCabecera cab = new FormatoImpresionCabecera();
            Dictionary <int, FormatoImpresionPagina> paginas = new Dictionary <int, FormatoImpresionPagina>();
            LogicaCuenta oLCuenta = new LogicaCuenta();
            BLMedico     oLMedico = new BLMedico();
            Medico       med      = oLMedico.ObtenerMedico(orden.IdMedico);
            Cuenta       cu       = oLCuenta.ObtenerCuenta(idLastResponsable);
            Tiempo       tiempo   = DiccionarioGeneral.GetInstance().CalcularEdad(paciente.FechaNacimiento);

            cab.Edad     = DiccionarioGeneral.GetInstance().FormatoEdad(tiempo);
            cab.Orden    = "No " + orden.IdData;
            cab.Nombre   = CultureInfo.CurrentCulture.TextInfo.ToTitleCase((paciente.Nombre + " " + paciente.PrimerApellido + " " + paciente.SegundoApellido));
            cab.Historia = paciente.Historia;

            cab.Responsable  = CultureInfo.CurrentCulture.TextInfo.ToTitleCase((cu.Nombre + " " + cu.PrimerApellido + " " + cu.SegundoApellido + " - " + cu.Especialidad));
            cab.Doctor       = CultureInfo.CurrentCulture.TextInfo.ToTitleCase((med.Nombre + " " + med.PrimerApellido + " " + med.SegundoApellido));
            cab.UltimaRev    = (tempTime.ToShortDateString());
            formato.Cabecera = cab;

            Dictionary <int, FormatoImpresionPaginaLinea> lineas = null;
            FormatoImpresionPagina      pagina = null;
            FormatoImpresionPaginaLinea linea  = null;
            int indexLinea = 0;

            foreach (Area key in repositorio.Keys)
            {
                if (repositorio[key].Count > 0)
                {
                    pagina          = new FormatoImpresionPagina();
                    lineas          = new Dictionary <int, FormatoImpresionPaginaLinea>();
                    pagina.Detalles = lineas;
                    indexLinea      = 0;
                    //CONSTRUCCION DE PAGINAS

                    linea           = new FormatoImpresionPaginaLinea();
                    linea.Nombre    = "LABORATORIO DE " + DiccionarioGeneral.GetInstance().Area[(int)key];
                    linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.TituloArea;

                    lineas.Add(indexLinea, linea);
                    indexLinea++;


                    foreach (int idEx in repositorio[key])
                    {
                        Examen ex = examenes[idEx];
                        linea           = new FormatoImpresionPaginaLinea();
                        linea.Nombre    = Plantillas.GetInstance().GetPlantilla(ex.IdPlantilla).Nombre;
                        linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.TituloExamen;
                        lineas.Add(indexLinea, linea);
                        indexLinea++;

                        Dictionary <int, PlantillaFila> plantillaFila = Plantillas.GetInstance().GetPlantilla(ex.IdPlantilla).Filas;
                        for (int i = 0; i < plantillaFila.Count; i++)
                        {
                            switch (plantillaFila[i].Tipo)
                            {
                            case PlantillaFila.PlantillaFilaTipo.Agrupada:

                                PlantillaFilaGrupo filaGrupo = (PlantillaFilaGrupo)plantillaFila[i];
                                linea           = new FormatoImpresionPaginaLinea();
                                linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.TituloGrupo;
                                linea.Nombre    = filaGrupo.Nombre;

                                lineas.Add(indexLinea, linea);
                                indexLinea++;

                                if (filaGrupo.IdData == 4)    //Para el grupo especial Medicina // Luego se puede mejorar Agregando un elemento deseado incorporandolo
                                {
                                    foreach (PlantillaItem itemG in filaGrupo.Items.Values)
                                    {
                                        linea           = new FormatoImpresionPaginaLinea();
                                        linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.ItemSimple;
                                        linea.Nombre    = " * " + itemG.Nombre;
                                        int indice = Convert.ToInt32(ex.DetallesByItem[itemG.IdData].Campo);
                                        if (indice != 0)
                                        {
                                            linea.Resultado = itemG.OpcionesByIndice[indice];
                                            lineas.Add(indexLinea, linea);
                                            indexLinea++;
                                        }
                                    }
                                }
                                else
                                {
                                    foreach (PlantillaItem itemG in filaGrupo.Items.Values)
                                    {
                                        switch (itemG.TipoCampo)
                                        {
                                        case TipoCampo.Input:
                                            linea           = new FormatoImpresionPaginaLinea();
                                            linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.ItemSimple;
                                            linea.Nombre    = " * " + itemG.Nombre;
                                            linea.Resultado = ex.DetallesByItem[itemG.IdData].Campo.ToString();
                                            if (itemG.TieneUnidad)
                                            {
                                                linea.Resultado += itemG.Unidad;
                                            }
                                            linea.Resultado += clasificador.Clasificar(paciente, ex.IdData, ex.DetallesByItem[itemG.IdData]);
                                            lineas.Add(indexLinea, linea);
                                            indexLinea++;
                                            break;

                                        case TipoCampo.Lista:
                                            linea           = new FormatoImpresionPaginaLinea();
                                            linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.ItemSimple;
                                            linea.Nombre    = " * " + itemG.Nombre;
                                            linea.Resultado = itemG.OpcionesByIndice[Convert.ToInt32(ex.DetallesByItem[itemG.IdData].Campo)];
                                            lineas.Add(indexLinea, linea);
                                            indexLinea++;
                                            break;

                                        case TipoCampo.Texto:
                                            if (!ex.DetallesByItem[itemG.IdData].Campo.Equals(""))
                                            {
                                                linea           = new FormatoImpresionPaginaLinea();
                                                linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.ItemSimple;
                                                linea.Nombre    = " * " + itemG.Nombre;
                                                string        temp  = "";
                                                List <string> lista = ConstructorFicha.AcoplarTexto(linea.Nombre + ": " + ex.DetallesByItem[itemG.IdData].Campo.ToString(), "Futura Bk BT", 7.5f, (double)tamañoPag.Width);
                                                for (int ind = 0; ind < lista.Count; ind++)
                                                {
                                                    linea           = new FormatoImpresionPaginaLinea();
                                                    linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.ItemTexto;

                                                    if (itemG.TieneUnidad && indexLinea + 1 == lista.Count)
                                                    {
                                                        temp += itemG.Unidad;
                                                    }
                                                    linea.Resultado = lista[ind];

                                                    lineas.Add(indexLinea, linea);
                                                    indexLinea++;
                                                }
                                            }
                                            break;
                                        }
                                    }
                                }
                                break;

                            case PlantillaFila.PlantillaFilaTipo.Simple:
                                PlantillaItem item = ((PlantillaFilaSimple)plantillaFila[i]).Item;
                                switch (item.TipoCampo)
                                {
                                case TipoCampo.Input:
                                    linea           = new FormatoImpresionPaginaLinea();
                                    linea.Nombre    = item.Nombre;
                                    linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.ItemSimple;
                                    linea.Resultado = ex.DetallesByItem[item.IdData].Campo.ToString();
                                    if (item.TieneUnidad)
                                    {
                                        linea.Resultado += "  " + item.Unidad;
                                    }
                                    switch (item.TipoDato)
                                    {
                                    case TipoDato.Entero:
                                        linea.Resultado += clasificador.Clasificar(paciente, ex.IdData, ex.DetallesByItem[item.IdData]);
                                        break;

                                    case TipoDato.Decimal:
                                        linea.Resultado += clasificador.Clasificar(paciente, ex.IdData, ex.DetallesByItem[item.IdData]);
                                        break;
                                    }

                                    lineas.Add(indexLinea, linea);
                                    indexLinea++;
                                    break;

                                case TipoCampo.Lista:

                                    linea           = new FormatoImpresionPaginaLinea();
                                    linea.Nombre    = item.Nombre;
                                    linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.ItemSimple;
                                    linea.Resultado = item.OpcionesByIndice[Convert.ToInt32(ex.DetallesByItem[item.IdData].Campo)];
                                    lineas.Add(indexLinea, linea);
                                    indexLinea++;
                                    break;

                                case TipoCampo.Texto:
                                    if (!ex.DetallesByItem[item.IdData].Campo.Equals(""))
                                    {
                                        linea        = new FormatoImpresionPaginaLinea();
                                        linea.Nombre = item.Nombre;
                                        string        temp  = "";
                                        List <string> lista = ConstructorFicha.AcoplarTexto(linea.Nombre + ": " + ex.DetallesByItem[item.IdData].Campo, "Futura Bk BT", 7.5f, (double)tamañoPag.Width);

                                        for (int ind = 0; ind < lista.Count; ind++)
                                        {
                                            linea           = new FormatoImpresionPaginaLinea();
                                            linea.TipoLinea = FormatoImpresionPaginaLinea.TipoPaginaLinea.ItemTexto;

                                            if (item.TieneUnidad && ind + 1 == lista.Count)
                                            {
                                                temp += item.Unidad;
                                            }
                                            linea.Resultado = lista[ind];

                                            lineas.Add(indexLinea, linea);
                                            indexLinea++;
                                        }
                                    }
                                    break;
                                }
                                break;
                            }
                        }
                    }
                    formato.Paginas.Add(pagina);
                }
            }
            return(formato);
        }