{"abstract":"Rates such as 2.25 mL/h are programmed as 2.2 mL/h.","category":"Medication dosing calculations","checks":7,"contract":"Input {dose (mcg/kg/min), weight_kg, drug_mg, bag_ml}. Concentration = drug_mg*1000/bag_ml mcg/mL. Rate mL/h = dose*weight*60/concentration, rounded half-up to 0.1 mL/h. Pump accepts 0.1-999.9 mL/h: a rounded rate above 999.9 returns status EXCEEDS_PUMP, a rounded rate of 0.0 returns BELOW_RESOLUTION; otherwise status OK with rate_ml_h. conc_mcg_ml is always reported.","evaluation_group":"w2-meddose-infusion-rate","failed_approach":"round() rounds half to even, so 2.25 still becomes 2.2.","family":"w2-meddose-infusion-rate-rate-rounding-to-pump-resolution","id":"FA-63906","implementations":{"attempt":{"sha256":"3385958008c16fe9cce43a4e252cc9d21a5590c1a1bd4730adfcdd55f8e1455d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    conc = Fraction(x['drug_mg']) * 1000 / Fraction(str(x['bag_ml']))\n    rate = Fraction(str(x['dose'])) * Fraction(str(x['weight_kg'])) * 60 / conc\n    tenths = round(rate * 10)\n    if tenths > 9999:\n        return {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': float(conc)}\n    if tenths == 0:\n        return {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': float(conc)}\n    return {'status': 'OK', 'conc_mcg_ml': float(conc), 'rate_ml_h': tenths / 10}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('standard adult infusion',\n   {'dose': '5', 'weight_kg': 71, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.3}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 5, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.3}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 101, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 101},\n   {'status': 'OK', 'conc_mcg_ml': 594.059405940594, 'rate_ml_h': 151.5}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 67, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 8, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 72, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.5}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 9, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.5}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 102, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 102},\n   {'status': 'OK', 'conc_mcg_ml': 588.2352941176471, 'rate_ml_h': 153.0}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 68, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 9, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 73, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.7}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 13, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.7}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 103, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 103},\n   {'status': 'OK', 'conc_mcg_ml': 582.5242718446602, 'rate_ml_h': 154.5}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 69, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 10, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 74, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.9}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 17, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.9}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 104, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 104},\n   {'status': 'OK', 'conc_mcg_ml': 576.9230769230769, 'rate_ml_h': 156.0}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 70, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 11, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 75, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 14.1}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 21, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 1.1}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 105, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 105},\n   {'status': 'OK', 'conc_mcg_ml': 571.4285714285714, 'rate_ml_h': 157.5}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 71, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 12, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})]]\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":"b48a7ebc185c1e2512242aca407f76d188c36d5c47a0cfb704222aa24747110e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    conc = Fraction(x['drug_mg']) * 1000 / Fraction(str(x['bag_ml']))\n    rate = Fraction(str(x['dose'])) * Fraction(str(x['weight_kg'])) * 60 / conc\n    tenths = math.floor(rate * 10)\n    if tenths > 9999:\n        return {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': float(conc)}\n    if tenths == 0:\n        return {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': float(conc)}\n    return {'status': 'OK', 'conc_mcg_ml': float(conc), 'rate_ml_h': tenths / 10}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('standard adult infusion',\n   {'dose': '5', 'weight_kg': 71, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.3}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 5, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.3}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 101, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 101},\n   {'status': 'OK', 'conc_mcg_ml': 594.059405940594, 'rate_ml_h': 151.5}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 67, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 8, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 72, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.5}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 9, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.5}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 102, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 102},\n   {'status': 'OK', 'conc_mcg_ml': 588.2352941176471, 'rate_ml_h': 153.0}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 68, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 9, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 73, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.7}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 13, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.7}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 103, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 103},\n   {'status': 'OK', 'conc_mcg_ml': 582.5242718446602, 'rate_ml_h': 154.5}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 69, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 10, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 74, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.9}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 17, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.9}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 104, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 104},\n   {'status': 'OK', 'conc_mcg_ml': 576.9230769230769, 'rate_ml_h': 156.0}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 70, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 11, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 75, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 14.1}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 21, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 1.1}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 105, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 105},\n   {'status': 'OK', 'conc_mcg_ml': 571.4285714285714, 'rate_ml_h': 157.5}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 71, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 12, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})]]\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":"d166ca32b8d6ca0fa57992c3379a7d11da99af3f37478e24953351496009c95d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    conc = Fraction(x['drug_mg']) * 1000 / Fraction(str(x['bag_ml']))\n    rate = Fraction(str(x['dose'])) * Fraction(str(x['weight_kg'])) * 60 / conc\n    tenths = math.floor(rate * 10 + Fraction(1, 2))\n    if tenths > 9999:\n        return {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': float(conc)}\n    if tenths == 0:\n        return {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': float(conc)}\n    return {'status': 'OK', 'conc_mcg_ml': float(conc), 'rate_ml_h': tenths / 10}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('standard adult infusion',\n   {'dose': '5', 'weight_kg': 71, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.3}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 5, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.3}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 101, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 101},\n   {'status': 'OK', 'conc_mcg_ml': 594.059405940594, 'rate_ml_h': 151.5}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 67, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 8, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 72, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.5}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 9, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.5}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 102, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 102},\n   {'status': 'OK', 'conc_mcg_ml': 588.2352941176471, 'rate_ml_h': 153.0}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 68, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 9, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 73, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.7}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 13, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.7}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 103, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 103},\n   {'status': 'OK', 'conc_mcg_ml': 582.5242718446602, 'rate_ml_h': 154.5}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 69, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 10, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 74, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 13.9}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 17, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.9}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 104, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 104},\n   {'status': 'OK', 'conc_mcg_ml': 576.9230769230769, 'rate_ml_h': 156.0}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 70, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 11, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})],\n [('standard adult infusion',\n   {'dose': '5', 'weight_kg': 75, 'drug_mg': 400, 'bag_ml': 250},\n   {'status': 'OK', 'conc_mcg_ml': 1600.0, 'rate_ml_h': 14.1}),\n  ('half-tenth rate rounds up',\n   {'dose': '0.5', 'weight_kg': 21, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 1.1}),\n  ('rate exactly at pump maximum',\n   {'dose': '99.99', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 999.9}),\n  ('rate above pump maximum',\n   {'dose': '100', 'weight_kg': 105, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'EXCEEDS_PUMP', 'conc_mcg_ml': 600.0}),\n  ('high but valid rate',\n   {'dose': '15', 'weight_kg': 100, 'drug_mg': 60, 'bag_ml': 105},\n   {'status': 'OK', 'conc_mcg_ml': 571.4285714285714, 'rate_ml_h': 157.5}),\n  ('tiny rate that rounds to 0.1',\n   {'dose': '0.01', 'weight_kg': 71, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'OK', 'conc_mcg_ml': 600.0, 'rate_ml_h': 0.1}),\n  ('rate that rounds to zero',\n   {'dose': '0.005', 'weight_kg': 12, 'drug_mg': 60, 'bag_ml': 100},\n   {'status': 'BELOW_RESOLUTION', 'conc_mcg_ml': 600.0})]]\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-infusion-rate-rate-rounding-to-pump-resolution","generated_at":"2026-09-29T14:47:19.167670+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Weight-based infusion programming is a classic unit-conversion fault surface: mg vs mcg, per-minute vs per-hour, and pump resolution limits.","repair":"Round rate*10 half-up before dividing by 10.","root_cause":"The rate is truncated to 0.1 mL/h instead of rounded half-up.","sha256":"d7e3dcd502ceed6c28db35fbea23655240aae552899ab5c11718e2dde095086c","title":"mcg/kg/min infusion converted to pump mL/h: rate rounding to pump resolution · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.945,"exit_code":1,"observations":[{"actual":{"conc_mcg_ml":1600.0,"rate_ml_h":13.3,"status":"OK"},"check":"standard adult infusion","expected":{"conc_mcg_ml":1600.0,"rate_ml_h":13.3,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"rate_ml_h":0.2,"status":"OK"},"check":"half-tenth rate rounds up","expected":{"conc_mcg_ml":600.0,"rate_ml_h":0.3,"status":"OK"},"passed":false},{"actual":{"conc_mcg_ml":600.0,"rate_ml_h":999.9,"status":"OK"},"check":"rate exactly at pump maximum","expected":{"conc_mcg_ml":600.0,"rate_ml_h":999.9,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"status":"EXCEEDS_PUMP"},"check":"rate above pump maximum","expected":{"conc_mcg_ml":600.0,"status":"EXCEEDS_PUMP"},"passed":true},{"actual":{"conc_mcg_ml":594.059405940594,"rate_ml_h":151.5,"status":"OK"},"check":"high but valid rate","expected":{"conc_mcg_ml":594.059405940594,"rate_ml_h":151.5,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"rate_ml_h":0.1,"status":"OK"},"check":"tiny rate that rounds to 0.1","expected":{"conc_mcg_ml":600.0,"rate_ml_h":0.1,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"status":"BELOW_RESOLUTION"},"check":"rate that rounds to zero","expected":{"conc_mcg_ml":600.0,"status":"BELOW_RESOLUTION"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"standard adult infusion\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 1600.0, \"rate_ml_h\": 13.3}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 1600.0, \"rate_ml_h\": 13.3}, \"passed\": true}, {\"check\": \"half-tenth rate rounds up\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.2}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.3}, \"passed\": false}, {\"check\": \"rate exactly at pump maximum\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 999.9}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 999.9}, \"passed\": true}, {\"check\": \"rate above pump maximum\", \"actual\": {\"status\": \"EXCEEDS_PUMP\", \"conc_mcg_ml\": 600.0}, \"expected\": {\"status\": \"EXCEEDS_PUMP\", \"conc_mcg_ml\": 600.0}, \"passed\": true}, {\"check\": \"high but valid rate\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 594.059405940594, \"rate_ml_h\": 151.5}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 594.059405940594, \"rate_ml_h\": 151.5}, \"passed\": true}, {\"check\": \"tiny rate that rounds to 0.1\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.1}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.1}, \"passed\": true}, {\"check\": \"rate that rounds to zero\", \"actual\": {\"status\": \"BELOW_RESOLUTION\", \"conc_mcg_ml\": 600.0}, \"expected\": {\"status\": \"BELOW_RESOLUTION\", \"conc_mcg_ml\": 600.0}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.048,"exit_code":1,"observations":[{"actual":{"conc_mcg_ml":1600.0,"rate_ml_h":13.3,"status":"OK"},"check":"standard adult infusion","expected":{"conc_mcg_ml":1600.0,"rate_ml_h":13.3,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"rate_ml_h":0.2,"status":"OK"},"check":"half-tenth rate rounds up","expected":{"conc_mcg_ml":600.0,"rate_ml_h":0.3,"status":"OK"},"passed":false},{"actual":{"conc_mcg_ml":600.0,"rate_ml_h":999.9,"status":"OK"},"check":"rate exactly at pump maximum","expected":{"conc_mcg_ml":600.0,"rate_ml_h":999.9,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"status":"EXCEEDS_PUMP"},"check":"rate above pump maximum","expected":{"conc_mcg_ml":600.0,"status":"EXCEEDS_PUMP"},"passed":true},{"actual":{"conc_mcg_ml":594.059405940594,"rate_ml_h":151.5,"status":"OK"},"check":"high but valid rate","expected":{"conc_mcg_ml":594.059405940594,"rate_ml_h":151.5,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"status":"BELOW_RESOLUTION"},"check":"tiny rate that rounds to 0.1","expected":{"conc_mcg_ml":600.0,"rate_ml_h":0.1,"status":"OK"},"passed":false},{"actual":{"conc_mcg_ml":600.0,"status":"BELOW_RESOLUTION"},"check":"rate that rounds to zero","expected":{"conc_mcg_ml":600.0,"status":"BELOW_RESOLUTION"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"standard adult infusion\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 1600.0, \"rate_ml_h\": 13.3}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 1600.0, \"rate_ml_h\": 13.3}, \"passed\": true}, {\"check\": \"half-tenth rate rounds up\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.2}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.3}, \"passed\": false}, {\"check\": \"rate exactly at pump maximum\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 999.9}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 999.9}, \"passed\": true}, {\"check\": \"rate above pump maximum\", \"actual\": {\"status\": \"EXCEEDS_PUMP\", \"conc_mcg_ml\": 600.0}, \"expected\": {\"status\": \"EXCEEDS_PUMP\", \"conc_mcg_ml\": 600.0}, \"passed\": true}, {\"check\": \"high but valid rate\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 594.059405940594, \"rate_ml_h\": 151.5}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 594.059405940594, \"rate_ml_h\": 151.5}, \"passed\": true}, {\"check\": \"tiny rate that rounds to 0.1\", \"actual\": {\"status\": \"BELOW_RESOLUTION\", \"conc_mcg_ml\": 600.0}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.1}, \"passed\": false}, {\"check\": \"rate that rounds to zero\", \"actual\": {\"status\": \"BELOW_RESOLUTION\", \"conc_mcg_ml\": 600.0}, \"expected\": {\"status\": \"BELOW_RESOLUTION\", \"conc_mcg_ml\": 600.0}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.275,"exit_code":0,"observations":[{"actual":{"conc_mcg_ml":1600.0,"rate_ml_h":13.3,"status":"OK"},"check":"standard adult infusion","expected":{"conc_mcg_ml":1600.0,"rate_ml_h":13.3,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"rate_ml_h":0.3,"status":"OK"},"check":"half-tenth rate rounds up","expected":{"conc_mcg_ml":600.0,"rate_ml_h":0.3,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"rate_ml_h":999.9,"status":"OK"},"check":"rate exactly at pump maximum","expected":{"conc_mcg_ml":600.0,"rate_ml_h":999.9,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"status":"EXCEEDS_PUMP"},"check":"rate above pump maximum","expected":{"conc_mcg_ml":600.0,"status":"EXCEEDS_PUMP"},"passed":true},{"actual":{"conc_mcg_ml":594.059405940594,"rate_ml_h":151.5,"status":"OK"},"check":"high but valid rate","expected":{"conc_mcg_ml":594.059405940594,"rate_ml_h":151.5,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"rate_ml_h":0.1,"status":"OK"},"check":"tiny rate that rounds to 0.1","expected":{"conc_mcg_ml":600.0,"rate_ml_h":0.1,"status":"OK"},"passed":true},{"actual":{"conc_mcg_ml":600.0,"status":"BELOW_RESOLUTION"},"check":"rate that rounds to zero","expected":{"conc_mcg_ml":600.0,"status":"BELOW_RESOLUTION"},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"standard adult infusion\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 1600.0, \"rate_ml_h\": 13.3}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 1600.0, \"rate_ml_h\": 13.3}, \"passed\": true}, {\"check\": \"half-tenth rate rounds up\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.3}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.3}, \"passed\": true}, {\"check\": \"rate exactly at pump maximum\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 999.9}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 999.9}, \"passed\": true}, {\"check\": \"rate above pump maximum\", \"actual\": {\"status\": \"EXCEEDS_PUMP\", \"conc_mcg_ml\": 600.0}, \"expected\": {\"status\": \"EXCEEDS_PUMP\", \"conc_mcg_ml\": 600.0}, \"passed\": true}, {\"check\": \"high but valid rate\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 594.059405940594, \"rate_ml_h\": 151.5}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 594.059405940594, \"rate_ml_h\": 151.5}, \"passed\": true}, {\"check\": \"tiny rate that rounds to 0.1\", \"actual\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.1}, \"expected\": {\"status\": \"OK\", \"conc_mcg_ml\": 600.0, \"rate_ml_h\": 0.1}, \"passed\": true}, {\"check\": \"rate that rounds to zero\", \"actual\": {\"status\": \"BELOW_RESOLUTION\", \"conc_mcg_ml\": 600.0}, \"expected\": {\"status\": \"BELOW_RESOLUTION\", \"conc_mcg_ml\": 600.0}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}