Skip to main content

Drug Carveouts

Drug carveout provisions capture the reimbursement terms for high-cost pharmaceuticals billed separately from the base DRG or facility rate. Identified by revenue code 636 (IV solutions and pharmacy charges) in the MRF.

Example: A contract pays MS-DRG rates for the hospitalization but separately reimburses chemotherapy drugs at 80% of billed charges.

See also: Implant Carveouts


Classification

FieldValuesDescription
provision_typeHigh Cost DrugsFixed value for all drug carveout rows
provision_valueDOUBLEReimbursement rate (percentage of charges)
settingInpatient, OutpatientClaim setting

Architecture

SOURCE SYSTEMS
├─ Core Rates tq_production.public_*.core_rates
└─ Hospital Rates glue.hospital_data.hospital_rates



Core Rates path (negotiated_type = 'percentage', rev code 636)
├─ provisions_drugs_core_rates_base_{subversion}
└─ provisions_drugs_aggregated_core_rates_{subversion}

Hospital MRF path (rev code 636)
├─ provisions_drugs_hospital_rates_base_{subversion}
└─ provisions_drugs_aggregated_hospital_rates_{subversion}

↓ UNION

provisions_drugs_combined_{subversion}

Pipeline

Rates from two sources — core rates and hospital MRF rates — are extracted, aggregated, and unioned into a single output table.

StepTableDescription
1provisions_drugs_core_rates_baseRaw core rates filtered to revenue code 636 with negotiated_type = 'percentage'
2provisions_drugs_hospital_rates_baseHospital MRF rates filtered to revenue code 636 with contract_methodology = 'percent of total billed charges', Commercial payer class only
3provisions_drugs_aggregated_core_ratesCore rates aggregated to (payer, provider, network, setting) level — computes min, max, avg, median, mode
4provisions_drugs_aggregated_hospital_ratesHospital rates aggregated to (payer, provider, network, setting) level — same statistics
5provisions_drugs_combinedSources cross-validated, canonical rate selected, and unioned into one row per contract group; feeds into provisions_final as High Cost Drugs

Setting Classification

Setting is derived from the service_code (CMS place-of-service code) on each rate record, not from the revenue code itself. A rate with a NULL or empty service code is emitted into both settings via UNION ALL.

SettingService Codes
Outpatient01, 10, 11, 20, 22, 23, 24, 49, 62, 65, 72, 81, NULL / empty
Inpatient21, 25, 34, 55, 61, NULL / empty

Rate Normalization

Raw percentage values are normalized to a [1, 100] scale before aggregation. Rates outside this range are set to NULL and excluded.

Core ratesnegotiated_rate: if the raw value is less than 1, it is multiplied by 100 (decimal form). Result is rounded to 2 decimal places.

Hospital ratesnegotiated_percentage: same decimal-to-percent conversion. If negotiated_percentage is NULL but negotiated_dollar and gross_charge are both present and positive, the percentage is derived as (negotiated_dollar / gross_charge) × 100.


Aggregation

Each base table is aggregated to the (payer_id, provider_id, network_id, billing_code, setting) grain. For every group the following statistics are computed:

ColumnDescription
min_rateMinimum rate across all source rows
max_rateMaximum rate
avg_rateMean rate (rounded to 2 decimal places)
median_rateMedian rate
mode_rateMost frequently occurring rate
num_ratesCount of distinct rate values
rate_id_countCount of distinct source rate IDs

Canonical Rate Selection

After aggregation the two sources are unioned and a single canonical rate is chosen per contract group (payer_id, provider_id, network_id, setting).

Cross-validation — a rate metric (max or median) is marked as validated when both the payer source and the hospital source agree within 5 percentage points and the rate is below 100.

Best rate priority (applied independently per source, then across both):

  1. max_rate — if cross-validated
  2. median_rate — if cross-validated
  3. max_rate < 100 (not validated, but within expected range)
  4. median_rate < 100
  5. max_rate (fallback, any value)
  6. median_rate (final fallback)

Source ranking — within each source, revenue code 636 rows are preferred over any other code. Within the same code, validated and in-range rows rank higher; higher best-rate values break ties. The top-ranked row across both sources becomes the canonical row.

The canonical_source field records whether the winning row came from 'payer' (core rates) or 'hospital' (MRF rates). canonical_validated indicates whether the rate was cross-validated.


unique_id Construction

unique_id is a string key composed as:

payer_id || network_id || provider_id || billing_code (leading zeros stripped) || setting_code || in_clear_rates_flag

Where setting_code is 'OP' or 'IP' and in_clear_rates_flag is '1' if the network was matched in the Clear Rates spine, '0' otherwise.

Combined output schema
ColumnTypeDescription
payer_idVARCHAR
payer_nameVARCHAR
provider_idVARCHAR
provider_nameVARCHAR
network_idBIGINT
network_nameVARCHAR
settingVARCHAR'Inpatient' or 'Outpatient'
in_clear_ratesBOOLEANWhether the network was matched in the Clear Rates spine
canonical_unique_idVARCHARunique_id of the winning source row (becomes unique_id in final)
canonical_rateDOUBLESelected reimbursement rate (becomes provision_value in final)
canonical_sourceVARCHAR'payer' or 'hospital' — which source the canonical rate came from
canonical_billing_codeVARCHARRevenue code from the canonical source row
canonical_metricVARCHAR'max' or 'median' — which statistic was used
canonical_validatedBOOLEANWhether the rate was cross-validated across both sources
hospital_best_rateDOUBLEBest rate from the hospital source
hospital_metric_usedVARCHARMetric used for hospital best rate
payer_best_rateDOUBLEBest rate from the payer (core rates) source
payer_metric_usedVARCHARMetric used for payer best rate
hospital_source_idBIGINTSource hospital rate ID for traceability
payer_source_idBIGINTSource payer rate ID for traceability
canonical_source_idBIGINTSource ID of the canonical row

Revenue Code Reference

Revenue CodeDescription
636Drugs requiring detailed coding — IV solutions, pharmacy charges, high-cost pharmaceuticals