MDP
Project · Workflow automation · Workflow published on GitHub
Medical Document Processor
- n8n
- Google Gemini
- LLM classification
- OCR
- Gmail OAuth2
An n8n workflow that OCRs incoming clinical documents with Gemini, classifies them, extracts patient details and routes one summary email to the front desk.
The problem in the clinic
Clinic front desks receive a constant mix of faxed and scanned referrals, imaging reports, surgical bookings, billing and records requests. Staff sort and route them by hand.
Approach
I built an n8n pipeline. A form accepts up to five PDFs or images, Gemini extracts the text and classifies each document into a clinic-specific category with patient identifiers, and the results are combined into a single routed email with the originals attached.
How it works
- 1Upload form (up to 5 files)
- 2Gemini OCR & text extraction
- 3AI classification + patient info extraction
- 4Results aggregated
- 5Single summary email with attachments
Safety & escalation
- Categories match real front-desk queues: referral (new or existing), imaging, surgical booking, billing, records request and other.
- A human still reviews every routed document. The AI sorts and does not act on its own.
- Built for demonstration only. Real use would need a PHIPA-compliant deployment and a data processing agreement.
What I learned
- Classification categories have to come from the people doing the work, not from the model.
- Combining results into one email made staff more likely to use it than one alert per file.