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) {