Skip to main content

Provisions

TypeDescriptionKey DistinctionSource
Medical IPInpatient base rates, per diem amounts, and percentage-of-charges ratesClaim-level; applies to entire inpatient stayMRF / Clear Rates
Medical OPOutpatient surgical group (OPG) base rates and percentagesProcedure-group-level; organized by OPG codeMRF / Clear Rates
Drug CarveoutsHigh-cost pharmaceutical reimbursement ratesLine-level; triggered by revenue code 636MRF / Core Rates
Implant CarveoutsHigh-cost implant ratesLine-level; triggered by revenue codes 275–278MRF / Core Rates
StoplossClauses that trigger a different reimbursement method when a claim exceeds a thresholdClaim-level; activates only above a dollar or LOS thresholdMRF notes + Claims remits

Architecture

All provision types are computed independently and unioned into a single final table, enriched with provider, payer, and network metadata from spines.

SOURCE SYSTEMS
├─ Hospital Rates (MRF) glue.hospital_data.hospital_rates
├─ Core Rates tq_production.public_*.core_rates
├─ Claims Remits (Komodo) tq_intermediate.external_komodo.remits
└─ Spines tq_production.spines.*



PROVISION STREAMS
├─ Medical IP → provisions_medical_inpatient_{subversion}
├─ Medical OP → provisions_medical_outpatient_base_rates_{subversion}
├─ Drug Carveouts → provisions_drugs_combined_{subversion}
├─ Implant Carveouts → provisions_implants_combined_{subversion}
└─ Stoploss → provisions_stoploss_combined_{subversion}



FINAL UNION
└─ provisions_final_{subversion}

Final Output Table

provisions_final_{subversion} — one row per provision instance.

provision_type values:

ValueStream
IP Base RateMedical IP
IP Per DiemMedical IP
IP PercentageMedical IP
OP Surg GroupMedical OP
OP PercentageMedical OP
High Cost DrugsDrug Carveouts
High Cost ImplantsImplant Carveouts
Stoploss ThresholdStoploss
Stoploss PercentageStoploss
Stoploss Per DiemStoploss
Full schema
ColumnTypeDescription
payer_idINT
payer_nameVARCHAR
provider_idVARCHAR
provider_nameVARCHAR
network_idBIGINT
network_nameVARCHAR
network_typeVARCHAR
settingVARCHAR'Inpatient' or 'Outpatient'
unique_idVARCHARComposite key for this provision row
contract_idVARCHARprovider_id-payer_id-network_id
provision_typeVARCHAROne of the 10 values above
provision_subtypeVARCHAROPG code for OP Surg Group; NULL otherwise
provision_valueDOUBLENumeric value of the provision
traceability_idBIGINTSource rate ID

DAG

The full pipeline runs as a single Airflow DAG: clear_rates_provisions (manually triggered).

Task groups run in this order:

  1. medical_inpatient_group — inpatient base, per diem, and percentage provisions
  2. medical_outpatient_group — outpatient OPG and percentage provisions
  3. stoploss_group — 21-task stoploss pipeline (MRF extraction + remits + inference)
  4. carveout_groups — drugs and implants carveout pipelines (parallel)
  5. final_provisions — union of all streams into provisions_final
DAG parameters
ParameterDescriptionExample
clear_rates_schemaSource CLD schematq_dev.internal_dev_csong_cld_v2_3_2
target_schemaOutput schematq_dev.internal_dev_mmalhotra_provisions
clear_rates_subversionDate suffix for CLD source tables2025_10
core_rates_monthMonth suffix for core rates source2025_10
subversionVersion suffix for output tables2025_12
remits_subversionVersion suffix for remits source2026_01