FA-64264 / Medication dosing calculations / Member archive
Order screening against mg/kg reference ranges: overdose tolerance edge · case 04
A dose at 105% of the upper bound is flagged as an overdose.
Case contract
Input {dose_mg, weight_kg (or null), age_days, range [lo, hi] mg/kg, optional neonatal_range, abs_max_mg}. Missing weight returns NO_WEIGHT. A dose above abs_max_mg returns OVER_ABSOLUTE. Neonates (age_days < 28) use neonatal_range when present. Toy 10% tolerance: UNDER when mg/kg < 0.9*lo, OVER when mg/kg > 1.1*hi, else OK. Return {flag, mg_per_kg (2 dp)}.
Why this case matters
Clinical decision support screens orders against weight-based ranges; the population gate and the tolerance edges are separate rules.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| neonate on day 27 | {"flag": "OVER", "mg_per_kg": 5.33} | {"flag": "OK", "mg_per_kg": 5.33} | 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 ↗