Adding a Payer
Adding a payer requires 3 changes in payer.sql and network configuration.
Steps
3 Changes in payer.sql
Change 1 — payer_ids list
Add the new payer as a quoted string in the Jinja2 payer_ids set.
{% set payer_ids = ['169', '42', '101', '643', ..., '999'] %}
-- ^^^
-- Add new payer_id as a quoted string
Change 2 — definitive_payer_id CASE block
Map the new payer to its Definitive Healthcare entity IDs. Use NULL if the payer has no Definitive Healthcare record.
CASE
WHEN payer_payer_id = 643 THEN ARRAY[100001, 100002] -- UHC
WHEN payer_payer_id = 42 THEN ARRAY[200001] -- Aetna
...
WHEN payer_payer_id = 999 THEN ARRAY[123456] -- New payer (or NULL if none)
ELSE NULL
END AS definitive_payer_id
Change 3 — blue_payer IN clause
Only required if the payer is a BCBS plan. Add the payer_id to the IN clause that sets blue_payer = True.
CASE
WHEN payer_payer_id IN (
169, 170, 171, ..., 999 -- Add here ONLY if this is a BCBS plan
) THEN True
ELSE False
END AS blue_payer
Payer without networks does nothing. A payer added to payer.sql but without network entries will have no ROIDs — and therefore no rates in the output. Always follow up with network configuration.
Definitive IDs can be NULL. Not all payers have Definitive Healthcare records. A NULL definitive_payer_id doesn't break anything — it just means the payer won't join to Definitive-sourced data.
Hospital-MRF-only payers: Some payers (e.g., Exchange plans) only appear in hospital MRF files, not in payer MRF files. They still require a payer.sql entry plus network configuration in network_mappings.py and variables_XXX.sql.