FA-63848 / Medication dosing calculations / Member archive
Weight-based dose with ideal and adjusted dosing weight: short stature ideal weight floor · case 03
Patients shorter than 60 inches get an ideal weight below the sex base and are pushed into the adjusted band.
Case contract
Input {sex, height_in, weight, unit ("kg" or "lb", 1 kg = 2.2 lb), mg_per_kg, max_mg}. Toy rule: IBW = 50 kg (sex "M") or 45.5 kg (otherwise) + 2.3 kg per inch above 60 in (never below the base). Dosing weight is actual weight when below IBW, IBW when actual is within 100-120% of IBW inclusive, and IBW + 0.4*(actual-IBW) when actual exceeds 120% of IBW. Dose = mg_per_kg * dosing weight rounded half-up to the nearest 5 mg, then capped at max_mg. Return {basis, dosing_weight_kg (1 decimal), dose_mg}.
Why this case matters
Weight-based ordering tools must choose the stipulated dosing weight band, convert units exactly, and apply the ceiling after the final rounding step.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| short stature keeps base ideal weight | {"basis": "adjusted", "dose_mg": 45, "dosing_weight_kg": 43.0} | {"basis": "ideal", "dose_mg": 45, "dosing_weight_kg": 45.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 ↗