{"abstract":"Every patient is dosed on a BSA of 0.02 m2.","category":"Medication dosing calculations","checks":7,"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}.","evaluation_group":"w2-meddose-bsa-banding","failed_approach":"Applying the cap only above 100 kg misses tall patients whose BSA exceeds 2.00 m2 at lower weights.","family":"w2-meddose-bsa-banding-bsa-cap-units","id":"FA-64031","implementations":{"attempt":{"sha256":"61b59a72be49116643794a50952601eb57f0b74d37af130d835830692e88a4e5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    h = (math.isqrt(100 * x['height_cm'] * x['weight_kg']) + 3) // 6\n    h = min(h, 200) if x['weight_kg'] > 100 else h\n    dose = Fraction(x['mg_m2'] * h, 100)\n    best = None\n    for b in sorted(x['bands']):\n        d = abs(b - dose)\n        if d * 20 <= dose and (best is None or d < best[0]):\n            best = (d, b)\n    if best is None:\n        return {'bsa': h / 100, 'dose_mg': math.floor(dose + Fraction(1, 2)), 'banded': False}\n    return {'bsa': h / 100, 'dose_mg': best[1], 'banded': True}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 71, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.83, 'dose_mg': 180, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 55, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.59, 'dose_mg': 16, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 91, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [189, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 151]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 50, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 91, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 56, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.58, 'dose_mg': 95, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 72, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.84, 'dose_mg': 180, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 60, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.66, 'dose_mg': 17, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 92, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [188, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 152]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 250, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 453, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 57, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.59, 'dose_mg': 95, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 73, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.86, 'dose_mg': 190, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 63, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.7, 'dose_mg': 17, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 93, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [187, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 153]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 450, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 815, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 58, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.61, 'dose_mg': 97, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 74, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.87, 'dose_mg': 190, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 72, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.82, 'dose_mg': 18, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 94, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [186, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 154]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 650, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 1177, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 59, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.62, 'dose_mg': 97, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 75, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.88, 'dose_mg': 190, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 76, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.87, 'dose_mg': 19, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 95, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [185, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 155]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 850, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 1539, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 60, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.63, 'dose_mg': 98, 'banded': False})]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"b68c0d23a435757d9bd831aa5f1064f2cb435d68c85863a73ebcf7289da881d9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    h = (math.isqrt(100 * x['height_cm'] * x['weight_kg']) + 3) // 6\n    h = min(h, 2)\n    dose = Fraction(x['mg_m2'] * h, 100)\n    best = None\n    for b in sorted(x['bands']):\n        d = abs(b - dose)\n        if d * 20 <= dose and (best is None or d < best[0]):\n            best = (d, b)\n    if best is None:\n        return {'bsa': h / 100, 'dose_mg': math.floor(dose + Fraction(1, 2)), 'banded': False}\n    return {'bsa': h / 100, 'dose_mg': best[1], 'banded': True}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 71, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.83, 'dose_mg': 180, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 55, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.59, 'dose_mg': 16, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 91, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [189, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 151]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 50, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 91, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 56, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.58, 'dose_mg': 95, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 72, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.84, 'dose_mg': 180, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 60, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.66, 'dose_mg': 17, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 92, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [188, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 152]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 250, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 453, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 57, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.59, 'dose_mg': 95, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 73, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.86, 'dose_mg': 190, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 63, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.7, 'dose_mg': 17, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 93, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [187, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 153]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 450, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 815, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 58, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.61, 'dose_mg': 97, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 74, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.87, 'dose_mg': 190, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 72, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.82, 'dose_mg': 18, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 94, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [186, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 154]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 650, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 1177, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 59, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.62, 'dose_mg': 97, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 75, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.88, 'dose_mg': 190, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 76, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.87, 'dose_mg': 19, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 95, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [185, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 155]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 850, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 1539, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 60, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.63, 'dose_mg': 98, 'banded': False})]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"8cafda0adce65d21e80978b81b96af6de2af650e1a542b904d988ae7cdcdb48e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    h = (math.isqrt(100 * x['height_cm'] * x['weight_kg']) + 3) // 6\n    h = min(h, 200)\n    dose = Fraction(x['mg_m2'] * h, 100)\n    best = None\n    for b in sorted(x['bands']):\n        d = abs(b - dose)\n        if d * 20 <= dose and (best is None or d < best[0]):\n            best = (d, b)\n    if best is None:\n        return {'bsa': h / 100, 'dose_mg': math.floor(dose + Fraction(1, 2)), 'banded': False}\n    return {'bsa': h / 100, 'dose_mg': best[1], 'banded': True}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 71, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.83, 'dose_mg': 180, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 55, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.59, 'dose_mg': 16, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 91, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [189, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 151]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 50, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 91, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 56, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.58, 'dose_mg': 95, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 72, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.84, 'dose_mg': 180, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 60, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.66, 'dose_mg': 17, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 92, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [188, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 152]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 250, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 453, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 57, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.59, 'dose_mg': 95, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 73, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.86, 'dose_mg': 190, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 63, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.7, 'dose_mg': 17, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 93, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [187, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 153]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 450, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 815, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 58, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.61, 'dose_mg': 97, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 74, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.87, 'dose_mg': 190, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 72, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.82, 'dose_mg': 18, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 94, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [186, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 154]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 650, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 1177, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 59, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.62, 'dose_mg': 97, 'banded': False})],\n [('typical adult banded',\n   {'height_cm': 170, 'weight_kg': 75, 'mg_m2': 100, 'bands': [170, 180, 190, 200]},\n   {'bsa': 1.88, 'dose_mg': 190, 'banded': True}),\n  ('BSA hundredths rounding',\n   {'height_cm': 165, 'weight_kg': 76, 'mg_m2': 10, 'bands': []},\n   {'bsa': 1.87, 'dose_mg': 19, 'banded': False}),\n  ('tall patient capped at 2.00',\n   {'height_cm': 200, 'weight_kg': 95, 'mg_m2': 75, 'bands': [140, 150, 160]},\n   {'bsa': 2.0, 'dose_mg': 150, 'banded': True}),\n  ('band exactly 5 percent away',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [185, 190, 250]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('equidistant bands prefer lower',\n   {'height_cm': 200, 'weight_kg': 100, 'mg_m2': 100, 'bands': [210, 190, 155]},\n   {'bsa': 2.0, 'dose_mg': 190, 'banded': True}),\n  ('unbanded half milligram rounds up',\n   {'height_cm': 150, 'weight_kg': 79, 'mg_m2': 850, 'bands': [1]},\n   {'bsa': 1.81, 'dose_mg': 1539, 'banded': False}),\n  ('no band within tolerance',\n   {'height_cm': 160, 'weight_kg': 60, 'mg_m2': 60, 'bands': [50, 150]},\n   {'bsa': 1.63, 'dose_mg': 98, 'banded': False})]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic toy software model with explicitly stipulated thresholds and formulas; it is not clinical guidance, not a validated medical calculator, and makes no claim of conformance to any published protocol. Numbered variants vary patient and order inputs. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-meddose-bsa-banding-bsa-cap-units","generated_at":"2026-09-29T14:47:20.486499+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Dose banding systems take a calculated BSA dose and snap it to prefilled products; BSA rounding, the cap and the tolerance each fail separately.","repair":"Cap the hundredths value at 200.","root_cause":"The 2.00 m2 cap is written in square metres while h holds hundredths.","sha256":"b582a37f7cdb74a0839818a56847d367d962ebc2e67515227811c127c3a0afe2","title":"Body-surface-area dose with capping and dose banding: BSA cap units · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.68,"exit_code":1,"observations":[{"actual":{"banded":true,"bsa":1.83,"dose_mg":180},"check":"typical adult banded","expected":{"banded":true,"bsa":1.83,"dose_mg":180},"passed":true},{"actual":{"banded":false,"bsa":1.59,"dose_mg":16},"check":"BSA hundredths rounding","expected":{"banded":false,"bsa":1.59,"dose_mg":16},"passed":true},{"actual":{"banded":false,"bsa":2.25,"dose_mg":169},"check":"tall patient capped at 2.00","expected":{"banded":true,"bsa":2.0,"dose_mg":150},"passed":false},{"actual":{"banded":false,"bsa":2.36,"dose_mg":236},"check":"band exactly 5 percent away","expected":{"banded":true,"bsa":2.0,"dose_mg":190},"passed":false},{"actual":{"banded":false,"bsa":2.36,"dose_mg":236},"check":"equidistant bands prefer lower","expected":{"banded":true,"bsa":2.0,"dose_mg":190},"passed":false},{"actual":{"banded":false,"bsa":1.81,"dose_mg":91},"check":"unbanded half milligram rounds up","expected":{"banded":false,"bsa":1.81,"dose_mg":91},"passed":true},{"actual":{"banded":false,"bsa":1.58,"dose_mg":95},"check":"no band within tolerance","expected":{"banded":false,"bsa":1.58,"dose_mg":95},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"typical adult banded\", \"actual\": {\"bsa\": 1.83, \"dose_mg\": 180, \"banded\": true}, \"expected\": {\"bsa\": 1.83, \"dose_mg\": 180, \"banded\": true}, \"passed\": true}, {\"check\": \"BSA hundredths rounding\", \"actual\": {\"bsa\": 1.59, \"dose_mg\": 16, \"banded\": false}, \"expected\": {\"bsa\": 1.59, \"dose_mg\": 16, \"banded\": false}, \"passed\": true}, {\"check\": \"tall patient capped at 2.00\", \"actual\": {\"bsa\": 2.25, \"dose_mg\": 169, \"banded\": false}, \"expected\": {\"bsa\": 2.0, \"dose_mg\": 150, \"banded\": true}, \"passed\": false}, {\"check\": \"band exactly 5 percent away\", \"actual\": {\"bsa\": 2.36, \"dose_mg\": 236, \"banded\": false}, \"expected\": {\"bsa\": 2.0, \"dose_mg\": 190, \"banded\": true}, \"passed\": false}, {\"check\": \"equidistant bands prefer lower\", \"actual\": {\"bsa\": 2.36, \"dose_mg\": 236, \"banded\": false}, \"expected\": {\"bsa\": 2.0, \"dose_mg\": 190, \"banded\": true}, \"passed\": false}, {\"check\": \"unbanded half milligram rounds up\", \"actual\": {\"bsa\": 1.81, \"dose_mg\": 91, \"banded\": false}, \"expected\": {\"bsa\": 1.81, \"dose_mg\": 91, \"banded\": false}, \"passed\": true}, {\"check\": \"no band within tolerance\", \"actual\": {\"bsa\": 1.58, \"dose_mg\": 95, \"banded\": false}, \"expected\": {\"bsa\": 1.58, \"dose_mg\": 95, \"banded\": false}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.299,"exit_code":1,"observations":[{"actual":{"banded":false,"bsa":0.02,"dose_mg":2},"check":"typical adult banded","expected":{"banded":true,"bsa":1.83,"dose_mg":180},"passed":false},{"actual":{"banded":false,"bsa":0.02,"dose_mg":0},"check":"BSA hundredths rounding","expected":{"banded":false,"bsa":1.59,"dose_mg":16},"passed":false},{"actual":{"banded":false,"bsa":0.02,"dose_mg":2},"check":"tall patient capped at 2.00","expected":{"banded":true,"bsa":2.0,"dose_mg":150},"passed":false},{"actual":{"banded":false,"bsa":0.02,"dose_mg":2},"check":"band exactly 5 percent away","expected":{"banded":true,"bsa":2.0,"dose_mg":190},"passed":false},{"actual":{"banded":false,"bsa":0.02,"dose_mg":2},"check":"equidistant bands prefer lower","expected":{"banded":true,"bsa":2.0,"dose_mg":190},"passed":false},{"actual":{"banded":true,"bsa":0.02,"dose_mg":1},"check":"unbanded half milligram rounds up","expected":{"banded":false,"bsa":1.81,"dose_mg":91},"passed":false},{"actual":{"banded":false,"bsa":0.02,"dose_mg":1},"check":"no band within tolerance","expected":{"banded":false,"bsa":1.58,"dose_mg":95},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"typical adult banded\", \"actual\": {\"bsa\": 0.02, \"dose_mg\": 2, \"banded\": false}, \"expected\": {\"bsa\": 1.83, \"dose_mg\": 180, \"banded\": true}, \"passed\": false}, {\"check\": \"BSA hundredths rounding\", \"actual\": {\"bsa\": 0.02, \"dose_mg\": 0, \"banded\": false}, \"expected\": {\"bsa\": 1.59, \"dose_mg\": 16, \"banded\": false}, \"passed\": false}, {\"check\": \"tall patient capped at 2.00\", \"actual\": {\"bsa\": 0.02, \"dose_mg\": 2, \"banded\": false}, \"expected\": {\"bsa\": 2.0, \"dose_mg\": 150, \"banded\": true}, \"passed\": false}, {\"check\": \"band exactly 5 percent away\", \"actual\": {\"bsa\": 0.02, \"dose_mg\": 2, \"banded\": false}, \"expected\": {\"bsa\": 2.0, \"dose_mg\": 190, \"banded\": true}, \"passed\": false}, {\"check\": \"equidistant bands prefer lower\", \"actual\": {\"bsa\": 0.02, \"dose_mg\": 2, \"banded\": false}, \"expected\": {\"bsa\": 2.0, \"dose_mg\": 190, \"banded\": true}, \"passed\": false}, {\"check\": \"unbanded half milligram rounds up\", \"actual\": {\"bsa\": 0.02, \"dose_mg\": 1, \"banded\": true}, \"expected\": {\"bsa\": 1.81, \"dose_mg\": 91, \"banded\": false}, \"passed\": false}, {\"check\": \"no band within tolerance\", \"actual\": {\"bsa\": 0.02, \"dose_mg\": 1, \"banded\": false}, \"expected\": {\"bsa\": 1.58, \"dose_mg\": 95, \"banded\": false}, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.386,"exit_code":0,"observations":[{"actual":{"banded":true,"bsa":1.83,"dose_mg":180},"check":"typical adult banded","expected":{"banded":true,"bsa":1.83,"dose_mg":180},"passed":true},{"actual":{"banded":false,"bsa":1.59,"dose_mg":16},"check":"BSA hundredths rounding","expected":{"banded":false,"bsa":1.59,"dose_mg":16},"passed":true},{"actual":{"banded":true,"bsa":2.0,"dose_mg":150},"check":"tall patient capped at 2.00","expected":{"banded":true,"bsa":2.0,"dose_mg":150},"passed":true},{"actual":{"banded":true,"bsa":2.0,"dose_mg":190},"check":"band exactly 5 percent away","expected":{"banded":true,"bsa":2.0,"dose_mg":190},"passed":true},{"actual":{"banded":true,"bsa":2.0,"dose_mg":190},"check":"equidistant bands prefer lower","expected":{"banded":true,"bsa":2.0,"dose_mg":190},"passed":true},{"actual":{"banded":false,"bsa":1.81,"dose_mg":91},"check":"unbanded half milligram rounds up","expected":{"banded":false,"bsa":1.81,"dose_mg":91},"passed":true},{"actual":{"banded":false,"bsa":1.58,"dose_mg":95},"check":"no band within tolerance","expected":{"banded":false,"bsa":1.58,"dose_mg":95},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"typical adult banded\", \"actual\": {\"bsa\": 1.83, \"dose_mg\": 180, \"banded\": true}, \"expected\": {\"bsa\": 1.83, \"dose_mg\": 180, \"banded\": true}, \"passed\": true}, {\"check\": \"BSA hundredths rounding\", \"actual\": {\"bsa\": 1.59, \"dose_mg\": 16, \"banded\": false}, \"expected\": {\"bsa\": 1.59, \"dose_mg\": 16, \"banded\": false}, \"passed\": true}, {\"check\": \"tall patient capped at 2.00\", \"actual\": {\"bsa\": 2.0, \"dose_mg\": 150, \"banded\": true}, \"expected\": {\"bsa\": 2.0, \"dose_mg\": 150, \"banded\": true}, \"passed\": true}, {\"check\": \"band exactly 5 percent away\", \"actual\": {\"bsa\": 2.0, \"dose_mg\": 190, \"banded\": true}, \"expected\": {\"bsa\": 2.0, \"dose_mg\": 190, \"banded\": true}, \"passed\": true}, {\"check\": \"equidistant bands prefer lower\", \"actual\": {\"bsa\": 2.0, \"dose_mg\": 190, \"banded\": true}, \"expected\": {\"bsa\": 2.0, \"dose_mg\": 190, \"banded\": true}, \"passed\": true}, {\"check\": \"unbanded half milligram rounds up\", \"actual\": {\"bsa\": 1.81, \"dose_mg\": 91, \"banded\": false}, \"expected\": {\"bsa\": 1.81, \"dose_mg\": 91, \"banded\": false}, \"passed\": true}, {\"check\": \"no band within tolerance\", \"actual\": {\"bsa\": 1.58, \"dose_mg\": 95, \"banded\": false}, \"expected\": {\"bsa\": 1.58, \"dose_mg\": 95, \"banded\": false}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}