Esempio n. 1
0
        public void CrearTarifario(int Año, bool Vigente)
        {
            Tarifario tar = null;

            DataAnalisis enlace = new DataAnalisis();

            if (!DataAnalisis.GetCheckTarifarioByAño(Año))
            {
                tar = new Tarifario();
                tar.FechaRegistro = DateTime.Now;
                tar.Año           = Año;
                tar.Vigente       = Vigente;
                Dictionary <int, TarifarioDetalle> listado = new Dictionary <int, TarifarioDetalle>();
                TarifarioDetalle tarDet;
                int i = 0;
                foreach (Analisis anal in ListaAnalisis.GetInstance().Analisis.Values)
                {
                    tarDet           = new TarifarioDetalle();
                    tarDet.IdPaquete = anal.IdData;
                    tarDet.Precio    = 0.0;
                    listado.Add(i, tarDet);
                    i++;
                }
                tar.Listado = listado;
                DataAnalisis.AddTarifario(tar);
            }
            else
            {
                throw new Exception("Ya existe un tarifario registrado para este año: " + Año);
            }
        }
Esempio n. 2
0
        private System.Data.DataTable ObtenerTablaFormatoDatosReporteEconomicoMedico(int ano, int mes, int idMedico)
        {
            BLTarifario enlace = new BLTarifario();
            Tarifario   tar    = enlace.ObtenerTarifario();

            System.Data.DataTable tablaInterna = new System.Data.DataTable();
            try
            {
                LogicaOrden enlaceOrden   = new LogicaOrden();
                List <int>  codigosExamen = new List <int>();


                Dictionary <int, Dictionary <int, int> > reporteAcumulado = enlaceOrden.ObtenerReporteAcumuladoMensual(ano, mes, idMedico);

                Dictionary <int, Dictionary <int, int> > reporteCantidad = enlaceOrden.ObtenerReporteCantidadMensual(ano, mes, idMedico);

                tablaInterna.Columns.Add("id", typeof(int));
                tablaInterna.Columns.Add("nombre", typeof(string));
                tablaInterna.Columns.Add("nroP", typeof(int));
                tablaInterna.Columns.Add("acuP", typeof(int));
                tablaInterna.Columns.Add("nroS", typeof(int));
                tablaInterna.Columns.Add("acuS", typeof(int));
                tablaInterna.Columns.Add("nroE", typeof(int));
                tablaInterna.Columns.Add("acuE", typeof(int));
                tablaInterna.Columns.Add("precioUn", typeof(double));
                tablaInterna.Columns.Add("totalMes", typeof(double));
                tablaInterna.Columns.Add("cob", typeof(int));

                foreach (int idAnalisis in ListaAnalisis.GetInstance().Coleccion.Keys)
                {
                    DataRow row = tablaInterna.NewRow();

                    row[0] = idAnalisis;
                    row[1] = ListaAnalisis.GetInstance().Analisis[idAnalisis].Nombre;

                    row[2] = (existDataInDictionary(idAnalisis, reporteCantidad[0]) ? reporteCantidad[0][idAnalisis] : 0);   //contador P
                    row[3] = (existDataInDictionary(idAnalisis, reporteAcumulado[0]) ? reporteAcumulado[0][idAnalisis] : 0); //acumulador P

                    row[4] = (existDataInDictionary(idAnalisis, reporteCantidad[1]) ? reporteCantidad[1][idAnalisis] : 0);   // Contador S
                    row[5] = (existDataInDictionary(idAnalisis, reporteAcumulado[1]) ? reporteAcumulado[1][idAnalisis] : 0); //acumulador S

                    row[6] = (existDataInDictionary(idAnalisis, reporteCantidad[2]) ? reporteCantidad[2][idAnalisis] : 0);   //Contador Ex
                    row[7] = (existDataInDictionary(idAnalisis, reporteAcumulado[2]) ? reporteAcumulado[2][idAnalisis] : 0); //acumulador Ex

                    row[8] = enlace.ObtenerTarifarioDetalle(tar, idAnalisis).Precio;
                    row[9] = (int)row[2] * enlace.ObtenerTarifarioDetalle(tar, idAnalisis).Precio;


                    row[10] = (int)row[2] + (int)row[4] + (int)row[6] + (int)row[3] + (int)row[5] + (int)row[7];

                    tablaInterna.Rows.Add(row);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(tablaInterna);
        }
Esempio n. 3
0
        public void GenerarExamenes(Orden orden)
        {
            Dictionary <int, Examen> examenesPreparados = new Dictionary <int, Examen>();
            Examen        examenTemp;
            ExamenDetalle detalle;
            int           idTemp = 0;

            foreach (OrdenDetalle detalleOrden in orden.Detalle.Values)
            {
                if (!DataExamen.ExistenExamenes(detalleOrden))
                {
                    foreach (int idPlantilla in ListaAnalisis.GetInstance().GetAnalisisById(detalleOrden.IdDataPaquete).PlantillasId)
                    {
                        //Obteniendo Items de Plantilla Id
                        Dictionary <int, PlantillaItem> items = BLPlantilla.GetAllItemsByPlantilla(idPlantilla);

                        examenTemp = new Examen();
                        //Complentado Datos Principales
                        examenTemp.Estado             = Examen.EstadoExamen.EnProceso;
                        examenTemp.FechaFinalizado    = DateTime.Now;
                        examenTemp.FechaRegistro      = DateTime.Now;
                        examenTemp.UltimaModificacion = DateTime.Now;
                        examenTemp.IdOrdenDetalle     = detalleOrden.IdData;
                        examenTemp.IdPlantilla        = idPlantilla;
                        examenTemp.IdCuenta           = SistemaControl.GetInstance().Sesion.Cuenta.IdData;
                        examenTemp.IdData             = 0;
                        examenTemp.DetallesByItem     = new Dictionary <int, ExamenDetalle>();
                        //Agregando Items a los detalles del examen
                        int indiceTemp = 0;
                        foreach (PlantillaItem item in items.Values)
                        {
                            detalle        = new ExamenDetalle();
                            detalle.IdItem = item.IdData;
                            detalle.Campo  = item.PorDefault;
                            examenTemp.DetallesByItem.Add(indiceTemp, detalle);
                            indiceTemp++;
                        }
                        examenesPreparados.Add(idTemp, examenTemp);
                        idTemp++;
                    }
                }
            }
            DataExamen.AddExamen(examenesPreparados);
        }
Esempio n. 4
0
        private System.Data.DataTable ObtenerTablaFormatoReporteEdad(int year, int month, int cobertura)
        {
            System.Data.DataTable tablaInterna = new System.Data.DataTable();
            // Configuracion de Tablas
            tablaInterna.Columns.Add("id", typeof(int));
            tablaInterna.Columns.Add("examen", typeof(string));

            for (int i = 0; i <= 19; i++)
            {
                tablaInterna.Columns.Add("c" + i, typeof(int));
            }
            for (int i = 20; i < 76; i += 5)
            {
                tablaInterna.Columns.Add("c" + i, typeof(int));
            }
            tablaInterna.Columns.Add("c80", typeof(int));

            try
            {
                LogicaOrden enlaceOrden = new LogicaOrden();

                List <int[]> general = enlaceOrden.ObtenerReporteEdad(cobertura, year, month);

                foreach (int[] fila in general)
                {
                    DataRow row = tablaInterna.NewRow();
                    row[0] = fila[0];
                    row[1] = ListaAnalisis.GetInstance().Analisis[fila[0]].Nombre;
                    for (int j = 1; j < fila.Length; j++)
                    {
                        row[j + 1] = fila[j];
                    }

                    tablaInterna.Rows.Add(row);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return(tablaInterna);
        }
Esempio n. 5
0
 public Analisis ObtenerAnalisis(int idAnalisis)
 {
     return(ListaAnalisis.GetInstance().GetAnalisisById(idAnalisis));
 }
Esempio n. 6
0
 public Dictionary <int, Analisis> ObtenerListadoAnalisis()
 {
     return(ListaAnalisis.GetInstance().Analisis);
 }