FA-64180 / Medication dosing calculations / Member archive
Patient-controlled analgesia lockout and hourly limit: lockout time units · case 05
Presses a few minutes apart are all delivered despite a 10-minute lockout.
Case contract
Input {presses (ascending seconds), dose_mg, lockout_min, hour_limit_mg}. A press less than 2 s after the previous press (delivered or not) is a switch bounce and ignored entirely. Otherwise it is denied for lockout when less than lockout_min*60 s have passed since the last DELIVERED dose, denied for limit when (deliveries in the preceding 3600 s + 1)*dose exceeds hour_limit_mg, else delivered. Return {delivered, denied_lockout, denied_limit, total_mg}.
Why this case matters
PCA pumps enforce lockout and rolling-hour limits on a stream of button presses; reference points and window edges are distinct defects.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| lockout measured in seconds | {"delivered": [100, 400, 705, 1300], "denied_limit": 0, "denied_lockout": 0, "total_mg": 2.0} | {"delivered": [100, 705, 1300], "denied_limit": 0, "denied_lockout": 1, "total_mg": 1.5} | 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 ↗