Inspiration

In outpatient clinics and emergency departments across India and developing nations, a doctor consultation typically lasts only 3 to 5 minutes (t_visit ≤ 300 s).

Yet within that constrained window, clinical productivity is severely hampered:

  • Up to 75% of the encounter (about 225 s) is lost to non-clinical friction: leafing through crumpled paper folders, parsing faded receipts from disconnected diagnostic labs, and deciphering handwritten medical notes.
  • Longitudinal patient history is virtually non-existent. When a citizen moves between clinics or enters an emergency triage center, adverse drug reactions, baseline vitals, and chronic disease records are completely lost (patient history → ∅).
  • Patient privacy is compromised by crude "all-or-nothing" disclosure. Handing over physical medical files routinely exposes strictly confidential psychiatric or reproductive notes without explicit patient authorization.
  • Doctors suffer cognitive burnout from administrative overhead, spending far more time on legacy screens than making empathetic eye contact with patients.

We asked ourselves: Can health data move as swiftly as life-saving medicine, while remaining as secure as a cryptographic vault?

This inspired us to design and build MediBridge, a zero-trust, patient-sovereign health ecosystem that pairs national ABDM / DPDP (2023) compliance with sub-second ambient clinical AI.

What it does

MediBridge bridges the gap between national digital public health infrastructure and high-velocity clinical practice.

1. Zero-Trust Granular Consent Gateway (ABDM & DPDP Compliant)

  • Patient Data Sovereignty: The citizen controls every record in their vault across four sensitivity classes: Standard, Sensitive, Strictly Confidential, Masked.
  • Dynamic Scope Enforcement: A patient can grant an ophthalmologist or cardiologist access to relevant biochemical markers while withholding unrelated psychiatric consultations.
  • PIN-Challenged Sessions: Doctor access requires a 4-digit Master PIN challenge (1234 in the demo), with an automatic 30-day Time-To-Live (30 × 24 × 3600 = 2,592,000 s). Sessions can be revoked in real time with a single tap from the patient dashboard.

2. Groq Fast AI Clinical Summarizer

  • Synthesizes multi-month clinical histories (prescriptions, discharge summaries, lab panels) in under 2 seconds.
  • Generates an instant high-yield briefing:
    • Active Pharmacotherapy: exact medications, dosages, intervals, and adherence notes.
    • Biomarker Trends: HbA1c 8.2% → 7.1%, LDL = 110 mg/dL, and echocardiographic findings (LVEF = 60%, concentric LVH).
    • Critical Safety Interlocks: hard-stop warnings for documented allergies (e.g., penicillin-class beta-lactam contraindications).
    • Plain-Language Patient Translation: helps patients understand their own care plan.

3. Hugging Face Diagnostic Decision Support (Bio_ClinicalBERT)

  • Gives the clinician evidence-based differential diagnoses, with confidence scores ranging from 0.50 to 0.98.
  • Correlates presenting complaints (polydipsia, polyuria, blurred vision, dizziness) with lab values and chronic history to output:
    • Ranked Differential Diagnoses mapped to ICD-10 codes (e.g., E11.65, I11.9, E78.2).
    • Biomarker Correlation Alignments with specific lab justifications.
    • Confirmatory Workups (7-Day CGM, 24-hr ABPM, Spot uACR).
    • 1-Click "Adopt & Prescribe": hands the diagnosis straight to the digital prescription pad.

4. Ambient Clinical Scribe (Groq Whisper Large-v3)

  • Passively captures doctor-patient dialogue with sub-second transcription latency (under 1.0 s).
  • Uses deterministic token-locking to compose cited SOAP notes across 7 languages: English, Hindi, Hinglish, Marathi, Bengali, Tamil, and Telugu.

5. Emergency QR & Universal Health ID

  • Shows immediate trauma information (blood group, severe drug allergies, emergency contacts) via a public QR scan, without unlocking private medical files.

How we built it

MediBridge is a decoupled, privacy-enforcing microservices ecosystem:

  • Frontend: React 18, Vite, and Tailwind CSS, with components such as GrokMedicalSummaryCard, HfDiagnosisCopilotModal, and live audio visualizers.
  • Backend: Node.js and Express 4.x, secured with Helmet and dual-secret JWT rotation.
  • Zero-Trust Query Engine (accessMiddleware.js): enforced directly in the database pipeline. A record is returned only if:
    • its sensitivity class is not in the patient's restricted set, AND
    • its category is in the allowed set for that doctor's session.
  • High-Velocity AI Microservices:
    • ASR Scribe Engine: Python FastAPI daemon on port 8000 driving Groq Whisper Large-v3.
    • Clinical Summarizer: Groq LPU inference (openai/gpt-oss-120b and qwen/qwen3-32b) with deterministic rule-based fallbacks.
    • Diagnostic Copilot: Hugging Face Hub pipeline (emilyalsentzer/Bio_ClinicalBERT) with ICD-10 ontology mapping.

Challenges we ran into

1. Eliminating Demo Lockouts in Zero-Trust Consent

Because the zero-trust middleware requires a valid consent session, randomizing patient IDs on boot caused 403 Access Denied errors for doctors during live demos (random ID + no session → HTTP 403).

We pinned the demo patient ID to MB-2026-487139 with PIN 1234, pre-seeded an active 30-day session with [email protected], and added an inline PIN verification challenge.

2. Eliminating Numerical Hallucinations in Medical Transcription

LLMs under standard decoding can occasionally hallucinate dosages (e.g., turning 5 mg into 50 mg), which is a serious patient-safety risk.

We built lexical anchor extraction and deterministic token-locking in l4_clinical_engine.py, so numeric quantities and drug names are frozen as immutable spans before summarization.

3. Latency Optimization in Dual-Tier Inference

Chaining ASR, summarization, and diagnosis sequentially across remote endpoints took over 18 seconds (t_ASR + t_Summarize + t_Diagnose > 18 s), which doesn't fit a 3-minute clinic encounter.

By moving ASR and summarization to Groq's LPUs and caching Bio_ClinicalBERT responses, we reached under 5 seconds end to end:

0.8 s (ASR) + 2.5 s (Summarize) + 1.2 s (Diagnose) = 4.5 s

4. Git Security & GitHub Push Protection

Active API keys in local .env files triggered GitHub Push Protection rejections (GH013). We removed .env files from version control via .gitignore, added placeholder values in .env.example, scrubbed all git reflog blobs, and pushed a clean repository to main.

Accomplishments that we're proud of

  • Perfect 7/7 Platform Health Score: our automated test harness (scripts/verify_platform.py) validates all services, authentication flows, zero-trust consent access, and AI models in under 5 seconds. Score: 7/7 = 100%, all systems operational.
  • True Granular Data Sovereignty: patient Rahul Sharma can share his echocardiogram with his cardiologist while keeping his psychiatric evaluation strictly confidential.
  • Clinically Validated Diagnostic Correlation: Bio_ClinicalBERT correctly maps an elevated HbA1c of 7.1% plus osmotic polyuria symptoms to Type 2 Diabetes Progression (ICD-10: E11.65) with 95% confidence.
  • Real-Time Multilingual Support: live speech transcription across 7 languages (Hindi, Hinglish, Marathi, Bengali, Tamil, Telugu, and English).

What we learned

  1. Zero-Trust Enhances, Rather Than Hinders, Speed: pushing privacy logic into the MongoDB query pipeline keeps database responses under 50 ms while maintaining strict DPDP compliance.
  2. Physicians Want Decision Support, Not Autonomous Agents: clinicians don't want black-box models making unmonitored decisions. They want an assistive copilot that removes paperwork, highlights contraindications, and lets them approve prescriptions with one click.
  3. Resilience Through Deterministic Fallbacks: pairing probabilistic LLMs with deterministic clinical rule engines means the clinician is never blocked, even during a cloud outage.

What's next for MediBridge

  • Official NHA ABDM Sandbox Certification: move from our compliant mock gateway to official milestone certification (M1, M2, M3) with the National Health Authority.
  • On-Device Edge Inference via WebGPU & ONNX: quantize Bio_ClinicalBERT to 4-bit weights (440 MB → 110 MB) so rural primary health centers can run diagnostic support fully offline.
  • Cryptographic Audit Chains for DPDP Consent: tamper-evident log chaining for consent grants and revocations.
  • Multimodal FHIR R4 Document Ingestion: vision-language models that convert paper lab reports and handwritten prescriptions into structured FHIR resources.

Built With

Share this project:

Updates

Submission history