FA-64048 / Medication dosing calculations / Member archive
Body-surface-area dose with capping and dose banding: unbanded dose rounding · case 03
A calculated 91.5 mg dose without a matching band is reported as 91 mg.
Case contract
Input {height_cm, weight_kg (integers), mg_m2, bands}. BSA (Mosteller) = sqrt(height*weight/3600) rounded half-up to 0.01 m2, computed exactly as (isqrt(100*h*w)+3)//6 hundredths, and capped at 2.00 m2. dose = mg_m2 * BSA. Dose banding: the band with the smallest absolute difference that is within 5% of the dose (difference*20 <= dose) is used, ties going to the lower band; otherwise the dose is rounded half-up to a whole mg. Return {bsa, dose_mg, banded}.
Why this case matters
Dose banding systems take a calculated BSA dose and snap it to prefilled products; BSA rounding, the cap and the tolerance each fail separately.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| unbanded half milligram rounds up | {"banded": false, "bsa": 1.81, "dose_mg": 814} | {"banded": false, "bsa": 1.81, "dose_mg": 815} | 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 ↗