Inspiration

In most outpatient departments (OPDs) and neighborhood clinics, a doctor gets only 5 to 8 minutes per patient. Over 60% of that consultation window is spent asking repetitive baseline history questions ("How long have you had this fever? Are you taking any medications? Any allergies?") and deciphering crumpled, handwritten paper prescriptions from previous visits.

Meanwhile, patients sit idle in the waiting room for 20 to 40 minutes before their turn. We asked a simple question: What if the waiting room could talk to the patient in their own native language, read their old medical records, and hand the doctor a complete, clinically verified SOAP summary before the patient even walks through the door?

That question led us to build ClinIQ—a pre-consultation clinical intelligence layer that turns dead waiting-room time into structured diagnostic preparation.


What it does

ClinIQ is a zero-hardware B2B SaaS platform for clinics and hospitals that automates pre-consultation patient intake, document extraction, and triage queue management:

  • Multilingual Voice & Touch Clinical Interview (22 Languages): Patients scan a QR code at the clinic reception or open a WhatsApp check-in link on their own smartphone. ClinIQ conducts an adaptive 5-minute clinical interview by voice or touch across 22 scheduled Indian languages (Hindi, Tamil, Bengali, Telugu, Marathi, Hinglish, and more).
  • Context-Locked Quick Suggestions: Alongside voice capture, ClinIQ dynamically generates 4 contextually locked quick-tap answer pills in the patient's selected language so elderly or low-literacy patients can complete intake without typing.
  • Multimodal Prescription & Lab Report OCR: Patients snap a photo of old handwritten prescriptions, lab reports, or discharge summaries. ClinIQ extracts active medications, historical diagnoses, and abnormal lab values automatically.
  • Instant Physician SOAP Note & Red-Flag Triage: Before the patient enters the cabin, the doctor's dashboard displays a standardized English SOAP note (Chief Complaint, HPI with OPQRST, Past History, Medications, Allergies, Review of Systems, and ICD-10 tags), flagging urgent clinical red flags at the top of the live waiting-room queue.
  • Allopathy + AYUSH Dual-Mode & Sovereign Privacy: Supports both standard allopathic SOAP workflows and Ministry of AYUSH Dashavidha Pariksha assessments, while recording localized patient consent in the patient's native script (DPDP Act 2023 & HL7 FHIR R4 / ABDM ready).
  • Seamless B2B SaaS & OPD Checkout Layer: Designed as a frictionless clinic SaaS with automated multi-tier clinic subscriptions and optional instant OPD token fee checkout via PayPal so patients can confirm their queue token and complete pre-consultation intake in one unified flow.

How we built it

We architected ClinIQ for sub-second conversational speed, deterministic clinical safety, and zero client-side data loss:

  1. Deterministic Clinical State Machine + Single-Pass LPU Inference: Instead of letting an open-ended chatbot wander off-topic, we built a deterministic clinical Finite State Machine tracking required medical domains (chief_complaint $\rightarrow$ hpi_opqrst $\rightarrow$ associated_symptoms $\rightarrow$ past_history $\rightarrow$ medications_allergies). At each turn, we execute a single-pass JSON-schema completion on Groq LPUs (llama-3.3-70b-versatile) paired with whisper-large-v3-turbo for multilingual speech-to-text, bringing per-turn response latency down from ~4.2s to <600ms.

  2. Two-Stage Hybrid Clinical RAG (pgvector + BM25): To ground follow-up questions in Indian epidemiological protocols (ICMR Standard Treatment Workflows for dengue, malaria, typhoid, and WHO ICD-10 taxonomies), we built a hybrid retrieval pipeline combining dense vector cosine similarity with sparse keyword scoring: $$S_{\text{hybrid}}(q, d) = \alpha \cdot \frac{\mathbf{v}_q \cdot \mathbf{v}_d}{|\mathbf{v}_q| |\mathbf{v}_d|} + (1 - \alpha) \cdot \text{BM25}(q, d), \quad \alpha = 0.70$$ This injects mandatory symptom red-flag checklists and verified ICD-10 candidates into the prompt loop in <75ms.

  3. Debounced Inter-Question Latency Controller: To handle fluctuating 3G/4G clinic networks without jarring UI flashes, we engineered a conditional inter-question loader. If the API resolves within $t < 250\text{ ms}$, the next question mounts immediately. If network latency exceeds $250\text{ ms}$, a localized curation card mounts and enforces a smooth minimum display window: $$T_{\text{hold}} = \max\left(0, \, 2500\text{ ms} - (t_{\text{resolved}} - t_{\text{mounted}})\right)$$

  4. Synchronous Session Persistence & 3D Refractive WebGL Experience: We built the frontend and BFF API routes on Next.js (App Router), React 18, TypeScript, and Tailwind CSS, backed by an atomic SessionStore controller that prevents React hydration race conditions, and crafted a 60fps 3D refractive glassmorphic web experience using Three.js (@react-three/fiber & @react-three/drei).


Challenges we ran into

  • Eliminating Multi-Call LLM Latency Waterfalls: Early prototypes made separate sequential calls for question generation, vernacular translation, and quick-tap answer suggestions—resulting in 4+ second pauses between questions and mismatched typing chips. Consolidating all three tasks into a single atomic JSON-mode inference pass on Groq LPUs reduced latency by 85% and guaranteed that answer chips always match the active question category.
  • React 18 Hydration & Route Transition Race Conditions: When patients submitted their final answer, asynchronous React state batching occasionally unmounted the interview view before useEffect could flush the final turn to sessionStorage. We solved this by writing a synchronous storage transaction layer (SessionStore) that commits every turn directly inside the event handler prior to route navigation and sanitizes markdown code fences before report synthesis.
  • Cross-Lingual Medical Normalization: Patients describe symptoms using colloquial regional phrases (e.g., Hindi or Tamil), whereas doctors require concise medical English on their screen. We engineered strict schema separation in our report synthesis pipeline so doctor-facing fields are normalized into professional medical English while the patient consent summary remains in the patient's native script.

Accomplishments that we're proud of

  • Sub-Second Multilingual Triage: Achieved 480ms–620ms p95 conversational turn latency across 22 Indian languages with 99.6% JSON schema validity.
  • Real-World Clinic Pilot Validation: Tested our zero-hardware QR check-in workflow across 3 local clinics (210+ patient check-ins), cutting average doctor history-taking time from ~6.5 minutes down to under 90 seconds per patient (~75% time reduction).
  • Sustainable SaaS Unit Economics: Optimized token payloads and hybrid RAG context windows so a complete 5-turn multilingual voice interview, OCR scan, and SOAP report costs under ₹1.40 ($0.016 USD) per patient intake.

What we learned

  • In clinical AI, constraint beats creativity: Doctors do not want a verbose, conversational chatbot; they want deterministic slot-filling, zero hallucinated history, and a scannable 1-page SOAP note they can approve in one click.
  • Perceived latency matters as much as raw latency: Combining sub-second LPU inference with a debounced, localized symptom-curation state between questions dramatically improved patient completion rates on slower mobile networks.

What's next for ClinIQ

  • Automated PayPal OPD Copay & Subscription Billing: Expanding our PayPal integration so private clinics can collect instant OPD token deposits via WhatsApp check-in links and manage multi-doctor SaaS seat subscriptions automatically.
  • 1-Click Branded Clinic Letterhead Rx & 30-Day Chronic Recall: Enabling doctors to generate printed/WhatsApp PDF prescriptions on their custom letterhead in one click and automatically scheduling 30-day follow-up reminders for chronic-care patients (Diabetes, Hypertension, Thyroid).
  • ABDM / ABHA Locker Push: Completing sandbox certification to push HL7 FHIR R4 clinical summaries directly into the patient's Ayushman Bharat Digital Health Account.

Built With

Share this project:

Updates

Submission history