Running in production
Daily mailbox intake and the weekly review run unattended. A deliberate limit: the review does not check signatures, and the agency decided to keep it that way.
The situation
A California home health agency pays contracted PT, OT and ST vendors by invoice, and must confirm each billed visit has a note in the EMR before paying. An intake coordinator did this by hand: print, tick, scan, one invoice at a time.
The cost of leaving it alone
Paying for an undocumented visit is a billing-integrity problem, and finding it after the check is cut is a conversation nobody enjoys. The manual check was also slow enough that it competed with everything else the coordinator did.
What we built
Vendors email invoices to a dedicated shared mailbox, and a daily job saves the attachments into the coordinator’s existing folder. A weekly review reads each invoice (the text layer when there is one, cell-by-cell OCR for scans), matches each billed visit to a fresh visit-note export from the EMR, and emails one report.
The report sorts every invoice into ready to pay, wait (with the missing visits listed), already paid, or needs a person. A first check catches invoices that were already paid. The review moves and renames nothing in the office’s folders, and paid invoices go to a read-only archive. Nothing goes to vendors automatically.
PythonTesseract OCR for scanned invoicesMicrosoft 365: shared mailbox, read-only SharePoint library, Power Automate, PlannerA scheduled, view-only EMR export
Why AI, or why not
No language model. Name normalization, date matching and classification are deterministic, and classic OCR handles scans. AI would only help if vendors sent unstructured invoices that defeat table reading, which has not happened.
The results
How PHI was protected
- Invoices and EMR exports are processed on agency-controlled, encrypted hardware.
- The mailbox app can read one shared mailbox and write one folder, and nothing else.
- The office’s folders are mounted read-only.
- The EMR session always logs off, because the agency has a concurrent-login limit.
What we would tell you to skip
Always export the whole billing period. A too-narrow export made the tool accuse real clinicians of not existing. And any name matcher that drives a payment decision ships with a regression suite, not a hope.
Reusable for
Agencies that pay contracted therapists per visit and can export visit-note status from their EMR.