All posts

Prior Authorization Automation for Legacy Claims Systems

Banner showing a legacy Claim record with a pre_authorization boolean field next to a Da Vinci PAS POST /fhir/Claim/$submit call returning approved, denied or pended, with the Forge by Opsera logo and the line "Same claims data, a new front door"

TL;DR

  • Prior authorization automation replaces fax, phone and portal requests with a FHIR exchange, so a payer can return most decisions without manual rework.
  • Impacted US payers must run a Prior Authorization API by January 1, 2027 under CMS-0057-F, yet only 40% of medical prior authorizations were fully electronic in the 2025 CAQH Index.
  • Most claims systems treat prior authorization as a flag on a claim. The fix is a separate request record and a Da Vinci PAS endpoint in front of the claims core, with the existing claim flow left alone.
  • We ran the open-source openIMIS claims module through Forge by Opsera. It scored 56 out of 100, its prior authorization support turned out to be a single boolean field, and Forge caught a date-validation conflict before any code was written.

A nurse team at a regional health plan keys in prior authorization requests that still arrive by fax and portal. The claims platform has paid claims reliably for years, yet it only learns about an approval when someone ticks a box on the claim.

Now the plan has a federal deadline for a Prior Authorization API, and providers want answers in minutes instead of days. The question for the engineering lead is simple: can we add electronic prior authorization without rebuilding the claims system that pays everyone? This guide works through it on a real claims codebase.

What Is Prior Authorization Automation?

Prior authorization is a payer’s approval, given before care happens, that a service or item will be covered. Prior authorization automation moves that request and its answer out of fax, phone and portal work into a system-to-system exchange, so most decisions come back without anyone retyping clinical details.

In the US, the standard path for that exchange is HL7 FHIR R4 and three Da Vinci implementation guides that work together:

  • Coverage Requirements Discovery (CRD): Tells the provider, inside the EHR, whether an order needs prior authorization at all.
  • Documentation Templates and Rules (DTR): Collects the documentation the payer needs, pre-filled from the chart where possible.
  • Prior Authorization Support (PAS): Sends the request and returns the decision. A PAS request is a FHIR Bundle POSTed to the payer’s Claim/$submit endpoint, with a Claim as its first entry, and the answer comes back as a ClaimResponse.

This guide focuses on PAS, because that is the part a claims system has to answer. A PAS decision can approve, deny or pend a request, and a pended request gets its final answer later through a status check or a subscription.

Why Is Prior Authorization Automation Urgent in 2026?

Three pressures are landing on payers at the same time:

  • A federal deadline. Under CMS-0057-F, impacted payers must run a Prior Authorization API by January 1, 2027. It must list covered items, show documentation rules, and return an approval, a denial with a specific reason, or a request for more information. Medicare Advantage, Medicaid and CHIP programs and plans, and QHP issuers on the federal exchanges are in scope, with decisions due within 72 hours for urgent requests and seven calendar days for standard ones.
  • A slow starting point. Electronic adoption of medical prior authorization rose from 31% to 40% between the 2023 and 2025 CAQH Index reports, and most medical plans were still building their ePA FHIR APIs.
  • A visible cost to care. In the AMA’s survey of 1,000 physicians, 95% said prior authorization delays access to necessary care, and it takes an average of 13 hours of physician and staff time each week.

Payers have also made a public promise. In June 2025, health plans covering 257 million Americans pledged that at least 80% of electronic prior authorization approvals would be answered in real time in 2027. A real-time answer needs a claims back end that can take a structured request and decide on it in seconds.

Why Do Legacy Claims Systems Struggle With Prior Authorization?

Most claims platforms were built to pay for care after it happened. Prior authorization asks them to decide before care, against rules and documentation, and to say why. The gaps usually look like this:

  • Prior auth is a flag, not a workflow: The claim record can say a service was pre-authorized, but there is no request, decision or expiry of its own.
  • Statuses built for payment: Claim states track entry, checking, processing and valuation, with no state for pended, approved with limits, or denied with a coded reason.
  • Old integration paths: Submission still runs through XML payloads, stored procedures or batch files that partners have to match exactly.
  • No clock: Nothing measures how long a decision took, so a 72-hour or seven-day deadline cannot be tracked, let alone reported.
  • Rules live in people: Medical policy sits with reviewers, not in a form a system can check, so every request starts as manual work.

What We Found in the openIMIS Claims Module

openIMIS is a free, open-source system that governments use to run health financing and social protection programs, and it reaches over 43 million beneficiaries across 14 countries. It is not a US payer system, so CMS-0057-F does not apply to it. We picked its claims module because its back end looks like many payer platforms, and its code is public, so every claim below can be checked.

We read the code before running anything:

  • Legacy tables under a modern framework: The Django models in claim/models.py map onto older tables such as tblClaim, tblClaimItems and tblClaimServices.
  • Prior auth is one boolean: The Claim model carries pre_authorization = models.BooleanField(default=False, blank=True, null=True), and nothing else in the module models a prior authorization request or decision.
  • Payment-shaped statuses: Claim status values run STATUS_REJECTED = 1, STATUS_ENTERED = 2, STATUS_CHECKED = 4, STATUS_PROCESSED = 8 and STATUS_VALUATED = 16.
  • A deprecated XML path: The README marks ClaimSubmitService.submit as deprecated, mapped to the uspUpdateClaimFromPhone stored procedure, and ClaimSubmit.to_xml() still builds an XML Claim document.
  • FHIR claims exist, prior auth does not: openIMIS ships a separate FHIR R4 module with a Claim endpoint, but its converter hard-codes use to "claim". A FHIR request with use set to preauthorization has nowhere to go.

That last point is the useful one. openIMIS already speaks FHIR for claims, so the plumbing exists. What it lacks is the decision workflow a prior authorization request needs behind that plumbing.

Assessing the openIMIS Claims Module With Forge

Forge by Opsera reads a repository and writes the plan and specs a coding agent then builds from. It does not write the code itself. Its assessment produces a ForgeScore, a 0 to 100 score across eight dimensions such as how clear the code’s boundaries are and how hard it is to change, plus a NIST CSF 2.0 rating of how well the code covers govern, identify, protect, detect, respond and recover.

We pointed Forge at the openIMIS claims repository and described the goal in plain words: a Da Vinci PAS API that accepts a request, maps it to the existing claim and pre_authorization fields, returns an approve, deny or pended decision, and supports status checks, with claim submission and review left unchanged.

What the Score Shows

Forge analyzed all 87 files and gave the module a ForgeScore of 56, labeled Developing, with a NIST CSF rating of C. Its security scorecard shows no exposed secrets, one end-of-life package and one circular dependency.

ForgeScore dashboard for openimis-be-claim_py showing a composite score of 56 across 87 files, NIST CSF rating C, 0 secrets, 2 CVEs, 1 end-of-life package and 1 circular dependency

The ForgeScore dashboard Overview tab for openimis/openimis-be-claim_py

The strongest dimensions were Code Excellence at 68, Logic Narrative at 63 and Semantic Clarity at 61. The weakest were System Gravity at 44, Cognitive Load at 46 and Data Weight at 49, which points to code that reads well but is hard to change in one place.

Forge also credited what to keep. It singled out claim/tests/test_permission_declarations.py, a test that checks declared permissions against real enforcement, as the best example of craft in the repository.

The verdict was Mixed, with updates recommended. Forge noted that setup.py still lists Django 3.0 and Python 3.6 and 3.7, and called the module a workable but tightly coupled monolith that can support PAS if a dedicated integration layer is added first.

Forge Assessment screen with a ForgeScore of 56 (Developing), eight dimension scores, a security snapshot and a Mixed, Updates Recommended verdict

The assessment verdict, with the stack Forge flagged as out of sync

What the Score Means for a PAS API

Forge’s roadmap puts the friction in three files: claim/services.py, claim/validations.py and claim/gql_mutations.py. Validation, permission checks and orchestration are spread across all three, so one rule change can ripple through several layers.

That is exactly where a PAS endpoint would plug in. Forge’s first quick win is one boundary where inputs are validated, authorized and normalized before they reach claim logic, which is the same seam a PAS adapter needs. Its roadmap projects the score rising from 56 to about 69 after three refactors, a target until a re-score confirms it.

From Score to a Scoped Intent

ForgeScore roadmap overview with a bottom line of 56 out of 100 rising to about 69 after three refactors, a Policy Drift Tripwire and a list of quick wins

Forge turned the goal into an intent, a short document that fixes the scope before anyone plans work, at 89% confidence. Its core features carry the prior authorization work:

  • A dedicated PAS boundary: A new FHIR R4 package inside claim/ that handles Claim/$submit with PAS request and response Bundles, instead of treating a single Claim as the whole exchange.
  • A verified field crosswalk: PAS data mapped to existing claim, item, service and pre_authorization fields, reusing eligibility, pricing and review rules.
  • Decisions as ClaimResponse: Approve, deny and pended answers built from existing claim and review state, kept separate from FHIR processing outcomes.
  • Status checks: Claim/$inquire backed by durable request correlation.
  • Audit persistence: A dedicated record of each exchange, added through Django migrations, so existing claim records keep their meaning.
Forge Intent Document for the openIMIS Claims Prior Authorization API showing the vision statement and target personas

The approved Intent document for the PAS API

Out of scope does as much work as in scope. It rules out changes to existing claim, pricing or review behavior, replacing the GraphQL API, new portals, and CRD or DTR work. It also rules out new automatic approval rules, so the first release returns decisions the existing review workflow already makes.

Forge Intent Document sections listing what is out of scope for the prior authorization work and the technical constraints, including the FHIR R4 and Da Vinci PAS requirements

Out of scope and technical constraints in the same intent

The Conflict Forge Found Before Any Code

Before writing the PRD, Forge asked five pre-flight questions. We answered them as a US payer would: the latest published PAS release, the reviewer’s decision as the authoritative answer, core capabilities only, HIPAA, and an initial target of a 5-second acknowledgement and 2-second status check at the 95th percentile.

Forge PRD-Spec pre-flight clarification questions about the Da Vinci PAS release and which business event authorizes a final decision, with the selected answers highlighted

Forge’s pre-flight questions, with our answers selected

While drafting, Forge raised one more issue on its own. Existing claim validation flags care dates later than the claim date, yet prior authorization is by definition about care that has not happened.

The code confirms it. get_claim_field_errors in claim/services.py returns an error when date_from is after date_claimed, with a comment that a claim is not made in advance. Mapping a PAS request straight onto a claim would save every future-dated request with an error status. Finding that in a spec costs minutes; finding it in production would cost a release.

Timeline graphic contrasting a claim, which looks back at care already delivered, with a prior authorization, which looks ahead, and showing the date_from after date_claimed conflict

Why a prior authorization request breaks the existing claim date rule

From Intent to a PRD Your Coding Agent Can Use

The PRD-Spec came back at 89% confidence. It holds 17 user stories, all P0, because the exchange cannot ship without the persistence, compatibility and document-security work underneath it. Each story has acceptance criteria a reviewer can test.

Forge PRD-Spec executive summary with an 89 percent confidence score and the PRD-Spec Complete prompt

The PRD-Spec executive summary at 89% confidence

A few stories show how much a careful spec protects:

  • Processing is not approval: ClaimResponse.outcome values such as complete must never be read as a decision. The decision travels in the PAS adjudication elements instead.
  • The reviewer has the final word: A completed approval or denial is returned as final even if payment processing is unfinished, and an unclear review state raises an exception instead of a guessed answer.
  • Status checks change nothing: Claim/$inquire returns the current decision without touching any claim or review field.
  • Partners stay isolated: Existing row-security rules apply, so one provider cannot discover another provider’s request.
  • Old behavior stays put: Claim submission, pricing, review and permissions must show zero unintended differences in regression tests.

The success measures follow the answers we gave. Submission acknowledgement must stay at or under 5 seconds and status checks at or under 2 seconds at the 95th percentile with 10 concurrent requests, with zero unresolved PAS conformance failures before a partner pilot.

Forge PRD-Spec Success Metrics and KPIs table with targets for latency, conformance and incorrect decisions

Primary success metrics in the PRD-Spec

The PRD is also honest about what is still undecided. It asks the team to pin the exact PAS release before claiming conformance, and it declines to estimate ROI until real volumes and costs are supplied. The next stage cuts the PRD into work orders, small testable tasks a coding agent can pick up one at a time while your team reviews each change.

How Do You Add a Prior Authorization API Without Breaking Claims Processing?

The safest pattern puts a PAS endpoint in front of the claims core and leaves the existing claim flow alone. The diagram below shows where each Da Vinci guide sits and what a decision has to carry:

Diagram of one prior authorization end to end through CRD, DTR and PAS into the claims core, ending in approved, denied or pended decisions with the 72-hour and 7-day clocks

Where CRD, DTR and PAS sit, and what a prior authorization decision returns

In practice, the work runs in five steps:

  1. Model the request as its own record. Add a prior authorization request with its own status, decision, reason, reference number and validity period, linked to the claim it later supports.
  2. Add the PAS endpoint beside the claims API. Accept a Claim Bundle with use set to preauthorization at Claim/$submit, and keep the existing claim endpoint unchanged.
  3. Return every decision as a ClaimResponse. Approvals carry a preAuthRef and preAuthPeriod, denials carry a coded reason, and pended requests come back as queued with a way to check status later.
  4. Start the clock at receipt. Record when each request arrived and was decided, so the 72-hour and seven-day windows can be tracked and reported.
  5. Automate the clearest decisions next. Once the endpoint returns reviewer decisions reliably, encode the clearest rules, keep everything else in the reviewer queue, and measure how many requests clear without a person.

What Does the First PAS Response Look Like?

Forge stops at the spec, so the sketch below shows what a coding agent might write once the request model exists. It turns a stored decision into a FHIR R4 ClaimResponse, which needs status, type, use, patient, created, insurer and outcome:

def to_claim_response(req):response = {"resourceType": "ClaimResponse","status": "active","type": req.claim_type, # copied from the incoming Claim"use": "preauthorization","patient": {"reference": f"Patient/{req.insuree_uuid}"},"created": req.decided_at.isoformat(),"insurer": {"reference": f"Organization/{req.payer_id}"},"request": {"reference": f"Claim/{req.uuid}"},"outcome": "queued" if req.decision == "pended" else "complete",}if req.decision == "approved":response["preAuthRef"] = req.auth_numberresponse["preAuthPeriod"] = {"start": str(req.valid_from), "end": str(req.valid_to)}if req.decision == "denied":response["disposition"] = req.denial_reasonreturn response

A production version also needs the PAS profile’s item-level review results and must keep each item’s sequence from the request. The point of the sketch is the shape: every answer says what was decided, until when, and why.

How Do You Prove the Prior Authorization Work Landed?

Track a small set of measures for each release:

MeasureHow to check itWhat good looks like
PAS conformanceRun the Inferno Da Vinci PAS test kitRequired tests pass
Decision timeMedian and 95th percentile from receipt to decisionInside 72 hours urgent and seven days standard
Auto-decision rateShare of requests decided without manual reviewRises each release
Denial reasonsSample denied responsesEvery denial carries a specific reason
Claims regressionRun the existing claim submission and review testsNo change in results

What Mistakes Derail Prior Authorization Automation?

  • Reusing the claim record: A boolean on a claim cannot hold a pended request, a validity period or a denial reason. Give prior authorization its own record.
  • Bolting PAS onto the claim endpoint: Mixing use values in one code path puts payment logic at risk. Keep a separate endpoint and test the claim flow on every release.
  • Automating the hard cases first: Start with high-volume, rule-clear services and leave clinical judgment to reviewers.
  • Forgetting the provider side: PAS alone still leaves providers guessing what to send. Plan for CRD and DTR, even if they ship later.
  • Skipping the metrics: If decision times are not recorded from day one, the yearly public report becomes a manual project.

Conclusion: Give Prior Authorization Its Own Front Door

A claims system built to pay for care can learn to approve it first, without being replaced. The work is to give prior authorization its own record, its own endpoint and its own clock, while the existing claim flow keeps running.

Start by reading the code, score it, write the scope down, ship the PAS endpoint with a small set of automated rules, and re-score after each release. See how Forge approaches legacy modernization, or read our healthcare IT modernization guide for the wider picture. Try it on your own repository with Forge by Opsera, or book a demo to see how Forge scopes prior authorization work on your claims system.

Questions.

What is prior authorization automation?

Prior authorization automation replaces fax, phone and portal requests with a system-to-system exchange, so a payer can receive a structured request and return a decision, often in real time.

What is the Da Vinci PAS implementation guide?

Da Vinci Prior Authorization Support is an HL7 FHIR R4 guide for sending prior authorization requests and returning decisions. A request goes to Claim/$submit as a Bundle, and the decision comes back as a ClaimResponse.

When is the CMS Prior Authorization API due?

Under CMS-0057-F, impacted payers must have the Prior Authorization API in place by January 1, 2027.

Do I have to replace my claims system to automate prior authorization?

No. A PAS endpoint and a prior authorization record can sit in front of the existing claims core, which keeps doing payment work.

Does Forge write the prior authorization code?

No. Forge assesses the codebase, writes the intent and the PRD, and cuts the work into work orders. Your coding agent builds from those, and your team reviews each change.

Two people at work on code, seen from behind their monitors.

See it running on your own pipelines.

Forty-five minutes with our engineers. Bring a pipeline you are unhappy with.

Book a demoNo install required