From 2c036fa35477955fd130e7146a1349af397ad8a8 Mon Sep 17 00:00:00 2001 From: 03jossellin-herrera-rodriguez Date: Sun, 19 May 2024 13:13:54 -0600 Subject: [PATCH] apartado medico 2 --- healthmanager/src/BuscarPaciente.jsx | 6 ++ healthmanager/src/EditarPaciente.css | 9 +++ healthmanager/src/EditarPaciente.jsx | 5 ++ healthmanager/src/HistorialPacientes.css | 60 +++++++++++++++ healthmanager/src/HistorialPacientes.jsx | 94 ++++++++++++++++++++++++ healthmanager/src/Paciente.css | 9 +++ healthmanager/src/Paciente.jsx | 5 ++ healthmanager/src/RecetaMedica.css | 9 +++ healthmanager/src/RecetaMedica.jsx | 8 ++ 9 files changed, 205 insertions(+) create mode 100644 healthmanager/src/HistorialPacientes.css create mode 100644 healthmanager/src/HistorialPacientes.jsx 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 ( +
+

Historial de Pacientes

+ + + + + + + + + + + {pacientes.map((paciente) => ( + + + + + + ))} + +
IDNombreVer Recetas
{paciente.id}{paciente.nombre} + +
+ + {selecPaciente && ( +
+

Datos del Paciente

+

ID: {selecPaciente.id}

+

Nombre: {selecPaciente.nombre}

+ +

Prescripcion

+ + + + + + + + + + + + + {preinscripcion.map((preinscripcion) => ( + + + + + + + + + ))} + +
ID RecetaFechaMedicamentoDosisInstruccionesFirma Médico
{preinscripcion.id}{preinscripcion.fecha}{preinscripcion.medicamento}{preinscripcion.dosis}{preinscripcion.instrucciones} + {preinscripcion.firmaMedico && ( + Firma del Médico + )} +
+
+ )} +

+ + + +
+ ); + }; + +export default HistorialPacientes; \ No newline at end of file diff --git a/healthmanager/src/Paciente.css b/healthmanager/src/Paciente.css index 3e68381..cb253c6 100644 --- a/healthmanager/src/Paciente.css +++ b/healthmanager/src/Paciente.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/Paciente.jsx b/healthmanager/src/Paciente.jsx index b4bd032..c8b3f00 100644 --- a/healthmanager/src/Paciente.jsx +++ b/healthmanager/src/Paciente.jsx @@ -1,5 +1,6 @@ import React, { useState } from 'react'; import './Paciente.css'; +import { Link } from 'react-router-dom'; const Paciente = () => { const [nombre, setNombre] = useState(''); @@ -42,6 +43,10 @@ const Paciente = () => { /> +

+ + + ); }; diff --git a/healthmanager/src/RecetaMedica.css b/healthmanager/src/RecetaMedica.css index 1eb2536..b6feb28 100644 --- a/healthmanager/src/RecetaMedica.css +++ b/healthmanager/src/RecetaMedica.css @@ -17,4 +17,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/RecetaMedica.jsx b/healthmanager/src/RecetaMedica.jsx index 05fd0ce..61feafe 100644 --- a/healthmanager/src/RecetaMedica.jsx +++ b/healthmanager/src/RecetaMedica.jsx @@ -1,5 +1,6 @@ import React, { useId, useState } from 'react'; import './RecetaMedica.css'; +import { Link } from 'react-router-dom'; const RecetaMedica = () => { const [idreceta, setIdReceta] = useId(''); @@ -109,8 +110,15 @@ const RecetaMedica = () => { accept="image/*" onChange={handleImageUpload} /> +

+

+

+

+ + + ); };