5-node AI system that transforms unstructured doctor's notes into TPA-ready insurance pre-authorization submissions.
Indian hospital insurance pre-authorization is broken:
- 3-7 hours from patient arrival to insurance approval (IRDAI mandates 1 hour)
- 40% of submissions get sent back for missing information
- 15+ different TPA portals, each with different forms and rules
The bottleneck isn't the insurer. It's the 2-4 hours inside the hospital — reading handwritten notes, filling templates, gathering reports from departments.
A 5-node AI pipeline that processes a patient case end-to-end:
| Node | Function | Impact |
|---|---|---|
| 1. Clinical Parser | Reads doctor's notes (Hindi-English mixed), extracts structured data, assigns ICD-10 codes | 30 min → 2 min |
| 2. Completeness Checker | Cross-checks documents against TPA-specific requirements, flags missing items | 40% → 15% send-back rate |
| 3. Approval Scorer | Multi-factor approval probability with risk factors and mitigation | Catches issues before submission |
| 4. Form Generator | Auto-generates the correct TPA-specific pre-auth form | One system replaces 15+ templates |
| 5. Query Drafter | Reads TPA send-back queries, drafts responses from existing data | 2-6 hrs → 15 min |
- Hindi-English mixed notes — "Patient ko 6 months se right knee mein pain hai" parsed natively
- Never invents medical data — every finding traces to the original notes
- TPA-specific rules — Medi Assist wants PAC for 55+, FHPL needs cost itemization, all checked automatically
- Correct ICD-10 coding — right knee vs left knee = different code, cross-references for laterality
- Pre-existing condition handling — flags, checks waiting periods, adjusts approval prediction
| Layer | Technology |
|---|---|
| AI Engine | Sarvam 105B (native Indian language support, 128K context) |
| Framework | Next.js 15, App Router, React Server Components |
| Hosting | Vercel Edge (global CDN, atomic rollbacks) |
| PDF Processing | pdf-parse (server-side, magic byte validation, 20MB limit) |
| Security | Rate limiting (10 req/min/IP), server-side API keys only |
| Type Safety | TypeScript strict mode, JSON schema validation on LLM output |
Doctor's Notes (Hindi/English)
|
+-------------+
| Node 1 | Clinical Parser — ICD-10, structured summary
+------+------+
|
+-------------+
| Node 2 | Completeness Checker — TPA-specific document audit
+------+------+
|
+-------------+
| Node 3 | Approval Scorer — probability + risk factors
+------+------+
|
+-------------+
| Node 4 | Form Generator — TPA-specific pre-auth form
+------+------+
|
+ - - - - - - +
| Node 5 | Query Drafter — handles TPA send-backs (if needed)
+ - - - - - - +
git clone https://github.com/balabommablock-cpu/preauth-ai.git
cd preauth-ai
npm install
cp .env.example .env.local # Add your API keys
npm run devOpen http://localhost:3000 for the architecture overview, or http://localhost:3000/demo for the interactive demo.
The demo runs 4 of 5 nodes live on a real Total Knee Replacement case:
- Sample case pre-loaded (62M, severe OA right knee, KL Grade IV)
- Upload your own clinical notes (PDF or text)
- Each node processes sequentially with real AI inference
Built by Rishabh Balabomma