rips: prevent reuse of already-consumed exam records

- Add turno_id column to rips_examenes_pendientes (already migrated)
- Filter turno_id IS NULL in get_examenes_rips.php query
- New marcar_rips_usado.php marks record as consumed when loaded
- cargarExamenesRips() calls marker after loading exams into the turn

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-21 16:39:22 -05:00
co-authored by Claude Sonnet 4.6
parent d46c983776
commit 26bb9e1844
3 changed files with 37 additions and 0 deletions
+1
View File
@@ -20,6 +20,7 @@ $cacheRow = db()->prepare(
WHERE numero_documento = ?
AND DATE(created_at) = CURDATE()
AND created_at >= NOW() - INTERVAL 30 MINUTE
AND turno_id IS NULL
ORDER BY created_at DESC
LIMIT 1"
);