diff --git a/src/sections/HistoriaClinica.tsx b/src/sections/HistoriaClinica.tsx index 659bbd4..7b33bf3 100644 --- a/src/sections/HistoriaClinica.tsx +++ b/src/sections/HistoriaClinica.tsx @@ -728,9 +728,11 @@ 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(' '); - let idxParam = partes.findIndex(p => p.toLowerCase().includes(clave)); + const claveParts = clave.split(' '); + let idxParam = partes.findIndex(p => claveParts.some(cp => p.toLowerCase().includes(cp))); if (idxParam === -1) idxParam = 0; for (let i = idxParam + 1; i < partes.length; i++) {