Skip to main content
Pharmacy Benefits is one of haau3’s two Benefits services, the two halves of CMS’s Real-Time Benefits use case; Medical Benefits answers what a Medicare Advantage or Marketplace plan covers and what a member pays, from CMS’s plan files. Pharmacy Benefits answers what a drug will cost a person on their plan, in two ways:
  • For a Medicare Part D plan, on its own or with Medicare Advantage, from CMS’s monthly Part D files: the plan’s formulary says whether it covers the drug, at which tier and with which limits; the plan’s drug plan says what each tier costs; and the plan’s pharmacies say where.
  • For a member’s own coverage, the real-time pharmacy benefit check asks their health plan.

A Medicare Part D formulary

Open to every customer. What a drug will cost a person on a Medicare Part D plan starts with the plan’s formulary: whether the plan covers the drug, at which tier, and whether it needs prior authorization or step therapy or has a quantity limit. What each tier costs is on the plan’s drug plan. Which drugs each Medicare Part D formulary lists, at which tier and with which limits, comes from CMS’s monthly Part D file, in the shape of HL7’s Da Vinci Payer Data Exchange (PDex) US Drug Formulary guide, version 2.1.0. Every resource claims that guide’s profile, and names CMS’s file in meta.source and when haau3 published it in meta.lastUpdated. A formulary and each item on it also name the month that file covers, in haau3’s Part D data month extension (2026-11). An item’s id is the formulary’s and the drug’s RxNorm code together, so with both you read the item with no search. The calls are counted as Pharmacy Benefits.
A formulary lists what a plan covers. It is not a statement of what a member will pay or be given: the plan decides, and can change its formulary during the year.

Which formulary a plan uses

A Medicare Advantage plan with Part D, read or found with Medical Benefits, names its formulary on its coverage, in the guide’s FormularyReference extension:
Every Part D plan’s drug plan names its formulary the same way, on a coverage typed DRUGPOL. A stand-alone prescription drug plan has no medical InsurancePlan, so its drug plan is where to read its formulary’s id. To find formularies without a plan, search InsurancePlan with type=DRUGPOL, alone for every formulary or with identifier (CMS’s formulary id, 00027002), a form of name or _id.

Whether a drug is on a formulary

Lisinopril 5 MG Oral Tablet is on formulary 00027002, the formulary of the plan H2406-013-000, at tier 1, limited to 60 every 30 days. The answer holds the item, then the formulary and the drug _include asked for. An item carries: A drug that is not on a formulary is an answer. A search that finds no item answers 200 with no items and an OperationOutcome entry (search.mode outcome): “RxNorm 1 is not on Part D formulary 00027002 in CMS’s file for 2026-11.” A read of the item answers 404 with the same words. A formulary that is not in CMS’s file is refused with 400, naming formulary.

Searching

  • formulary takes InsurancePlan/Formulary-00027002 or Formulary-00027002, and subject takes MedicationKnowledge/FormularyDrug-311354 or FormularyDrug-311354. Each takes up to 20, separated by commas.
  • code matches a drug’s RxNorm code or one of its dose form groups’, so a group’s code finds every drug in it. drug-name matches the start of either’s name, ignoring case.
  • _include=Basic:formulary and _include=Basic:subject add each item’s formulary and drug, and do not count toward _count.
  • _count is 1 to 100, 25 by default, for items and drugs, and 1 to 50, 10 by default, for formularies. Follow the next link to continue. Once a newer month of CMS’s file is served, a later page answers 410: start the search again.
  • Every other parameter is refused by name, with the reason, the guide’s own included: status, period, _lastUpdated, code on Basic, and doseform.

What is left out

  • The tier’s name, such as generic or preferred brand, which each plan gives its tiers.
  • The two-month and preferred pharmacy ways to fill, on an item. A plan’s drug plan prices them.
  • Drugs a plan excludes, which are per plan, and CMS’s flag for drugs selected for Medicare price negotiation.
  • A drug’s dose form, and the doseform search.

A Medicare Part D plan’s drug plan

Open to every customer. What each tier costs on a Medicare Part D plan is on the plan’s drug plan: an InsurancePlan of its own, beside the plan’s medical one, in the shape of the same Da Vinci guide’s PayerInsurancePlan. Every Part D plan in CMS’s monthly file has one. A stand-alone prescription drug plan has no medical InsurancePlan, so its drug plan is the only one it has. A drug plan’s id is the plan’s own id after DrugPlan-. Read it by that id. No search finds one. The call is counted as Pharmacy Benefits.
With a drug’s tier from its formulary item, the cost of a one-month supply at a retail pharmacy is the specificCost whose category is 1-month-in-retail, and in it the benefit whose type is that tier. On this plan a tier 2 drug is a $5 copay, and a tier 3 drug is 22% after the deductible:
A drug plan’s costs are CMS’s for the month, in the initial coverage phase, for a person with no subsidy. They may not be what a member pays at the pharmacy: the deductible, the other coverage phases and a subsidy each change it. Insulin has costs of its own in CMS’s file, which are not served yet.

Reading a cost

Each tier has one cost for each way to fill: a copay in dollars or a coinsurance in percent, as CMS’s file gives it, and never both. A coinsurance is a share of the drug’s price, which this service does not turn into dollars. A cost’s qualifier says whether the plan’s deductible comes first, in four of the guide’s codes, each by the guide’s own definition: For a few plans CMS’s file gives a cost with a minimum or a maximum. Those are in haau3’s Part D cost range extension on the cost, in dollars:
  • A copay between two amounts has the maximum as its value, with the comparator <=, and the minimum and maximum in the extension.
  • A coinsurance with a maximum keeps its percent as its value, and the extension holds the most it comes to.

The ways to fill

A plan prices up to twelve ways to fill a prescription: a supply of one, two or three months, at a retail pharmacy or by mail order, at a pharmacy the plan lists as preferred or at any other in its network. The Da Vinci guide’s codes name four of them, which carry the price at a pharmacy that is not preferred: The other eight are haau3’s interim codes, in https://fhir.haau3.com/platform/CodeSystem/part-d-pharmacy-benefit-type, until the guide can say them: A plan prices only some of them. A way to fill the plan does not price for a tier is absent, never a zero.

When there is no drug plan

  • A plan that is not in CMS’s file for the month answers 404, and the OperationOutcome names the month.
  • A read of a stand-alone drug plan by its own id, InsurancePlan/S5743-001-000, answers 404, since the plan has no medical InsurancePlan. Its words name the drug plan’s id, DrugPlan-S5743-001-000.
  • An employer plan has no drug plan: CMS’s Part D file leaves out employer plans. Its own id’s 404 names none.
  • When CMS’s file cannot be read just now, the answer is 503 with Retry-After. It is never reported as a plan with no drug plan.

What is left out

  • Insulin’s own costs, which CMS’s file gives apart from the tier’s.
  • The two other coverage phases, before the deductible is met and catastrophic coverage.
  • Drugs a plan excludes, and the plan’s own address for its drug list.
  • A search for drug plans. Read one by its id.

A Medicare Part D plan’s pharmacies

Open to every customer. From CMS’s Medicare Part D files, published monthly, each pharmacy naming the month its file covers: They are calls of the Provider directory and of Medical Benefits, and are counted as theirs. A plan’s list is the plan’s as CMS’s file states it for the month, which may not be what a member pays at the pharmacy, and a plan can change its list from one month to the next.

The real-time pharmacy benefit check

Ask what a medication would cost: its price at pharmacies near a ZIP code, with no patient details, or what it would cost a member under their pharmacy coverage. The exchange is the CARIN Consumer Real-Time Pharmacy Benefit Check (STU2 ballot, 2.0.0-ballot): you POST a FHIR message Bundle and get the answer in the same exchange, in real time, from the sources it connects to.
The real-time check is not yet open to customers. While its price sources are being licensed, every request from a customer’s organization, with or without patient details, is refused with 403 forbidden. Every price is an estimate; the pharmacy confirms the price.
Try it now in the Sandbox, the API’s test environment, where a test insurer, Example Health Plan, answers a member’s request for synthetic test members, the same way every time, at https://sandbox.haau3.com/v1/fhir/r4/$process-message, with no key or a test key. Platform.haau3.com’s Pharmacy Benefits playground sends its requests there.
A member’s request carries patient data. Send the rtpbc-request message only under an executed agreement with haau3, as the terms require. Without one, it accepts only test data marked as such, as the example here is, and refuses anything else with 403. The request without patient details carries none. Nothing from a request that succeeds is stored, cached or logged. When a request fails, haau3 keeps the failed exchange for a short time to find and fix the cause. See Data handling.

Service base

Everything hangs off that base, exactly as the FHIR REST specification describes. /v1/ is the version of the haau3 platform API contract, not a FHIR version. The FHIR release is r4, and every response says so:
You never have to ask for a release. A plain Accept: application/fhir+json, or no Accept header at all, works fine. If you do ask for one we do not serve, or for a format other than JSON (in Accept or _format), you get a 406 rather than a silent substitution. Every error on this base is a FHIR OperationOutcome, including the 401 you get without a key and a 429, so a FHIR client only ever has one error shape to parse. Errors, limits and request ids lists the statuses every service shares.
The uppercase form /v1/fhir/R4/... redirects to the lowercase base with a 308, which preserves the method and body so a POST is not quietly turned into a GET.
The Terminology service, the Provider directory, Questionnaires, Medical Benefits and MedList use this same base and the same CapabilityStatement. This operation is declared under rest.operation, beside MedList’s. The formulary’s Basic and MedicationKnowledge are declared as resources, and its formularies on the InsurancePlan entry, beside Medical Benefits’ plans.

What is served

One operation, on the service base itself: GET [base]/metadata returns the CapabilityStatement, which lists this operation under rest.operation and names CARIN’s responder statement in instantiates. The operation accepts POST only, with Content-Type: application/fhir+json, and it needs an API key (see Authentication). It takes no parameters: it answers synchronously, and its input is the message Bundle sent as the body. Every request is a Bundle of type message whose first entry is a MessageHeader. The header’s eventCoding says which of two messages it is, from the system http://hl7.org/fhir/us/carin-rtpbc/CodeSystem/rtpbc-event-type:

Price sources

A request without patient details is asked of every price source your organization may receive, all at once, and the answer holds every price they return. Every price names its source in processNote, with when it was read and how it is paid; show the notes with the prices. Cost Plus Drugs takes no quantity, so its price follows its own published unit price and fees for the quantity you ask for. A pack that cannot be split is priced only in whole packs, and a medication sold in a unit other than the one you ask for is not priced. A source that does not answer within 8 seconds, or answers with an error, is left out and named in a note.

Price a medication without patient details

The request names the product and the quantity in its Claim, masks the patient and the coverage with a data-absent-reason of masked, and names a pharmacy in Claim.provider, up to three ZIP codes in its preferredPharmacyPostalCode extension, or both.
The request.json below is the synthetic example from the haau3 FHIR Implementation Guide: 30 lisinopril 5 mg tablets (RxNorm 311354) at pharmacies in ZIP code 33131.
request.json
The answer, for an organization the price sources are available to: the lowest price at a pharmacy near the ZIP code in item, and every price, that one included, as an addItem naming its pharmacy. These are the prices Cost Plus Drugs answered for this request on 2026-10-20, three of its twenty pharmacies kept.
Until the real-time check opens to customers, a customer’s organization gets 403 instead, before its request is read:

Check a member’s cost

The member’s request carries their Patient, named by an identifier with a system, and their Coverage, the prescription as a MedicationRequest, its prescriber as a Practitioner named by an NPI and a family name, and the pharmacy as an Organization named by its NPI or NCPDP provider id. The member’s insurer needs each of those names, so a request missing one is refused with a 400 that names the element. The Coverage carries the payer’s identifier in payor.identifier: it is how the member’s insurer is found, so a member’s request without it is refused. For prices without patient details, send rtpbc-request-non-phi instead. Send the member’s address in Patient.address, their language in Patient.communication and the prescription’s dosage in MedicationRequest.dosageInstruction.text when you have them: an insurer may require them, and this service never makes them up. Two parts of an address you send are filled in when you leave them out: the country, as the US, and, for an insurer that requires one, a period that starts on the day of the check. A language or a dosage you leave out goes to an insurer that requires one as FHIR’s standard way of saying it is not known, never as a guess: the language as und (BCP 47’s code for undetermined), and a dosage with no text, marked with the data-absent-reason extension as unknown. No insurer answers yet. A member’s request is answered no-responder-for-coverage, or, for an insurer that answers only with the member’s authorization and has not yet opened its production service, payer-authorization-required without one and payer-authorization-rejected with one. An insurer may price by NDC only. Send the product’s NDC when you have it. For an RxNorm code, such an insurer is asked about an NDC haau3’s RxNorm release holds for the code, or for one of its branded forms when the code holds none, and the answer’s note names that NDC. When the release holds none, the insurer is not asked and the answer carries ndc-required. Send the prescription’s days supply, how many days the quantity lasts, in MedicationRequest.dispenseRequest.expectedSupplyDuration, as a whole number of days with the UCUM code d. CARIN leaves it optional, and an insurer may require it. A days supply changes the price, so this service never makes one up: an insurer that requires one is not asked about a request without one, and the answer carries days-supply-required. When the NDC is missing too, the answer carries both codes, so one change to the request fixes both.

The member’s insurer

The insurer is found by the payer’s Payer ID, which CARIN’s Coverage profile names payor.identifier. Type the identifier as one: its type is payerid from http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType (CARIN Blue Button’s identifier types), and its value is the payer’s Payer ID. An identifier with another type, or none, finds no insurer.

The member’s authorization

Some insurers answer only with the member’s own authorization. Your app registers with the insurer, the member signs in with the insurer through your app, and your app sends the access token it receives with each request, in the Payer-Authorization header, beside your API key:
The header takes Bearer and the token, as an Authorization header does, at most 4,096 characters. The token is sent to that one insurer, as its Authorization, for that one request. haau3 never stores, logs or caches it, never asks an insurer for one or refreshes one, and never sends it to a price source.
  • Without the header, a request to an insurer that needs it is answered payer-authorization-required, and the insurer is not asked.
  • When the insurer refuses the token, because it has expired, was revoked or was issued for another insurer, the answer is payer-authorization-rejected. The member signs in with the insurer again for a new token.
  • A request without patient details that carries the header is refused: price sources never receive it.
request.json
The answer today: no insurer this service connects to answers for the coverage’s payer. The member’s Patient comes back as it was sent, as CARIN requires.

Reading the answer

The answer is a Bundle of type message. Its MessageHeader answers yours: response.identifier is your MessageHeader.id, and response.code is ok whenever the request was read. Its one ClaimResponse carries either prices and coverage in item, or the reason there are none in error, never both, as CARIN requires. ClaimResponse.request.identifier is your Claim’s identifier. A member’s answer also carries your Patient, at the same fullUrl. A member’s answer from their insurer is the insurer’s own ClaimResponse, with its coverage, costs, restrictions and alternatives as the insurer gave them, inside this service’s message. One more processNote names the insurer and when it answered, and the NDC it was asked about when haau3 chose one for your RxNorm code. An answer with prices has ClaimResponse.outcome complete:
  • item is the lowest price at a pharmacy near the ZIP codes, or at the pharmacy the request named. When only mail order has a price for a request naming ZIP codes, item is the mail-order price. item cannot name a pharmacy in FHIR, so its note does.
  • Every price, the one in item included, is also an addItem, with CARIN’s isAlternative set and its pharmacy in provider: an Organization in the Bundle, named by its NPI. The list is sorted from the lowest total. A mail-order price names no pharmacy.
  • Each price’s adjudications are the drug’s price (cash-price) when the source gives it apart from its fees, each fee as an other-cost with its name in reason.text, and the total, in USD.
  • Each addItem names its price source in programCode, from https://haau3.com/fhir/CodeSystem/pharmacy-benefits-price-source: cost-plus-mail-order, cost-plus-team-cuban-card or clixrx, each with its name as the display.
  • processNote says where each price came from and when it was read, which free card pays it, and why a source’s prices are missing. noteNumber on item and each addItem points to its notes.
  • Each price repeats your product coding. CARIN requires it to carry a display, so an RxNorm code you send without one is answered with the display haau3’s RxNorm release gives it. Send an NDC’s display with the NDC: nothing in haau3’s data names an NDC.
When no connected source can answer, ClaimResponse.outcome is error and error[0].code carries a code from https://haau3.com/fhir/CodeSystem/pharmacy-benefits-processing-code, and error[1] the second when a request lacks two things an insurer requires: An NCPDP reject code in an answer comes from the source that sent it, unchanged.

What is refused

The whole request is refused with HTTP 400 and an OperationOutcome before any source is asked when it holds:
  • a query parameter: the operation takes none;
  • a body that is not a Bundle of type message (a Parameters resource is refused by name), or a first entry that is not a MessageHeader;
  • an event other than the two above (issue code not-supported);
  • a list over its cap (issue code too-long): 20 entries, 5 focus references, 10 codings on a product, 3 ZIP codes, 10 identifiers on a pharmacy, 5 payors and 20 classes on a coverage;
  • an element the CARIN profiles require that is missing, such as the MessageHeader.id, the Claim’s one identifier and one item, or a quantity with no unit;
  • a reference that names no entry in the Bundle, or names one of the wrong type, resolved as FHIR resolves references inside a Bundle;
  • a product with no NDC (11 digits, no dashes) or RxNorm code: text alone cannot be priced;
  • a ZIP code that is not five digits or ZIP+4;
  • in a request without patient details, a patient or coverage that is not masked, or no pharmacy and no ZIP code;
  • in a member’s request, no Coverage, or a Coverage with no payor.identifier;
  • in a member’s request, a days supply that is not a whole number of days greater than 0 with the UCUM code d, such as one in weeks or months;
  • a Payer-Authorization that is not Bearer and a token (issue code invalid) or is over 4,096 characters (issue code too-long), checked before the body is read;
  • a Payer-Authorization with a request without patient details (issue code business-rule);
  • malformed content, or a body over 1 MiB (HTTP 413).
The OperationOutcome names the element by its FHIRPath in expression, or the header by its name, and never repeats a value you sent.

Errors

Every error is a FHIR OperationOutcome. The statuses every service shares, among them 401, 405, 406, 415, 429 and 500, are on Errors, limits and request ids. This operation is not offered inside a batch Bundle. A batch entry that names it is refused by name.

Data handling

This operation is stateless. Nothing a request that succeeds carries is stored, cached or logged, apart from a request ID you choose to send, and each check is a point-in-time answer: nothing from an earlier request bears on a later one. When a request fails, or the member’s health plan fails or refuses it, haau3 keeps the failed exchange for a short time, in a separate log only haau3 can read, to find and fix the cause: What the logs hold says what that log holds and for how long. A refusal names the element, never a value. A member’s Payer-Authorization goes to their insurer for that one request and nowhere else, and is never stored, cached or logged; the log records only whether one was sent. Every answer carries Cache-Control: no-store, errors included, so no cache between you and the service keeps one. A member’s request is protected health information. The haau3 terms reserve patient data for services designated to receive it under an executed agreement, and this operation is one of them. Send a member’s request only under such an agreement with haau3. The platform project that serves it runs under Google Cloud’s Business Associate Agreement.

Specification

The contract is the CARIN Consumer Real-Time Pharmacy Benefit Check, STU2 ballot, and the haau3 FHIR Implementation Guide’s Pharmacy Benefits page: