Revenue Code (RC) Imputations
Use revenue code rates from payer and hospital MRFs to impute MS-DRG and HCPCS codes. RC = Revenue Code — the 4-digit codes hospitals use to report services at departmental level.
Why Revenue Codes
Some hospitals report rates at revenue code family level (e.g., "Operating Room" RC 036x) without breaking down by individual HCPCS procedure codes. A hospital might post a single OR rate covering hundreds of distinct surgical procedures. RC imputations reverse-engineer HCPCS and MS-DRG rates from these family-level prices, expanding coverage significantly.
Three RC Imputation Types
RC Global — Inpatient MS-DRG Imputation
Detects a global inpatient percentage or per diem rate shared across many revenue codes and uses it to impute MS-DRG dollar rates.
Data Sources
Both payer MRF and hospital MRF revenue code data feed this imputation:
| Source | Table | Filter |
|---|---|---|
| Payer MRF | core_rates (billing_code_type = 'RC') | Inpatient codes only: 00xx, 01xx, 020x, 021x |
| Hospital MRF | hospital_rates via plan bridge | All RC codes with negotiated_percentage IS NOT NULL or contract_methodology = 'per diem' |
Hospital percentage normalization:
ROUND(
CASE
WHEN negotiated_percentage < 1 THEN negotiated_percentage * 100 -- decimal (0.50 → 50)
WHEN negotiated_percentage > 1000 THEN negotiated_percentage / 100 -- basis points
ELSE negotiated_percentage -- already a percent
END, 0 -- rounded to nearest whole number
) AS rate
is_global Flag
A (provider, payer, network, negotiated_type, rate) group is flagged is_global = True when it covers both:
- At least one Room & Board code:
0110, 0111, 0113, 0117, 0119, 0120, 0121, 0123, 0127, 0129, 0140, 0149 - At least one ICU code:
0200, 0201, 0202, 0203, 0204, 0206, 0207, 0208, 0209
The logic: a single rate applying to both room & board and ICU reflects a global inpatient contract structure that can impute any MS-DRG.
Winning Rate Selection
Among all rate groups for a (provider, payer, network):
ROW_NUMBER() OVER (
PARTITION BY payer_id, network_name, provider_id
ORDER BY n_codes DESC, rate DESC -- most codes wins; ties go to higher rate
)
Only the rn = 1 row with is_global = True feeds into the MS-DRG imputation. The rn = 1 per diem row feeds into the rc_global_per_diem_mult_glos variant.
Source table: tmp_int_imputations_rc_global_{sub_version}
Imputation Variants
The selected global percentage or per diem is applied to different gross charge sources to produce a dollar rate:
| Rate Type | Formula |
|---|---|
rc_global_gc_hosp_base_perc_to_dol | rate% × provider MRF gross charge |
rc_global_gc_hosp_cbsa_base_perc_to_dol | rate% × CBSA median gross charge × adjustment |
rc_global_gc_hosp_state_base_perc_to_dol | rate% × state median gross charge × adjustment |
rc_global_gc_komodo_base_perc_to_dol | rate% × Komodo provider gross charge |
rc_global_gc_komodo_cbsa_base_perc_to_dol | rate% × Komodo CBSA median × adjustment |
rc_global_gc_komodo_state_base_perc_to_dol | rate% × Komodo state median × adjustment |
rc_global_per_diem_mult_glos | per_diem_rate × Medicare geometric length of stay |
Provider-level variants (_hosp_base_, _komodo_base_) are preferred. CBSA and state medians serve as fallbacks when provider-level gross charges are unavailable.
To understand a rc_global_gc_* rate in prod_combined_all, check rc_global_inpatient_base_rate (the raw percentage before dividing by 100), canonical_gross_charge, and canonical_gross_charge_type (which gross charge source was used). The full rate group — including all RC codes that drove the is_global flag — is in tmp_int_imputations_rc_global_{sub_version}.
RC Carveout — RC Family → MS-DRG Mapping
Where RC Global assigns a single global rate across all MS-DRGs, RC Carveout assigns family-specific rates to MS-DRGs that are primarily associated with a particular RC family (e.g., Room & Board, Obstetrics, ICU). It uses a Jaccard similarity score to match a rate group's revenue codes against each family's expected code set.
How It Works
- Take the RC Global rate groups from
tmp_int_imputations_rc_global_{sub_version}(all rows, not justis_global = True) - Compute Jaccard similarity between each group's
billing_code_arrayand each RC family's canonical code set (rc_group_familyreference table):
jaccard_index = |intersection| / |union|
- Rank groups per RC family: for each (provider, payer, network, rc_family), rank by
jaccard_index DESC - Filter to quality matches: only
rank = 1ANDjaccard_index > 0.25 - Map to MS-DRG via
rc_msdrg_affiliations: each RC family maps to a set of affiliated MS-DRGs
Source table: tmp_int_imputations_rc_carveouts_{sub_version}
Practical Effect
A hospital might post separate rates for Room & Board codes vs. ICU codes. RC Carveout detects the best-matching rate for each family and applies it only to the MS-DRGs affiliated with that family, rather than using one global rate for all DRGs.
Supported families include: RB (Room & Board), ICU, OB (Obstetrics), and others defined in tq_intermediate.cld_utils.rc_group_family.
The resulting imputation types in prod_combined_all are:
rc_family_gc_hosp_perc_to_dol/rc_family_gc_komodo_perc_to_dol(and CBSA/state variants)rc_family_per_diem_mult_glos
RC HCPCS — Revenue Code → HCPCS Mapping
Maps RC rates from both payer and hospital MRFs to individual HCPCS codes using the rc_to_hcpcs_cross_validated_75 crosswalk, which captures the empirical relationship between revenue codes and procedure codes observed across MRF data.
Data Sources
Same dual-source approach as RC Global:
| Source | Filter |
|---|---|
Payer MRF (core_rates) | billing_code_type = 'RC', joined to RC → HCPCS crosswalk |
Hospital MRF (hospital_rates) | case rate (dollar) or percentage entries, joined to crosswalk via plan bridge |
Hospital percentage normalization uses the same <1 / >1000 / else rounding logic as RC Global.
Crosswalk: rc_to_hcpcs_cross_validated_75
Each row in the crosswalk maps one revenue_code to one hcpcs code within an rc_family grouping. A revenue code can map to many HCPCS codes; the crosswalk is cross-validated to include only relationships observed in at least 75% of hospitals that report both codes.
Rate Selection
For each (provider, payer, network, rc_family, hcpcs), the highest rate wins:
ROW_NUMBER() OVER (
PARTITION BY payer_id, network_id, provider_id,
CASE WHEN negotiated_type = 'percentage' THEN 'percentage'
ELSE 'case rate' END,
rc_family, hcpcs
ORDER BY rate DESC
)
WHERE rn = 1 AND negotiated_type = 'percentage'
Source table: tmp_int_imputations_rc_hcpcs_{sub_version}
The resulting imputation types in prod_combined_all are:
rc_hcpcs_gc_hosp_perc_to_dol/rc_hcpcs_gc_komodo_perc_to_dol(and CBSA/state variants)
RC imputations are not the final imputation output. They feed into imputations_derived.sql alongside long rates, providing additional rate observations for the tier aggregations. A rate derived from an RC crosswalk competes against rates from other sources under the standard tier selection logic.