FA-64063 / Medication dosing calculations / Member archive
Vial reconstitution, draw volume and waste: draw volume rounding · case 03
A 2.25 mL requirement is drawn as 2.2 mL.
Case contract
Input {dose_mg, vial_mg, diluent_ml, displacement_ml, single_use}. Concentration = vial_mg/(diluent_ml + displacement_ml). Draw volume = dose/concentration, rounded half-up to 0.01 mL when the volume is <= 1 mL, else to 0.1 mL. Vials = ceil(dose/vial_mg). Waste = vials*vial_mg - dose for single-use vials, else 0. Return {conc_mg_ml (4 dp), draw_ml, vials, waste_mg}.
Why this case matters
Reconstitution calculators must account for powder displacement and syringe graduations; vial counts and waste accounting are separate rules.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| draw volume half step rounds up | {"conc_mg_ml": 20.0, "draw_ml": 2.6, "vials": 1, "waste_mg": 0.0} | {"conc_mg_ml": 20.0, "draw_ml": 2.7, "vials": 1, "waste_mg": 0.0} | 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 ↗