fix: load desk consents automatically when a turno is opened

- cargarConsentimientosDesk() called from abrirFicha using DESK_ID
- First checks existing DB records (get_consentimientos), falls back to desk config
- abrirFormularioLugar shows proper errors if no patient or no turno
- Starts polling on open to detect patient signature in real time
- Fix creado_at column error in create_consent_token INSERT

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-16 11:20:22 -05:00
co-authored by Claude Haiku 4.5
parent 5b02be6686
commit d8a6581fe5
2 changed files with 61 additions and 15 deletions
+2 -2
View File
@@ -60,8 +60,8 @@ if ($existente) {
);
$stmt = $pdo->prepare(
"INSERT INTO turnero_consentimientos (turno_id, formulario_id, token, estado, creado_at)
VALUES (?, ?, ?, 'pendiente', NOW())"
"INSERT INTO turnero_consentimientos (turno_id, formulario_id, token, estado)
VALUES (?, ?, ?, 'pendiente')"
);
$stmt->execute([$turnoId, $formularioId, $token]);
}