Skip to main content
Version: 3.0

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:

Payerpayer_idparams.py variable
UnitedHealthcare643OPG_SCHEDULES_UNITED
Aetna7OPG_SCHEDULES_AETNA
Cigna76OPG_SCHEDULES_CIGNA
BCBS California403OPG_SCHEDULES_BCBS_CA
CareFirst44OPG_SCHEDULES_CAREFIRST
Anthem CA (CA Blue Cross PPO only)42OPG_SCHEDULES_ANTHEM_CA
Florida Blue388OPG_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 detection (simplified)
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:

ConditionThreshold
High coverage within groupfreq / total > 80% and total > 100 codes observed
High coverage vs. full grouperfreq / 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

UHC PPO, Hospital Z — Grouper 'Tier 2 Surgery'
Grouper schedule: UHC's OPG schedule assigns 40 HCPCS codes to grouper "Tier 2 Surgery". All are expected to pay the same rate.
Observed rates: 35 of those 40 codes have a negotiated rate of $2,800 in the hospital MRF. The remaining 5 have no MRF entry.
Frequency check: 35 / 40 = 87.5% → passes the 80% threshold. 35 > 100? No. But 35 / 40 = 87.5% > 50% of total_possible → passes second threshold.
Detected base rate: opg_base_rate = $2,800 (rounded to nearest $10).
Impute 5 missing codes: Each gets imputed_rate = $2,800.
opg_base_rate = $2,800 | 5 codes imputed | sourced from imputations_derived
OPG vs CSTM

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.