From 9462a51f0d6154e54386f40d482abf86aef65167 Mon Sep 17 00:00:00 2001 From: Sergio Nicolas Lavaise Date: Thu, 16 Apr 2026 12:45:58 -0300 Subject: [PATCH] Fix parser: buscar por palabras clave --- src/sections/HistoriaClinica.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sections/HistoriaClinica.tsx b/src/sections/HistoriaClinica.tsx index 7b33bf3..5252b5a 100644 --- a/src/sections/HistoriaClinica.tsx +++ b/src/sections/HistoriaClinica.tsx @@ -728,11 +728,10 @@ for (const linea of lineas) { for (const [clave, info] of Object.entries(mapeoParametros)) { if (lineaLower.includes(clave)) { const cleanLinea = linea.replace(/show_chart|list_alt/g, '').replace(/\t+/g, ' ').replace(/\s+/g, ' ').trim(); - console.log('Testing param:', clave, 'in:', cleanLinea); const partes = cleanLinea.split(' '); - const claveParts = clave.split(' '); - let idxParam = partes.findIndex(p => claveParts.some(cp => p.toLowerCase().includes(cp))); + const keyWords = clave.split(' ').filter(w => w.length > 2); + let idxParam = partes.findIndex(p => keyWords.some(kw => p.toLowerCase().includes(kw))); if (idxParam === -1) idxParam = 0; for (let i = idxParam + 1; i < partes.length; i++) {