diff --git a/src/sections/HistoriaClinica.tsx b/src/sections/HistoriaClinica.tsx index 7f0bc0d..bb0e129 100644 --- a/src/sections/HistoriaClinica.tsx +++ b/src/sections/HistoriaClinica.tsx @@ -951,6 +951,7 @@ function SeccionLaboratorios({ lab, patientId, internacionId, add, update, del, }) { const [dialog, setDialog] = useState(false); const [obsDialog, setObsDialog] = useState(false); + const [otrosDialog, setOtrosDialog] = useState(false); const [evolDialog, setEvolDialog] = useState(false); const [edit, setEdit] = useState(null); const [obsLab, setObsLab] = useState(null); @@ -1444,6 +1445,14 @@ function SeccionLaboratorios({ lab, patientId, internacionId, add, update, del, return labSortAsc ? -diff : diff; }); + const labsConObservaciones = lab + .filter(l => l.pacienteId === patientId && l.observaciones && l.observaciones.trim() !== '') + .sort((a, b) => { + const dateA = new Date(a.fecha + 'T' + (a.hora || '00:00')).getTime(); + const dateB = new Date(b.fecha + 'T' + (b.hora || '00:00')).getTime(); + return dateB - dateA; + }); + return (
@@ -1451,6 +1460,7 @@ function SeccionLaboratorios({ lab, patientId, internacionId, add, update, del, {canEdit && } +
@@ -1529,6 +1539,32 @@ function SeccionLaboratorios({ lab, patientId, internacionId, add, update, del, + + + + Otros / Observaciones de Laboratorio + +
+ {labsConObservaciones.length === 0 ? ( +

No hay observaciones registradas.

+ ) : ( + labsConObservaciones.map(l => ( +
+
+ {formatDateDDMMYYYY(l.fecha)} {l.hora || ''} + Obs +
+

{l.observaciones}

+
+ )) + )} +
+
+ +
+
+
+