diff --git a/modules/turnero/views/lugar.php b/modules/turnero/views/lugar.php index 730a4d8..b28b232 100644 --- a/modules/turnero/views/lugar.php +++ b/modules/turnero/views/lugar.php @@ -1999,6 +1999,14 @@ function _mpParentCancelCd() { } window.addEventListener('message', function(e) { + // El formulario embebido pide corregir la ficha del paciente: se abre el + // modal directamente en modo edición, sin cerrar el formulario. + if (e.data && e.data.type === 'corregirPaciente') { + if (!_pacienteActivo) return; + abrirModalPaciente(); + mpacEditar(true); + return; + } if (e.data && e.data.type === 'tomaProgresivaIniciada') { _tomaProgresivaActiva = true; if ('Notification' in window && Notification.permission === 'default') Notification.requestPermission(); @@ -2557,8 +2565,12 @@ async function mpacGuardarFicha() { mpacEditar(false); abrirModalPaciente(); if (turnoActivo?.id) actualizarConsentimientos(turnoActivo.id); - const marco = document.querySelector('#modal-consent iframe'); - if (marco && marco.src) marco.src = marco.src; + // Recargar el formulario abierto para que sus campos vinculados + // tomen el dato corregido. Puede estar en el modal o embebido. + ['modal-consent-iframe', 'form-embebido-iframe'].forEach(function (id) { + const marco = document.getElementById(id); + if (marco && marco.src) marco.src = marco.src; + }); }, 700); } catch (_) { msg.className = 'small mb-2 text-danger'; diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index 96a588f..a5325a3 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -696,6 +696,9 @@ function _addExamWizardHtml(string $cid): string { .campo-linked { display: flex; gap: 16px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; } .campo-linked-label { flex: 0 0 38%; font-size: 12px; color: #6c757d; } + .lnk-corregir { background:none; border:none; color:#94a3b8; cursor:pointer; + padding:0 4px; font-size:11px; flex-shrink:0; } + .lnk-corregir:hover { color:#1565c0; } .campo-linked-valor { flex: 1; font-size: 13px; font-weight: 600; color: #1565c0; } @@ -1023,6 +1026,7 @@ function _addExamWizardHtml(string $cid): string { $_hayDatosPerCampoSvg = !empty(array_filter(array_keys($datosCliente ?? []), fn($k) => str_ends_with($k, '_svg'))); // Rastrear si ya se renderizó la firma inline (para no duplicarla al pie) + $_lnkBtnPuesto = false; // el lápiz de corregir va una sola vez $_renderedFirmaProfesional = false; $_renderedFirmaPaciente = false; $_esquemaTieneFirmaPaciente = false; @@ -1283,6 +1287,12 @@ function _addExamWizardHtml(string $cid): string {