Inspiration
Prior authorization is one of the most repetitive, time-consuming parts of getting patients care — providers have to gather records, review clinical history, and fill out insurer-specific paperwork by hand before treatment can even be approved. We wanted to see if an AI agent could take on that prep work end-to-end, without cutting corners on the parts that actually matter in healthcare: patient consent and secure data access.
What it does
PriorPilot automates the prep work behind a prior authorization request. It authenticates the user, gets explicit patient consent through a CIBA step-up flow, securely pulls clinical data (medications, conditions, labs) from Epic FHIR APIs via Auth0 Token Vault, and uses an AI agent to draft a structured PA form plus a clinical justification — grounded only in facts actually present in the records. The draft then goes to a simulated insurer portal for submission, but a clinician always reviews it first. PriorPilot drafts, it doesn't decide.
How we built it
React + TypeScript + Vite on the frontend, Node/Express on the backend. Auth0 handles authentication and brokers short-lived Epic tokens through Token Vault so we never store long-lived provider secrets. CIBA handles the patient consent flow. An agent loop built on OpenAI's function-calling takes the structured FHIR data and drafts the PA form + justification narrative. For submission, we built a real Playwright-driven headless-browser flow against a simulated insurer portal, instead of faking it with a timer.
Challenges we ran into
(this one's yours to fill in honestly — but from what you've told me you fixed: agent loop bugs where tool results were going unassigned, and a malformed OpenAI function-calling message sequence that was breaking the multi-step flow. That's a great one to mention — bugs judges actually understand.)
Accomplishments that we're proud of
Getting the whole pipeline to work together for real — not mocking the parts that are annoying to build. The Token Vault + CIBA consent flow is real, the FHIR integration is real, and the final submission step is a genuine headless-browser interaction instead of a setTimeout pretending to submit something.
What we learned
(also yours — but candidates: how CIBA step-up consent actually works in practice, how finicky OpenAI's function-calling message sequencing can be when chaining multi-step tool calls, or what it takes to keep an AI agent's output grounded strictly in provided data instead of hallucinating clinical details.)
What's next for PriorPilot
Support for insurer-specific authorization forms, explainable AI that links every claim in the summary back to the specific FHIR resource it came from, confidence scoring on generated recommendations, and broader FHIR resource coverage.
Built With
- fhir
- openai
- typescript
Log in or sign up for Devpost to join the conversation.