Trap · order status · patient PT008
A stopped order counted as active
The flag lands on a drug nobody is taking. False alarms wear clinicians down and invite a fix to a dose that doesn't exist.
The patient's rows
Exactly what the agent sees for PT008, copied from the chart. The value this mistake misreads is underlined.
| patient_id | age_years | sex | weight | weight_unit |
|---|---|---|---|---|
| PT008 | 61 | M | 70 | kg |
| patient_id | creatinine | creatinine_unit | collected_at |
|---|---|---|---|
| PT008 | 1.2 | mg/dL | 2026-11-01T04:44 |
| order_id | patient_id | drug | dose_mg | frequency | start_time | status |
|---|---|---|---|---|---|---|
| RX6426 | PT008 | Bremazotan | 200 | OD | 2026-10-18T08:12 | active |
| RX4062 | PT008 | Aldrovexin | 2000 | OD | 2026-10-26T16:33 | active |
| RX5633 | PT008 | Aldrovexin | 3500 | OD | 2026-10-24T09:47 | discontinued (the value this mistake misreads) |
Two readings of the same rows
Every step is shown. Where the careless reading goes wrong, the value is underlined.
What a careless agent computes
Checks every order in meds.csv, including the one whose status is discontinued.
- Weight
- 70 read as kg → 70 kg
- Creatinine
- 1.2 mg/dL (2026-11-01T04:44) read as mg/dL → 1.20 mg/dL
- CrCl
- (140 − 61) × 70 ÷ (72 × 1.20) = 64 mL/min
| Order | Daily dose | Limit | Flagged |
|---|---|---|---|
| RX6426Bremazotan | 200 × 1 = 200 mg | 400 mgCrCl ≥ 50 | no |
| RX4062Aldrovexin | 2000 × 1 = 2000 mg | 3000 mgCrCl ≥ 60 | no |
| RX5633Aldrovexin | 3500 × 1 = 3500 mg (the value this mistake misreads) | 3000 mgCrCl ≥ 60 | yes (the value this mistake misreads) |
Output line: {"crcl_ml_min":64,"flagged_order_ids":["RX5633"]}
The correct answer
Reads the unit, status, frequency and time columns as the instruction says, and flags only a daily dose strictly over the band's limit.
- Weight
- 70 read as kg → 70 kg
- Creatinine
- 1.2 mg/dL (2026-11-01T04:44) read as mg/dL → 1.20 mg/dL
- CrCl
- (140 − 61) × 70 ÷ (72 × 1.20) = 64 mL/min
| Order | Daily dose | Limit | Flagged |
|---|---|---|---|
| RX6426Bremazotan | 200 × 1 = 200 mg | 400 mgCrCl ≥ 50 | no |
| RX4062Aldrovexin | 2000 × 1 = 2000 mg | 3000 mgCrCl ≥ 60 | no |
| RX5633Aldrovexin | not active, skipped | - | no |
Output line: {"crcl_ml_min":64,"flagged_order_ids":[]}
The test that catches it
The careless output, graded by the task's real test file. This is what pytest printed.
Flagged set exact · PT008test_flagged_orders_exact[PT008]
AssertionError: PT008: flagged ['RX5633'] vs expected []
@pytest.mark.parametrize("pid", PATIENT_IDS)
def test_flagged_orders_exact(by_patient, pid):
assert pid in by_patient, f"no output for {pid}"
got = by_patient[pid].get("flagged_order_ids")
assert isinstance(got, list)
assert set(got) == set(EXPECTED[pid]["flagged_order_ids"]), \
f"{pid}: flagged {sorted(got)} vs expected {EXPECTED[pid]['flagged_order_ids']}"
No other patient's answer moves under this mistake, so this one failure is the whole signal.