Recepción: vincular paciente atómicamente al crear token de firma
create_consent_token.php ahora acepta paciente_id y lo vincula al turno si aún no lo tiene, eliminando la carrera con vincular_paciente.php (fire-and-forget). Ya no hace falta refrescar para firmar el consentimiento. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
506f3469b4
commit
dfe3a01fee
@@ -568,7 +568,7 @@ async function abrirFormularioLugar(formularioId, nombre) {
|
||||
const res = await fetch(API + 'create_consent_token.php', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ turno_id: turnoActivo.id, formulario_id: formularioId }),
|
||||
body: JSON.stringify({ turno_id: turnoActivo.id, formulario_id: formularioId, paciente_id: pacienteActivo?.id || null }),
|
||||
});
|
||||
const json = await res.json();
|
||||
if (json.ok && (json.data?.url || json.url)) {
|
||||
@@ -1208,7 +1208,7 @@ async function firmarConsentimiento(formularioId, nombre) {
|
||||
const res = await fetch(API + 'create_consent_token.php', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ turno_id: turnoActivo.id, formulario_id: formularioId }),
|
||||
body: JSON.stringify({ turno_id: turnoActivo.id, formulario_id: formularioId, paciente_id: pacienteActivo?.id || null }),
|
||||
});
|
||||
const json = await res.json();
|
||||
if (json.ok && (json.url || json.data?.url)) {
|
||||
|
||||
Reference in New Issue
Block a user