Fix: Mapa de camas responsive y mejoras en Historia Clínica
This commit is contained in:
+3
-3
@@ -4,11 +4,11 @@ services:
|
|||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "8077:80"
|
||||||
- "4000:4000"
|
- "4000:4000"
|
||||||
volumes:
|
volumes:
|
||||||
- hospital-data:/app/data
|
- hospital-data:/app
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
hospital-data:
|
hospital-data:
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { PDFDocument } from 'pdf-lib';
|
import { PDFDocument } from 'pdf-lib';
|
||||||
import {
|
import {
|
||||||
FlaskConical,
|
FlaskConical,
|
||||||
Activity,
|
Activity,
|
||||||
Microscope,
|
Microscope,
|
||||||
Plus,
|
Plus,
|
||||||
Calendar,
|
Calendar,
|
||||||
Clock,
|
Clock,
|
||||||
AlertCircle,
|
AlertCircle,
|
||||||
CheckCircle2,
|
CheckCircle2,
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
Pencil,
|
Pencil,
|
||||||
Trash2,
|
Trash2,
|
||||||
@@ -154,23 +154,34 @@ export function HistoriaClinica({
|
|||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<div className="flex items-center justify-between gap-4">
|
<div className="flex items-center justify-between gap-4">
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<Button variant="outline" onClick={onVolver}>
|
|
||||||
<ArrowLeft className="h-4 w-4 mr-2" />
|
|
||||||
Volver
|
|
||||||
</Button>
|
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold text-gray-900">Historia Clínica</h1>
|
<h1 className="text-2xl font-bold text-gray-900">Historia Clínica</h1>
|
||||||
<p className="text-gray-500">
|
<p className="text-gray-500">
|
||||||
Cama: {cama?.numero || 'N/A'} | {paciente.apellido}, {paciente.nombre} | {paciente.fechaNacimiento ? calcularEdad(paciente.fechaNacimiento) + ' años' : ''} | DNI: {paciente.dni}
|
Cama: {cama?.numero || 'N/A'} | {paciente.apellido}, {paciente.nombre} | {paciente.fechaNacimiento ? calcularEdad(paciente.fechaNacimiento) + ' años' : ''} | DNI: {paciente.dni}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<Button variant="outline" onClick={() => setEditIngresoDialog(true)}>
|
|
||||||
<Pencil className="h-4 w-4 mr-2" />
|
<div className="flex items-center gap-4">
|
||||||
Editar Ingreso
|
<Button variant="outline" onClick={onVolver}>
|
||||||
</Button>
|
<ArrowLeft className="h-4 w-4 mr-2" />
|
||||||
|
Volver
|
||||||
|
</Button>
|
||||||
|
<Button variant="outline" onClick={() => setEditIngresoDialog(true)}>
|
||||||
|
<Pencil className="h-4 w-4 mr-2" />
|
||||||
|
Editar Ingreso
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<Dialog open={editIngresoDialog} onOpenChange={setEditIngresoDialog}>
|
<Dialog open={editIngresoDialog} onOpenChange={setEditIngresoDialog}>
|
||||||
<DialogContent className="sm:max-w-2xl max-h-[90vh] overflow-y-auto">
|
<DialogContent className="sm:max-w-2xl max-h-[90vh] overflow-y-auto">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
@@ -284,7 +295,7 @@ export function HistoriaClinica({
|
|||||||
try {
|
try {
|
||||||
const formField = form.getTextField(field.name);
|
const formField = form.getTextField(field.name);
|
||||||
if (formField) formField.setText(field.value);
|
if (formField) formField.setText(field.value);
|
||||||
} catch (e) {}
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
const pdfBytes = await pdfDoc.save();
|
const pdfBytes = await pdfDoc.save();
|
||||||
const blob = new Blob([new Uint8Array(pdfBytes)], { type: 'application/pdf' });
|
const blob = new Blob([new Uint8Array(pdfBytes)], { type: 'application/pdf' });
|
||||||
@@ -793,9 +804,9 @@ function SeccionAcidosBase({ ab, patientId, add, del }: {
|
|||||||
const [lactato, setLactato] = useState('');
|
const [lactato, setLactato] = useState('');
|
||||||
const [interpretacion, setInterpretacion] = useState('');
|
const [interpretacion, setInterpretacion] = useState('');
|
||||||
|
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
setFecha(new Date().toISOString().split('T')[0]);
|
setFecha(new Date().toISOString().split('T')[0]);
|
||||||
setHora(new Date().toTimeString().slice(0, 5));
|
setHora(new Date().toTimeString().slice(0, 5));
|
||||||
setPh(''); setPco2(''); setPo2(''); setHco3(''); setBe(''); setSato2(''); setLactato(''); setInterpretacion('');
|
setPh(''); setPco2(''); setPo2(''); setHco3(''); setBe(''); setSato2(''); setLactato(''); setInterpretacion('');
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -917,12 +928,12 @@ function SeccionCultivos({ cults, patient, add, update, del }: {
|
|||||||
const [sensible, setSensible] = useState('');
|
const [sensible, setSensible] = useState('');
|
||||||
const [resistente, setResistente] = useState('');
|
const [resistente, setResistente] = useState('');
|
||||||
|
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
setFechaToma(new Date().toISOString().split('T')[0]);
|
setFechaToma(new Date().toISOString().split('T')[0]);
|
||||||
setProtocolo('');
|
setProtocolo('');
|
||||||
setTipoMuestra('HMCx2');
|
setTipoMuestra('HMCx2');
|
||||||
setObservaciones('');
|
setObservaciones('');
|
||||||
setSelected(null);
|
setSelected(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
const resetRes = () => {
|
const resetRes = () => {
|
||||||
@@ -956,7 +967,7 @@ function SeccionCultivos({ cults, patient, add, update, del }: {
|
|||||||
|
|
||||||
const cs = cults.filter(c => c.pacienteId === patient.id).sort((a, b) => new Date(b.fechaToma).getTime() - new Date(a.fechaToma).getTime());
|
const cs = cults.filter(c => c.pacienteId === patient.id).sort((a, b) => new Date(b.fechaToma).getTime() - new Date(a.fechaToma).getTime());
|
||||||
|
|
||||||
const getEstadoColor = (estado:Cultivo['estado']) => {
|
const getEstadoColor = (estado: Cultivo['estado']) => {
|
||||||
switch (estado) {
|
switch (estado) {
|
||||||
case 'NAF/Pendiente': return 'bg-amber-100 text-amber-800';
|
case 'NAF/Pendiente': return 'bg-amber-100 text-amber-800';
|
||||||
case 'Parcial': return 'bg-orange-100 text-orange-800';
|
case 'Parcial': return 'bg-orange-100 text-orange-800';
|
||||||
@@ -975,19 +986,19 @@ function SeccionCultivos({ cults, patient, add, update, del }: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handle = () => { add({ pacienteId: patient.id, fechaToma, protocolo: protocolo || undefined, tipoMuestra, observaciones: observaciones || undefined, estado: 'NAF/Pendiente' }); setDialog(false); reset(); };
|
const handle = () => { add({ pacienteId: patient.id, fechaToma, protocolo: protocolo || undefined, tipoMuestra, observaciones: observaciones || undefined, estado: 'NAF/Pendiente' }); setDialog(false); reset(); };
|
||||||
|
|
||||||
const handleParcial = () => {
|
const handleParcial = () => {
|
||||||
if (!selected) return;
|
if (!selected) return;
|
||||||
update(selected.id, { estado: 'Parcial', germen: germen || undefined, sensible: sensible || undefined, resistente: resistente || undefined });
|
update(selected.id, { estado: 'Parcial', germen: germen || undefined, sensible: sensible || undefined, resistente: resistente || undefined });
|
||||||
setResDialog(false);
|
setResDialog(false);
|
||||||
resetRes();
|
resetRes();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDefinitivo = () => {
|
const handleDefinitivo = () => {
|
||||||
if (!selected) return;
|
if (!selected) return;
|
||||||
update(selected.id, { fechaResultado, estado: estadoResultado, germen: germen || undefined, sensible: sensible || undefined, resistente: resistente || undefined });
|
update(selected.id, { fechaResultado, estado: estadoResultado, germen: germen || undefined, sensible: sensible || undefined, resistente: resistente || undefined });
|
||||||
setEditDialog(false);
|
setEditDialog(false);
|
||||||
resetRes();
|
resetRes();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -1005,7 +1016,7 @@ function SeccionCultivos({ cults, patient, add, update, del }: {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Label>Tipo de Muestra *</Label>
|
<Label>Tipo de Muestra *</Label>
|
||||||
<Select value={tipoMuestra} onValueChange={(v:Cultivo['tipoMuestra']) => setTipoMuestra(v)}>
|
<Select value={tipoMuestra} onValueChange={(v: Cultivo['tipoMuestra']) => setTipoMuestra(v)}>
|
||||||
<SelectTrigger><SelectValue /></SelectTrigger>
|
<SelectTrigger><SelectValue /></SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="HMCx2">HMCx2</SelectItem>
|
<SelectItem value="HMCx2">HMCx2</SelectItem>
|
||||||
@@ -1049,7 +1060,7 @@ function SeccionCultivos({ cults, patient, add, update, del }: {
|
|||||||
<div className="grid grid-cols-2 gap-4">
|
<div className="grid grid-cols-2 gap-4">
|
||||||
<div><Label>Fecha de Resultado *</Label><Input type="date" value={fechaResultado} onChange={e => setFechaResultado(e.target.value)} /></div>
|
<div><Label>Fecha de Resultado *</Label><Input type="date" value={fechaResultado} onChange={e => setFechaResultado(e.target.value)} /></div>
|
||||||
<div><Label>Resultado *</Label>
|
<div><Label>Resultado *</Label>
|
||||||
<Select value={estadoResultado} onValueChange={(v:Cultivo['estado']) => setEstadoResultado(v)}>
|
<Select value={estadoResultado} onValueChange={(v: Cultivo['estado']) => setEstadoResultado(v)}>
|
||||||
<SelectTrigger><SelectValue /></SelectTrigger>
|
<SelectTrigger><SelectValue /></SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="Positivo">Positivo</SelectItem>
|
<SelectItem value="Positivo">Positivo</SelectItem>
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ export function MapaCamas({
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* Mapa de Camas */}
|
{/* Mapa de Camas */}
|
||||||
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4">
|
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2 sm:gap-4">
|
||||||
{sortedCamas.map((cama) => {
|
{sortedCamas.map((cama) => {
|
||||||
const paciente = cama.pacienteId ? getPacienteById(cama.pacienteId) : null;
|
const paciente = cama.pacienteId ? getPacienteById(cama.pacienteId) : null;
|
||||||
const internacion = cama.internacionId ? getInternacionById(cama.internacionId) : null;
|
const internacion = cama.internacionId ? getInternacionById(cama.internacionId) : null;
|
||||||
|
|||||||
Reference in New Issue
Block a user