Automating Prior Authorization in Healthcare: Architecture and Cost
How to build RPA bots that automate prior authorization submission and status tracking across payer portals — architecture, HIPAA requirements, and what can't be automated.
The Prior Authorization Problem
Prior authorization (PA) requires clinics to get insurance company approval before providing certain procedures, medications, or referrals. For high-volume practices, PA requests consume hours of staff time daily — logging into payer portals, submitting clinical documentation, checking status, and managing denials.
Most PA workflows are deterministic: same codes, same documentation type, same portal navigation. They're exactly what RPA bots are designed for.
What Can Be Automated
- Status checks on submitted PA requests
- Eligibility pre-checks before submitting
- Form submission for standard procedures (orthopedic, imaging, DME, specialty pharmacy)
- Denial notification retrieval and routing to the right staff queue
- Re-submission of denied requests after appending additional documentation
What Cannot Be Automated
- Clinical judgment calls — whether to submit at all, what documentation to include
- Complex appeals requiring physician narrative letters
- Phone-based PA requests (some payers still require calls for specific codes)
The Bot Architecture
Each major payer has its own portal with its own navigation flow. The bot suite is organized as one script per payer with a shared library for common operations (login, session management, file upload).
from playwright.async_api import async_playwright
from typing import TypedDict
class PARequest(TypedDict):
member_id: str
procedure_code: str
diagnosis_codes: list[str]
requesting_provider_npi: str
documentation_path: str
async def submit_aetna_pa(request: PARequest) -> str:
async with async_playwright() as p:
browser = await p.chromium.launch(headless=True)
page = await browser.new_page()
await page.goto("https://navivityportal.aetna.com")
await page.get_by_label("Username").fill(get_credential("aetna_username"))
await page.get_by_label("Password").fill(get_credential("aetna_password"))
await page.get_by_role("button", name="Sign In").click()
await page.get_by_role("link", name="Request Authorization").click()
await page.fill("#member-id", request["member_id"])
# ... procedure code, diagnosis, documentation upload
await page.get_by_role("button", name="Submit Request").click()
await page.wait_for_selector(".confirmation-number")
return await page.inner_text(".confirmation-number")
Role-based selectors (get_by_label, get_by_role) survive portal redesigns. CSS ID selectors don't. See the eligibility verification automation guide for a detailed breakdown of why this distinction matters in production.
HIPAA Requirements
PA bots handle PHI: member IDs, procedure codes, diagnosis codes, and clinical documentation files. The pipeline must satisfy HIPAA technical safeguards:
- Bot credentials stored in AWS Secrets Manager (never in code or environment variables)
- Documentation files encrypted in transit and at rest (KMS-encrypted S3)
- Audit log of every submission, status check, and outcome
The same Lambda + Secrets Manager + encrypted S3 pattern used in the dental RPA billing reference architecture applies here.
Denial Analytics
When every PA result is stored as structured data, you can analyze denial patterns by payer, procedure code, and provider — turning a reactive task into a proactive workflow optimization signal. This layer integrates directly with custom Practice Management software.
The RPA Billing Automation service covers prior authorization, eligibility verification, and claim status — built and maintained as a single bot suite.
Related Service
RPA Billing Automation
Deep-dive into our engineering approach, capabilities, and technical specifications.
Written by Sheharyar Amin
Founder & Lead Engineer, Opexia