diff --git a/healthmanager/src/BuscarPaciente.jsx b/healthmanager/src/BuscarPaciente.jsx index 5054490..32551ad 100644 --- a/healthmanager/src/BuscarPaciente.jsx +++ b/healthmanager/src/BuscarPaciente.jsx @@ -1,4 +1,5 @@ import React, { useState } from 'react'; +import { Link } from 'react-router-dom'; const BuscarPaciente = () => { const [busqueda, setBusqueda] = useState(''); @@ -19,6 +20,11 @@ const BuscarPaciente = () => { className="buscar-paciente-input" /> +
+ + + + ); diff --git a/healthmanager/src/EditarPaciente.css b/healthmanager/src/EditarPaciente.css index 5a3e39b..f955d48 100644 --- a/healthmanager/src/EditarPaciente.css +++ b/healthmanager/src/EditarPaciente.css @@ -20,4 +20,13 @@ color: #fff; border: none; cursor: pointer; + } + .btnsalir { + margin-bottom: 20px; + padding: 10px 20px; + font-size: 18px; + background-color: #007bff; + color: #fff; + border: none; + cursor: pointer; } \ No newline at end of file diff --git a/healthmanager/src/EditarPaciente.jsx b/healthmanager/src/EditarPaciente.jsx index edad46b..519adef 100644 --- a/healthmanager/src/EditarPaciente.jsx +++ b/healthmanager/src/EditarPaciente.jsx @@ -1,5 +1,6 @@ import React, { useState } from 'react'; import './EditarPaciente.css'; +import { Link } from 'react-router-dom'; const EditarPaciente = () => { const [nombre, setNombre] = useState(''); @@ -43,6 +44,10 @@ const EditarPaciente = () => { /> + + + + ); }; diff --git a/healthmanager/src/HistorialPacientes.css b/healthmanager/src/HistorialPacientes.css new file mode 100644 index 0000000..8ba5704 --- /dev/null +++ b/healthmanager/src/HistorialPacientes.css @@ -0,0 +1,60 @@ +.historial-paciente { + margin: 20px; + } + + .patient-list { + width: 100%; + border-collapse: collapse; + } + + .patient-list th, + .patient-list td { + border: 1px solid #ddd; + padding: 8px; + } + + .patient-list th { + text-align: left; + background-color: #f0f0f0; + } + + .patient-list button { + padding: 5px 10px; + background-color: #007bff; + color: white; + border: none; + cursor: pointer; + } + + .patient-details { + margin-top: 20px; + border: 1px solid #ddd; + padding: 20px; + } + + .patient-details h2 { + margin-top: 0; + margin-bottom: 10px; + } + + .patient-details p { + margin-bottom: 0; + } + + .patient-details ul { + list-style: none; + padding: 0; + } + + .patient-details li { + margin-bottom: 10px; + } + .btnsalir { + margin-bottom: 20px; + padding: 10px 20px; + font-size: 18px; + background-color: #007bff; + color: #fff; + border: none; + cursor: pointer; + } \ No newline at end of file diff --git a/healthmanager/src/HistorialPacientes.jsx b/healthmanager/src/HistorialPacientes.jsx new file mode 100644 index 0000000..5e8a436 --- /dev/null +++ b/healthmanager/src/HistorialPacientes.jsx @@ -0,0 +1,94 @@ +import React, { useState, useEffect } from 'react'; +import './HistorialPacientes.css'; +import { Link } from 'react-router-dom'; + +const HistorialPacientes = () => { + const [pacientes, setPatientes] = useState([]); + const [selecPaciente, setSelecPaciente] = useState(null); + const [preinscripcion, setPreinscripcion] = useState([]); + + useEffect(() => { + fetch('/pacientes') + .then((response) => response.json()) + .then((data) => setPatientes(data)); + }, []); + + const handleViewPatient = (paciente) => { + setSelecPaciente(paciente); + + fetch(`/preinscripcion/${paciente.id}`) + .then((response) => response.json()) + .then((data) => setSelecPaciente(data)); + }; + + return ( +ID | +Nombre | +Ver Recetas | +
---|---|---|
{paciente.id} | +{paciente.nombre} | ++ + | +
ID: {selecPaciente.id}
+Nombre: {selecPaciente.nombre}
+ +ID Receta | +Fecha | +Medicamento | +Dosis | +Instrucciones | +Firma Médico | +
---|---|---|---|---|---|
{preinscripcion.id} | +{preinscripcion.fecha} | +{preinscripcion.medicamento} | +{preinscripcion.dosis} | +{preinscripcion.instrucciones} | ++ {preinscripcion.firmaMedico && ( + + )} + | +