Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6ac73f79f | ||
|
|
f0b995f046 | ||
|
|
d17ba39b2d | ||
|
|
a17deb815e |
+1
-4
@@ -125,12 +125,9 @@ function AppContent() {
|
|||||||
pacientes={store.pacientes}
|
pacientes={store.pacientes}
|
||||||
internaciones={store.internaciones}
|
internaciones={store.internaciones}
|
||||||
camas={store.camas}
|
camas={store.camas}
|
||||||
onAgregarCultivo={store.agregarCultivo}
|
|
||||||
onActualizarCultivo={store.actualizarCultivo}
|
|
||||||
onEliminarCultivo={store.eliminarCultivo}
|
|
||||||
getPacienteById={store.getPacienteById}
|
getPacienteById={store.getPacienteById}
|
||||||
getInternacionActivaByPaciente={store.getInternacionActivaByPaciente}
|
getInternacionActivaByPaciente={store.getInternacionActivaByPaciente}
|
||||||
canEdit={true}
|
canEdit={false}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
case 'historiaclinica': {
|
case 'historiaclinica': {
|
||||||
|
|||||||
+12
-10
@@ -42,25 +42,27 @@ export function calcularEdad(fechaNacimiento?: string): string | number {
|
|||||||
export function isCamaFueraDeGrupo(
|
export function isCamaFueraDeGrupo(
|
||||||
cama: { numero: string; grupoId?: string; areaId?: string; sector?: string }
|
cama: { numero: string; grupoId?: string; areaId?: string; sector?: string }
|
||||||
): boolean {
|
): boolean {
|
||||||
if (cama.sector === 'Fuera de Área') return true;
|
return computeSector(cama?.numero || '') === 'Fuera de Área';
|
||||||
if (cama.sector === 'En Área') return false;
|
|
||||||
return computeSector(cama.numero) === 'Fuera de Área';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function computeSector(numero: string): "En Área" | "Fuera de Área" {
|
export function computeSector(numero: string): "En Área" | "Fuera de Área" {
|
||||||
if (!numero) return 'En Área';
|
if (!numero) return 'En Área';
|
||||||
const parts = String(numero).trim().split('-');
|
const cleanNumero = String(numero).trim();
|
||||||
if (parts.length === 0) return 'En Área';
|
// Format is XXX-YY (where XXX is room number, YY is bed number in room)
|
||||||
|
// Extract room number XXX (first part before hyphen if hyphen exists, or first 3 digits)
|
||||||
|
const parts = cleanNumero.split('-');
|
||||||
const salaStr = parts[0].trim();
|
const salaStr = parts[0].trim();
|
||||||
const salaNum = parseInt(salaStr, 10);
|
|
||||||
if (isNaN(salaNum)) return 'En Área';
|
|
||||||
|
|
||||||
// 3XX-YY where XX is odd (so the whole 3XX is odd)
|
// Fuera de área rule 1: 3XX where XX is an odd number (e.g., 301, 303, 315, 399)
|
||||||
if (salaStr.length === 3 && salaStr.startsWith('3') && salaNum % 2 !== 0) {
|
// salaStr length can be 3, starting with '3'
|
||||||
|
if (salaStr.length === 3 && salaStr.startsWith('3')) {
|
||||||
|
const xxNum = parseInt(salaStr.slice(1), 10);
|
||||||
|
if (!isNaN(xxNum) && xxNum % 2 !== 0) {
|
||||||
return 'Fuera de Área';
|
return 'Fuera de Área';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// All those starting with 4
|
// Fuera de área rule 2: 4XX (starts with '4', regardless of digits XX)
|
||||||
if (salaStr.startsWith('4')) {
|
if (salaStr.startsWith('4')) {
|
||||||
return 'Fuera de Área';
|
return 'Fuera de Área';
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-274
@@ -1,11 +1,8 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Microscope, Plus, Search, Calendar, AlertCircle, Trash2, CheckCircle2, Pencil } from 'lucide-react';
|
import { Microscope, Search, Calendar, AlertCircle, CheckCircle2 } from 'lucide-react';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Label } from '@/components/ui/label';
|
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import type { Cultivo, Paciente, Cama, Internacion } from '@/types';
|
import type { Cultivo, Paciente, Cama, Internacion } from '@/types';
|
||||||
|
|
||||||
@@ -16,12 +13,12 @@ interface CultivosProps {
|
|||||||
camas?: Cama[];
|
camas?: Cama[];
|
||||||
patient?: Paciente;
|
patient?: Paciente;
|
||||||
internacionId?: string;
|
internacionId?: string;
|
||||||
onAgregarCultivo: (cultivo: Omit<Cultivo, 'id'>) => void;
|
onAgregarCultivo?: (cultivo: Omit<Cultivo, 'id'>) => void;
|
||||||
onActualizarCultivo?: (id: string, datos: Partial<Cultivo>) => void;
|
onActualizarCultivo?: (id: string, datos: Partial<Cultivo>) => void;
|
||||||
onEliminarCultivo: (id: string) => void;
|
onEliminarCultivo?: (id: string) => void;
|
||||||
getPacienteById?: (id: string) => Paciente | undefined;
|
getPacienteById?: (id: string) => Paciente | undefined;
|
||||||
getInternacionActivaByPaciente?: (pacienteId: string) => Internacion | undefined;
|
getInternacionActivaByPaciente?: (pacienteId: string) => Internacion | undefined;
|
||||||
canEdit: boolean;
|
canEdit?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Cultivos({
|
export function Cultivos({
|
||||||
@@ -30,33 +27,10 @@ export function Cultivos({
|
|||||||
internaciones = [],
|
internaciones = [],
|
||||||
camas = [],
|
camas = [],
|
||||||
patient,
|
patient,
|
||||||
internacionId,
|
|
||||||
onAgregarCultivo,
|
|
||||||
onActualizarCultivo,
|
|
||||||
onEliminarCultivo,
|
|
||||||
getPacienteById,
|
getPacienteById,
|
||||||
getInternacionActivaByPaciente,
|
|
||||||
canEdit,
|
|
||||||
}: CultivosProps) {
|
}: CultivosProps) {
|
||||||
const [busqueda, setBusqueda] = useState('');
|
const [busqueda, setBusqueda] = useState('');
|
||||||
const [filtroEstado, setFiltroEstado] = useState<'todos' | 'NAF/Pendiente' | 'Parcial' | 'Positivo' | 'Negativo'>('todos');
|
const [filtroEstado, setFiltroEstado] = useState<'todos' | 'NAF/Pendiente' | 'Parcial' | 'Positivo' | 'Negativo'>('todos');
|
||||||
const [dialogoNuevoAbierto, setDialogoNuevoAbierto] = useState(false);
|
|
||||||
const [dialogoParcialAbierto, setDialogoParcialAbierto] = useState(false);
|
|
||||||
const [dialogoDefinitivoAbierto, setDialogoDefinitivoAbierto] = useState(false);
|
|
||||||
const [cultivoSeleccionado, setCultivoSeleccionado] = useState<Cultivo | null>(null);
|
|
||||||
|
|
||||||
const [pacienteSeleccionado, setPacienteSeleccionado] = useState<string>(patient?.id || '');
|
|
||||||
const [busquedaPaciente, setBusquedaPaciente] = useState('');
|
|
||||||
const [fechaToma, setFechaToma] = useState(new Date().toISOString().split('T')[0]);
|
|
||||||
const [protocolo, setProtocolo] = useState('');
|
|
||||||
const [tipoMuestra, setTipoMuestra] = useState<Cultivo['tipoMuestra']>('HMCx2');
|
|
||||||
const [observaciones, setObservaciones] = useState('');
|
|
||||||
|
|
||||||
const [fechaResultado, setFechaResultado] = useState(new Date().toISOString().split('T')[0]);
|
|
||||||
const [estadoResultado, setEstadoResultado] = useState<Cultivo['estado']>('Positivo');
|
|
||||||
const [germen, setGermen] = useState('');
|
|
||||||
const [sensible, setSensible] = useState('');
|
|
||||||
const [resistente, setResistente] = useState('');
|
|
||||||
|
|
||||||
const findPaciente = (pacienteId: string): Paciente | undefined => {
|
const findPaciente = (pacienteId: string): Paciente | undefined => {
|
||||||
if (patient && patient.id === pacienteId) return patient;
|
if (patient && patient.id === pacienteId) return patient;
|
||||||
@@ -107,88 +81,25 @@ export function Cultivos({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const abrirNuevo = () => {
|
|
||||||
setCultivoSeleccionado(null);
|
|
||||||
setPacienteSeleccionado(patient?.id || '');
|
|
||||||
setBusquedaPaciente('');
|
|
||||||
setFechaToma(new Date().toISOString().split('T')[0]);
|
|
||||||
setProtocolo('');
|
|
||||||
setTipoMuestra('HMCx2');
|
|
||||||
setObservaciones('');
|
|
||||||
setDialogoNuevoAbierto(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
const abrirParcial = (cultivo: Cultivo) => {
|
|
||||||
setCultivoSeleccionado(cultivo);
|
|
||||||
setGermen(cultivo.germen || '');
|
|
||||||
setSensible(cultivo.sensible || '');
|
|
||||||
setResistente(cultivo.resistente || '');
|
|
||||||
setDialogoParcialAbierto(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
const abrirDefinitivo = (cultivo: Cultivo) => {
|
|
||||||
setCultivoSeleccionado(cultivo);
|
|
||||||
setFechaResultado(new Date().toISOString().split('T')[0]);
|
|
||||||
setEstadoResultado(cultivo.estado === 'Parcial' ? 'Positivo' : cultivo.estado);
|
|
||||||
setGermen(cultivo.germen || '');
|
|
||||||
setSensible(cultivo.sensible || '');
|
|
||||||
setResistente(cultivo.resistente || '');
|
|
||||||
setDialogoDefinitivoAbierto(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
const guardarNuevo = () => {
|
|
||||||
const targetPac = patient || findPaciente(pacienteSeleccionado);
|
|
||||||
if (!protocolo.trim() || !targetPac) return;
|
|
||||||
const activeInter = getInternacionActivaByPaciente ? getInternacionActivaByPaciente(targetPac.id) : undefined;
|
|
||||||
const targetInternacionId = internacionId || activeInter?.id || '';
|
|
||||||
|
|
||||||
onAgregarCultivo({
|
|
||||||
pacienteId: targetPac.id,
|
|
||||||
internacionId: targetInternacionId,
|
|
||||||
fechaToma,
|
|
||||||
protocolo,
|
|
||||||
tipoMuestra,
|
|
||||||
observaciones: observaciones,
|
|
||||||
estado: 'NAF/Pendiente',
|
|
||||||
});
|
|
||||||
setDialogoNuevoAbierto(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
const guardarParcial = () => {
|
|
||||||
if (!cultivoSeleccionado || !germen.trim()) return;
|
|
||||||
if (onActualizarCultivo) {
|
|
||||||
onActualizarCultivo(cultivoSeleccionado.id, {
|
|
||||||
estado: 'Parcial',
|
|
||||||
germen,
|
|
||||||
sensible: sensible,
|
|
||||||
resistente: resistente,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
setDialogoParcialAbierto(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
const guardarDefinitivo = () => {
|
|
||||||
if (!cultivoSeleccionado) return;
|
|
||||||
if (onActualizarCultivo) {
|
|
||||||
onActualizarCultivo(cultivoSeleccionado.id, {
|
|
||||||
estado: estadoResultado,
|
|
||||||
fechaResultado,
|
|
||||||
germen: cultivoSeleccionado.germen,
|
|
||||||
sensible: cultivoSeleccionado.sensible,
|
|
||||||
resistente: cultivoSeleccionado.resistente,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
setDialogoDefinitivoAbierto(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-6 dark:text-white">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||||
|
<div>
|
||||||
|
<h1 className="text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2.5">
|
||||||
|
<Microscope className="h-7 w-7 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
Cultivos
|
||||||
|
</h1>
|
||||||
|
<p className="text-gray-500 dark:text-gray-400">Informe y registro de cultivos y muestras</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between">
|
<div className="flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between">
|
||||||
<div className="flex-1 flex gap-2">
|
<div className="flex-1 flex gap-2">
|
||||||
<div className="relative flex-1">
|
<div className="relative flex-1">
|
||||||
<Search className="absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500" />
|
<Search className="absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500" />
|
||||||
<Input
|
<Input
|
||||||
placeholder="Buscar por protocolo, germen..."
|
placeholder="Buscar por protocolo, germen, paciente..."
|
||||||
value={busqueda}
|
value={busqueda}
|
||||||
onChange={(e) => setBusqueda(e.target.value)}
|
onChange={(e) => setBusqueda(e.target.value)}
|
||||||
className="pl-8"
|
className="pl-8"
|
||||||
@@ -207,12 +118,6 @@ export function Cultivos({
|
|||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
{canEdit && (
|
|
||||||
<Button onClick={abrirNuevo} size="sm">
|
|
||||||
<Plus className="h-4 w-4 mr-2" />
|
|
||||||
Nuevo Cultivo
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
@@ -238,17 +143,17 @@ export function Cultivos({
|
|||||||
}`} />
|
}`} />
|
||||||
</div>
|
</div>
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2 flex-wrap">
|
||||||
<h3 className="font-bold text-sm sm:text-base truncate">
|
|
||||||
{pac ? `${pac.apellido}, ${pac.nombre}` : 'Paciente no encontrado'}
|
|
||||||
</h3>
|
|
||||||
{camaNombre && (
|
{camaNombre && (
|
||||||
<Badge variant="outline" className="text-xs shrink-0">
|
<Badge variant="outline" className="text-xs shrink-0 font-semibold bg-blue-50 text-blue-700 dark:bg-blue-950/80 dark:text-blue-300 dark:border-blue-800">
|
||||||
{camaNombre}
|
{camaNombre}
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
|
<h3 className="font-bold text-sm sm:text-base truncate">
|
||||||
|
{pac ? `${pac.apellido}, ${pac.nombre}` : 'Paciente no encontrado'}
|
||||||
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap items-center gap-2 text-xs sm:text-sm text-gray-500">
|
<div className="flex flex-wrap items-center gap-2 text-xs sm:text-sm text-gray-500 mt-1">
|
||||||
<span className="flex items-center gap-1">
|
<span className="flex items-center gap-1">
|
||||||
<Calendar className="h-3 w-3" />
|
<Calendar className="h-3 w-3" />
|
||||||
{cultivo.fechaToma}
|
{cultivo.fechaToma}
|
||||||
@@ -260,30 +165,6 @@ export function Cultivos({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap items-center gap-1 sm:gap-2 ml-auto sm:ml-0">
|
|
||||||
{canEdit && onActualizarCultivo && cultivo.estado === 'NAF/Pendiente' && (
|
|
||||||
<Button size="sm" variant="outline" className="text-xs px-2 py-1" onClick={() => abrirDefinitivo(cultivo)}>
|
|
||||||
<CheckCircle2 className="h-3 w-3 sm:h-4 sm:w-4 sm:mr-1" />
|
|
||||||
<span className="hidden sm:inline">Definitivo</span>
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{canEdit && onActualizarCultivo && (cultivo.estado === 'Positivo' || cultivo.estado === 'Negativo') && (
|
|
||||||
<Button size="sm" variant="outline" className="text-xs px-2 py-1" onClick={() => abrirDefinitivo(cultivo)}>
|
|
||||||
<Pencil className="h-3 w-3 sm:h-4 sm:w-4" />
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{canEdit && onActualizarCultivo && cultivo.estado === 'Parcial' && (
|
|
||||||
<Button size="sm" variant="outline" className="text-xs px-2 py-1" onClick={() => abrirParcial(cultivo)}>
|
|
||||||
<Pencil className="h-3 w-3 sm:h-4 sm:w-4 sm:mr-1" />
|
|
||||||
<span className="hidden sm:inline">Editar</span>
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{canEdit && (
|
|
||||||
<Button size="sm" variant="outline" className="text-red-600 text-xs px-2 py-1" onClick={() => onEliminarCultivo(cultivo.id)}>
|
|
||||||
<Trash2 className="h-3 w-3 sm:h-4 sm:w-4" />
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{cultivo.protocolo && (
|
{cultivo.protocolo && (
|
||||||
@@ -366,138 +247,6 @@ export function Cultivos({
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Dialog Nuevo Cultivo */}
|
|
||||||
<Dialog open={dialogoNuevoAbierto} onOpenChange={setDialogoNuevoAbierto}>
|
|
||||||
<DialogContent>
|
|
||||||
<DialogHeader>
|
|
||||||
<DialogTitle>Nuevo Cultivo</DialogTitle>
|
|
||||||
</DialogHeader>
|
|
||||||
<div className="space-y-4">
|
|
||||||
{!patient && (
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Paciente</Label>
|
|
||||||
<Input
|
|
||||||
placeholder="Buscar paciente por nombre o DNI..."
|
|
||||||
value={busquedaPaciente}
|
|
||||||
onChange={(e) => setBusquedaPaciente(e.target.value)}
|
|
||||||
className="mb-2 text-xs"
|
|
||||||
/>
|
|
||||||
<Select value={pacienteSeleccionado} onValueChange={setPacienteSeleccionado}>
|
|
||||||
<SelectTrigger>
|
|
||||||
<SelectValue placeholder="Seleccionar paciente" />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent className="max-h-60 overflow-auto">
|
|
||||||
{pacientes
|
|
||||||
.filter(p => !busquedaPaciente || `${p.apellido} ${p.nombre} ${p.dni}`.toLowerCase().includes(busquedaPaciente.toLowerCase()))
|
|
||||||
.map(p => (
|
|
||||||
<SelectItem key={p.id} value={p.id}>
|
|
||||||
{p.apellido}, {p.nombre} (DNI: {p.dni})
|
|
||||||
</SelectItem>
|
|
||||||
))}
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className="grid grid-cols-2 gap-4">
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Fecha de Toma</Label>
|
|
||||||
<Input type="date" value={fechaToma} onChange={(e) => setFechaToma(e.target.value)} />
|
|
||||||
</div>
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Tipo de Muestra</Label>
|
|
||||||
<Select value={tipoMuestra} onValueChange={(v) => setTipoMuestra(v as Cultivo['tipoMuestra'])}>
|
|
||||||
<SelectTrigger>
|
|
||||||
<SelectValue />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value="HMCx2">HMCx2</SelectItem>
|
|
||||||
<SelectItem value="HMCx1">HMCx1</SelectItem>
|
|
||||||
<SelectItem value="Plaq.File">Plaq. File</SelectItem>
|
|
||||||
<SelectItem value="Orina">Orina</SelectItem>
|
|
||||||
<SelectItem value="Cateter">Cateter</SelectItem>
|
|
||||||
<SelectItem value="Esputo">Esputo</SelectItem>
|
|
||||||
<SelectItem value="LCR">LCR</SelectItem>
|
|
||||||
<SelectItem value="Sangre">Sangre</SelectItem>
|
|
||||||
<SelectItem value="Tejido">Tejido</SelectItem>
|
|
||||||
<SelectItem value="Otro">Otro</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Protocolo</Label>
|
|
||||||
<Input value={protocolo} onChange={(e) => setProtocolo(e.target.value)} placeholder="Ej: P-2024-001" />
|
|
||||||
</div>
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Observaciones</Label>
|
|
||||||
<Input value={observaciones} onChange={(e) => setObservaciones(e.target.value)} />
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-end gap-2">
|
|
||||||
<Button variant="outline" onClick={() => setDialogoNuevoAbierto(false)}>Cancelar</Button>
|
|
||||||
<Button onClick={guardarNuevo}>Guardar</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
|
|
||||||
{/* Dialog Parcial */}
|
|
||||||
<Dialog open={dialogoParcialAbierto} onOpenChange={setDialogoParcialAbierto}>
|
|
||||||
<DialogContent>
|
|
||||||
<DialogHeader>
|
|
||||||
<DialogTitle>Resultado Parcial</DialogTitle>
|
|
||||||
</DialogHeader>
|
|
||||||
<div className="space-y-4">
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Germen</Label>
|
|
||||||
<Input value={germen} onChange={(e) => setGermen(e.target.value)} />
|
|
||||||
</div>
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Sensible a</Label>
|
|
||||||
<Input value={sensible} onChange={(e) => setSensible(e.target.value)} placeholder="Ej: Ampicilina" />
|
|
||||||
</div>
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Resistente a</Label>
|
|
||||||
<Input value={resistente} onChange={(e) => setResistente(e.target.value)} placeholder="Ej: Cefalosporinas" />
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-end gap-2">
|
|
||||||
<Button variant="outline" onClick={() => setDialogoParcialAbierto(false)}>Cancelar</Button>
|
|
||||||
<Button onClick={guardarParcial}>Guardar</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
|
|
||||||
{/* Dialog Definitivo */}
|
|
||||||
<Dialog open={dialogoDefinitivoAbierto} onOpenChange={setDialogoDefinitivoAbierto}>
|
|
||||||
<DialogContent>
|
|
||||||
<DialogHeader>
|
|
||||||
<DialogTitle>Resultado Definitivo</DialogTitle>
|
|
||||||
</DialogHeader>
|
|
||||||
<div className="space-y-4">
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Fecha de Resultado</Label>
|
|
||||||
<Input type="date" value={fechaResultado} onChange={(e) => setFechaResultado(e.target.value)} />
|
|
||||||
</div>
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Label>Estado</Label>
|
|
||||||
<Select value={estadoResultado} onValueChange={(v) => setEstadoResultado(v as Cultivo['estado'])}>
|
|
||||||
<SelectTrigger>
|
|
||||||
<SelectValue />
|
|
||||||
</SelectTrigger>
|
|
||||||
<SelectContent>
|
|
||||||
<SelectItem value="Positivo">Positivo</SelectItem>
|
|
||||||
<SelectItem value="Negativo">Negativo</SelectItem>
|
|
||||||
</SelectContent>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-end gap-2">
|
|
||||||
<Button variant="outline" onClick={() => setDialogoDefinitivoAbierto(false)}>Cancelar</Button>
|
|
||||||
<Button onClick={guardarDefinitivo}>Guardar</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
LayoutDashboard,
|
||||||
Bed,
|
Bed,
|
||||||
Users,
|
Users,
|
||||||
ClipboardList,
|
ClipboardList,
|
||||||
@@ -52,8 +53,11 @@ export function Dashboard({
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold text-gray-900 dark:text-white">Dashboard</h1>
|
<h1 className="text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2.5">
|
||||||
<p className="text-gray-500 dark:text-gray-400">Resumen del servicio - Clinica Medica</p>
|
<LayoutDashboard className="h-7 w-7 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
Dashboard
|
||||||
|
</h1>
|
||||||
|
<p className="text-gray-500 dark:text-gray-400">Resumen del servicio - Clínica Médica</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Badge variant="outline" className="bg-green-50 text-green-700 border-green-200 dark:bg-green-900 dark:text-green-300 dark:border-green-700">
|
<Badge variant="outline" className="bg-green-50 text-green-700 border-green-200 dark:bg-green-900 dark:text-green-300 dark:border-green-700">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
|
|||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import type { Paciente, Cama, Grupo, Internacion } from '@/types';
|
import type { Paciente, Cama, Grupo, Internacion } from '@/types';
|
||||||
import { getNombreProfesional, calcularEdad } from '@/lib/utils';
|
import { getNombreProfesional, calcularEdad, computeSector } from '@/lib/utils';
|
||||||
import { useHospitalStore } from '@/hooks/useHospitalStore';
|
import { useHospitalStore } from '@/hooks/useHospitalStore';
|
||||||
|
|
||||||
interface EditIngresoProps {
|
interface EditIngresoProps {
|
||||||
@@ -343,7 +343,7 @@ export function EditIngreso({
|
|||||||
onChange={(e) => setCamaInput(e.target.value)}
|
onChange={(e) => setCamaInput(e.target.value)}
|
||||||
/>
|
/>
|
||||||
<p className="text-xs text-gray-500 mt-1">
|
<p className="text-xs text-gray-500 mt-1">
|
||||||
Esta cama será creada como "Fuera de área"
|
{camaInput.trim() ? `Clasificación: ${computeSector(camaInput.trim())}` : 'Formato XXX-YY (Salas 3XX impares y 4XX son Fuera de Área)'}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -207,7 +207,10 @@ export function Evoluciones({
|
|||||||
<div className="space-y-6 dark:text-white overflow-x-hidden max-w-screen">
|
<div className="space-y-6 dark:text-white overflow-x-hidden max-w-screen">
|
||||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold text-gray-900 dark:text-white">Evoluciones Diarias</h1>
|
<h1 className="text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2.5">
|
||||||
|
<FileText className="h-7 w-7 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
Evoluciones Diarias
|
||||||
|
</h1>
|
||||||
<p className="text-gray-500 dark:text-gray-400">Registro de evoluciones y signos vitales</p>
|
<p className="text-gray-500 dark:text-gray-400">Registro de evoluciones y signos vitales</p>
|
||||||
</div>
|
</div>
|
||||||
<Dialog open={dialogoAbierto} onOpenChange={setDialogoAbierto}>
|
<Dialog open={dialogoAbierto} onOpenChange={setDialogoAbierto}>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
|
|||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Plus, Pencil, Trash2 } from 'lucide-react';
|
import { Plus, Pencil, Trash2, UserCog } from 'lucide-react';
|
||||||
|
|
||||||
const API_BASE = import.meta.env.VITE_API_URL || '/api';
|
const API_BASE = import.meta.env.VITE_API_URL || '/api';
|
||||||
|
|
||||||
@@ -177,7 +177,10 @@ export function GestionUsuarios() {
|
|||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-3">
|
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-3">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold dark:text-white">Gestión de Usuarios</h1>
|
<h1 className="text-2xl font-bold dark:text-white flex items-center gap-2.5">
|
||||||
|
<UserCog className="h-7 w-7 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
Gestión de Usuarios
|
||||||
|
</h1>
|
||||||
<p className="text-gray-500 dark:text-gray-400">Administrar usuarios del sistema</p>
|
<p className="text-gray-500 dark:text-gray-400">Administrar usuarios del sistema</p>
|
||||||
</div>
|
</div>
|
||||||
<Button className="w-full sm:w-auto" onClick={() => { resetForm(); setDialogOpen(true); }}>
|
<Button className="w-full sm:w-auto" onClick={() => { resetForm(); setDialogOpen(true); }}>
|
||||||
|
|||||||
@@ -270,8 +270,8 @@ export function HistoriaClinica({
|
|||||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold text-gray-900 dark:text-white">
|
<h1 className="text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2.5">
|
||||||
<ClipboardList className="h-6 w-6 text-blue-600" />
|
<ClipboardList className="h-7 w-7 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
{cama?.numero || 'N/A'} - Historia Clínica
|
{cama?.numero || 'N/A'} - Historia Clínica
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-gray-500 dark:text-gray-400">Módulo de Historia Clínica de Internación</p>
|
<p className="text-gray-500 dark:text-gray-400">Módulo de Historia Clínica de Internación</p>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { ClipboardList, Plus, Search, LogOut, CheckCircle2, MoreHorizontal, FileText, Trash2 } from 'lucide-react';
|
import { ClipboardList, Plus, Search, LogOut, CheckCircle2, MoreHorizontal, FileText, Trash2, Bed, User, Calendar, IdCard, Activity, CalendarDays, Clock, Settings } from 'lucide-react';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
@@ -223,7 +223,10 @@ export function Internaciones({
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold text-gray-900 dark:text-white">Internaciones</h1>
|
<h1 className="text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2.5">
|
||||||
|
<ClipboardList className="h-7 w-7 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
Internaciones
|
||||||
|
</h1>
|
||||||
<p className="text-gray-500 dark:text-gray-400">Gestión de internaciones en sala</p>
|
<p className="text-gray-500 dark:text-gray-400">Gestión de internaciones en sala</p>
|
||||||
</div>
|
</div>
|
||||||
<Dialog open={dialogoNuevaAbierto} onOpenChange={setDialogoNuevaAbierto}>
|
<Dialog open={dialogoNuevaAbierto} onOpenChange={setDialogoNuevaAbierto}>
|
||||||
@@ -412,15 +415,60 @@ export function Internaciones({
|
|||||||
<Table className="w-full min-w-max text-sm">
|
<Table className="w-full min-w-max text-sm">
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>Cama</TableHead>
|
<TableHead>
|
||||||
<TableHead>Apellido</TableHead>
|
<div className="flex items-center gap-1.5">
|
||||||
<TableHead>Nombre</TableHead>
|
<Bed className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
<TableHead className="text-center">Edad</TableHead>
|
<span>Cama</span>
|
||||||
<TableHead className="text-center">DNI</TableHead>
|
</div>
|
||||||
<TableHead className="text-center">Estado</TableHead>
|
</TableHead>
|
||||||
<TableHead className="text-center">Fecha Ingreso</TableHead>
|
<TableHead>
|
||||||
<TableHead className="text-center">Duración</TableHead>
|
<div className="flex items-center gap-1.5">
|
||||||
<TableHead className="text-center w-[60px]">Acciones</TableHead>
|
<User className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Apellido</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<User className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Nombre</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead className="text-center">
|
||||||
|
<div className="flex items-center justify-center gap-1.5">
|
||||||
|
<Calendar className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Edad</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead className="text-center">
|
||||||
|
<div className="flex items-center justify-center gap-1.5">
|
||||||
|
<IdCard className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>DNI</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead className="text-center">
|
||||||
|
<div className="flex items-center justify-center gap-1.5">
|
||||||
|
<Activity className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Estado</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead className="text-center">
|
||||||
|
<div className="flex items-center justify-center gap-1.5">
|
||||||
|
<CalendarDays className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Fecha Ingreso</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead className="text-center">
|
||||||
|
<div className="flex items-center justify-center gap-1.5">
|
||||||
|
<Clock className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Duración</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead className="text-center w-[60px]">
|
||||||
|
<div className="flex items-center justify-center gap-1.5">
|
||||||
|
<Settings className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span className="sr-only">Acciones</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Bed, CheckCircle2, Clock, Wrench, User, Plus, Trash, Edit2, Save, X } f
|
|||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { formatDateDDMMYYYY, getNombreProfesional, isCamaFueraDeGrupo } from '@/lib/utils';
|
import { formatDateDDMMYYYY, getNombreProfesional, isCamaFueraDeGrupo, computeSector } from '@/lib/utils';
|
||||||
|
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
@@ -181,7 +181,10 @@ export function MapaCamas({
|
|||||||
<div className="space-y-6 dark:text-white">
|
<div className="space-y-6 dark:text-white">
|
||||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold text-gray-900 dark:text-white">Mapa de Camas</h1>
|
<h1 className="text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2.5">
|
||||||
|
<Bed className="h-7 w-7 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
Camas
|
||||||
|
</h1>
|
||||||
<p className="text-gray-500 dark:text-gray-400">Gestión de camas del servicio</p>
|
<p className="text-gray-500 dark:text-gray-400">Gestión de camas del servicio</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
@@ -283,7 +286,7 @@ export function MapaCamas({
|
|||||||
{getEstadoIcono(cama)}
|
{getEstadoIcono(cama)}
|
||||||
</div>
|
</div>
|
||||||
<p className="font-bold text-sm sm:text-lg">{cama.numero}</p>
|
<p className="font-bold text-sm sm:text-lg">{cama.numero}</p>
|
||||||
<p className="text-xs opacity-75 truncate">{cama.grupoId ? grupoById[cama.grupoId] ?? 'Grupo desconocido' : 'Sin grupo'} - {cama.sector || 'En Área'}</p>
|
<p className="text-xs opacity-75 truncate">{cama.grupoId ? grupoById[cama.grupoId] ?? 'Grupo desconocido' : 'Sin grupo'} - {computeSector(cama.numero)}</p>
|
||||||
<Badge variant="outline" className="mt-1 sm:mt-2 text-xs bg-white/50 dark:bg-gray-800 dark:text-gray-300">
|
<Badge variant="outline" className="mt-1 sm:mt-2 text-xs bg-white/50 dark:bg-gray-800 dark:text-gray-300">
|
||||||
{cama.tipo}
|
{cama.tipo}
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
|
|||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import type { Paciente, Cama, Grupo, Internacion } from '@/types';
|
import type { Paciente, Cama, Grupo, Internacion } from '@/types';
|
||||||
import { getNombreProfesional } from '@/lib/utils';
|
import { getNombreProfesional, computeSector } from '@/lib/utils';
|
||||||
import { useHospitalStore } from '@/hooks/useHospitalStore';
|
import { useHospitalStore } from '@/hooks/useHospitalStore';
|
||||||
|
|
||||||
interface NuevoIngresoProps {
|
interface NuevoIngresoProps {
|
||||||
@@ -162,7 +162,7 @@ export function NuevoIngreso({ pacientes, camas, grupos, onIniciarInternacion, o
|
|||||||
grupoId: grupoSeleccionado,
|
grupoId: grupoSeleccionado,
|
||||||
tipo: 'General',
|
tipo: 'General',
|
||||||
estado: 'Ocupada',
|
estado: 'Ocupada',
|
||||||
sector: 'Fuera de Área'
|
sector: computeSector(numeroCama)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
toast.error('No se puede crear la cama');
|
toast.error('No se puede crear la cama');
|
||||||
@@ -381,7 +381,7 @@ export function NuevoIngreso({ pacientes, camas, grupos, onIniciarInternacion, o
|
|||||||
onChange={(e) => setCamaInput(e.target.value)}
|
onChange={(e) => setCamaInput(e.target.value)}
|
||||||
/>
|
/>
|
||||||
<p className="text-xs text-gray-500 dark:text-gray-400 mt-1">
|
<p className="text-xs text-gray-500 dark:text-gray-400 mt-1">
|
||||||
Esta cama será creada como "Fuera de área"
|
{camaInput.trim() ? `Clasificación: ${computeSector(camaInput.trim())}` : 'Formato XXX-YY (Salas 3XX impares y 4XX son Fuera de Área)'}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
+294
-100
@@ -1,5 +1,5 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Users, Plus, Search, Edit2, Trash2, User, Calendar, Phone, Mail, Droplet, AlertTriangle, X, Save } from 'lucide-react';
|
import { Users, Plus, Search, Edit2, Trash2, User, Calendar, Phone, AlertTriangle, X, Save, IdCard, Activity, Settings, ShieldCheck, MoreHorizontal, Eye } from 'lucide-react';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
@@ -7,7 +7,9 @@ import { Input } from '@/components/ui/input';
|
|||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from '@/components/ui/alert-dialog';
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
|
||||||
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '@/components/ui/alert-dialog';
|
||||||
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
|
||||||
import type { Paciente } from '@/types';
|
import type { Paciente } from '@/types';
|
||||||
|
|
||||||
interface PacientesProps {
|
interface PacientesProps {
|
||||||
@@ -28,6 +30,9 @@ export function Pacientes({
|
|||||||
const [busqueda, setBusqueda] = useState('');
|
const [busqueda, setBusqueda] = useState('');
|
||||||
const [dialogoAbierto, setDialogoAbierto] = useState(false);
|
const [dialogoAbierto, setDialogoAbierto] = useState(false);
|
||||||
const [pacienteEditando, setPacienteEditando] = useState<Paciente | null>(null);
|
const [pacienteEditando, setPacienteEditando] = useState<Paciente | null>(null);
|
||||||
|
const [pacienteAEliminar, setPacienteAEliminar] = useState<Paciente | null>(null);
|
||||||
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||||
|
const [pacienteVerDetalle, setPacienteVerDetalle] = useState<Paciente | null>(null);
|
||||||
|
|
||||||
// Formulario
|
// Formulario
|
||||||
const [nombre, setNombre] = useState('');
|
const [nombre, setNombre] = useState('');
|
||||||
@@ -142,7 +147,10 @@ export function Pacientes({
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold text-gray-900 dark:text-white">Pacientes</h1>
|
<h1 className="text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2.5">
|
||||||
|
<Users className="h-7 w-7 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
Pacientes
|
||||||
|
</h1>
|
||||||
<p className="text-gray-500 dark:text-gray-400">Gestión de pacientes del hospital</p>
|
<p className="text-gray-500 dark:text-gray-400">Gestión de pacientes del hospital</p>
|
||||||
</div>
|
</div>
|
||||||
<Dialog open={dialogoAbierto} onOpenChange={setDialogoAbierto}>
|
<Dialog open={dialogoAbierto} onOpenChange={setDialogoAbierto}>
|
||||||
@@ -326,115 +334,157 @@ export function Pacientes({
|
|||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* Lista de Pacientes */}
|
{/* Tabla de Pacientes */}
|
||||||
<div className="grid grid-cols-1 gap-4">
|
{pacientesFiltrados.length > 0 ? (
|
||||||
{pacientesFiltrados.map((paciente) => (
|
<Card>
|
||||||
<Card key={paciente.id} className="hover:shadow-md transition-shadow">
|
<CardContent className="p-0">
|
||||||
<CardContent className="p-4">
|
<div className="overflow-x-auto">
|
||||||
<div className="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4">
|
<Table className="w-full min-w-max text-sm">
|
||||||
<div className="flex items-start gap-4">
|
<TableHeader>
|
||||||
<div className="h-12 w-12 bg-blue-100 rounded-full flex items-center justify-center flex-shrink-0">
|
<TableRow>
|
||||||
<User className="h-6 w-6 text-blue-600" />
|
<TableHead>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<User className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Apellido</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
</TableHead>
|
||||||
<div className="flex items-center gap-2 flex-wrap">
|
<TableHead>
|
||||||
<h3 className="font-bold text-lg">
|
<div className="flex items-center gap-1.5">
|
||||||
{paciente.apellido}, {paciente.nombre}
|
<User className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
</h3>
|
<span>Nombre</span>
|
||||||
{estaInternado(paciente.id) && (
|
</div>
|
||||||
<Badge className="bg-purple-100 text-purple-800">
|
</TableHead>
|
||||||
|
<TableHead>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<IdCard className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>DNI</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<Calendar className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Edad</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<Users className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Sexo</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<ShieldCheck className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Obra Social</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<Phone className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Teléfono</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<Activity className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span>Estado</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
<TableHead className="w-[80px]">
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<Settings className="h-3.5 w-3.5 text-blue-600 dark:text-blue-400 shrink-0" />
|
||||||
|
<span className="sr-only">Acciones</span>
|
||||||
|
</div>
|
||||||
|
</TableHead>
|
||||||
|
</TableRow>
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{pacientesFiltrados.map((paciente) => {
|
||||||
|
const internado = estaInternado(paciente.id);
|
||||||
|
return (
|
||||||
|
<TableRow key={paciente.id}>
|
||||||
|
<TableCell className="font-medium text-gray-900 dark:text-white">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<span>{paciente.apellido}</span>
|
||||||
|
{paciente.alergias && (
|
||||||
|
<Badge variant="outline" className="bg-amber-50 text-amber-700 border-amber-200 text-xs px-1.5 py-0">
|
||||||
|
<AlertTriangle className="h-2.5 w-2.5 mr-0.5" />
|
||||||
|
Alergia
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="text-gray-700 dark:text-gray-300">
|
||||||
|
{paciente.nombre}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="text-gray-600 dark:text-gray-400 font-mono">
|
||||||
|
{paciente.dni}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="text-gray-600 dark:text-gray-400">
|
||||||
|
{getEdad(paciente.fechaNacimiento)}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="text-gray-600 dark:text-gray-400">
|
||||||
|
{paciente.sexo}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="text-gray-600 dark:text-gray-400">
|
||||||
|
{paciente.obraSocial || '-'}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="text-gray-600 dark:text-gray-400">
|
||||||
|
{paciente.telefono || '-'}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
{internado ? (
|
||||||
|
<Badge className="bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-300 border-purple-200">
|
||||||
Internado
|
Internado
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
) : (
|
||||||
</div>
|
<Badge variant="outline" className="bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-300">
|
||||||
<div className="grid grid-cols-2 sm:grid-cols-4 gap-x-4 gap-y-1 mt-2 text-sm text-gray-500">
|
Ambulatorio
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
<span className="font-medium">DNI:</span> {paciente.dni}
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
<Calendar className="h-3 w-3" />
|
|
||||||
{getEdad(paciente.fechaNacimiento)} años
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
<span className="font-medium">Sexo:</span> {paciente.sexo}
|
|
||||||
</div>
|
|
||||||
{paciente.grupoSanguineo && (
|
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
<Droplet className="h-3 w-3" />
|
|
||||||
{paciente.grupoSanguineo}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-wrap gap-3 mt-2 text-sm text-gray-500">
|
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
<Phone className="h-3 w-3" />
|
|
||||||
{paciente.telefono}
|
|
||||||
</div>
|
|
||||||
{paciente.email && (
|
|
||||||
<div className="flex items-center gap-1">
|
|
||||||
<Mail className="h-3 w-3" />
|
|
||||||
{paciente.email}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{(paciente.alergias || paciente.antecedentes) && (
|
|
||||||
<div className="mt-2 flex flex-wrap gap-2">
|
|
||||||
{paciente.alergias && (
|
|
||||||
<Badge variant="outline" className="bg-amber-50 text-amber-700 border-amber-200">
|
|
||||||
<AlertTriangle className="h-3 w-3 mr-1" />
|
|
||||||
Alergias
|
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
{paciente.antecedentes && (
|
</TableCell>
|
||||||
<Badge variant="outline" className="bg-blue-50 text-blue-700 border-blue-200">
|
<TableCell>
|
||||||
Antecedentes
|
<div className="flex items-center">
|
||||||
</Badge>
|
<DropdownMenu>
|
||||||
)}
|
<DropdownMenuTrigger asChild>
|
||||||
</div>
|
<Button variant="ghost" size="icon" className="h-8 w-8 p-0">
|
||||||
)}
|
<MoreHorizontal className="h-4 w-4" />
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => handleEditar(paciente)}
|
|
||||||
>
|
|
||||||
<Edit2 className="h-4 w-4" />
|
|
||||||
</Button>
|
</Button>
|
||||||
<AlertDialog>
|
</DropdownMenuTrigger>
|
||||||
<AlertDialogTrigger asChild>
|
<DropdownMenuContent align="end">
|
||||||
<Button variant="outline" size="sm" className="text-red-600 hover:bg-red-50">
|
<DropdownMenuLabel>Acciones</DropdownMenuLabel>
|
||||||
<Trash2 className="h-4 w-4" />
|
<DropdownMenuSeparator />
|
||||||
</Button>
|
<DropdownMenuItem onClick={() => setPacienteVerDetalle(paciente)}>
|
||||||
</AlertDialogTrigger>
|
<Eye className="h-4 w-4 mr-2 text-teal-600 dark:text-teal-400" />
|
||||||
<AlertDialogContent>
|
Detalles
|
||||||
<AlertDialogHeader>
|
</DropdownMenuItem>
|
||||||
<AlertDialogTitle>¿Eliminar paciente?</AlertDialogTitle>
|
<DropdownMenuItem onClick={() => handleEditar(paciente)}>
|
||||||
<AlertDialogDescription>
|
<Edit2 className="h-4 w-4 mr-2 text-blue-600" />
|
||||||
Esta acción no se puede deshacer. Se eliminará permanentemente el paciente{' '}
|
Editar paciente
|
||||||
<strong>{paciente.apellido}, {paciente.nombre}</strong>.
|
</DropdownMenuItem>
|
||||||
</AlertDialogDescription>
|
<DropdownMenuItem
|
||||||
</AlertDialogHeader>
|
className="text-red-600 focus:text-red-600 focus:bg-red-50 dark:focus:bg-red-950/50"
|
||||||
<AlertDialogFooter>
|
onClick={() => {
|
||||||
<AlertDialogCancel>Cancelar</AlertDialogCancel>
|
setPacienteAEliminar(paciente);
|
||||||
<AlertDialogAction
|
setDeleteDialogOpen(true);
|
||||||
onClick={() => onEliminar(paciente.id)}
|
}}
|
||||||
className="bg-red-600 hover:bg-red-700"
|
|
||||||
>
|
>
|
||||||
|
<Trash2 className="h-4 w-4 mr-2" />
|
||||||
Eliminar
|
Eliminar
|
||||||
</AlertDialogAction>
|
</DropdownMenuItem>
|
||||||
</AlertDialogFooter>
|
</DropdownMenuContent>
|
||||||
</AlertDialogContent>
|
</DropdownMenu>
|
||||||
</AlertDialog>
|
|
||||||
</div>
|
</div>
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
))}
|
) : (
|
||||||
</div>
|
|
||||||
|
|
||||||
{pacientesFiltrados.length === 0 && (
|
|
||||||
<div className="text-center py-12 text-gray-400">
|
<div className="text-center py-12 text-gray-400">
|
||||||
<Users className="h-16 w-16 mx-auto mb-4 opacity-50" />
|
<Users className="h-16 w-16 mx-auto mb-4 opacity-50" />
|
||||||
<p className="text-lg">
|
<p className="text-lg">
|
||||||
@@ -448,6 +498,150 @@ export function Pacientes({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* Dialogo de confirmacion de eliminacion */}
|
||||||
|
<AlertDialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
|
||||||
|
<AlertDialogContent>
|
||||||
|
<AlertDialogHeader>
|
||||||
|
<AlertDialogTitle>¿Eliminar paciente?</AlertDialogTitle>
|
||||||
|
<AlertDialogDescription>
|
||||||
|
Esta acción no se puede deshacer. Se eliminará permanentemente el paciente{' '}
|
||||||
|
<strong>{pacienteAEliminar?.apellido}, {pacienteAEliminar?.nombre}</strong>.
|
||||||
|
</AlertDialogDescription>
|
||||||
|
</AlertDialogHeader>
|
||||||
|
<AlertDialogFooter>
|
||||||
|
<AlertDialogCancel onClick={() => setPacienteAEliminar(null)}>Cancelar</AlertDialogCancel>
|
||||||
|
<AlertDialogAction
|
||||||
|
onClick={() => {
|
||||||
|
if (pacienteAEliminar) {
|
||||||
|
onEliminar(pacienteAEliminar.id);
|
||||||
|
setPacienteAEliminar(null);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
className="bg-red-600 hover:bg-red-700"
|
||||||
|
>
|
||||||
|
Eliminar
|
||||||
|
</AlertDialogAction>
|
||||||
|
</AlertDialogFooter>
|
||||||
|
</AlertDialogContent>
|
||||||
|
</AlertDialog>
|
||||||
|
|
||||||
|
{/* Dialogo de detalles del paciente */}
|
||||||
|
<Dialog open={!!pacienteVerDetalle} onOpenChange={(open) => { if (!open) setPacienteVerDetalle(null); }}>
|
||||||
|
<DialogContent className="max-w-lg max-h-[85vh] overflow-y-auto">
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle className="flex items-center gap-2 text-xl">
|
||||||
|
<User className="h-5 w-5 text-teal-600 dark:text-teal-400" />
|
||||||
|
Detalles del Paciente
|
||||||
|
</DialogTitle>
|
||||||
|
</DialogHeader>
|
||||||
|
{pacienteVerDetalle && (
|
||||||
|
<div className="space-y-4 pt-1">
|
||||||
|
<div className="bg-gray-50 dark:bg-gray-800/50 p-4 rounded-lg space-y-3 border border-gray-100 dark:border-gray-800">
|
||||||
|
<div className="text-lg font-semibold text-gray-900 dark:text-gray-100">
|
||||||
|
{pacienteVerDetalle.apellido || '—'}, {pacienteVerDetalle.nombre || '—'}
|
||||||
|
</div>
|
||||||
|
<div className="grid grid-cols-2 gap-3 text-sm">
|
||||||
|
<div>
|
||||||
|
<span className="text-gray-500 dark:text-gray-400 block text-xs">DNI</span>
|
||||||
|
<span className="font-mono font-medium text-gray-800 dark:text-gray-200">{pacienteVerDetalle.dni || 'Sin especificar'}</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span className="text-gray-500 dark:text-gray-400 block text-xs">Sexo</span>
|
||||||
|
<span className="font-medium text-gray-800 dark:text-gray-200">{pacienteVerDetalle.sexo || 'Sin especificar'}</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span className="text-gray-500 dark:text-gray-400 block text-xs">Fecha de Nacimiento</span>
|
||||||
|
<span className="font-medium text-gray-800 dark:text-gray-200">
|
||||||
|
{pacienteVerDetalle.fechaNacimiento ? `${pacienteVerDetalle.fechaNacimiento} (${getEdad(pacienteVerDetalle.fechaNacimiento)})` : 'Sin especificar'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span className="text-gray-500 dark:text-gray-400 block text-xs">Grupo Sanguíneo</span>
|
||||||
|
<span className="font-medium text-gray-800 dark:text-gray-200">{pacienteVerDetalle.grupoSanguineo || 'Sin especificar'}</span>
|
||||||
|
</div>
|
||||||
|
<div className="col-span-2">
|
||||||
|
<span className="text-gray-500 dark:text-gray-400 block text-xs">Estado Actual</span>
|
||||||
|
{internaciones.some(i => i.pacienteId === pacienteVerDetalle.id && i.activa) ? (
|
||||||
|
<Badge className="bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-300 border-purple-200 mt-0.5">
|
||||||
|
Internado
|
||||||
|
</Badge>
|
||||||
|
) : (
|
||||||
|
<Badge variant="outline" className="bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-300 mt-0.5">
|
||||||
|
Ambulatorio
|
||||||
|
</Badge>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Informacion de contacto, filiación y cobertura */}
|
||||||
|
<div className="space-y-2 text-sm text-gray-700 dark:text-gray-300 px-1">
|
||||||
|
<div className="flex justify-between py-1 border-b border-gray-100 dark:border-gray-800">
|
||||||
|
<span className="text-gray-500 dark:text-gray-400">Historia Clínica:</span>
|
||||||
|
<span className="font-mono font-medium">{pacienteVerDetalle.historiaClinica || 'Sin especificar'}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between py-1 border-b border-gray-100 dark:border-gray-800">
|
||||||
|
<span className="text-gray-500 dark:text-gray-400">Obra Social:</span>
|
||||||
|
<span className="font-medium">{pacienteVerDetalle.obraSocial || 'Sin especificar'}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between py-1 border-b border-gray-100 dark:border-gray-800">
|
||||||
|
<span className="text-gray-500 dark:text-gray-400">Nacionalidad:</span>
|
||||||
|
<span>{pacienteVerDetalle.nacionalidad || 'Sin especificar'}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between py-1 border-b border-gray-100 dark:border-gray-800">
|
||||||
|
<span className="text-gray-500 dark:text-gray-400">Teléfono:</span>
|
||||||
|
<span>{pacienteVerDetalle.telefono || 'Sin especificar'}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between py-1 border-b border-gray-100 dark:border-gray-800">
|
||||||
|
<span className="text-gray-500 dark:text-gray-400">Email:</span>
|
||||||
|
<span>{pacienteVerDetalle.email || 'Sin especificar'}</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between py-1 border-b border-gray-100 dark:border-gray-800">
|
||||||
|
<span className="text-gray-500 dark:text-gray-400">Dirección:</span>
|
||||||
|
<span>{pacienteVerDetalle.direccion || 'Sin especificar'}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Sección Clínica */}
|
||||||
|
<div className="space-y-3 pt-2">
|
||||||
|
<h4 className="text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">
|
||||||
|
Información Clínica
|
||||||
|
</h4>
|
||||||
|
<div>
|
||||||
|
<span className="text-xs text-gray-500 dark:text-gray-400 block mb-1 font-medium">
|
||||||
|
Medicación Habitual
|
||||||
|
</span>
|
||||||
|
<p className="bg-gray-50 dark:bg-gray-800/60 p-2.5 rounded border border-gray-100 dark:border-gray-800 text-xs text-gray-800 dark:text-gray-200 min-h-[38px] whitespace-pre-wrap">
|
||||||
|
{pacienteVerDetalle.medicacionHabitual || 'Sin medicación habitual registrada'}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span className="text-xs text-gray-500 dark:text-gray-400 block mb-1 font-medium">
|
||||||
|
Antecedentes Médicos
|
||||||
|
</span>
|
||||||
|
<p className="bg-gray-50 dark:bg-gray-800/60 p-2.5 rounded border border-gray-100 dark:border-gray-800 text-xs text-gray-800 dark:text-gray-200 min-h-[38px] whitespace-pre-wrap">
|
||||||
|
{pacienteVerDetalle.antecedentes || 'Sin antecedentes registrados'}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span className="text-xs text-red-600 dark:text-red-400 block mb-1 font-medium flex items-center gap-1">
|
||||||
|
<AlertTriangle className="h-3 w-3" />
|
||||||
|
Alergias
|
||||||
|
</span>
|
||||||
|
<p className={`p-2.5 rounded border text-xs min-h-[38px] whitespace-pre-wrap ${
|
||||||
|
pacienteVerDetalle.alergias
|
||||||
|
? 'bg-red-50 dark:bg-red-950/30 border-red-200/60 dark:border-red-800/40 text-red-900 dark:text-red-200'
|
||||||
|
: 'bg-gray-50 dark:bg-gray-800/60 border-gray-100 dark:border-gray-800 text-gray-500 dark:text-gray-400'
|
||||||
|
}`}>
|
||||||
|
{pacienteVerDetalle.alergias || 'Sin alergias registradas'}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user