logo

Prototype / Demo Product

This is a demonstration project with synthetic data. Not intended for production use without proper compliance and validation.

AI-Powered Medical Prescription OCR System icon

Healthcare

12/26/2024

Demo Project

AI-Powered Medical Prescription OCR System

Prototype AI system that digitizes handwritten prescriptions using multi-engine OCR, medical NLP, and 253K+ Indian medicine database.

#AI/ML#Healthcare#OCR#NLP#Python#React
Try Live Demo
AI-Powered Medical Prescription OCR System

Client

Batra Hospital

Duration

10 weeks

Team Size

6 developers

Key Result

98-99% extraction accuracy

The Challenge

Handwritten prescriptions cause medication errors and delays in pharmacy workflows

Our Solution

Multi-engine OCR with Google, Azure & AWS, combined with medical NLP and drug database enrichment

Key Results

98-99% extraction accuracy, 3-5 second processing, 253K+ medicine database

Technologies Used

PythonFastAPIReactTypeScriptGoogle Document AIAzure Form RecognizerAWS TextractAWS Comprehend MedicalGoogle Gemini AIPostgreSQL
⚠️

Demo Product

This is a prototype with synthetic data for demonstration purposes. Not intended for production medical use without proper regulatory compliance and clinical validation.

🚀 Try the Live Demo

Upload a prescription image and watch AI extract medications, dosages & more in real-time.

Launch Demo →

Overview

Healthcare facilities face significant challenges with handwritten prescriptions — illegibility leads to medication errors, pharmacy staff waste time deciphering writing, and valuable data gets lost in paper-based systems. This AI-powered solution digitizes prescriptions automatically.

98%+

Medicine Extraction

3-5s

Processing Time

253K+

Indian Medicines

3

OCR Engines

How It Works

The system uses a sophisticated multi-stage pipeline:

  1. Image Preprocessing (~150ms) — Grayscale conversion, deskewing, CLAHE enhancement, and denoising
  2. Content Segmentation (~90ms) — Divides prescription into logical sections (header, medications, notes)
  3. Parallel OCR (~3s) — Google Document AI, Azure Form Recognizer, and AWS Textract process simultaneously
  4. Best Result Selection — Confidence-based selection of best OCR result per section
  5. Medical NLP (~4.5s) — AWS Comprehend Medical extracts entities, Gemini AI corrects errors
  6. Database Enrichment (~500ms) — Matches against 253K+ Indian medicines with RxNorm codes

Key Features

Multi-Engine OCR Ensemble

Each prescription section is processed by all 3 OCR engines in parallel. The system automatically selects the best result per section based on confidence scores — different engines excel at different handwriting styles.

Medical-Aware NLP

AWS Comprehend Medical extracts structured entities:

  • MEDICATION — Drug names
  • DOSAGE — Amounts (500mg, 1 tab)
  • FREQUENCY — Timing (BD → Twice daily, TDS → Three times daily)
  • DURATION — Length (5 days, 2 weeks)

Gemini AI then corrects OCR errors using medical context: "Prctmol" → "Paracetamol"

Drug Database Integration

Every medication is enriched with RxNorm codes for standardization, brand/generic mapping from 253K+ Indian medicine records, pricing information, and manufacturer details.

Smart Confidence Routing

Results are automatically routed based on confidence: 95%+ auto-approved, 85-95% low-priority review, 70-85% high-priority review, below 70% urgent pharmacist review.

Try It Yourself

  1. Visit demo.qbitlog.com
  2. Navigate to the Clinic page
  3. Drag & drop any prescription image (JPG/PNG, max 10MB)
  4. Watch real-time processing: preprocessing ✓ → OCR ✓ → NLP ✓ → enrichment ✓
  5. Review and edit extracted medications, dosages, frequencies
  6. Send to pharmacy workflow

⚡ Demo Limitations

  • • No authentication — open demo for testing
  • • All patient/prescription data is synthetic
  • • Not HIPAA/GDPR compliant
  • • Requires internet for cloud OCR/NLP APIs
  • • Processing costs apply for API calls

Technology Stack

Backend: Python 3.11+, FastAPI, SQLAlchemy 2.0 (async), OpenCV, PostgreSQL

OCR Services: Google Document AI, Azure Document Intelligence, AWS Textract

NLP: AWS Comprehend Medical, Google Gemini AI

Frontend: React 18, TypeScript, Vite, TanStack Router, Tailwind CSS