Katkat

Add Status, Pharmacist Worklists, and Digests to Prior Authorization

LatentSoftware Engineer · Technical Screen

Last updated

Design an event-driven prior authorization platform supporting real-time status tracking, prioritized pharmacist worklists, and scheduled email digests powered by asynchronous payer integrations.

Scenario

Healthcare providers submit Prior Authorization (PA) requests to insurance payers to approve specific medications or procedures before treatment. Payer responses are notoriously asynchronous, arriving via webhooks, polling APIs, or manual clearinghouse updates over hours or weeks.

Your task is to design the core backend services for a health-tech platform that manages prior authorizations for pharmacy teams. The system must support real-time status visibility, an actionable worklist for clinical pharmacists, and reliable daily digest emails.

Requirements

Functional Requirements

  • Status Tracking & Ingestion: Ingest asynchronous payer status updates (e.g., Approved, Denied, Additional Information Required, Expired). Expose APIs for clinics to query the current status and full history of any PA.
  • Pharmacist Worklist: Provide a dynamic, filterable queue of PAs requiring pharmacist review (e.g., denials needing appeals, urgent requests close to SLA expiration). Pharmacists should be able to claim, update, and resolve work items concurrently without collision.
  • Daily Digests: Generate and deliver personalized daily summary emails to clinic staff and pharmacists detailing overnight status changes, pending actions, and upcoming deadlines.

Non-Functional Requirements & Scale

  • Scale: 100,000 active PAs at any time; 500,000 status events ingested per day; 25,000 daily digest recipients across different time zones.
  • Consistency & Durability: Medical state transitions must be strictly ordered, durable, and auditable. Duplicate payer webhooks must be handled idempotently.
  • Delivery Guarantees: Digest emails must follow at-least-once delivery semantics without spamming users upon retry failures.
  • Latency: Worklist queries and status lookups should return within 200 ms at p95.

What to Cover

  • High-Level Architecture: Core services, event flow from payer ingestion to pharmacist UI and email delivery.
  • Data Model: Storage strategy for PA states, state change audit logs, worklist claims/locks, and digest tracking.
  • Worklist Engine: How the worklist is indexed, filtered, and safely locked for concurrent pharmacist reviews.
  • Digest Pipeline: Scheduling, batching, and failure handling for sending time-zone-aware notification digests.

Hints

Hint 1

Model state transitions as an append-only event stream or audit log to guarantee an immutable timeline for clinical compliance and idempotent processing.

Hint 2

For the pharmacist worklist, consider optimistic concurrency or short-lived distributed lease locks to prevent two pharmacists from acting on the same case simultaneously.

Hint 3

Decouple digest generation into an aggregation phase (querying changes over a 24-hour window per user) and an idempotent dispatch worker pool partitioned by user time zone.

Follow-up questions

  • How would you handle out-of-order webhook events from a payer where an 'Approved' notification arrives before a 'Pending Additional Info' notification?
  • If thousands of digest emails need to go out at 8:00 AM local time across multiple time zones, how do you prevent thundering herd problems on your database?
  • How would you ensure HIPAA compliance when transmitting sensitive patient health information (PHI) via email digests?