> ## Documentation Index
> Fetch the complete documentation index at: https://docs.perfectreferral.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Referral Scope Match

## What this module answers

When a provider refers a patient, the question is not whether a specialist *could*,
in principle, be a match for a referral. It is whether they are an appropriate match
in practice. This module reveals whether a specialist's billing data indicates they're
a good destination for a given kind of **routine** referral.

We work from what specialists bill, not from what their license or self-reported
specialty permits. A specialist's billing record is the most direct, large-scale
evidence of the work they actually perform, and it's what these predictions are
built on.

## How to read a label

For each specialty and each *routine* referral target to that specialty (such as
"colonoscopy" or "retina"), the module emits one of six labels.

| Label                 | Meaning                                                                                                    |
| :-------------------- | :--------------------------------------------------------------------------------------------------------- |
| `very_likely_match`   | The billing profile strongly indicates a match for this routine referral target.                           |
| `likely_match`        | The billing profile indicates a match for this routine referral target.                                    |
| `uncertain`           | The provider is evaluable, but the evidence meets neither the match nor the no-match predictive threshold. |
| `unlikely_match`      | The billing profile indicates this is not a match for this routine referral target.                        |
| `very_unlikely_match` | The billing profile strongly indicates this is not a match for this routine referral target.               |
| `insufficient_data`   | Not enough billing data to evaluate.                                                                       |

The predictive value of a label for a target is calibrated against an even sampling
of held-out providers in the target's specialty. A `very_likely_*` label carries at
least a 95% predictive value, and a `likely_*`/`unlikely_*` label at least an 80%
predictive value.

<Note>
  Neither `uncertain` nor `insufficient_data` is a negative signal, and a consumer
  can treat both as "not confident calls." They are not the same finding, though:
  `uncertain` means we could see the provider clearly and the evidence was genuinely
  mixed; `insufficient_data` means we could not see enough of the provider to judge
  at all.
</Note>

<Frame caption="Figure 1: Label distribution for ophthalmologists against the &#x22;Cataract evaluation and surgery&#x22; referral target. `very_likely_match` is calibrated to have 95% PPV (positive predictive value), `likely_match` is calibrated to 80% PPV, and analogously for `unlikely_match` and `very_unlikely_match`.">
  <img className="block dark:hidden" src="https://mintcdn.com/beeline/-4iOBXq3Q5kHZDjb/images/methodology/scope_match_docs_fig1-light.svg?fit=max&auto=format&n=-4iOBXq3Q5kHZDjb&q=85&s=6416ce02c89dec07dd5012286958c01b" alt="Label distribution for ophthalmologists against the &#x22;Cataract evaluation and surgery&#x22; referral target." width="543" height="324" data-path="images/methodology/scope_match_docs_fig1-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/beeline/-4iOBXq3Q5kHZDjb/images/methodology/scope_match_docs_fig1-dark.svg?fit=max&auto=format&n=-4iOBXq3Q5kHZDjb&q=85&s=0388105ed3e8f9a35f4de7e2e9d5d10f" alt="Label distribution for ophthalmologists against the &#x22;Cataract evaluation and surgery&#x22; referral target." width="543" height="324" data-path="images/methodology/scope_match_docs_fig1-dark.svg" />
</Frame>

## Where the signal comes from

Every prediction this module produces is computed from public data:

* **Medicare Physician & Other Practitioners** data ([CMS](https://data.cms.gov/provider-summary-by-type-of-service/medicare-physician-other-practitioners/medicare-physician-other-practitioners-by-provider-and-service)),
  for per-provider, per-procedure billing.
* **Medicaid T-MSIS** ([HHS](https://opendata.hhs.gov/datasets/medicaid-provider-spending/)),
  as a second, separate payer channel.
* **NPPES**, the national provider registry, which defines each specialty cohort.

Some notes on the data:

* Medicare and Medicaid cover structurally different populations, so we keep them
  side by side and never add a count from one to the other. An absent channel means
  "no data here," not "this provider does not see those patients."
* We only label people, not group practices. Organization records are excluded
  because a group's billing is an aggregate of many providers rather than a referable
  person.
* Public billing data suppresses small counts, so a missing code may have been
  performed and withheld for privacy rather than never performed. We never read a
  missing code as a negative without first confirming the provider is observed
  heavily enough for that absence to mean something.
* We do not consider the dollar amount of services. Payment amounts encode billing
  and site-of-service mix, not clinical focus, so we stick to patient and service
  counts in each provider's own mix of procedures.

## How we turn billing into predictions

**Tools.** We use frontier LLMs to handle the clinical ontology, reviewed by our
Chief Medical Officer: identifying referral targets, defining subspecialty workflows,
and characterizing provider billing profiles. However, LLMs do not calculate
magnitudes. Every weight, threshold, and prediction in the module is calculated via
deterministic analytics on claims data to maintain repeatability and explainability.

**Clinical context.** Our objective is to help match
routine referrals to the specialists who are genuinely the right fit. A patient who
needs diabetic retinopathy screening, for instance, should reach a general
ophthalmologist, not a retina surgeon. This guiding application affects the scope, training,
evaluation, and interpretation of this module:

1. **Target definitions.** We identify typical referral reasons per specialty; these
   include focus areas, common procedures, and a catch-all "generalist" target for
   every specialty.
2. **Provider matching.** Under the clinical context defined above, we leverage
   frontier LLMs to reason about which providers are appropriate for each target
   based on their billing fingerprints. These were sanity-checked by our Chief
   Medical Officer.
3. **Training and calibration.** We use machine learning to identify billing
   signatures that deterministically recapitulate the LLM-driven provider matching
   step. This converts potentially inconsistent LLM judgements into robust and
   explainable predictions. This step sometimes fails to produce a performant model.
   Read more about limitations below.

<Frame caption="Figure 2: Diagram of the methodology.">
  <img className="block dark:hidden" src="https://mintcdn.com/beeline/-4iOBXq3Q5kHZDjb/images/methodology/methodology-light.png?fit=max&auto=format&n=-4iOBXq3Q5kHZDjb&q=85&s=2a79675b66d5d3a29b61949cf6c9d2f5" alt="Diagram of the referral scope match methodology." width="1716" height="504" data-path="images/methodology/methodology-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/beeline/-4iOBXq3Q5kHZDjb/images/methodology/methodology-dark.png?fit=max&auto=format&n=-4iOBXq3Q5kHZDjb&q=85&s=2ca112d7684210bc382684893f61a207" alt="Diagram of the referral scope match methodology." width="1716" height="504" data-path="images/methodology/methodology-dark.png" />
</Frame>

## Why we sometimes only rule targets out

Not every referral target can be answered in both directions. For many routine
referral targets, billing data can confidently rule a provider out as a poor fit, but
cannot reliably rule them in. When that is the case, we make it clear (the
`rule_out_only` field in the endpoint response).

Whether a target can be ruled in at all is determined empirically, from the data, not
decided by hand.

To understand why, consider the ongoing management of heart failure. A focused
practice does leave billing traces, like the blood tests and imaging used to monitor
the condition. But none of these belong to heart failure alone: general cardiologists
order the same tests to work up other problems. Because the codes recur across all of
cardiology, a heavy share of them cannot separate the cardiologists who concentrate
on heart failure from those who touch it occasionally, so the evidence cannot rule in.
The reverse is firmer: a cardiologist who bills none of this workup can be confidently
set aside, because a genuine heart-failure practice does not leave that whole
footprint empty. The signal rules out, but it cannot rule in, and no additional
modeling recovers a positive trace that the claims never recorded.

<Frame caption="Figure 3: Each curve is colored by the label a provider at that operating threshold would receive. The left target shows a green (`likely_match`/`very_likely_match`) stretch up the left edge; the **rule-out-only** target has **no green at all**: its thresholds only ever reach `uncertain` or `unlikely_match`/`very_unlikely_match`, the visual signature of a target the data can rule out but cannot rule in.">
  <img className="block dark:hidden" src="https://mintcdn.com/beeline/-4iOBXq3Q5kHZDjb/images/methodology/roc_example-light.svg?fit=max&auto=format&n=-4iOBXq3Q5kHZDjb&q=85&s=de88f1b1a88ed5f67d61ff403a9f6625" alt="Two ROC curves: an affirm-capable target and a rule-out-only target, colored by the label at each operating threshold." width="846" height="364" data-path="images/methodology/roc_example-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/beeline/-4iOBXq3Q5kHZDjb/images/methodology/roc_example-dark.svg?fit=max&auto=format&n=-4iOBXq3Q5kHZDjb&q=85&s=c39fa514faba347e7963e1b5073f7d45" alt="Two ROC curves: an affirm-capable target and a rule-out-only target, colored by the label at each operating threshold." width="846" height="364" data-path="images/methodology/roc_example-dark.svg" />
</Frame>

## How we calibrate

We set the thresholds so that, on a uniform, representative sample drawn to represent
the target specialty population, a `likely_match` call matches the LLM reasoning at
least 80% of the time and a `very_likely_match` call at least 95% of the time. The
rule-out thresholds are set the same way against the same bar, so an `unlikely_match`
or `very_unlikely_match` call carries the matching guarantee on the exclusion side.

When a target model does not reach a minimum performance or positive/negative
predictive performance, it is omitted and recorded as omitted.

## Ongoing validation

Predicting scope of practice from billing data isn't new, but using it to judge
routine referral fit is. We're still learning where these predictions are strong and
where they're weak.

We treat validation as ongoing rather than a one-time gate: as our reference data
grows and as users surface corrections, we re-examine each target and revise or retire
it when the evidence no longer backs the call.

Two checks anchor this work. First, we perform clinical-consistency reviews to ask
whether a target's predictions cohere with independent clinical expectation: do the
specialists we rule in and rule out match how the specialty actually refers? We also
inspect the clinical validity of the weights assigned to billing codes during machine
learning. When possible, we interrogate the observed-versus-expected (O/E) enrichment
of providers' self-attested subspecialties against our predictions when there is a
strong match with a specific referral target.

<Frame caption="Figure 4: When a referral target maps to a named subspecialty, our matching predictions are highly enriched for that specialty. Here, Retina specialists (a specialty taxonomy introduced in 2017) are over 4x enriched over expected. Yet more than half of the providers we strongly predict as appropriate for retina-focused referrals do not list this specialty on their NPI profile.">
  <img className="block dark:hidden" src="https://mintcdn.com/beeline/-4iOBXq3Q5kHZDjb/images/methodology/retina_oe-light.svg?fit=max&auto=format&n=-4iOBXq3Q5kHZDjb&q=85&s=94477ff32ea7c13a90c37ae7e13d030c" alt="Observed-versus-expected enrichment of self-attested Retina specialists across prediction labels for the medical and surgical retinal care referral target." width="527" height="428" data-path="images/methodology/retina_oe-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/beeline/-4iOBXq3Q5kHZDjb/images/methodology/retina_oe-dark.svg?fit=max&auto=format&n=-4iOBXq3Q5kHZDjb&q=85&s=edb97d22fb29ec4e5359821d8dd5c7a3" alt="Observed-versus-expected enrichment of self-attested Retina specialists across prediction labels for the medical and surgical retinal care referral target." width="527" height="428" data-path="images/methodology/retina_oe-dark.svg" />
</Frame>

## Other limitations

**Some referral targets are billing-invisible.** Inflammatory bowel disease, for
instance, is treated largely through prescriptions rather than billed infusions, so
most of the providers who manage it do not look distinctive in claims. We therefore
label the target as omitted and do not make predictions.

**Referral targets may change.** Though we'll do our best to keep the API stable,
methodological improvements may mean we change target definitions where appropriate.

**Not all specialties are present.** For this initial release, we focused on some of
the most common specialties that patients are referred to in an ambulatory setting.
Let us know if there's a specialty you're eager to see included in the next release.

**Billing data is incomplete and dated.** The billing data used in this module is
from 2024 and reflects care provided to Medicaid and traditional Medicare patients. A
provider may provide significantly different care to other populations, may have
changed their scope of practice, or may provide services not reflected in billing
data (for example, cash pay).

<Info>
  Want more recent data, or to augment predictions with your own dataset? Reach out to
  learn more.
</Info>

**Providers work in teams.** This module currently makes predictions about individual
providers. In reality, patients are referred to specialty clinics with many providers.
Future modules will connect this work to location and affiliation predictions.

<Info>
  Did you find an error or limitation? Please let us know by reaching out to
  [corrections@threshold.health](mailto:corrections@threshold.health).
</Info>

## What this module is not

This module reports a destination-fit signal. It is not a credentialing, licensure,
or privileging source, and it does not assert what a provider is qualified or
permitted to do. It reflects observed Medicare and Medicaid billing, so a provider who
practices primarily under commercial insurance, or who is newly in practice, may be
observed too thinly to judge. That is precisely what the `insufficient_data` label is
for. The referring clinician's judgment remains the decision. Our aim is to make that
decision better informed at the moment it is made, not to replace it.
