> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.joincandidhealth.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.joincandidhealth.com/_mcp/server.

# Reference Data

> Payers, plans, providers, facilities and non-insurance payers in Candid Data Share

The master data the other tables point to: payers, payer plans, providers, service facilities and non-insurance payers.

## Tables

| Table                                                                                 | One row per         | Primary key                        | [Shape](/data-share/data-model#table-shapes) |
| ------------------------------------------------------------------------------------- | ------------------- | ---------------------------------- | -------------------------------------------- |
| [`export_payer`](/data-share/reference-data/export-payer)                             | Payer               | `payer_uuid`                       | Current state                                |
| [`export_payer_plan_group`](/data-share/reference-data/export-payer-plan-group)       | Payer plan          | `payer_plan_group_id`              | Current state                                |
| [`export_provider`](/data-share/reference-data/export-provider)                       | Provider            | `organization_provider_id`         | Current state                                |
| [`export_service_facility`](/data-share/reference-data/export-service-facility)       | Service facility    | `organization_service_facility_id` | Current state                                |
| [`export_non_insurance_payer`](/data-share/reference-data/export-non-insurance-payer) | Non-insurance payer | `id`                               | Current state                                |

## Notes

* **An encounter's payer:** join `export_encounter.subscriber_primary_payer_plan_group_id` (or the secondary or tertiary column) to `export_payer_plan_group.payer_plan_group_id`, then `payer_uuid` to `export_payer`.
* **Providers:** join on `npi` and `organization_id`, and filter `is_billing` or `is_rendering`.
* **Service facilities:** join `export_encounter.service_facility_id` to `export_service_facility.organization_service_facility_id`.
* **Non-insurance payers:** join `non_insurance_payer_id` on `export_encounter` or `export_patient_non_insurance_payer_history` to `export_non_insurance_payer.id`.
* **`export_provider` has no deleted-row marker.** Reload this small table in full rather than incrementally.

## Common queries

### Encounters with their billing provider

```sql
SELECT
  e.encounter_id,
  e.billing_provider_npi,
  p.first_name,
  p.last_name,
  p.taxonomy_code
FROM export_encounter e
LEFT JOIN export_provider p
  ON p.npi = e.billing_provider_npi
  AND p.organization_id = e.organization_id
  AND p.is_billing
```