FA-63874 / Medication dosing calculations / Member archive
Pediatric mg/kg/day dose divided by interval: administrations per day · case 04
An every-8-hour order is split into four doses, so each dose is a quarter of the daily amount.
Case contract
Input {weight_kg, mg_per_kg_day, interval_h (divides 24), max_single_mg, max_daily_mg, round_mg}. Toy rule: doses/day = 24 / interval_h; daily = min(mg_per_kg_day * weight, max_daily_mg); per-dose = min(daily / doses, max_single_mg), then rounded DOWN to a multiple of round_mg. Return {doses_per_day, dose_mg, daily_mg = dose_mg * doses_per_day}.
Why this case matters
Divided-dose calculators must count administrations per day correctly and apply both ceilings before rounding down to a measurable increment.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| every 8 hours normal order | {"daily_mg": 760.0, "dose_mg": 190.0, "doses_per_day": 4} | {"daily_mg": 765.0, "dose_mg": 255.0, "doses_per_day": 3} | 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 ↗