FA-64542 / Clinical triage scoring / Member archive
Waiting room queue ordering with overdue escalation: re-triage precedence · case 02
A patient re-triaged after a change in condition keeps their arrival level.
Case contract
Input {now, patients [{id, level, arrival, retriage (or null)}]}. Effective level = retriage when present (up or down), else level. Target waits: 1:0, 2:10, 3:30, 4:60, 5:120 minutes. A patient whose wait strictly exceeds the target of the effective level is overdue and moves up one priority (never above 1). Order by (priority, arrival, id). Return {order, overdue (sorted ids)}.
Why this case matters
Queue ordering with re-triage and time escalation mixes several keys; the chosen level, comparison and tie-break are separate faults.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| downgraded on re-triage | {"order": ["a", "b"], "overdue": []} | {"order": ["b", "a"], "overdue": []} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗