fix(turnero): llamar_desde_espera actualiza lugar y dispara display

Al llamar un paciente de toma progresiva desde la espera, ahora se
actualiza lugar_destino_id al puesto que llama, se pone llamado_lugar_at
para que el display anuncie al paciente, y se notifica por SSE. El JS
abre la ficha y muestra el toast igual que un llamar normal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-28 11:49:37 -05:00
co-authored by Claude Sonnet 4.6
parent 3d26700e16
commit 8472c916b0
2 changed files with 31 additions and 9 deletions
+5 -3
View File
@@ -2589,11 +2589,13 @@ async function _llamarDesdeEspera(turnoId) {
try {
const res = await fetch(API + 'llamar_desde_espera.php', {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ turno_id: turnoId }),
body: JSON.stringify({ turno_id: turnoId, lugar_id: lugarId }),
});
const j = await res.json();
if (!j.ok) mostrarError(j.error);
else cargarCola();
if (!j.ok) { mostrarError(j.error); return; }
mostrarLlamando(j.turno.codigo);
await abrirFicha(j.turno);
cargarCola();
} catch (e) { mostrarError(e.message); }
}