public PacienteResponse getPaciente(string PacienteDocument) { var response = new PacienteResponse(); try { var paciente = db.Pacientes.Where(x => x.Identificacion == PacienteDocument).FirstOrDefault(); if (paciente == null) { response.State = false; response.Message = "El paciente buscado no existe."; } else { response.State = true; response.Message = "OK"; response.paciente = paciente; } } catch (Exception ex) { response.State = false; response.Message = ex.Message; } return(response); }
public ActionResult <PacienteResponse> Post(PacienteRequest request) { CrearPacienteService _service = new CrearPacienteService(_unitOfWork); PacienteResponse response = _service.CrearPaciente(request); return(Ok(response)); }
public ActionResult <PacienteResponse> ActualizarPaciente([FromBody] PacienteRequest request) { ActualizarService _service = new ActualizarService(_unitOfWork); PacienteResponse response = _service.ActualizarPaciente(request); return(Ok(response)); }
private void cargarPacientes(string iD) { try { grvPacientes.DataSource = null; PacienteRequest request = new PacienteRequest(); PacienteResponse response = new PacienteResponse(); request.mdlUser = Usuario; request.busqueda = iD; request.intSitioID = Usuario.intSitioID; response = RisService.getBusquedaPacientesList(request); if (response != null) { if (response.lstPacientes != null) { if (response.lstPacientes.Count > 0) { grvPacientes.DataSource = response.lstPacientes; } } } if (Usuario.intTipoUsuario == 2) { grvPacientes.Columns[5].Visible = true; } else { grvPacientes.Columns[5].Visible = false; } grvPacientes.DataBind(); } catch (Exception ecP) { Log.EscribeLog("Existe un error en cargarPacientes: " + ecP.Message, 3, Usuario.vchUsuario); } }
private void cargarDetallePaciente(int intPacienteID) { try { PacienteRequest request = new PacienteRequest(); PacienteResponse response = new PacienteResponse(); request.mdlUser = Usuario; request.intPacienteID = intPacienteID; if (request != null) { response = RisService.getPacienteDetalle(request); if (response != null) { if (response.Success) { //bitEditar = true; //HFintPacienteID.Value = intPacienteID.ToString(); //txtNombrePaciente.Text = response.mdlPaciente.vchNombre; //txtApellidos.Text = response.mdlPaciente.vchApellidos; //Date1.Text = response.mdlPaciente.datFechaNac.ToString("dd/MM/yyyy"); //lblIDs.Text = intPacienteID.ToString(); //lblIDs.Visible = true; //btnEditPaciente.Visible = true; if (response.mdlDireccion != null) { fillDireccion(response.mdlDireccion); } if (response.mdlPaciente != null) { fillPaciente(response.mdlPaciente); } if (response.lstIden != null) { if (response.lstIden.Count > 0) { fillIdentificaciones(response.lstIden); } } if (response.lstVarAdi != null) { if (response.lstVarAdi.Count > 0) { fillVarAdicionalPaciente(response.lstVarAdi); } } } else { ShowMessage("Existe un error al cargar al paciente: " + response.Mensaje, MessageType.Error, "alert_container"); } } } } catch (Exception eCP) { Log.EscribeLog("Existe un error en cargarDetallePaciente: " + eCP.Message, 3, Usuario.vchUsuario); } }
public IActionResult Read(int id) { PacienteResponse paciente = pacienteService.Read(id); return(Ok(paciente)); }