From 69793dd9c4bb6260c8953bdb2c1a23c738b9de6f Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Fri, 17 Jul 2026 09:46:55 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20propagar=20genero=20al=20seleccionar=20p?= =?UTF-8?q?aciente=20reci=C3=A9n=20creado=20o=20editado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Al crear un paciente nuevo desde el modal, el objeto no incluía genero por lo que el bloque embarazada no se ocultaba para masculinos. Al editar también se actualiza genero y se re-evalúa la visibilidad del bloque. Co-Authored-By: Claude Sonnet 4.6 --- modules/turnero/views/recepcion.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/turnero/views/recepcion.php b/modules/turnero/views/recepcion.php index 2fcc747..f803d8e 100644 --- a/modules/turnero/views/recepcion.php +++ b/modules/turnero/views/recepcion.php @@ -2879,11 +2879,15 @@ async function mpacGuardar() { pacienteActivo.numero_documento = docVal; pacienteActivo.tipo_documento = tipoDoc; pacienteActivo.telefono = tel; + pacienteActivo.genero = document.getElementById('mpac-genero').value; document.getElementById('lbl-pac-nombre').textContent = (pacienteActivo.full_name || nombre).trim(); document.getElementById('lbl-pac-doc').textContent = tipoDoc + ' ' + (docVal || ''); document.getElementById('lbl-pac-cel').textContent = tel || ''; + const esMasc = (pacienteActivo.genero || '').toUpperCase() === 'M'; + document.getElementById('bloque-embarazada').style.display = esMasc ? 'none' : ''; + if (esMasc) document.getElementById('chk-embarazada').checked = false; } } else { // Creación: vincular al turno automáticamente @@ -2894,6 +2898,7 @@ async function mpacGuardar() { tipo_documento: tipoDoc, numero_documento: docVal, telefono: tel, + genero: document.getElementById('mpac-genero').value, }; seleccionarPaciente(nuevoPac); }