Agregar columna de eliminación por X para determinaciones no-core en el modal de importación

This commit is contained in:
2026-08-12 02:33:00 +00:00
parent 4ee30ad8fe
commit ab6f23c7f2
+38
View File
@@ -1368,6 +1368,31 @@ function SeccionLaboratorios({ lab, patientId, internacionId, add, update, del,
return null; return null;
}; };
const esParametroCore = (param: string): boolean => {
const coreParameters = [
// Hemograma
'hematocrito', 'hto', 'hemoglobina', 'hb', 'leucocitos', 'gb', 'plaquetas', 'plaq',
'vcm', 'hcm', 'rdw', 'eritroblastos', 'neutrófilos', 'neutrofilos', 'linfocitos', 'monocitos', 'eosinófilos', 'eosinofilos', 'basófilos', 'basofilos', 'vpm',
// Glucemia
'glucemia', 'glucosa',
// Urea
'urea',
// Creatinina
'creatinina', 'creat', 'filtrado glomerular (mdrd)', 'mdrd',
// Ionograma
'sodio', 'na', 'potasio', 'k', 'k+', 'cloro', 'cl', 'cl-',
// Hepatograma
'bilirrubina total', 'bt', 'bilirrubina directa', 'bd', 'got', 'ast', 'gpt', 'alt', 'proteínas totales', 'proteinas totales', 'fosfatasa alcalina', 'fal', 'albúmina', 'albumina',
// Coagulograma
'tiempo de protrombina', 'tp', 't.p.', 't.p', 'rin', 'inr', 'aptt', 'kptt'
];
return coreParameters.includes(param.toLowerCase().trim());
};
const handleEliminarDeterminacion = (index: number) => {
setImportResultados(prev => prev.filter((_, i) => i !== index));
};
const handleProcesarTexto = () => { const handleProcesarTexto = () => {
const { resultados, observaciones } = parseLaboratorioTexto(importTexto); const { resultados, observaciones } = parseLaboratorioTexto(importTexto);
const acidoBase = parseAcidoBaseTexto(importTexto); const acidoBase = parseAcidoBaseTexto(importTexto);
@@ -1661,6 +1686,7 @@ function SeccionLaboratorios({ lab, patientId, internacionId, add, update, del,
<Table> <Table>
<TableHeader> <TableHeader>
<TableRow> <TableRow>
<TableHead className="w-10"></TableHead>
<TableHead>Parámetro</TableHead> <TableHead>Parámetro</TableHead>
<TableHead>Valor</TableHead> <TableHead>Valor</TableHead>
<TableHead>Unidad</TableHead> <TableHead>Unidad</TableHead>
@@ -1669,6 +1695,18 @@ function SeccionLaboratorios({ lab, patientId, internacionId, add, update, del,
<TableBody> <TableBody>
{importResultados.map((r, idx) => ( {importResultados.map((r, idx) => (
<TableRow key={idx}> <TableRow key={idx}>
<TableCell className="text-center p-2 w-10">
{!esParametroCore(r.parametro) && (
<Button
size="sm"
variant="ghost"
className="h-6 w-6 p-0 text-red-600 hover:text-red-800 hover:bg-red-50 dark:hover:bg-red-950/50 font-bold"
onClick={() => handleEliminarDeterminacion(idx)}
>
X
</Button>
)}
</TableCell>
<TableCell>{r.parametro}</TableCell> <TableCell>{r.parametro}</TableCell>
<TableCell className={r.estado === 'Alto' ? 'text-amber-600' : r.estado === 'Bajo' ? 'text-blue-600' : r.estado === 'Crítico' ? 'text-red-600 font-bold' : 'text-green-600'}>{r.valor}</TableCell> <TableCell className={r.estado === 'Alto' ? 'text-amber-600' : r.estado === 'Bajo' ? 'text-blue-600' : r.estado === 'Crítico' ? 'text-red-600 font-bold' : 'text-green-600'}>{r.valor}</TableCell>
<TableCell>{r.unidad}</TableCell> <TableCell>{r.unidad}</TableCell>