Skip to main content
Version: 3.0

Traceability

Two traceability tables connect every final canonical rate back to its raw MRF source.

Why Traceability

Customer disputes, regulatory compliance, and data debugging all require knowing exactly where a rate came from. Traceability makes it possible to answer: "Which MRF file did this rate come from, and which record in that file?"

Two Traceability Tables

TableWhat It ContainsBuilt By
prod_traceability_to_raw_dataMaps canonical_rate → source MRF file, raw record ID, ingestion datebuild_traceability_to_raw_data() in orchestrator
prod_traceability_formulasDocuments computation formula for derived rates (e.g., "81% × $22,800 hospital gross charge")build_traceability_formulas_table() in orchestrator

Walk-Through: Tracing a Rate

canonical_rate $18,500 — MS-DRG 470 at Mass General, Aetna PPO
Starting point: canonical_rate = \$18,500, canonical_rate_type = "raw: payer_negotiated_rate", canonical_rate_subversion = "2024_11"
Step 1: Join prod_traceability_to_raw_data on (roid, canonical_rate_subversion).
Step 2: Result: Aetna PPO MRF file aetna_machine_readable_2024_11.json, row_id 4829301, ingested 2024-11-08.
The $18,500 rate came from Aetna's November 2024 MRF file, row 4829301. If the customer disputes it, you can point directly to the published file and the specific record.

Traceability for Derived Rates

For percentage-to-dollar transforms and other derived rates, prod_traceability_formulas stores the full computation formula so the derivation is auditable:

  • canonical_rate_type: 'transform: hospital_perc_of_total_billed_charges_gc_hosp_perc_to_dol'
  • formula: 0.81 × 22800 = 18468

This makes it possible to explain not just "the rate came from the hospital MRF" but "the hospital MRF reported 81% of charges, and the gross charge used was $22,800."

Traceability runs in the orchestrator, not the sub-DAG

Traceability tables need the final merged canonical rates across all sub-versions before they can record which sub-version and raw record each canonical rate came from. They cannot be built until after the orchestrator merge step completes.