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.

patients.csv
patient_idage_yearssexweightweight_unit
PT00861M70kg
labs.csv
patient_idcreatininecreatinine_unitcollected_at
PT0081.2mg/dL2026-11-01T04:44
meds.csv
order_idpatient_iddrugdose_mgfrequencystart_timestatus
RX6426PT008Bremazotan200OD2026-10-18T08:12active
RX4062PT008Aldrovexin2000OD2026-10-26T16:33active
RX5633PT008Aldrovexin3500OD2026-10-24T09:47discontinued (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
OrderDaily doseLimitFlagged
RX6426Bremazotan200 × 1 = 200 mg400 mgCrCl ≥ 50no
RX4062Aldrovexin2000 × 1 = 2000 mg3000 mgCrCl ≥ 60no
RX5633Aldrovexin3500 × 1 = 3500 mg (the value this mistake misreads)3000 mgCrCl ≥ 60yes (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
OrderDaily doseLimitFlagged
RX6426Bremazotan200 × 1 = 200 mg400 mgCrCl ≥ 50no
RX4062Aldrovexin2000 × 1 = 2000 mg3000 mgCrCl ≥ 60no
RX5633Aldrovexinnot 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 []
tests/test_outputs.py
@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.