OPG Surgical Grouper Imputation
Some payers price outpatient surgery using a grouper-based contract: each HCPCS code is assigned to a procedure tier, and all codes in the same tier share the same negotiated rate. The OPG (Outpatient Procedure Grouper) imputation detects the rate per tier from observed MRF data and fills in missing codes within the same grouper.
Payer Coverage
OPG imputations are only active for payers that have a published surgical grouper reference table:
| Payer | payer_id | params.py variable |
|---|---|---|
| UnitedHealthcare | 643 | OPG_SCHEDULES_UNITED |
| Aetna | 7 | OPG_SCHEDULES_AETNA |
| Cigna | 76 | OPG_SCHEDULES_CIGNA |
| BCBS California | 403 | OPG_SCHEDULES_BCBS_CA |
| CareFirst | 44 | OPG_SCHEDULES_CAREFIRST |
| Anthem CA (CA Blue Cross PPO only) | 42 | OPG_SCHEDULES_ANTHEM_CA |
| Florida Blue | 388 | OPG_SCHEDULES_FLORIDA_BLUE |
Each reference table maps (billing_code, billing_code_type) → grouper. All HCPCS codes that share a grouper are expected to share the same negotiated rate under a grouper-based contract.
Detection Logic
For each (payer_id, network_id, provider_id, grouper) combination, the pipeline finds the most frequently observed dollar rate among Outpatient HCPCS codes in that grouper:
opg_grouper_ranked AS (
SELECT
payer_id, network_id, provider_id,
grouper,
ROUND(rate, -1) AS rate, -- rounded to nearest $10
COUNT(DISTINCT roid) AS freq,
ROW_NUMBER() OVER (
PARTITION BY payer_id, network_id, provider_id, grouper
ORDER BY COUNT(*) DESC
) AS rnk
FROM long_rates
JOIN opg_schedules USING (payer_id, billing_code, billing_code_type)
WHERE bill_type = 'Outpatient'
AND rate_type NOT LIKE '%perc%' -- dollar rates only
GROUP BY 1, 2, 3, 4, 5
)
The top-ranked rate activates only if it clears one of two confidence thresholds:
| Condition | Threshold |
|---|---|
| High coverage within group | freq / total > 80% and total > 100 codes observed |
| High coverage vs. full grouper | freq / total_possible > 50% of all codes in the payer's schedule |
If neither is met, opg_base_rate is set to NULL and no imputation occurs for that grouper.
Application
Once the grouper base rate is confirmed, every missing code assigned to that grouper gets the same rate:
imputed_rate = opg_base_rate
The grouper assignment comes directly from the payer's reference table — a code's grouper is fixed by the schedule, not inferred from the data.
Walk-Through
opg_base_rate = $2,800 (rounded to nearest $10).imputed_rate = $2,800.Both OPG and CSTM use surgical grouper reference tables, but they operate at different stages. OPG is part of imputations_derived and detects the most common observed rate per grouper from MRF data. CSTM (imputations_cstm) is a separate late-stage pass that uses tier averages from core_rates and runs after the main derived imputation chain.