From 6df8f96f9c6c1b280600bfec4d374a75766ddd65 Mon Sep 17 00:00:00 2001 From: Sergio Nicolas Lavaise Date: Thu, 16 Apr 2026 14:20:11 -0300 Subject: [PATCH] Parser: buscar primer valor numerico despues de letra --- src/sections/HistoriaClinica.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sections/HistoriaClinica.tsx b/src/sections/HistoriaClinica.tsx index 43b7184..1d66995 100644 --- a/src/sections/HistoriaClinica.tsx +++ b/src/sections/HistoriaClinica.tsx @@ -727,11 +727,8 @@ for (const linea of lineas) { for (const [clave, info] of Object.entries(mapeoParametros)) { if (lineaLower.includes(clave)) { - let match = linea.match(/show_chart.*?(\d+\.?\d*)/); - if (!match) { - const claveEscaped = clave.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); - match = linea.match(new RegExp(claveEscaped + '.*?(\\d+\\.?\\d*)')); - } + // buscar primer valor numérico después de cualquier texto (letra o palabra) + const match = linea.match(/[a-zA-ZáéíóúñÁÉÍÓÚÑ]+.*?(\d+\.?\d*)/); if (match && match[1]) { const valor = parseFloat(match[1].replace(',', '.')); if (!isNaN(valor) && valor > 0 && valor < 1000) {