OCR Prescription Analysis

A local-first prescription reader for clinicians. Photograph a handwritten prescription, have it read on the machine that took the photo, and get back a draft record that is explicit about how confident it is in every medication name.

A draft record: the source photo beside the extracted medications, each with raw OCR, matched name, edit distance and confidence.
A draft record: the source photo beside the extracted medications, each with raw OCR, matched name, edit distance and confidence.
Starting a read: patient selected, photo attached, and the privacy panel stating the image is never stored.
Starting a read: patient selected, photo attached, and the privacy panel stating the image is never stored.
The read running locally, with an elapsed timer.
The read running locally, with an elapsed timer.
Dashboard: drafts waiting for review, open repeat alerts, and the confidence mix across records.
Dashboard: drafts waiting for review, open repeat alerts, and the confidence mix across records.
The plain-language patient view, including the gaps where no drug information was found.
The plain-language patient view, including the gaps where no drug information was found.
The same view in Urdu, right-to-left, carrying the translation disclaimer.
The same view in Urdu, right-to-left, carrying the translation disclaimer.
Repeat-prescription alerts, each naming the rule behind it.
Repeat-prescription alerts, each naming the rule behind it.
Evaluation scorecard: character error rate, reachability, NER F1, page-level F1, and zero third-party requests.
Evaluation scorecard: character error rate, reachability, NER F1, page-level F1, and zero third-party requests.
One page traced end to end: detection, raw OCR, then corrected names.
One page traced end to end: detection, raw OCR, then corrected names.
Pipeline settings: cloud OCR off by default.
Pipeline settings: cloud OCR off by default.

The problem

Handwritten prescriptions are genuinely hard to read, and that is exactly why software that claims to read them is dangerous. A wrong drug name delivered confidently is worse than no software at all. So the design question was never “how do we get accuracy up”, it was “what does a clinician need to see in order to trust or reject each individual line?”

Showing the work

Every extracted medication displays the raw OCR text, the drug name it was matched to, the edit distance between the two, and a confidence band. When the pipeline is unsure it says so on that specific line, and the record stays a draft until a clinician confirms it. The page header counts how many entries need checking rather than burying them in the list.

Local by default

The whole pipeline runs CPU-only and offline. The evaluation scorecard records zero third-party requests, cloud OCR is switched off unless someone deliberately enables it, and the privacy panel states plainly that the photo is never stored. For medical images that is a design constraint, not a feature.

Measuring it honestly

The evaluation harness reports character error rate, drug-name reachability, NER F1 and page-level F1, alongside a pipeline trace that shows one page going from detection through raw OCR to corrected names. Page-level F1 is 0.348. That number is on the page because it is the reason the product is shaped as decision support rather than as an automatic reader.

Highlights

Demo patients, staged dates and a throwaway database. The prescription images come from the public bilingual_prescriptions dataset. The reads themselves are unedited, the needs-checking badges are what the pipeline actually produced.

More AI