FA-64222 / Medication dosing calculations / Member archive
Concentration and electrolyte unit conversions: unknown kind handling · case 02
An unsupported unit silently converts to 0.
Case contract
Input {kind, value, mw?, valence?}. kind "pct": w/v percent to mg/mL (x10). kind "ratio": "a:b" ratio strength (a g in b mL) to mg/mL = a*1000/b, whitespace around parts allowed. kind "meq_to_mg": mg = mEq*mw/|valence|. kind "mmol_to_meq": mEq = mmol*|valence|. Any other kind returns {error: UNKNOWN_KIND}. Otherwise {result} rounded to 4 decimals.
Why this case matters
Strength labels mix percent, ratio and equivalent units; each conversion has its own orientation and sign rule.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| unknown conversion kind | {"result": 0.0} | {"error": "UNKNOWN_KIND"} | 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 ↗