diff --git a/modules/turnero/views/recepcion.php b/modules/turnero/views/recepcion.php index fce0d35..625bfaf 100644 --- a/modules/turnero/views/recepcion.php +++ b/modules/turnero/views/recepcion.php @@ -1630,14 +1630,15 @@ function filtrarExamenesPorGenero() { if (!examTS) return; const genero = (pacienteActivo?.genero || '').toUpperCase(); const bloqueados = []; - Object.values(examTS.options).forEach(opt => { + Object.entries(examTS.options).forEach(([val, opt]) => { const gp = (opt['data-genero'] || '').toUpperCase(); const incompatible = !!(gp && genero && gp !== genero); opt.disabled = incompatible; - if (incompatible && examTS.items.includes(String(opt.value))) bloqueados.push(String(opt.value)); + if (incompatible && examTS.items.includes(String(val))) bloqueados.push(String(val)); }); bloqueados.forEach(id => examTS.removeItem(id, true)); if (bloqueados.length) recalcularPrecios(); + examTS.clearCache(); examTS.refreshOptions(false); }