Stand up the CMS-mandated Patient Access, Provider Access, and Payer-to-Payer FHIR APIs on top of Epic, exposing claims (ExplanationOfBenefit) and US Core clinical data to registered apps with SMART on FHIR and payer-attributed member access.
Patient, Payer, and Provider Access
Objective: CMS rules (Patient Access API, Provider Access API, Payer-to-Payer exchange under CMS-0057-F) require payers and providers to expose claims and clinical data through standardized FHIR R4 endpoints to third-party apps and to each other. The real problem: Epic holds the clinical record, an external payer system holds claims and formulary, and neither speaks the other's identifiers or consent model. Done looks like a patient's app retrieving a unified US Core set plus ExplanationOfBenefit claims through one gateway; a payer retrieving data only for attributed members; and every request authorized, consented, throttled, and audited to CMS reporting granularity. This accelerator packages the Patient, Payer, and Provider Access Epic Data Sharing Playbook as a MuleSoft-anchored solution plan.
What's Getting Built
- API Gateway (Experience API) — Fronts patient SMART, payer, and provider callers and enforces OAuth scopes, consent, attribution, and per-app rate limits ·
GET /Patient/{id}, GET /ExplanationOfBenefit, GET /Coverage, POST /oauth2/token
- Aggregation (Process API) — Fans out to both System APIs in parallel and assembles a single searchset Bundle keyed on the resolved Patient ·
GET /Patient/{id}, GET /ExplanationOfBenefit, POST /payer-to-payer/transfer
- Epic (System API) — Fronts Epic Interconnect FHIR R4 exposing only US Core reads and owning the backend OAuth JWT token cache ·
GET /Patient/{id}, GET /Condition, GET /MedicationRequest, GET /Observation
- Claims (System API) — Fronts the payer claims store and emits CARIN Blue Button conformant claims and coverage ·
GET /ExplanationOfBenefit, GET /Coverage
- Attribution Roster Refresh (Scheduler) — Async job that pulls and versions the member attribution roster via Bulk $export for provider and payer access checks ·
POST /Group/{id}/$export, SCHEDULER refresh roster, CONSUME attribution-jobs queue
Prerequisites
- Epic on FHIR app registered at fhir.epic.com with production client IDs for patient-facing SMART standalone launch and system-level backend OAuth 2.0 client_credentials with JWT assertion
- Epic Bridges or Interconnect FHIR endpoints licensed and the US Core R4 resource set enabled in the target environment
- External payer claims platform exposing ExplanationOfBenefit, Coverage, and formulary reachable from Anypoint VPC
- Anypoint Platform with API Manager, an OAuth 2.0 / OpenID provider for app authorization, and Anypoint MQ for async attribution jobs
- Governed dynamic client registration process aligned to CMS third-party app attestation requirements
- Member attribution roster feed for Provider Access and Payer-to-Payer, keyed to a resolvable patient identifier
1. Epic interfaces and standards
This accelerator implements the Patient, Payer, and Provider Access Epic Data Sharing Playbook. Register the connecting app on Epic on FHIR and confirm the customer has the relevant Epic modules licensed before building.
- FHIR R4 US Core resources: Patient, Coverage, ExplanationOfBenefit, Condition, MedicationRequest, Observation
- SMART on FHIR standalone patient launch with OAuth 2.0 scopes patient/*.read and offline_access
- Epic backend OAuth 2.0 client_credentials using signed JWT for system-level payer and provider access
- Bulk Data Access $export via Group for payer attribution rosters
- Da Vinci PDex and CARIN Blue Button IG profiles for ExplanationOfBenefit exchange
- Epic Bridges FHIR endpoints exposed through Interconnect
Architecture
2. Business requirements
- Serve three distinct consumers from one gateway: patients via SMART standalone launch, payers via backend client_credentials, and providers via attributed system access, each with its own scope profile.
- Return a merged CMS payload: US Core clinical resources from Epic plus CARIN Blue Button ExplanationOfBenefit claims from the payer platform, correlated on a single Patient resource.
- Enforce attribution for Provider Access and Payer-to-Payer so a caller retrieves data only for members on its current roster, never the full population.
- Support Payer-to-Payer exchange at member request, moving up to five years of historical claims and clinical data on enrollment change.
- Meet CMS reporting: track adopted-app counts, request volumes, and denied-request reasons at a granularity you can attest to.
3. Ingestion and API-led aggregation
- Build an Epic System API that fronts Interconnect FHIR R4 and exposes only US Core read operations; it owns the Epic backend OAuth JWT client and token caching.
- Build a Claims System API that fronts the payer store and emits ExplanationOfBenefit and Coverage conformant to CARIN Blue Button, with a stable resource id scheme.
- Aggregate in a Process API: fan out to both System APIs in parallel, then assemble a single searchset Bundle keyed on the resolved Patient.
- Normalize identifiers in DataWeave so the Epic MRN/FHIR id and the payer member id map to one logical patient before merge.
- Cache Epic access tokens per client and reuse until near expiry; never mint a token per inbound request or you will hit Epic throttles under load.
4. Matching, consent, and attribution
- Resolve inbound patient context to both an Epic FHIR Patient id and a payer member id via a deterministic cross-reference table, not fuzzy demographics at request time.
- For patient access, honor the SMART launch context: the token scopes to one patient, so reject any request whose target id differs from the launch patient.
- For provider and payer access, check the caller-supplied member id against the current attribution roster from Bulk $export Group; deny with an explicit reason if absent.
- Persist consent state so a Payer-to-Payer or Provider Access opt-out immediately blocks further retrieval and is reflected in audit.
- Refresh attribution rosters on a schedule via Anypoint MQ jobs and version them, so a request is always evaluated against a known roster snapshot.
5. Orchestration and Payer-to-Payer flow
- Model Payer-to-Payer as an asynchronous job: accept the member-initiated request, queue it, then pull the historical set and post it to the receiving payer's FHIR endpoint.
- Bound the historical window to the CMS-required five years and page through ExplanationOfBenefit and clinical resources rather than requesting unbounded Bundles.
- Stamp every hop with a correlation ID spanning Experience, Process, and both System APIs so a single member request is traceable end to end.
- Use Bulk Data $export for roster-scale reads and single-resource FHIR reads for interactive patient-app calls; do not force one pattern to serve both.
- Return partial results with an OperationOutcome warning when Epic responds but the claims store times out, rather than failing the whole Bundle.
6. Error handling and operations
- Route unrecoverable requests to a dead-letter queue with the correlation ID, caller client id, and denial reason preserved for CMS reporting.
- Alert on the absence of a scheduled attribution-roster refresh, which is the failure mode dashboards miss most often and silently changes who gets denied.
- Distinguish Epic 429 throttling from payer-store outages in metrics; they need different remediation and different on-call runbooks.
- Rate-limit per registered app in API Manager so one misbehaving patient app cannot exhaust the shared Epic token budget.
- Log every denied request with a machine-readable reason code so adopted-app and denial metrics can be produced without re-deriving them from raw logs.
7. Security and compliance
- Encrypt PHI in transit and at rest.
- Audit-log every access to and modification of patient data, and carry a correlation ID end to end.
- Enforce minimum-necessary access for integration operators and support users.
- Register patient apps through a governed dynamic client registration process and enforce the CMS third-party app attestation and privacy-notice checkpoints before granting production scopes.
- Scope backend payer and provider clients to system/*.read only and bind them to their attribution roster; never issue a wildcard population scope.
- Validate the signed JWT client assertion for issuer, audience, expiry, and key on every backend token exchange and rotate signing keys on a fixed schedule.
- Honor patient and member opt-out for Payer-to-Payer and Provider Access as a hard block enforced at the Process API, not merely a UI preference.
Sample payload — Merged CMS Patient Access searchset Bundle
{
"resourceType": "Bundle",
"type": "searchset",
"total": 2,
"entry": [
{
"fullUrl": "https://api.example.org/fhir/Patient/eXYZ123",
"resource": {
"resourceType": "Patient",
"id": "eXYZ123",
"meta": { "profile": ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"] },
"identifier": [
{ "system": "urn:oid:1.2.840.114350.1.13.mrn", "value": "MRN-88213" },
{ "system": "https://payer.example.org/member", "value": "MBR-4471902" }
],
"name": [{ "family": "Alvarez", "given": ["Maria"] }]
}
},
{
"fullUrl": "https://api.example.org/fhir/ExplanationOfBenefit/eob-55901",
"resource": {
"resourceType": "ExplanationOfBenefit",
"id": "eob-55901",
"meta": { "profile": ["http://hl7.org/fhir/us/carin/bb/StructureDefinition/C4BB-ExplanationOfBenefit-Professional-NonClinician"] },
"status": "active",
"use": "claim",
"patient": { "reference": "Patient/eXYZ123" },
"insurer": { "display": "Example Health Plan" },
"outcome": "complete"
}
}
]
}
Testing and validation
- Run Epic-provided US Core resource conformance and CARIN Blue Button / Da Vinci PDex validators against every response Bundle before release.
- Test the SMART standalone launch end to end: authorization, patient-scoped token, refresh with offline_access, and rejection of a mismatched patient id.
- Exercise the backend client_credentials JWT flow with a valid, expired, and wrong-audience assertion and confirm only the valid one mints a token.
- Verify attribution enforcement: a payer request for an on-roster member succeeds and an off-roster member is denied with the expected reason code.
- Simulate a claims-store timeout with Epic healthy and confirm a partial Bundle with an OperationOutcome warning, not a hard failure.
- Load-test to confirm per-app rate limits protect the shared Epic token budget and that token caching holds under concurrency.
Phased rollout
Phase 1 — Connect
- Register the patient-facing SMART app and the backend system client on fhir.epic.com and confirm Interconnect US Core reads in a non-production environment.
- Stand up connectivity from Anypoint VPC to the payer claims store and validate a raw ExplanationOfBenefit read.
Phase 2 — Map and test
- Build the Epic and Claims System APIs plus the aggregating Process API and pass US Core and CARIN Blue Button conformance validators.
- Load and version an attribution roster via Bulk $export and prove on-roster/off-roster enforcement for provider and payer callers.
Phase 3 — Production
- Enable governed dynamic client registration and CMS app attestation, then admit a first cohort of registered patient apps under per-app rate limits.
- Turn on the asynchronous Payer-to-Payer job and monitor correlation-tracked end-to-end transfers before opening it to all members.
Success metrics
- Number of registered/adopted third-party apps and their active patient count, per CMS reporting.
- Denied requests by machine-readable reason code (off-roster, opt-out, scope, auth failure).
- End-to-end p95 latency for the merged Epic-plus-claims Bundle.
- Attribution-roster freshness: age of the currently enforced roster snapshot.
- Payer-to-Payer transfer completion rate and time-to-complete per member request.
Troubleshooting
- Patient-app requests intermittently return Epic 429 errors under peak load. — Likely cause: The gateway is minting a new Epic access token per inbound request instead of caching and reusing it. Fix: Cache the backend token per client until near expiry and add per-app rate limits in API Manager so one app cannot exhaust the shared budget.
- A payer receives an empty Bundle for a member it believes is attributed to it. — Likely cause: The enforced attribution roster is a stale snapshot that predates the member's enrollment. Fix: Alert on missed roster-refresh jobs, version each snapshot, and reprocess against the current roster once refresh succeeds.
- ExplanationOfBenefit resources fail CARIN Blue Button validation at the app. — Likely cause: The Claims System API emits payer-native fields without mapping to the C4BB profile and required value sets. Fix: Add a DataWeave mapping layer that conforms EOB to the correct C4BB profile and run the validator in CI before release.
- The whole patient Bundle fails when only the claims store is slow. — Likely cause: The Process API treats both System API calls as all-or-nothing with no partial-result path. Fix: Return Epic results with an OperationOutcome warning for the missing claims and retry the claims fetch asynchronously.
Deliverable: A three-tier API-led MuleSoft build: an Epic System API over Interconnect US Core R4, a Claims System API emitting CARIN Blue Button ExplanationOfBenefit, and an aggregating Process API behind an Experience gateway that authorizes patient (SMART), payer, and provider callers, enforces consent and attribution, and supports async Payer-to-Payer exchange with correlation-ID audit for CMS reporting.