Ejemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     tiempo = new Timer();
     tiempo.Tick += new EventHandler(eventoReloj);
     tiempo.Enabled = true;
     miConexion = new Conexion();
     miGestor = new GestorTurno();
 }
Ejemplo n.º 2
0
 public static void modificarNroOrden(string idturno, string autorizacion)
 {
     try
     {
         GestorTurno gestorTurno = new GestorTurno();
         gestorTurno.ModificarNroOrden(idturno, autorizacion);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Ejemplo n.º 3
0
 public static void modificarEstadoEnTurno(string idturno, string estado)
 {
     try
     {
         GestorTurno gestorTurno = new GestorTurno();
         gestorTurno.ModificarEstadoEnTurno(idturno, estado);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Ejemplo n.º 4
0
 public static string traeEstados()
 {
     try
     {
         GestorTurno gestorTurno = new GestorTurno();
         DataTable   estados     = gestorTurno.TraeEstados();
         string      col         = JsonConvert.SerializeObject(estados);
         return(col);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Ejemplo n.º 5
0
        public static string traerTurnosInformes(string idSucursal, string idObraSocial, string fechaDesde, string fechaHasta)
        {
            try
            {
                GestorTurno gestorTurno = new GestorTurno();
                DataTable   dt          = gestorTurno.TraerTurnosInformes(idSucursal, idObraSocial, fechaDesde, fechaHasta);
                string      col         = JsonConvert.SerializeObject(dt);

                return(col);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Ejemplo n.º 6
0
        public static bool verificarTurnoDisponible(string sucursalId, string especialidadId, string profesionalId, string diaTurno, string hora)
        {
            try
            {
                Turno       turno       = new Turno();
                GestorTurno gestorTurno = new GestorTurno();

                if (!string.IsNullOrEmpty(sucursalId))
                {
                    Centro centro = new Centro();
                    centro.IdCentro = Convert.ToInt32(sucursalId);
                    turno.Centro    = centro;
                }

                if (!string.IsNullOrEmpty(especialidadId))
                {
                    Especialidad especialidad = new Especialidad();
                    especialidad.IdEspecialidad = Convert.ToInt32(especialidadId);
                    turno.Especialidad          = especialidad;
                }

                if (!string.IsNullOrEmpty(profesionalId))
                {
                    Profesional prof = new Profesional();
                    prof.IdProfesional = Convert.ToInt32(profesionalId);
                    turno.Profesional  = prof;
                }

                if (!string.IsNullOrEmpty(diaTurno))
                {
                    turno.FechaTurno = Convert.ToDateTime(diaTurno);
                }

                if (!string.IsNullOrEmpty(hora))
                {
                    TimeSpan ts = TimeSpan.Parse(hora);
                    turno.HoraDesde = ts;
                }

                bool validacion = gestorTurno.VerificarTurnoDisponible(turno);

                return(validacion);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Ejemplo n.º 7
0
        public static string traerTurnos(string idProfesional, string dia)
        {
            try
            {
                DateTime    diaTurno = DateTime.Parse(dia);
                GestorTurno gTurno   = new GestorTurno();
                DataTable   dt       = gTurno.TraerTurnos(idProfesional, diaTurno);
                string      col      = JsonConvert.SerializeObject(dt);

                return(col);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Ejemplo n.º 8
0
        public static string traerTurnosDelDia(string idCentro, string dia)
        {
            try
            {
                string result = "ok";

                GestorTurno gTurnos = new GestorTurno();
                DataTable   dt      = gTurnos.TraerTurnosDelDia(idCentro, dia);
                string      col     = JsonConvert.SerializeObject(dt);

                return(col);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Ejemplo n.º 9
0
        public static string agregarTurnoEditarTratamiento(string objTurnoTratamiento)
        {
            try
            {
                JObject obj = JObject.Parse(objTurnoTratamiento);

                PlanTratamiento tratamiento = new PlanTratamiento();
                Usuario         usuario     = (Usuario)HttpContext.Current.Session["TURNERO.Usuario"];
                tratamiento.UsuarioMod    = usuario.IdUsuario;
                tratamiento.FechaMod      = DateTime.Now;
                tratamiento.IdTratamiento = Convert.ToInt32(obj.GetValue("p_idTratamiento").ToString());

                Turno turno = new Turno();
                turno.Paciente                  = new Paciente();
                turno.Paciente.IdPaciente       = Convert.ToInt32(obj.GetValue("p_idPaciente").ToString());
                turno.Profesional               = new Profesional();
                turno.Profesional.IdProfesional = Convert.ToInt32(obj.GetValue("p_idProfesional").ToString());
                turno.ObraSocial                = new ObraSocial();
                turno.ObraSocial.IdObraSocial   = Convert.ToInt32(obj.GetValue("p_idObraSocial").ToString());
                turno.ObraSocial.IdPlanObra     = Convert.ToInt32(obj.GetValue("p_idPlanObra").ToString());
                turno.NroAfiliado               = obj.GetValue("p_nroAfiliado").ToString();
                turno.NroAutorizacionObra       = obj.GetValue("p_nroAutorizacion").ToString();
                turno.Centro                      = new Centro();
                turno.Centro.IdCentro             = Convert.ToInt32(obj.GetValue("p_idSucursal").ToString());
                turno.Especialidad                = new Especialidad();
                turno.Especialidad.IdEspecialidad = Convert.ToInt32(obj.GetValue("p_idEspecialidad").ToString());
                turno.FechaTurno                  = Convert.ToDateTime(obj.GetValue("p_DiaTurno").ToString());
                TimeSpan ts = TimeSpan.Parse(obj.GetValue("p_HoraTurno").ToString());
                turno.HoraDesde          = ts;
                turno.Id_PlanTratamiento = Convert.ToInt32(obj.GetValue("p_idTratamiento").ToString());

                turno.UsuarioAlta = usuario.IdUsuario;
                turno.FechaAlta   = DateTime.Now;

                GestorTurno gTurno       = new GestorTurno();
                bool        verificacion = gTurno.VerificarTurnoDisponible(turno);

                if (verificacion)
                {
                    bool resultado = gTurno.ValidacionDelDiaTurno(turno);

                    if (resultado)
                    {
                        GestorPlanTratamiento gTratamiento = new GestorPlanTratamiento();
                        gTratamiento.EditarTratamiento(tratamiento, turno);

                        return("OK");
                    }
                    else
                    {
                        return("Err2"); //Dia no disponible
                    }
                }
                else
                {
                    return("Err1"); // Turno no disponible
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 10
0
        public static string RegistrarSoloTurno(string p_centro, string p_especialidad, string p_fechaTurno, string p_horaTurno,
                                                string p_idPaciente, string p_idObraSocial, string p_idPlan, string p_nroAfiliado, string p_profesional)
        {
            ObraSocial  obraSocial  = new ObraSocial();
            Turno       turno       = new Turno();
            GestorTurno gestorTurno = new GestorTurno();


            try
            {
                string mensaje = "OK";

                #region Completa entidad Turno

                if (!string.IsNullOrEmpty(p_idPaciente))
                {
                    Paciente paciente = new Paciente();
                    paciente.IdPaciente = Convert.ToInt32(p_idPaciente);
                    turno.Paciente      = paciente;
                }

                if (!string.IsNullOrEmpty(p_centro))
                {
                    Centro centro = new Centro();
                    centro.IdCentro = Convert.ToInt32(p_centro);
                    turno.Centro    = centro;
                }

                if (!string.IsNullOrEmpty(p_profesional))
                {
                    Profesional profesional = new Profesional();
                    profesional.IdProfesional = Convert.ToInt32(p_profesional);
                    turno.Profesional         = profesional;
                }

                if (!string.IsNullOrEmpty(p_especialidad))
                {
                    Especialidad especialidad = new Especialidad();
                    especialidad.IdEspecialidad = Convert.ToInt32(p_especialidad);
                    turno.Especialidad          = especialidad;
                }

                if (!string.IsNullOrEmpty(p_idObraSocial))
                {
                    obraSocial.IdObraSocial = Convert.ToInt32(p_idObraSocial);
                    turno.ObraSocial        = obraSocial;
                }

                if (!string.IsNullOrEmpty(p_idPlan))
                {
                    obraSocial.IdPlanObra = Convert.ToInt32(p_idPlan);
                    turno.ObraSocial      = obraSocial;
                }

                if (!string.IsNullOrEmpty(p_nroAfiliado))
                {
                    turno.NroAfiliado = p_nroAfiliado;
                }

                if (!string.IsNullOrEmpty(p_fechaTurno))
                {
                    turno.FechaTurno = Convert.ToDateTime(p_fechaTurno);
                }

                if (!string.IsNullOrEmpty(p_horaTurno))
                {
                    TimeSpan ts = TimeSpan.Parse(p_horaTurno);
                    turno.HoraDesde = ts;
                }


                turno.UsuarioAlta = 1;
                turno.FechaAlta   = DateTime.Today;

                #endregion

                gestorTurno.RegistrarSoloTurno(turno);

                return(mensaje);
            }
            catch (Exception e)
            {
                string error = "error al registrar turno " + e.Message;
                return(error);
            }
        }
Ejemplo n.º 11
0
        public static string registrarTurnoNew(string p_centro, string p_especialidad, string p_fechaTurno, string p_horaTurno, string p_nombre,
                                               string p_apellido, string p_documento, string p_celular, string p_email1, string p_email2,
                                               string p_obraSocial, string p_planObra, string p_nroAfiliado, string p_profesional, string es_edicion)
        {
            Turno       turno       = new Turno();
            Paciente    paciente    = new Paciente();
            GestorTurno gestorTurno = new GestorTurno();
            Centro      centro      = new Centro();

            try
            {
                string mensaje = "OK";

                #region Completa entidad Turno

                if (!string.IsNullOrEmpty(p_centro))
                {
                    centro.IdCentro = Convert.ToInt32(p_centro);
                    turno.Centro    = centro;
                }

                if (!string.IsNullOrEmpty(p_profesional))
                {
                    Profesional prof = new Profesional();
                    prof.IdProfesional = Convert.ToInt32(p_profesional);
                    turno.Profesional  = prof;
                }

                if (!string.IsNullOrEmpty(p_especialidad))
                {
                    Especialidad especialidad = new Especialidad();
                    especialidad.IdEspecialidad = Convert.ToInt32(p_especialidad);
                    turno.Especialidad          = especialidad;
                }

                if (!string.IsNullOrEmpty(p_fechaTurno))
                {
                    turno.FechaTurno = Convert.ToDateTime(p_fechaTurno);
                }

                //Sumar Campo de Obra Social
                ObraSocial obraSocial = new ObraSocial();

                if (!string.IsNullOrEmpty(p_obraSocial))
                {
                    obraSocial.IdObraSocial = Convert.ToInt32(p_obraSocial);
                    turno.ObraSocial        = obraSocial;
                }

                if (!string.IsNullOrEmpty(p_planObra))
                {
                    obraSocial.IdPlanObra = Convert.ToInt32(p_planObra);
                    turno.ObraSocial      = obraSocial;
                }

                if (!string.IsNullOrEmpty(p_nroAfiliado))
                {
                    turno.NroAfiliado = p_nroAfiliado;
                }


                if (!string.IsNullOrEmpty(p_horaTurno))
                {
                    TimeSpan ts = TimeSpan.Parse(p_horaTurno);
                    turno.HoraDesde = ts;
                }

                turno.UsuarioAlta = 1;
                turno.FechaAlta   = DateTime.Today;

                #endregion

                #region Completa entidad Paciente

                if (!string.IsNullOrEmpty(p_nombre))
                {
                    paciente.Nombre = p_nombre;
                }

                if (!string.IsNullOrEmpty(p_apellido))
                {
                    paciente.Apellido = p_apellido;
                }

                if (!string.IsNullOrEmpty(p_documento))
                {
                    paciente.Documento = p_documento;
                }

                if (!string.IsNullOrEmpty(p_celular))
                {
                    paciente.NroContacto = p_celular;
                }

                if ((!string.IsNullOrEmpty(p_email1)) && (!string.IsNullOrEmpty(p_email2)))
                {
                    string email = p_email1 + "@" + p_email2;
                    paciente.EmailContacto = email;
                }

                paciente.UsuarioAlta = 1; //hardcode
                paciente.FechaAlta   = DateTime.Today;

                #endregion


                gestorTurno.RegistrarTurnoNew(turno, paciente, p_obraSocial, p_planObra, Convert.ToBoolean(es_edicion));

                return(mensaje);
            }
            catch (Exception e)
            {
                string error = "error al registrar turno " + e.Message;
                return(error);
            }
        }