public IHttpActionResult listarMedicosFrecuentes(int idPaciente) { PacienteService serv = new PacienteService(); var lista = serv.listarMedicosRecomendados(idPaciente); return(Ok(lista)); }
public frmPaciente() { InitializeComponent(); oPacienteService = new PacienteService(); btnEditar.Enabled = false; btnEliminar.Enabled = false; }
public HttpResponseMessage GetAgendaPaciente() { try { var agendaService = new AgendaService(); var pacienteLogadoId = PacienteService.ObtemUsuarioLogadoId((User.Identity as ClaimsIdentity).Claims.ToList()); var agenda = agendaService.Get(pacienteLogadoId); if (agendaService.ResponseService.Type.Equals("Error")) { return(Request.CreateErrorResponse( HttpStatusCode.BadRequest, agendaService.ResponseService.Message)); } else { return(Request.CreateResponse(HttpStatusCode.OK, new { Agenda = agenda, Message = agendaService.ResponseService.Message, Type = agendaService.ResponseService.Type })); } } catch (Exception ex) { return(Request.CreateErrorResponse( HttpStatusCode.BadRequest, "Erro ao recuperar a agenda.")); } }
public void SVDebePoderNoRetorarUnDePaciente() { var data = new List <Paciente> { new Paciente { Apellidos = "Coral", Celular = "11111", Correo = "*****@*****.**", Direccion = "jr los andes", Edad = "22", IdPaciente = "ssssss", Nombres = "Anderson", NumeroDocumento = "4783434", TipoDocumento = TipoDocumento.DNI, TipoGenero = Genero.Masculino }, new Paciente { Apellidos = "GOMEZ MACEDO", Celular = "11111", Correo = "*****@*****.**", Direccion = "jr los andes", Edad = "22", IdPaciente = "ddddd", Nombres = "JAVIER ANGEL", NumeroDocumento = "4783434", TipoDocumento = TipoDocumento.DNI, TipoGenero = Genero.Masculino } }.AsQueryable(); var dbset = new Mock <DbSet <Paciente> >(); dbset.As <IQueryable <Paciente> >().Setup(m => m.Provider).Returns(data.Provider); dbset.As <IQueryable <Paciente> >().Setup(m => m.Expression).Returns(data.Expression); dbset.As <IQueryable <Paciente> >().Setup(m => m.ElementType).Returns(data.ElementType); dbset.As <IQueryable <Paciente> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator()); var context = new Mock <OpticaContext>(); context.Setup(a => a.Pacientes).Returns(dbset.Object); var service = new PacienteService(context.Object); var paciente = service.PacienteModificar("otroId"); Assert.IsNull(paciente); }
public PacienteController(IConfiguration configuration) { Configuration = configuration; string connectionString = Configuration["ConnectionStrings:DefaultConnection"]; _pacienteService = new PacienteService(connectionString); }
public HttpResponseMessage Conclui(int agendaId) { try { var agendaService = new AgendaService(); var pacienteLogadoId = PacienteService.ObtemUsuarioLogadoId((User.Identity as ClaimsIdentity).Claims.ToList()); agendaService.Conclui(agendaId); var agenda = agendaService.Get(pacienteLogadoId); if (agendaService.ResponseService.Type == ResponseTypeEnum.Error) { return(Request.CreateErrorResponse( HttpStatusCode.BadRequest, agendaService.ResponseService.Message)); } else { return(Request.CreateResponse(HttpStatusCode.OK, new { Agenda = agenda, Message = agendaService.ResponseService.Message, Type = agendaService.ResponseService.Type.ToString(), Fields = agendaService.ResponseService.FieldsInvalids })); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Erro ao confirmar.")); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.MedicamentoAdd); Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); // Una marca atrás en el icono en ActionBar SupportActionBar.SetDisplayHomeAsUpEnabled(true); _edtFarmaco = FindViewById <EditText>(Resource.Id.editFarmaco); // Farmaco _edtDosis = FindViewById <EditText>(Resource.Id.editDosis); // Dosis _radio1 = FindViewById <RadioButton>(Resource.Id.radio1); // Oral _radio2 = FindViewById <RadioButton>(Resource.Id.radio2); // Subcutanea _radio3 = FindViewById <RadioButton>(Resource.Id.radio3); // Intramuscular _radio4 = FindViewById <RadioButton>(Resource.Id.radio4); // Intravenoso _radio5 = FindViewById <RadioButton>(Resource.Id.radio5); // Inhalatoria _edtFecha = FindViewById <EditText>(Resource.Id.edtFecha); // Fecha _edtHora = FindViewById <EditText>(Resource.Id.edtHora); // Hora _btnAdd = FindViewById <Button>(Resource.Id.btnAdd); // Botón // Instanciamos _medicamento = new Medicamento(); // Click Fecha _edtFecha.Click += delegate { DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time) { _edtFecha.Text = time.ToShortDateString(); // Mostrar la fecha seleccionada en el edittext _medicamento.fecha = _edtFecha.Text; // Cargamos la fecha }); frag.Show(FragmentManager, DatePickerFragment.TAG); }; // Click Hora _edtHora.Click += delegate { TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(DateTime time) { _edtHora.Text = time.ToShortTimeString(); // Mostrar la hora seleccionada en el edittext _medicamento.hora = _edtHora.Text; // Cargamos la hora }); frag.Show(FragmentManager, TimePickerFragment.TAG); }; // Recibimos el Id paciente var id = Intent.Extras.GetInt(KEY_ID); // Consultamos _paciente = new Paciente(); _pacienteService = new PacienteService(); _paciente = _pacienteService.getPacienteById(id); // Devuelve un paciente por Id // Click Alertar _btnAdd.Click += saveAlertMedicamento; }
public PacienteController(CopagoContext context) { _pacienteService = new PacienteService(context); }
private void ViewPacienteDetail(int idPaciente) { // Instanciamos _paciente = new Paciente(); _pacienteService = new PacienteService(); // Consultamos _paciente = _pacienteService.getPacienteById(idPaciente); // Devuelve un paciente por Id // Mostramos los datos _txtNroHistoria.Text = _paciente.NroHistoria.ToString(); //ToString: convierte de entero a string _txtNombre.Text = _paciente.Nombre; _txtApellido.Text = _paciente.Apellido; _txtEdad.Text = _paciente.Edad.ToString(); if (_paciente.Masculino == true) { _txtGenero.Text = "Masculino"; } if (_paciente.Femenino == true) { _txtGenero.Text = "Femenino"; } _txtNroHabitacion.Text = _paciente.NroHabitacion.ToString(); _txtNroCama.Text = _paciente.NroCama; }
public IHttpActionResult buscarPaciente(int tipoDocumento, string nroDocumento) { PacienteService serv = new PacienteService(); var lista = serv.buscarPaciente(tipoDocumento, nroDocumento); return(Ok(lista)); }
static void ViejoMain() { string ruta = @"K:\FotosPacientes\"; IPacienteService servicio = new PacienteService(new UnitOfWork(new TurnosDB())); foreach (string fileRut in System.IO.Directory.GetFiles(ruta)) { Console.WriteLine(fileRut.Replace(ruta, "")); try { int PacienteID = Convert.ToInt32(fileRut.Replace(ruta, "").Replace(".jpg", "")); var paciente = servicio.Find(PacienteID); Byte[] bytes = File.ReadAllBytes(fileRut); String fileB64 = "data:image/jpeg;base64," + Convert.ToBase64String(bytes); paciente.Foto = fileB64; servicio.Edit(paciente); } catch (Exception ex) { Console.WriteLine(ex.ToString()); //Console.ReadKey(); } } Console.ReadKey(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.RotacionAdd); Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); // Una marca atrás en el icono en ActionBar SupportActionBar.SetDisplayHomeAsUpEnabled(true); _radioComun = FindViewById <RadioButton>(Resource.Id.radioComun); // Común _radioAire = FindViewById <RadioButton>(Resource.Id.radioAire); // Aíre _radio1 = FindViewById <RadioButton>(Resource.Id.radio1); // Lateral Izquierdo _radio2 = FindViewById <RadioButton>(Resource.Id.radio2); // Lateral Derecho _radio3 = FindViewById <RadioButton>(Resource.Id.radio3); // Supino _radio4 = FindViewById <RadioButton>(Resource.Id.radio4); // Prono _edtFecha = FindViewById <EditText>(Resource.Id.edtFecha); // Fecha _edtHora = FindViewById <EditText>(Resource.Id.edtHora); // Hora _btnAdd = FindViewById <Button>(Resource.Id.btnAdd); // Botón // Instanciamos _rotacion = new Rotacion(); // Click Fecha _edtFecha.Click += delegate { DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time) { _edtFecha.Text = time.ToShortDateString(); // Mostrar la fecha seleccionada en el edittext _rotacion.fecha = _edtFecha.Text; // Cargamos la fecha }); frag.Show(FragmentManager, DatePickerFragment.TAG); }; // Click Hora _edtHora.Click += delegate { TimePickerFragment frag = TimePickerFragment.NewInstance(delegate(DateTime time) { _edtHora.Text = time.ToShortTimeString(); // Mostrar la hora seleccionada en el edittext _rotacion.hora = _edtHora.Text; // Cargamos la hora }); frag.Show(FragmentManager, TimePickerFragment.TAG); }; // Recibimos el Id Paciente var id = Intent.Extras.GetInt(KEY_ID); _paciente = new Paciente(); _pacienteService = new PacienteService(); _paciente = _pacienteService.getPacienteById(id); // Devuelve Paciente por Id // Click Alertar _btnAdd.Click += saveAlertRotacion; }
static void Main(string[] args) { Console.WriteLine("Inicio de Carga de Formulario..."); DataContext dataContext = new DataContext(); //ProvinciaService provinciaService = new ProvinciaService(dataContext); try { //localidadService.CargarLocalidades(); AntEmp1Service antEmp1Service1 = new AntEmp1Service(dataContext); AntEmp2Service antEmp1Service2 = new AntEmp2Service(dataContext); EPCService ePCService = new EPCService(dataContext); SignosYsintomasService signosYsintomasService = new SignosYsintomasService(dataContext); PacienteService pacienteService = new PacienteService(dataContext); FormuarioParaAnalisisService formuario = new FormuarioParaAnalisisService(dataContext); ProvinciaService provinciaService = new ProvinciaService(dataContext); LocalidadService localidadService = new LocalidadService(dataContext); List <AntecedenteEpidemiologicos1> ant1 = antEmp1Service1.GetAntEmp1(); List <AntecedenteEpidemiologicos2> ant2 = antEmp1Service2.GetAntEmp2(); List <EnfermedadesPreviasComorbilidades> epc = ePCService.GetEPC(); List <SignosYSintomas> sys = signosYsintomasService.GetSignosYsintomas(); List <Paciente> pacientes = pacienteService.GetPacientes(); var p = pacienteService.GetPacientes(); //var Lista = provinciaService.GetProvincias(); var Lista = localidadService.GetLocalidades(); //for (int i = 0; i < 100; i++) //{ // CargarFormulario(); //} //int x = ant1.Count; // int xx = ant2.Count; //int xxx = epc.Count; // int xxxx = sys.Count; // int xxxxx = pacientes.Count; // Console.WriteLine(x.ToString()); // Console.WriteLine(xx.ToString()); // Console.WriteLine(xxx.ToString()); // Console.WriteLine(xxxx.ToString()); // Console.WriteLine(xxxxx.ToString()); //FormularioParaAnalisis f = formuario.SendFormulario(); //formuario.CargarFormularios(); // CargarFormulario(); //Console.WriteLine("Termino la carga"); for (int i = 0; i < 6; i++) { SetearComoEnviado(i); } Console.WriteLine("Fin de Cargar"); } catch (Exception ex) { Console.WriteLine(Tools.Tools.ExceptionMessage(ex)); }
public IHttpActionResult buscarProfesionalesDisponibles(DateTime fecha, int turno, string hora, int id) { PacienteService serv = new PacienteService(); string horaFinal = hora.Substring(0, 2) + ":" + hora.Substring(2, 2); var lista = serv.buscarProfesionalesDisponibles(fecha, turno, horaFinal, id); return(Ok(lista)); }
public void buscarPacienteOIQ(string tipoDoc, string busqueda) { IPacienteService pacservice = new PacienteService(); this.pacientes = new List <PacienteModel>(); this.pacientes = DTOToModel.listPaciente (pacservice.getPacienteAll(busqueda, tipoDoc)); }
private void Paciente_Load(object sender, EventArgs e) { _obraSocialService = new ObraSocialService(DaoFactory.GetObraSocialDao()); _pacienteService = new PacienteService(DaoFactory.GetPacienteDao()); IList<ObraSocial> obraSociales = _obraSocialService.GetAll(); foreach (ObraSocial os in obraSociales) { cmbObraSocial.Items.Add(os.RazonSocial); } }
public void InserirNovoPaciente() { Paciente novoPaciente = new Paciente(); novoPaciente.nome = "Nunes"; COVID_Context context = new COVID_Context(); PacienteRepository pacienteRepository = new PacienteRepository(context); PacienteService _service = new PacienteService(pacienteRepository); int retorno = _service.inserir(novoPaciente); Assert.Greater(retorno, 0); }
public void TesteIdadeMaxima() { Paciente novoPaciente = new Paciente(); novoPaciente.idade = 130; COVID_Context context = new COVID_Context(); PacienteRepository pacienteRepository = new PacienteRepository(context); PacienteService _service = new PacienteService(pacienteRepository); var ex = Assert.Throws <Exception>(() => _service.inserir(novoPaciente)); Assert.That(ex.Message, Is.EqualTo("Idade acima do limite")); }
public void TesteNomeVazio() { Paciente novoPaciente = new Paciente(); novoPaciente.nome = ""; COVID_Context context = new COVID_Context(); PacienteRepository pacienteRepository = new PacienteRepository(context); PacienteService _service = new PacienteService(pacienteRepository); var ex = Assert.Throws <Exception>(() => _service.inserir(novoPaciente)); Assert.That(ex.Message, Is.EqualTo("Nome Obrigatório")); }
public void TesteIdadeNegativa() { Paciente novoPaciente = new Paciente(); novoPaciente.idade = -12; COVID_Context context = new COVID_Context(); PacienteRepository pacienteRepository = new PacienteRepository(context); PacienteService _service = new PacienteService(pacienteRepository); var ex = Assert.Throws <Exception>(() => _service.inserir(novoPaciente)); Assert.That(ex.Message, Is.EqualTo("Idade não válida")); }
public void TestePacienteCPF() { Paciente novoPaciente = new Paciente(); novoPaciente.cpf = "113227126900"; COVID_Context context = new COVID_Context(); PacienteRepository pacienteRepository = new PacienteRepository(context); PacienteService _service = new PacienteService(pacienteRepository); var ex = Assert.Throws <Exception>(() => _service.inserir(novoPaciente)); Assert.That(ex.Message, Is.EqualTo("Já existente")); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.PacienteEdit); Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); // Una marca atrás en el icono en ActionBar SupportActionBar.SetDisplayHomeAsUpEnabled(true); _edtNroHistoria = FindViewById <EditText>(Resource.Id.editNroHistoria); // Numero historia _edtNombre = FindViewById <EditText>(Resource.Id.editNombre); // Nombre _edtApellido = FindViewById <EditText>(Resource.Id.editApellido); // Apellido _edtEdad = FindViewById <EditText>(Resource.Id.editEdad); // Edad _radioM = FindViewById <RadioButton>(Resource.Id.radioM); // Masculino _radioF = FindViewById <RadioButton>(Resource.Id.radioF); // Femenino _edtNroHabitacion = FindViewById <EditText>(Resource.Id.editNroHabit); // Numero habitacion _edtNroCama = FindViewById <EditText>(Resource.Id.editNroCama); // Numero cama _btnEdit = FindViewById <Button>(Resource.Id.btnEdit); // Botón // Recibimos el Id Paciente var id = Intent.Extras.GetInt(KEY_ID); // Instanciamos _paciente = new Paciente(); _pacienteService = new PacienteService(); // Consultamos _paciente = _pacienteService.getPacienteById(id); // Devuelve un paciente por Id // Mostramos los datos en EditText _edtNroHistoria.Text = _paciente.NroHistoria.ToString(); //ToString: convierte de entero a string _edtNombre.Text = _paciente.Nombre; _edtApellido.Text = _paciente.Apellido; _edtEdad.Text = _paciente.Edad.ToString(); if (_paciente.Masculino == true) { _radioM.Checked = true; } if (_paciente.Femenino == true) { _radioF.Checked = true; } _edtNroHabitacion.Text = _paciente.NroHabitacion.ToString(); _edtNroCama.Text = _paciente.NroCama; // Click Actualizar _btnEdit.Click += updatePaciente; }
public void buscarPaciente(string hcd, string nombres, string apellido1, string apellido2) { IPacienteService pacservice = new PacienteService(); this.pacientes = new List <PacienteModel>(); string materno = apellido2 ?? ""; string nombre = nombres ?? ""; if (pacservice.getPaciente(hcd, nombre, apellido1, materno) == null) { mensajeError = "Hubo un problema, consute con el administrador"; } else { this.pacientes = DTOToModel.listPaciente(pacservice.getPaciente(hcd, nombre, apellido1, materno).ToList()); } }
// Cuando la actividad ha sido creado, este metodo se ejecutara cuando la actividad que contiene este fragmento sea creado public override void OnActivityCreated(Bundle savedInstanceState) { base.OnActivityCreated(savedInstanceState); // Verifica si hay pacientes if (!_pacienteList.Any()) { _pacienteService = new PacienteService(); _pacienteList = _pacienteService.getListPacientes(); } ConfigurarVistas(); ConfigurarEventos(); // Adaptador _pacienteListView.Adapter = new PacienteListAdapter(Activity, _pacienteList); }
public ActionResult <Paciente> GetPacienteByDNI(string DNI) { try { DataContext dataContext = new DataContext(); PacienteService pacienteService = new PacienteService(dataContext); var paciente = pacienteService.GetByDNI(DNI); if (paciente == null) { return(NotFound()); } return(paciente); } catch (Exception e) { return(BadRequest(Tools.ExceptionMessage(e))); } }
private void updatePaciente(object sender, EventArgs e) { // Recibimos el Id var id = Intent.Extras.GetInt(KEY_ID); // Instanciamos _paciente = new Paciente(); // Cargamos los datos _paciente.Id = id; _paciente.Nombre = _edtNombre.Text; _paciente.Apellido = _edtApellido.Text; _paciente.Masculino = _radioM.Checked == true ? true : false; _paciente.Femenino = _radioF.Checked == true ? true : false; _paciente.NroCama = _edtNroCama.Text; // Validacion if (Validate()) { try { //Instanciamos _pacienteService = new PacienteService(); // Actualizar el registro en la base de datos _pacienteService.updatePaciente(_paciente); // Mensaje Toast.MakeText(this, "Se ha actualizado el paciente", ToastLength.Short).Show(); // Acción redireccionar a otra activity StartActivity(new Intent(this, typeof(PacienteList))); Finish(); } catch (Java.Lang.Exception ex) { Toast.MakeText(this, "Error en la base de datos: " + ex.Message, ToastLength.Long).Show(); } } }
public void SVDebePoderGuadarUnPaciente() { var data = new List <Paciente> { }.AsQueryable(); var dbset = new Mock <DbSet <Paciente> >(); dbset.As <IQueryable <Paciente> >().Setup(m => m.Provider).Returns(data.Provider); dbset.As <IQueryable <Paciente> >().Setup(m => m.Expression).Returns(data.Expression); dbset.As <IQueryable <Paciente> >().Setup(m => m.ElementType).Returns(data.ElementType); dbset.As <IQueryable <Paciente> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator()); var context = new Mock <OpticaContext>(); context.Setup(a => a.Pacientes).Returns(dbset.Object); var service = new PacienteService(context.Object); var paciente = new Paciente { Apellidos = "Coral", Celular = "11111", Correo = "*****@*****.**", Direccion = "jr los andes", Edad = "22", Nombres = "Anderson", NumeroDocumento = "4783434", TipoDocumento = TipoDocumento.DNI, TipoGenero = Genero.Masculino }; var guardar = service.AddPaciente(paciente); Assert.AreEqual(true, guardar); Assert.IsTrue(guardar); }
public void SVDebePoderRetorarUnaListaDePacienteCuandoElCriterioSeaNulo() { string criterio = null; var data = new List <Paciente> { new Paciente { Apellidos = "Coral", Celular = "11111", Correo = "*****@*****.**", Direccion = "jr los andes", Edad = "22", IdPaciente = "ssssss", Nombres = "Anderson", NumeroDocumento = "4783434", TipoDocumento = TipoDocumento.DNI, TipoGenero = Genero.Masculino }, new Paciente { Apellidos = "GOMEZ MACEDO", Celular = "11111", Correo = "*****@*****.**", Direccion = "jr los andes", Edad = "22", IdPaciente = "ssssss", Nombres = "JAVIER ANGEL", NumeroDocumento = "4783434", TipoDocumento = TipoDocumento.DNI, TipoGenero = Genero.Masculino } }.AsQueryable(); var dbset = new Mock <DbSet <Paciente> >(); dbset.As <IQueryable <Paciente> >().Setup(m => m.Provider).Returns(data.Provider); dbset.As <IQueryable <Paciente> >().Setup(m => m.Expression).Returns(data.Expression); dbset.As <IQueryable <Paciente> >().Setup(m => m.ElementType).Returns(data.ElementType); dbset.As <IQueryable <Paciente> >().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator()); var context = new Mock <OpticaContext>(); context.Setup(a => a.Pacientes).Returns(dbset.Object); var service = new PacienteService(context.Object); var paciente = service.GetRetornarListasPaciente(criterio); Assert.IsNotNull(paciente); Assert.AreEqual(2, paciente.Count()); }
public PacientesController(PacienteService pacienteService) { this.pacienteService = pacienteService; }
public PacienteController(PacienteService pacienteService) { _pacienteService = pacienteService; }
private void TestForm_Load(object sender, EventArgs e) { gridMain.AutoGenerateColumns = false; //Seteo estado del form al inicio Estado = EstadoForm.GRILLA; //Crear servicios de negocio _pacienteService = new PacienteService(base.DaoFactory.GetPacienteDao()); _obraSocialService = new ObraSocialService(base.DaoFactory.GetObraSocialDao()); //Cargar combo Obra Social cmbObraSocial.DataSource = _obraSocialService.GetAll(); cmbObraSocial.ValueMember = "ID"; cmbObraSocial.DisplayMember = "RazonSocial"; //Cargar grilla asincronicamente backgroundWorker.RunWorkerAsync(Operacion.CARGAR_GRILLA); //medusaStatusBar.Loading = false; this.ModoEstatico(); //TEST SEARCH CONTROL SearchItem item1 = new SearchItem(); item1.DisplayMember = "Nombre"; item1.ValueMember = "Nombre"; SearchItem item2 = new SearchItem(); item2.DisplayMember = "Apellido"; item2.ValueMember = "Apellido"; IList<SearchItem> listItems = new List<SearchItem>(); listItems.Add(item1); listItems.Add(item2); searchControl1.Campos = listItems; }
private void sentenciaYCarga(PacienteE ob, DataGridView grilla, PacienteService obS, bool esAlta) { obS.altaPaciente(ob, esAlta); cargarGrilla(grilla, obS.recuperarPaciente()); }