How to Build a Patient Cost Estimator: The Data Stack

Build a patient cost estimator in four layers: Medicare allowed amount, modifier and contract adjustments, a 270/271 eligibility check and cost-share rules.

Updated CMS RVU26D13 min read

Soft clay still life of a balance scale with a small stack of blank round tokens on each pan, a short stack of blank index cards and a forest-green calculator with blank keys, on a warm off-white background.
On this page 9 sections
  1. The four layers of a patient cost estimator
  2. Step 1: Price the service at the Medicare allowed amount
  3. Step 2: Adjust for modifiers, provider and contract
  4. Step 3: Pull benefits with a real-time eligibility check (270/271)
  5. Step 4: Apply the cost-share rules in order
  6. Keep patient data and pricing apart
  7. Good Faith Estimates
  8. What FeeBase covers and what it doesn't
  9. FAQ

A patient cost estimator answers one question: what will this patient owe for this visit? Getting there takes four steps in a fixed order: price the service at its allowed amount, adjust that price for modifiers and the provider's contract, pull the patient's benefits with a real-time eligibility check (X12 270/271), then apply deductible, copay, coinsurance and out-of-pocket limits in sequence. Most payer contracts are written as a percentage of Medicare, so step one usually starts with the Medicare Physician Fee Schedule allowed amount for the code, location, date of service and setting. FeeBase's API supplies that number and several of the step-two adjustments. It doesn't check eligibility or calculate what the patient owes; those layers are yours to build or buy.

Key takeaways

  • Patient responsibility = the allowed amount, run through the patient's remaining deductible, then copay or coinsurance, then their remaining out-of-pocket maximum. Every input has to be right for the date of service.
  • The allowed amount comes from the contract, and many contracts are a percentage of the Medicare fee schedule for the same code, locality, date and setting. Original Medicare pays the fee schedule amount itself.
  • Benefits come from a 270/271 eligibility transaction, which needs patient identifiers. Pricing doesn't: the fee schedule lookup needs only a code, a ZIP and a date.
  • Keep the two apart. Your pricing vendor never sees patient data, and your eligibility vendor never needs your contract terms.
  • FeeBase covers the Medicare base price, modifiers 26 and TC, provider type, non-participating limiting charges and therapy timed units with MPPR. Contract rates, eligibility and the cost-share calculation stay in your system.

The four layers of a patient cost estimator

Each layer has different inputs, a different source and a different owner. Build them as separate services and the estimator becomes a join, not a tangle.

Layer Inputs Output Where it comes from FeeBase
1. Base price Code, ZIP or locality, date of service, facility or office Medicare allowed amount per line CMS Physician Fee Schedule files Yes
2. Adjustments Modifiers, units and minutes, provider type, participation, payer contract Expected allowed amount per line under this payer CMS payment rules plus your contract table 26/TC, provider type, non-par, therapy only
3. Benefits Patient and member identifiers, payer, service type Deductible remaining, copay, coinsurance, out-of-pocket remaining, plan type X12 270/271 via a clearinghouse, the payer, or CMS HETS for Medicare No
4. Cost share Layer 2 amounts plus layer 3 benefits Patient responsibility per line and per visit Your code No

Step 1: Price the service at the Medicare allowed amount

Start with the Medicare Physician Fee Schedule amount because it's the reference most other prices are built on. Original Medicare pays it directly. Commercial contracts are commonly negotiated as a percentage of it. Many practices set their own self-pay price list as a multiple of it too.

The fee schedule amount depends on four inputs, and an estimator that skips any of them will be wrong for some patients:

  • Code. The CPT or HCPCS code on the line. FeeBase prices by code and doesn't display AMA CPT descriptors, so your product supplies its own service names.
  • Location. The rendering location's ZIP, resolved to one of Medicare's payment localities. Some ZIPs cross a locality boundary and need ZIP+4.
  • Date of service. CMS publishes new rates every quarter, and a January visit is priced from the January release, not today's file.
  • Setting. Office (non-facility) and hospital or facility amounts differ because of practice expense. Map your place of service code to the setting; the facility vs non-facility guide explains which POS codes go where.

Medicare rate · 99214

Office visit, established patient, moderate complexity

Office or facility?

Work RVUs
1.92
Total RVUs
4.06
Global days
XXX

National rate · 2026

$135.61

Office setting, before claim adjustments.

See every locality for 99214 →Billed by an NP, PA or therapist? →

One request prices every line on the visit, up to 50 codes, with a shared ZIP, date and setting:

curl -G https://feebase.co/api/v1/rates \
  -H "Authorization: Bearer $FEEBASE_API_KEY" \
  -d 'codes[]=99214' \
  -d 'codes[]=93000' \
  -d setting=non_facility \
  -d zip=10001 \
  -d date=2026-11-03

The response, trimmed. Results come back in the order requested, with amounts in integer cents and the ID of the CMS release used:

{
    "data": [
        {
            "code": "99214",
            "amount": "<integer cents>",
            "currency": "usd",
            "setting": "non_facility",
            "date": "2026-11-03",
            "qp_status": "non_qp",
            "location": { "type": "locality", "id": "13202-01" },
            "release": "<release ID>"
        },
        {
            "code": "93000",
            "amount": "<integer cents>",
            "currency": "usd",
            "setting": "non_facility",
            "date": "2026-11-03",
            "qp_status": "non_qp",
            "location": { "type": "locality", "id": "13202-01" },
            "release": "<release ID>"
        }
    ]
}

Two responses need handling in the estimator, not just the integration:

  • No Medicare amount. Contractor-priced and non-payable codes return amount: null with an unavailable_reason. Show "we can't estimate this service" for that line. Don't treat it as zero, or the patient sees a free service.
  • Split ZIP. A ZIP that spans two localities returns 422 zip_plus4_required. Send the practice's ZIP+4 or store its locality ID once at setup (locations).

Use the practice location, not the patient's home address: the fee schedule is set by where the service is furnished.

Step 2: Adjust for modifiers, provider and contract

The base amount is the full fee schedule amount for a participating physician. Real claims carry modifiers, non-physician clinicians and contract terms, and each changes the expected allowed amount before cost share is applied.

Professional and technical components. A radiologist reading an echo bills modifier 26; the facility that owns the machine bills TC. Each is its own row in the CMS file, not a percentage of the global amount. Pass modifier=26 or modifier=TC and FeeBase prices that row.

Modifier 26 · payment effect

With and without the modifier

93306 without 26 · national office

$196.73

Echocardiogram (TTE), complete, with spectral and color Doppler

93306-26 · Professional component

$67.47

Pays only the interpretation and report.

Provider type. Medicare pays nurse practitioners, physician assistants and clinical nurse specialists 85% of the fee schedule, and clinical social workers, marriage and family therapists and mental health counselors 75%. Pass provider_type and the amount comes back adjusted, with the multiplier and its source (provider pricing).

Non-participating providers. A provider enrolled in Medicare who hasn't signed a participation agreement is paid 95% of the fee schedule. If they don't accept assignment, they can bill the patient up to the limiting charge, 115% of that amount, and the patient pays the difference. Pass participation=non_participating and the response includes limiting_charge. Your estimator needs it: for unassigned claims, the patient's share is the limiting charge minus what Medicare pays.

Therapy visits. Physical, occupational and speech therapy are billed in timed units, and Medicare reduces practice expense on every unit after the first. POST /api/v1/therapy/estimate takes minutes per code, allocates units under the 8-minute rule and applies the therapy multiple procedure payment reduction (MPPR) for the visit (therapy estimates). The therapy MPPR calculator shows the same calculation in the browser.

Therapy MPPR

Same-day therapy units after the practice-expense reduction

The contract layer. For any payer other than Original Medicare, the allowed amount comes from the provider's contract. Store contracts as data: payer, plan or product, the TIN or NPI they apply to, effective dates, and a rule per code group. Most rules are a multiplier on the Medicare amount for the same date of service:

Contracted allowed amount

Expected allowed=Medicare allowed amount×contract percentage\textsf{Expected allowed} = \textsf{Medicare allowed amount}\times\textsf{contract percentage}

Two details decide whether this is right. Check which Medicare year the contract references: some pin a specific year's fee schedule, others float with the current one, and FeeBase can price either by date (releases go back to January 2013). And keep fixed-fee rows and carve-outs as exceptions to the multiplier, not edits to it. Medicare Advantage plans pay contracted providers under their own contracts and set their own cost share, so treat each MA plan as a payer in this table; FeeBase's amounts aren't Medicare Advantage or commercial rates. The contract check compares a payer's rates to Medicare code by code.

Step 3: Pull benefits with a real-time eligibility check (270/271)

The patient's benefits come from an eligibility transaction. Your system sends an X12 270 request with the patient's identifiers, payer and the service type; the payer returns a 271 response listing coverage and cost-share amounts. Most estimators reach commercial payers through a clearinghouse. For Original Medicare, CMS runs the HIPAA Eligibility Transaction System (HETS), which "supports real-time transactions only" and doesn't accept batches.

Benefits arrive as EB segments. These are from CMS's annotated HETS 271 example:

271 segment Meaning Use in the estimator
EB*C**30*MB**29*0~ Deductible (C), Part B (MB), remaining this period (29) The deductible still to be met before coinsurance applies
EB*A**30*MB**27**.2~ Coinsurance (A) for Part B, as a decimal The patient's share of the allowed amount after the deductible
EB*U**30*IN~ Medicare Advantage enrollment, with the plan to contact Stop: the MA plan's contract and cost share apply, not Original Medicare's
EB*R**30*13~ Another payer, here Medicare Secondary Payer Medicare may not be primary; estimate against the primary payer

Commercial 271s use the same structure with more variety: copays (B), out-of-pocket limits (G), and in-network or out-of-network flags per benefit. Build for the gaps. Benefits are reported by service type, not by CPT code, so you have to map each line to a service type (an office visit, physical therapy, imaging) yourself. Accumulators lag behind claims still in process, so "deductible remaining" can be stale by the amount of last week's visit. And some payers omit fields entirely; decide in advance what the estimator shows when the coinsurance or out-of-pocket amount is missing.

The 270 request contains protected health information: name, date of birth, member ID. That's the reason to keep this layer separate from pricing, which needs none of it.

Step 4: Apply the cost-share rules in order

With an expected allowed amount per line and the patient's benefits, patient responsibility is arithmetic, but the order matters:

  1. Remove non-covered and no-cost-share lines. Some services have no deductible or coinsurance when the provider accepts assignment, such as Medicare's annual wellness visit. Others aren't covered at all and are the patient's in full.
  2. Apply the remaining deductible. The patient pays the lesser of the line's allowed amount and the deductible still remaining. Carry the remainder to the next line.
  3. Apply copay or coinsurance. A copay is a flat amount per visit or service; coinsurance is a percentage of what's left of the allowed amount after the deductible. Plans differ on whether copay services also go through the deductible; the 271 usually says.
  4. Cap at the out-of-pocket maximum remaining. Once the patient reaches it, their share of further covered services is zero for the rest of the plan year.
  5. Account for secondary coverage. A Medigap, Medicaid or other secondary plan can pick up some or all of the primary's cost share. If you can't price the secondary, show the primary result and say a secondary may reduce it.

For Original Medicare Part B, the 2026 deductible is $283, after which the patient usually pays 20% of the Medicare-approved amount, and Original Medicare has no annual out-of-pocket limit. Medicare's 2% sequestration reduction applies to Medicare's payment, not to the patient's deductible or coinsurance.

A minimal cost-share function, in integer cents. It runs inside your system, after pricing and eligibility have returned:

from dataclasses import dataclass


@dataclass
class Benefits:
    deductible_remaining: int  # cents, from the 271
    coinsurance_rate: float  # e.g. 0.20
    copay: int | None  # cents per visit, if any
    oop_remaining: int | None  # None: no limit


def patient_share(allowed: list[int], b: Benefits) -> int:
    """Patient share for one visit in cents, before any secondary.

    Uses the copay if the plan has one, otherwise coinsurance.
    """
    deductible_left = b.deductible_remaining
    total = 0

    for amount in allowed:
        to_deductible = min(amount, deductible_left)
        deductible_left -= to_deductible
        total += to_deductible
        if b.copay is None:
            rest = amount - to_deductible
            total += round(rest * b.coinsurance_rate)

    if b.copay is not None:
        total += b.copay

    if b.oop_remaining is not None:
        total = min(total, b.oop_remaining)

    return total

The order of lines matters when the deductible runs out partway through a visit, because the deductible absorbs whichever lines come first. Payers adjudicate in their own order, so an estimate can differ from the final bill by part of a line. Pick a rule, apply it consistently and show the estimate as an estimate.

Keep patient data and pricing apart

The cleanest architecture puts the patient on one side and the price on the other:

  • Pricing service calls FeeBase with codes, a ZIP or locality, a date of service, a setting and provider options. No patient data is sent or needed.
  • Eligibility service sends 270s through your clearinghouse or HETS under your HIPAA agreements and stores the 271 benefits.
  • Estimator joins the two by visit, applies your contract table and cost-share rules, and writes the result to the patient's record.

FeeBase doesn't sign business associate agreements and must not receive patient information. That's a constraint, but it's also a simpler design: your pricing dependency stays outside your HIPAA scope, and no patient identifier ever leaves your system to get a price. Store the release ID FeeBase returns with each estimate; with include=sources, each amount also carries the CMS file and line it was built from, so you can show exactly which Medicare rate an estimate used if a patient disputes it.

Good Faith Estimates

The No Surprises Act requires providers to give a Good Faith Estimate to uninsured or self-pay patients who schedule care at least three business days ahead or ask for one. Under 45 CFR 149.610 it lists each expected item or service with "applicable diagnosis codes, expected service codes, and expected charges." Patients covered by Medicare or another federal health care program and using it aren't "uninsured or self-pay" under that rule.

A Good Faith Estimate uses your charges, not an insurer's allowed amount. If your self-pay prices are set as a percentage of Medicare, the same pricing layer produces them: Medicare amount for the code, ZIP and date, times your self-pay multiplier. The federal agencies deferred enforcing the separate insured-patient estimate and Advanced Explanation of Benefits requirements in August 2021, pending further rulemaking.

What FeeBase covers and what it doesn't

In FeeBase Outside FeeBase
Medicare PFS allowed amounts by code, ZIP or locality, date of service and setting Eligibility and benefits (270/271)
Up to 50 codes per request, in integer cents, with the CMS release Commercial and Medicare Advantage contract rates
Releases back to January 2013; QP and non-QP conversion factors Patient responsibility and cost-share logic
Modifiers 26 and TC; provider type; non-participating amounts with limiting charge Claim adjudication, NCCI edits, general multiple procedure reductions
Therapy timed units and therapy MPPR (POST /api/v1/therapy/estimate) Facility (OPPS, ASC) payments
Optional RVU breakdown and the source CMS file rows Anything involving patient data

FeeBase's API plans are Try it ($49/month, 500 requests), Scale ($999/month, 100,000 requests, commercial use in your product) and Enterprise (custom). There's no free API plan; the free lookup prices codes at a ZIP in the browser if you want to check numbers before integrating. The build or buy guide covers what it takes to compute these amounts from CMS's files yourself.

Sources: CMS, HIPAA Eligibility Transaction System (HETS) and Medicare 5010A1 271 transaction example (HETS2024-4, amended October 30, 2024); Medicare.gov, Medicare costs (2026 Part B deductible and coinsurance); 45 CFR 149.610 (Good Faith Estimates for uninsured or self-pay individuals); CMS, Good Faith Estimate guide; Departments of Labor, HHS and Treasury, FAQs about Affordable Care Act and Consolidated Appropriations Act, 2021 implementation, Part 49 (August 20, 2021); CMS, PFS relative value files. Verified October 10, 2026.

FAQ

How do you calculate patient responsibility?

Start with the allowed amount for each service under the patient's plan. Apply the remaining deductible first, then the copay or coinsurance on what's left, then cap the total at the patient's remaining out-of-pocket maximum. Secondary coverage can reduce the result further.

Does FeeBase calculate what the patient owes?

No. FeeBase returns Medicare Physician Fee Schedule allowed amounts and some adjustments to them. Eligibility checks, contract rates and the cost-share calculation happen in your system.

Can I send patient information to the FeeBase API?

No. The API needs only codes, a ZIP or locality, a date of service and pricing options. FeeBase doesn't sign BAAs, so keep patient identifiers in your eligibility layer.

Is the Medicare allowed amount what the patient pays?

No. It's the total Medicare allows for the service. Under Original Medicare, the patient usually pays 20% of it after the Part B deductible, and Medicare pays the rest.

Does FeeBase have Medicare Advantage or commercial rates?

No. FeeBase's amounts are Original Medicare fee schedule amounts. Many commercial contracts are written as a percentage of them, so they're the base you multiply by each contract's percentage.

Do I need a 270/271 check for every estimate?

To estimate what a specific patient owes, yes: the deductible and out-of-pocket amounts remaining change with every claim. A price list or self-pay estimate doesn't need one.

Did this answer your question about How to Build a Patient Cost Estimator: The Data Stack?

Tell us what you were actually trying to work out. We’ll answer you directly, or build the page that does.