Fix: get_especialidades muestra pacientes en_espera_lugar

Antes solo aparecían pacientes con inicio_lugar_at IS NOT NULL (ya llamados).
Ahora incluye estado IN ('en_espera_lugar','en_servicio') para mostrar
pacientes enviados a ginecología/pediatría antes de ser llamados.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-27 23:30:49 -05:00
co-authored by Claude Sonnet 4.6
parent a3c19bf4e7
commit abbd5bde16
+1 -1
View File
@@ -32,7 +32,7 @@ foreach ($lugares as $l) {
FROM turnero_turnos t
JOIN turnero_solicitudes ts ON ts.turno_id = t.id
WHERE t.sesion_id = ? AND t.lugar_destino_id = ?
AND t.inicio_lugar_at IS NOT NULL AND t.fin_lugar_at IS NULL
AND t.estado IN ('en_espera_lugar','en_servicio') AND t.fin_lugar_at IS NULL
ORDER BY ts.numero_orden ASC
");
$stmt->execute([$sesionId, $lid]);