CMS-0057-F for FHIR Teams: The Payer-to-Payer Five-Year Window and What Bulk Data Can Filter

On this page

CMS released the Interoperability and Prior Authorization final rule, CMS-0057-F, on Wednesday 17 January 2024. For FHIR teams at Medicare Advantage organisations, Medicaid and CHIP programmes and plans, and issuers on the federal exchanges, it means four APIs to have running by 1 January 2027 and prior authorization decision deadlines from 1 January 2026. Most of the commentary this week is about prior authorization, and rightly so. This article looks at one line in the payer-to-payer section that turns into a surprising amount of engineering.

The rule limits payer-to-payer exchange to data with a date of service within five years of the request. Payer-to-payer uses FHIR Bulk Data Access 1.0, and Bulk Data’s only built-in time filter, _since, filters on when the server last changed a resource, not on when the care happened. So the window has to be applied somewhere else, with an explicit decision about which element is the date of service for each resource type. The sections below summarise what the rule requires of each API, then run a payer-to-payer export against HAPI FHIR five ways to show what each filter actually does.

The four APIs

APIWhat it carriesConsentStandards
Patient AccessExisting claims and clinical data, plus prior authorization information (not drugs)Patient-directed appFHIR R4, US Core 3.1.1, SMART App Launch, OpenID Connect
Provider AccessClaims and encounters (no remittances or cost-sharing), USCDI data, prior authorization informationOpt-outFHIR R4, US Core 3.1.1, Bulk Data 1.0
Payer-to-PayerThe same data classes, dates of service within five years of the requestOpt-inFHIR R4, US Core 3.1.1, Bulk Data 1.0
Prior AuthorizationWhich items need prior authorization, what documentation is required, the request and the decisionNot applicableFHIR R4; CRD, DTR and PAS recommended

All four are due on 1 January 2027, a year later than the proposed rule. Payers must start reporting Patient Access API usage to CMS from 1 January 2026, and the operational prior authorization rules start the same day: 72 hours for urgent requests and seven calendar days for standard ones (QHP issuers on the federal exchanges are excluded from those timeframes), with a specific reason for every denial. The first public prior authorization metrics are due by 31 March 2026.

CMS names a short list of required standards (USCDI, FHIR 4.0.1, US Core 3.1.1, SMART App Launch 1.0, Bulk Data 1.0 and OpenID Connect) and a longer list of recommended implementation guides: CARIN Blue Button, Da Vinci PDex, Plan-Net, the drug formulary guide, CRD, DTR and PAS, and SMART App Launch 2.0 for backend services. For prior authorization, HHS will use enforcement discretion on the HIPAA X12 278 standard, so a FHIR-only implementation is acceptable.

The four CMS-0057-F APIs with consent model and standards, and the key dates from 17 January 2024 to 1 January 2027
Four APIs, one compliance date, and the earlier operational deadlines.

Payer-to-payer timing

The rule text sets the clock. Once a member has opted in and the new payer has enough information to identify the previous payer, the new payer must request the data within one week, and the previous payer must answer within one business day of the request. One business day rules out a manual review of every export, so whatever decides what is in scope has to be automatic, and its decisions have to be recorded.

%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#FFF3E0', 'primaryTextColor': '#232F3E', 'primaryBorderColor': '#FF9900', 'lineColor': '#232F3E', 'clusterBkg': '#F8FAFC', 'clusterBorder': '#CBD5E1', 'edgeLabelBackground': '#FFFFFF', 'nodeTextColor': '#232F3E'}}}%%
flowchart TD
    O["Opt-in record<br/>member, previous payer, date"] --> G["Group per request<br/>opted-in members only"]
    G --> E["Bulk Data Group export<br/>_type list, no _since"]
    E --> F["Optional _typeFilter<br/>only with indexed date parameters"]
    F --> W["Date-of-service window<br/>per resource type, inclusive"]
    W --> S["Send to the new payer"]
    W --> R["Held for review<br/>no date, or after the request"]
    W --> A["Disclosure log<br/>what was sent and why"]
    classDef compute fill:#FFF3E0,stroke:#FF9900,stroke-width:2px,color:#232F3E
    classDef data fill:#EBF8FF,stroke:#0073BB,stroke-width:2px,color:#004C74
    classDef store fill:#F0FFF4,stroke:#1D8102,stroke-width:2px,color:#145202
    classDef alert fill:#FEF2F2,stroke:#D13212,stroke-width:2px,color:#991B1B
    classDef policy fill:#F3E8FF,stroke:#7C3AED,stroke-width:2px,color:#4C1D95
    class O,G policy
    class E,F data
    class W compute
    class S,A store
    class R alert

The opt-in record drives a Group that contains only members who opted in for this request. Bulk Data’s Group export returns only those members’ data, so consent is enforced by construction rather than by filtering afterwards. The window is then applied per resource, and anything it cannot decide is held for a person to look at rather than sent.

Test setup

The sample loads a synthetic payer’s data into HAPI FHIR 6.10, the version in the hapiproject/hapi:v6.10.1 image of November 2023, with bulk export turned on. There are four members: three opted in and are in Group/p2p-optin; one did not. Their claims (ExplanationOfBenefit), encounters, conditions and observations have dates of service from 2016 to 2023. One condition has no date at all, and one claim is dated after the request, as data-quality cases. The request date is 19 January 2024, so the window starts on 19 January 2019, and claims on 18 and 19 January 2019 sit either side of the boundary.

The export client follows the Bulk Data 1.0 flow: kick-off with Prefer: respond-async, poll the status URL, download the NDJSON files. It uses only the Python standard library:

Python36 lines
    def kick_off(self, group_id: str, types: list[str], since: str | None = None,
                 type_filters: list[str] | None = None) -> str:
        params = [("_outputFormat", "application/fhir+ndjson"), ("_type", ",".join(types))]
        if since:
            params.append(("_since", since))
        for f in type_filters or []:
            params.append(("_typeFilter", f))
        url = f"{self.base_url}/Group/{group_id}/$export?{urllib.parse.urlencode(params)}"
        status, headers, body = self._request(url, "application/fhir+json", {"Prefer": "respond-async"})
        if status != 202:
            raise ExportError(f"kick-off returned {status}: {body[:300]!r}")
        location = headers.get("Content-Location") or headers.get("content-location")
        if not location:
            raise ExportError("kick-off returned 202 without Content-Location")
        return location

    def wait(self, status_url: str) -> tuple[dict, int]:
        started, polls, delay = time.monotonic(), 0, 1.0
        while True:
            status, headers, body = self._request(status_url, "application/json")
            polls += 1
            if status == 200:
                return json.loads(body), polls
            if status == 202:
                retry_after = headers.get("Retry-After") or headers.get("retry-after")
                if retry_after and retry_after.isdigit():
                    delay = float(retry_after)
                else:
                    delay = min(self.max_poll_interval, delay * 2)
            elif status in (429, 503):
                delay = min(self.max_poll_interval, delay * 2)
            else:
                raise ExportError(f"status request returned {status}: {body[:300]!r}")
            if time.monotonic() - started + delay > self.max_wait_seconds:
                raise ExportError(f"export not complete after {self.max_wait_seconds:.0f} s")
            self.sleep(delay + random.uniform(0, delay * 0.1))
%%{init: {'theme': 'base', 'themeVariables': {'signalColor': '#0073BB', 'signalTextColor': '#0F172A', 'actorBkg': '#FFF3E0', 'actorBorder': '#FF9900', 'actorTextColor': '#232F3E', 'noteBkgColor': '#FFF8E7', 'noteBorderColor': '#FF9900', 'noteTextColor': '#232F3E'}}}%%
sequenceDiagram
    participant N as New payer
    participant P as Previous payer (Bulk Data)
    participant W as Window filter
    Note over N: Member opts in and names the previous payer
    N->>P: GET Group/{id}/$export (Prefer: respond-async)
    P-->>N: 202 Accepted, Content-Location
    N->>P: poll status URL (Retry-After)
    P-->>N: 200 manifest with NDJSON file URLs
    N->>P: download NDJSON
    N->>W: resources and the request date
    W-->>N: in-scope resources, plus a list held for review

Test results

Text18 lines
server HAPI FHIR Server 6.10.0, FHIR 4.0.1
request date 2024-01-19, window starts 2019-01-19
loaded {'201': 31}
plain             {'Condition': 3, 'Coverage': 3, 'Encounter': 3, 'ExplanationOfBenefit': 10, 'Observation': 3, 'Patient': 3} patients=['m1', 'm2', 'm4']
since_five_years  {'Condition': 3, 'Coverage': 3, 'Encounter': 3, 'ExplanationOfBenefit': 10, 'Observation': 3, 'Patient': 3} patients=['m1', 'm2', 'm4']
type_filter_registered {'Condition': 1, 'Coverage': 3, 'Encounter': 2, 'ExplanationOfBenefit': 7, 'Observation': 2, 'Patient': 3} patients=['m1', 'm2', 'm4']
service-date search after reindex found 8 claims
after the window   kept {'Condition': 1, 'Observation': 2, 'Encounter': 2, 'Patient': 3, 'Coverage': 3, 'ExplanationOfBenefit': 6}
  not sent: Condition/cond-m1-1 2017-05-05: older than five years
  not sent: Condition/cond-m4-1 -: no date of service; held for review
  not sent: Encounter/enc-m1-1 2017-05-05: older than five years
  not sent: ExplanationOfBenefit/eob-m1-1 2016-03-02: older than five years
  not sent: ExplanationOfBenefit/eob-m1-2 2018-11-21: older than five years
  not sent: ExplanationOfBenefit/eob-m1-3 2019-01-18: older than five years
  not sent: ExplanationOfBenefit/eob-m4-2 2024-02-01: date of service after the request
  not sent: Observation/obs-m1-1 2018-02-01: older than five years
type filter + window kept {'Condition': 1, 'Observation': 2, 'Patient': 3, 'Encounter': 2, 'Coverage': 3, 'ExplanationOfBenefit': 6}
  not sent: ExplanationOfBenefit/eob-m4-2: date of service after the request
Results of five export runs: no filter and _since both return all 10 claims; _typeFilter on an unregistered parameter fails; with a registered parameter 7 claims; export then window keeps 6
The same request run five ways against HAPI FHIR 6.10.

Member 3, who did not opt in, appeared in none of the exports. The Group did its job.

_since and lastUpdated

The export with _since=2019-01-19T00:00:00Z returned exactly what the unfiltered export returned: all 10 claims, including one from 2016. That is not a HAPI defect. Bulk Data defines _since in terms of when a resource changed on the server, which HAPI reads from meta.lastUpdated, and every resource in this test was written the day it was loaded. A real payer’s data looks the same after any platform migration, claims reprocessing or bulk load: the last-updated time records the payer’s own systems, not the member’s care.

_since still has a use in payer-to-payer exchange, just not this one: it is the right filter for a follow-up request that only wants what has changed since the last exchange. It cannot implement the five-year window.

_typeFilter and search parameters

Bulk Data 1.0 also has _typeFilter, which applies a FHIR search to each resource type. It is optional for servers, and it can only use search parameters the server has indexed. Core FHIR R4 has no search parameter for an ExplanationOfBenefit’s billing period. The service-date parameter that payer teams expect comes from the CARIN Blue Button guide. Against a server that does not know it, HAPI accepted the kick-off with 202, started the job, and only reported the problem when polled: the status URL answered 500 after the job failed, and the server log says why: A client that treats 202 as success and polls lazily finds out late.

Text1 line
HAPI-0488: Failed to parse match URL[ExplanationOfBenefit?service-date=ge2019-01-19] - Resource type ExplanationOfBenefit does not have a parameter with name: service-date

Registering a date parameter for claims fixes the error. The sample defines one modelled on CARIN Blue Button’s, registers it, reindexes the claims and waits until a search by it finds them:

Python6 lines
SERVICE_DATE_SP = {
    "resourceType": "SearchParameter", "id": "eob-service-date", "url": "http://example.org/fhir/SearchParameter/eob-service-date",
    "name": "service-date", "status": "active", "code": "service-date", "base": ["ExplanationOfBenefit"], "type": "date",
    "description": "Date of service: the billing period or the item's serviced date (modelled on CARIN Blue Button)",
    "expression": "ExplanationOfBenefit.billablePeriod | ExplanationOfBenefit.item.serviced",
}

With that parameter, plus the core date parameter for Encounter and Observation and recorded-date for Condition, the export returned 7 claims instead of 10. Two problems remain. It still included the claim dated after the request, because ge has no upper bound unless you add one. And the condition with no date simply disappeared: a search filter cannot tell you what it excluded, so an undated record is dropped without anyone deciding to drop it.

Date of service per resource

The window that produced the right answer is applied after the export, per resource, with the date-of-service element written down for each type:

Python11 lines
# Resource type -> ordered list of paths whose first present value is the date of service.
SERVICE_DATE_PATHS: dict[str, list[tuple[str, ...]]] = {
    "ExplanationOfBenefit": [("billablePeriod", "end"), ("billablePeriod", "start"), ("created",)],
    "Encounter": [("period", "end"), ("period", "start")],
    "Condition": [("recordedDate",), ("onsetDateTime",)],
    "Observation": [("effectiveDateTime",), ("effectivePeriod", "end"), ("issued",)],
    "MedicationRequest": [("authoredOn",)],
    "Procedure": [("performedDateTime",), ("performedPeriod", "end")],
}
# Context resources that carry no date of service and are always sent with the member's data.
ALWAYS_INCLUDED = {"Patient", "Coverage", "Organization", "Practitioner"}
Python13 lines
def decide(resource: dict, request_date: date) -> Decision:
    rtype, rid = resource["resourceType"], resource.get("id", "?")
    if rtype in ALWAYS_INCLUDED:
        return Decision(rtype, rid, None, True, "context resource")
    when = service_date(resource)
    if when is None:
        # No usable date: hold it back for review rather than send data outside the window.
        return Decision(rtype, rid, None, False, "no date of service; held for review")
    if when > request_date:
        return Decision(rtype, rid, when, False, "date of service after the request")
    if when < five_years_before(request_date):
        return Decision(rtype, rid, when, False, "older than five years")
    return Decision(rtype, rid, when, True, "within five years")

Three choices in this code are policy, not engineering, and belong in a document your compliance team signs. First, which element is the date of service: the sample takes the end of a billing or encounter period, so a stay that began before the window and ended inside it is in scope. Second, the boundary is inclusive: a claim on 19 January 2019 is in scope for a request on 19 January 2024; one on 18 January is not. Third, a resource with no usable date is held for review, not sent and not silently dropped.

⚖️
MINIMUM NECESSARY

Sending data outside the five-year window is a disclosure the rule does not require. Treat the window table as a privacy control: version it, log each decision with the request, and keep the held-for-review list as evidence that undated records were looked at rather than sent by default.

Using _typeFilter and the window together is reasonable once the search parameters are indexed: the filter cuts the volume the server writes to NDJSON, and the window makes the final decision. In this test the combination sent the same 6 claims and 5 other clinical resources, and flagged the one future-dated claim.

Provider Access and attribution

Provider Access uses the same machinery with a different consent model. Members are in by default and can opt out, and the payer must maintain an attribution process that links a member to in-network providers with a treatment relationship. In Bulk Data terms that is one Group per provider or practice, with members removed when they opt out or the relationship ends. The hard part is not the export; it is keeping attribution Groups current, because a stale Group is a disclosure to a provider who no longer treats the member. Plan for that as a data pipeline with its own tests, not as an occasional batch job.

⚠️
GROUP MEMBERSHIP IS THE CONTROL

In both payer-to-payer and Provider Access, the Group decides whose data leaves. Build it from the consent and attribution records at request time, give it a period, and do not reuse a long-lived Group whose membership has drifted.

Prior Authorization API

The Prior Authorization API is the largest piece of new work and is out of scope for this sample. CMS recommends the Da Vinci Coverage Requirements Discovery, Documentation Templates and Rules, and Prior Authorization Support guides, and the X12 278 enforcement discretion means a payer can run PAS natively rather than translating to X12. The operational deadlines arrive a year before the API: 72-hour and seven-day decision times and denial reasons apply from 1 January 2026, so the workflow behind the API has to be fast before the API exists.

Cost

The rule’s API costs are mostly people and integration, but two engineering costs are worth planning now. Bulk exports are database work: a Group export for many members reads every compartment resource for each one, so run them on a replica or with job concurrency limits rather than against the claims system of record. And reindexing for a new search parameter touches every resource of that type, which on a large claims history takes time and I/O; register the parameters you need before the bulk load, not after.

Production considerations

  • Authentication. The test server is open. Production payer-to-payer endpoints need mutual trust between payers, typically SMART Backend Services with signed client assertions, and the token belongs in every kick-off, poll and download request.
  • Polling. Honour Retry-After, cap the wait, and treat a 5xx on the status URL as a failed job, not a transient error. In this test, an invalid filter surfaced only there.
  • Manifest errors. The manifest’s error array lists OperationOutcome files. Stop and alert when it is not empty; a partial export sent as complete is worse than a late one.
  • Audit. Record each request with its date, the Group, the window table version, counts sent and the held-for-review list.
  • Validation. Run the exported resources through US Core and, for claims, CARIN Blue Button validation before go-live; this sample did not.
  • Deadlines. One business day from request to response means the export, window and delivery run unattended. Alert on anything held for review so a person sees it the same day.

Decision framework

QuestionRecommendation
Filter the five-year window with _since?No. It filters on server change time
Use _typeFilter?Only with date parameters registered and indexed before the data is loaded, and still apply the window
Where to apply the window?After export, per resource type, with an inclusive boundary and a written date-of-service table
Undated resources?Hold for review; never send or drop by default
How to enforce opt-in or opt-out?Build the Group from consent and attribution at request time
📝
HOW THIS WAS CHECKED

Everything ran in GitHub Actions (run) against hapiproject/hapi:v6.10.1 (HAPI FHIR 6.10.0, FHIR 4.0.1) with bulk export enabled, using Python 3.12 and pytest 7.4.4. The 12 unit tests cover the window boundaries and the client against a scripted Bulk Data server. All data is synthetic and hand-written, the server had no authentication, and nothing was validated against US Core or CARIN Blue Button. The rule summary is from CMS’s fact sheet and the final rule text released on 17 January 2024; it is not legal advice.

Key takeaways

  • All four CMS-0057-F APIs are due on 1 January 2027; prior authorization decision deadlines start on 1 January 2026.
  • Payer-to-payer exchange is opt-in and limited to dates of service within five years of the request.
  • Bulk Data _since filters on last-updated time and returned every claim back to 2016 in the test.
  • _typeFilter works only with indexed search parameters; an unknown one failed the job after a 202.
  • Apply the window per resource after export, write down the date-of-service element for each type, and hold undated data for review.

If your team has settled the date-of-service question differently, I would like to hear how. Comments are open below.

Glossary

CMS-0057-F
The CMS Interoperability and Prior Authorization final rule, released 17 January 2024.
Impacted payers
Medicare Advantage organisations, Medicaid and CHIP fee-for-service programmes and managed care plans, and QHP issuers on the federally facilitated exchanges.
Payer-to-Payer API
The API through which a member’s previous payer sends their data to a new payer, with the member’s opt-in.
Provider Access API
The API through which in-network providers with a treatment relationship get a member’s data, unless the member opts out.
FHIR Bulk Data Access
An HL7 implementation guide for asynchronous export of large sets of FHIR resources as NDJSON files.
Group export
A Bulk Data export of the data of the patients listed in a Group resource.
_since
A Bulk Data parameter that returns resources changed on the server after a given time.
_typeFilter
An optional Bulk Data parameter that applies a FHIR search to each exported resource type.
NDJSON
Newline-delimited JSON: one FHIR resource per line, the Bulk Data file format.
ExplanationOfBenefit
The FHIR resource for an adjudicated claim; its billablePeriod covers the dates of service.
CARIN Blue Button
An HL7 implementation guide for payer claims data, which defines a service-date search parameter.
Da Vinci PAS
The HL7 Prior Authorization Support guide, recommended for the Prior Authorization API.
USCDI
United States Core Data for Interoperability, the set of data classes the APIs must carry.

References & Further Reading


Discover more from C4: Container, Code, Cloud & Context

Subscribe to get the latest posts sent to your email.

Written by

Nithin Mohan TK

Hello Namaste! 👋🏻 I'm an accomplished Enterprise Solution Architect & Engineering Leader with 20+ years of progressive experience architecting, building, and scaling transformative enterprise solutions. ⚜️ Solution Architect / AI & Cloud 📌 Galway, Ireland

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.