Inspiration

The U.S. healthcare system loses an estimated $262 billion annually to denied insurance claims — driven not by fraud, but by preventable documentation errors. The average medical biller spends $25 per claim just on rework after a denial. We asked ourselves: what if an AI could catch these errors before the claim ever leaves the office?

The inspiration came from a real conversation with a medical billing specialist who said, "Half my day is fixing things that the system should have caught in the first place." That sentence became the product brief for ClaimIQ.

What it does

ClaimIQ is a real-time AI claim auditor powered by Google Gemini 3.1 Pro Preview. It validates medical insurance claims before submission by:

  • Detecting coding mismatches — e.g., flagging CPT 27447 (Total Knee Arthroplasty) paired with ICD-10 J01.90 (Acute Sinusitis) with a score of 5/100
  • Identifying missing documentation that payers deny for lack of medical necessity
  • Auto-generating clinical narratives — ready-to-paste professional notes when descriptions are blank or vague
  • Auto-filling corrected ICD-10 codes with one click, directly into the claim form
  • Scoring every claim 0–100, enforcing: missing description → score < 70, vague code → score < 75, complete claim → score ≥ 95

After fixing the AI-recommended errors, a claim that scored 5 jumps to 95+ in under 60 seconds. Submitted claims automatically update the Dashboard — revenue, approval counts, hours saved — in real time.

How we built it

Layer Technology
Framework Next.js 16 (App Router, TypeScript)
AI Model gemini-3.1-pro-preview via @google/generative-ai
Styling Custom Glassmorphism CSS + Lucide Icons
Charts Chart.js + react-chartjs-2
State React useState + localStorage
Deployment Docker + Google Cloud Run

The core is a structured JSON prompt sent to Gemini on every validation. Gemini returns a strict schema:

{
  "score": 45,
  "validations": [
    { "type": "error", "message": "Critical mismatch: CPT 27447 is unrelated to J01.90." }
  ],
  "recommendation": "- Replace J01.90 with J01.01 (Acute recurrent maxillary sinusitis)",
  "suggestedDescription": "Patient presents with recurrent maxillary and frontal sinusitis...",
  "suggestedCodes": ["J01.01", "J01.11"]
}

Each field drives a dedicated UI component independently — the score ring, validation badges, recommendation bullets, the copy-able narrative box, and the auto-fill button. The AI is instructed never to mix narratives with code suggestions.

On the frontend, the auto-fill button applies suggested codes instantly:

onClick={() => {
  update('diagnosisCode', aiResult.suggestedCodes!.join(', '));
  setStep(2); // Jump back to edit screen
}}

Claims are synced across pages via localStorage:

// On submit — auto-routes based on AI score
const isApproved = (aiResult?.score || 0) >= 95;
localStorage.setItem('claimiq_claims', JSON.stringify([newClaim, ...storedClaims]));
localStorage.setItem('claimiq_approved', (approvedCount + (isApproved ? 1 : 0)).toString());
localStorage.setItem('claimiq_hours_saved', (currentHours + 1.5).toFixed(1));

Challenges we ran into

Prompt Engineering Discipline — Getting Gemini to strictly separate suggestedDescription from recommendation took significant iteration. Early versions placed clinical narratives inside the validations array. We solved it by embedding explicit field-level docstrings directly inside the JSON schema in the prompt, treating it like a typed API contract.

Scoring Consistency — The model initially awarded high scores to claims with missing descriptions if the codes were valid. We added a strict scoring matrix to the system prompt:

STRICT SCORING:
- If Description is 'N/A' or missing → score MUST BE < 70
- If ICD-10 code is "unspecified" for an expensive procedure → score MUST BE < 75  
- ONLY score >= 95 if BOTH a specific ICD-10 AND a detailed clinical description exist

Cross-Page State Sync — Without a backend database, we built a complete localStorage sync layer so that KPI tiles on the Dashboard update mathematically every time a claim is submitted from the Submit page.

Demo Reliability — For a live hackathon demo, nothing can break. We built three one-click scenario buttons (Perfect, Missing Context, Coding Mismatch) that auto-fill deterministic bad data, guaranteeing the full 5 → 95 transformation can be shown every single time without manual typing.

Accomplishments that we're proud of

  • 🎯 Real AI utility — Gemini doesn't just flag errors; it writes the exact fix for the biller to copy and paste
  • Sub-5 second validation — full Gemini API round-trip with structured JSON parsing
  • 🏗️ Production deployment — live on Google Cloud Run, zero cold-start issues
  • 🔗 Fully navigable UI — every KPI tile, table row, and button links to the correct page
  • 📊 Live KPI sync — Revenue, Approved, Pending, and Hours Saved all update on every claim submission

What we learned

  • Gemini excels at structured medical reasoning when given precise schemas — it correctly identifies CPT/ICD-10 incompatibilities that would take a trained human coder minutes to spot
  • Prompt contracts matter more than model size — tight JSON schemas with explicit field rules produce far more reliable outputs than free-form instructions
  • Demo design is product design — engineering the three scenario buttons forced us to deeply understand the exact pain points we solve, sharpening both the pitch and the product
  • localStorage as a lightweight backend is surprisingly powerful for hackathon-scale demos when combined with React useState and useEffect

What's next for ClaimIQ

  • 🏥 EHR Integration — Pull claims directly from Epic/Cerner via FHIR APIs, eliminating all manual data entry
  • 🔐 HIPAA-Compliant Auth — OAuth2 with role-based access for billers, physicians, and administrators
  • 🗄️ Real Database — Replace localStorage with Firestore for true multi-user, multi-practice persistence
  • 📬 Payer API Integration — Submit claims and receive real-time responses via X12 EDI 837/835 standards
  • 📈 Predictive Denial ML — Fine-tune a model on historical denial data to predict payer-specific rejection probability before Gemini validation runs
  • 🌐 Multi-Specialty Templates — Pre-built claim templates for cardiology, orthopedics, radiology, and mental health to reduce form time to under 30 seconds

Built With

Share this project:

Updates