public async Task <IActionResult> Post([FromBody] Cita model)
        {
            try
            {
                var newModel = new Cita()
                {
                    Id            = model.Id,
                    PacienteId    = model.PacienteId,
                    Fecharegistro = DateTime.Now,
                    Fechacita     = model.Fechacita,
                    DoctorId      = model.DoctorId,
                    Observaciones = model.Observaciones
                };
                clinicaRepositorio.AddCita(newModel);
                if (clinicaRepositorio.SaveAll())
                {
                    /*   return Created($"/api/order/{Newmodel.Id}", Newmodel);*/
                    var results = new
                    {
                        ruta = $"{newModel.Id}"
                    };
                    return(Created("", results));
                }
            }
            catch (Exception ex)
            {
                logger.LogError($"Fallo al Guardar Paciente:{ex}");
            }

            return(BadRequest("Fallo al Guardar Paciente"));
        }
예제 #2
0
        public async Task <IActionResult> Post([FromBody] Laboratorios model)
        {
            try
            {
                var currentUser = await userManager.FindByNameAsync(User.Identity.Name);

                var newModel = new Laboratorios()
                {
                    Id            = model.Id,
                    pacienteId    = model.pacienteId,
                    Fecharegistro = DateTime.Now,
                    Tipolabo      = model.Tipolabo,
                    user          = currentUser
                };
                clinicaRepositorio.AddLaboratorio(newModel);
                if (clinicaRepositorio.SaveAll())
                {
                    /*   return Created($"/api/order/{Newmodel.Id}", Newmodel);*/
                    var results = new
                    {
                        ruta = $"{newModel.Id}"
                    };
                    return(Created("", results));
                }
            }
            catch (Exception ex)
            {
                logger.LogError($"Fallo al Guardar Paciente:{ex}");
            }

            return(BadRequest("Fallo al Guardar Paciente"));
        }
예제 #3
0
        public async Task <IActionResult> Post([FromBody] Paciente model)
        {
            try
            {
                var currentUser = await userManager.FindByNameAsync(User.Identity.Name);

                var newModel = new Paciente()
                {
                    Id                  = model.Id,
                    Nombre              = model.Nombre,
                    Apellido            = model.Apellido,
                    DPI                 = model.DPI,
                    FechaNacimiento     = model.FechaNacimiento,
                    Edad                = model.Edad,
                    Sexo                = model.Sexo,
                    Profesion           = model.Profesion,
                    Direccion           = model.Direccion,
                    ContactoEmergencia  = model.ContactoEmergencia,
                    TelefenoContacto    = model.TelefenoContacto,
                    Parentescocontacto  = model.Parentescocontacto,
                    EnfermeraAsignadaId = model.EnfermeraAsignadaId,
                    user                = currentUser
                };
                clinicaRepositorio.AddPaciente(newModel);
                if (clinicaRepositorio.SaveAll())
                {
                    /*   return Created($"/api/order/{Newmodel.Id}", Newmodel);*/
                    var results = new
                    {
                        ruta = $"{newModel.Id}"
                    };
                    return(Created("", results));
                }
            }
            catch (Exception ex)
            {
                logger.LogError($"Fallo al Guardar Paciente:{ex}");
            }

            return(BadRequest("Fallo al Guardar Paciente"));
        }
예제 #4
0
        public async Task <IActionResult> Post([FromBody] NotaEnfermeria model)
        {
            try
            {
                var currentUser = await userManager.FindByNameAsync(User.Identity.Name);

                var newModel = new NotaEnfermeria()
                {
                    Id            = model.Id,
                    pacienteId    = model.pacienteId,
                    Fecharegistro = DateTime.Now,
                    Pesokg        = model.Pesokg,
                    Alturamts     = model.Alturamts,
                    Pulso         = model.Pulso,
                    Presion       = model.Presion,
                    Respiraxmin   = model.Respiraxmin,
                    Temperatura   = model.Temperatura,
                    doctorId      = model.doctorId,
                    Observaciones = model.Observaciones,
                    user          = currentUser
                };
                clinicaRepositorio.AddNota(newModel);
                if (clinicaRepositorio.SaveAll())
                {
                    /*   return Created($"/api/order/{Newmodel.Id}", Newmodel);*/
                    var results = new
                    {
                        ruta = $"{newModel.Id}"
                    };
                    return(Created("", results));
                }
            }
            catch (Exception ex)
            {
                logger.LogError($"Fallo al Guardar Paciente:{ex}");
            }

            return(BadRequest("Fallo al Guardar Paciente"));
        }