FA-64035 / Medication dosing calculations / Member archive
Body-surface-area dose with capping and dose banding: BSA cap units · case 05
Every patient is dosed on a BSA of 0.02 m2.
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 |
|---|---|---|---|
| typical adult banded | {"banded": false, "bsa": 0.02, "dose_mg": 2} | {"banded": true, "bsa": 1.88, "dose_mg": 190} | 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 ↗