Wrong-Patient Safety

The look-alike-patient problem, and how the system refuses to guess.

5/5 dangerous look-alikes refused · 2/2 safe cases handled correctly

What you're looking at

Automating an EMR means a computer clicks a patient's row and writes to their chart. The catastrophic failure is picking the wrong patient. This page shows that failure mode — and proves the system stops before it happens.

Why it's hard

On legacy, Citrix, and RDP EMRs the software reads the screen with OCR — pixels, not the database. Some patient IDs differ by a single look-alike character: a letter O vs the digit 0, a lowercase l vs the digit 1. OCR reads those two different patients as the same text — so the computer literally cannot tell them apart from the screen.

The defense

When an identifier is that ambiguous, openadapt-flow halts instead of guessing. Below, every dangerous look-alike → it stops; a genuinely clean patient → it proceeds normally; a different patient → it catches the mismatch. It stops exactly when it should, and acts when it's safe.

How to read each card

  • Left — the patient the workflow was recorded on.
  • Right — the row present at replay. For the dangerous cards this is a different patient whose row looks the same; for the clean control it's the same patient re-rendered.
  • The magnified strip — the patient ID, the only real difference between the two.
  • “What the computer sees (OCR)” — the text read from the pixels. When it's identical on both sides, that's the danger.
  • The verdict — what the system actually did.

Every pair below is a real screenshot, read with the repo's own OCR and judged by the exact check that ships in production (verify_target_identity). No AI model, no network, fully reproducible: python -m benchmark.safety_gallery.generate.

What this does NOT protect against

This page would be dishonest without the failures it does not fix. Pulled straight from docs/LIMITS.md and the fault-model study:

The check turns a wrong-patient approval into a stop; it does not make the rest of the automation all-seeing. The limits above are open problems, disclosed on purpose.