Skip to content

yashas004/PriorAuth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PriorAuth AI Agent

Automates US healthcare prior authorization using a 3-tool MCP pipeline. A clinician types one sentence — the agent returns a complete PA submission in under 30 seconds.

Stack

  • MCP servers: FastMCP (Streamable HTTP, MCP 2025-03-26 spec)
  • LLM: Google Gemini API (gemini-2.5-flash, free tier)
  • FHIR: SMART Health IT R4 sandbox with mock fallback
  • Platform: Prompt Opinion A2A orchestrator
  • Frontend: Next.js + Tailwind CSS dashboard

Architecture

Layer Component Port
MCP Tool 1 fhir-patient-fetcher 8001
MCP Tool 2 coverage-checker 8002
MCP Tool 3 justification-writer 8003
Orchestrator FastAPI chain (Tool 1 → 2 → 3) 8000
Platform Prompt Opinion A2A Orchestrator
Frontend Next.js dashboard 3000

Quick Start

cd backend/prior-auth-agent
cp .env.example .env
# Add your GEMINI_API_KEY to .env
docker compose up --build

Verify the servers are running

curl http://localhost:8000/health   # orchestrator
curl http://localhost:8001/health   # fhir-fetcher
curl http://localhost:8002/health   # coverage-checker
curl http://localhost:8003/health   # justification-writer

Demo patients

ID Patient Scenario Denial risk
mock-123 Sarah Johnson RA — Humira (adalimumab) Low
mock-456 Marcus Williams Psoriasis — Skyrizi (risankizumab) Medium
mock-789 Linda Okafor T2D — Ozempic (semaglutide) High

SHARP Context Headers

When called via Prompt Opinion, the orchestrator injects:

  • X-Sharp-Patient-Id — patient identifier
  • X-Sharp-Fhir-Token — FHIR OAuth2 bearer token
  • X-Sharp-Fhir-Base-Url — FHIR server base URL

Project structure

backend/prior-auth-agent/
  services/
    fhir_fetcher/        MCP Tool 1 (port 8001)
    coverage_checker/    MCP Tool 2 (port 8002)
    justification_writer/ MCP Tool 3 (port 8003)
  shared/
    models.py            Pydantic v2 data contracts
    sharp_context.py     SHARP header utilities
  docker-compose.yml
  .env.example
frontend/                Next.js dashboard

Contributors

Name Role
Vipin Bhatt Backend MCP servers, FHIR client, coverage checker
Yashas Yadav Frontend, orchestrator, platform integration

About

web application that simulates an AI-powered healthcare prior authorization workflow

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors