From 9872f5010400f5908211f746595bbb0b1dbaf1fe Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 16 Jun 2026 11:24:02 -0500 Subject: [PATCH] fix: onLugarChange no longer hides desk consents The sel-lugar dropdown is only for selecting the patient's next destination. Desk consents are loaded by cargarConsentimientosDesk() on turno open and must not be affected by destination lugar changes. Co-Authored-By: Claude Haiku 4.5 --- modules/turnero/views/recepcion.php | 37 +++-------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/modules/turnero/views/recepcion.php b/modules/turnero/views/recepcion.php index 58a38ef..3b379f3 100644 --- a/modules/turnero/views/recepcion.php +++ b/modules/turnero/views/recepcion.php @@ -471,40 +471,9 @@ async function refrescarConsentimientosLugar() { } catch (_) {} } // ── Formularios del lugar (aparecen al seleccionar lugar) ──── -async function onLugarChange() { - const sec = document.getElementById('sec-consentimientos'); - const lista = document.getElementById('lista-consentimientos'); - const lugarId = parseInt(document.getElementById('sel-lugar').value); - if (!lugarId) { sec.style.display = 'none'; return; } - - try { - const res = await fetch(`${API}get_lugar_formularios.php?lugar_id=${lugarId}`); - const json = await res.json(); - if (!json.ok || !json.formularios?.length) { - sec.style.display = 'none'; - return; - } - - lista.innerHTML = json.formularios.map(f => { - const nom = escHtml(f.nombre); - const disabled = !turnoActivo ? 'disabled title="Llama el turno primero"' : ''; - return ``; - }).join(''); - sec.style.display = ''; - } catch (_) { - sec.style.display = 'none'; - } -} +// El dropdown sel-lugar es solo para elegir destino del paciente. +// Los consentimientos del desk se cargan via cargarConsentimientosDesk() y no dependen de este cambio. +function onLugarChange() {} async function abrirFormularioLugar(formularioId, nombre) { if (!turnoActivo) { mostrarError('Llama un turno primero.'); return; } if (!pacienteActivo) { mostrarError('Vincula el paciente antes de abrir el consentimiento.'); return; }