Skip to main content
Version: 3.0

Stage 7: Rate Selection

By the time rate selection runs, each ROID has dozens of candidate rates across raw, transformed, and imputed columns — all scored 0–7. Rate selection picks the one winner per ROID and writes it to canonical_rate.

How All Sources Come Together

Rate selection reads from tmp_int_accuracy_brit — every rate column and its _validation_score are present on a single wide row per ROID. Rate selection does not join anything new. All the work of scoring happened upstream in the accuracy stages.

1
BRIT Accuracy Table
One row per ROID with every rate column and its corresponding _validation_score. Input to rate selection — no additional joins needed.
tmp_int_accuracy_brit
2
Build Rate Arrays
Collect all non-NULL rate columns into parallel arrays: values, scores, sources, types, and methodologies. Array position is consistent across all arrays — position i in rate_array corresponds to position i in rate_score_array.
3
Select Canonical Rate
array_max(rate_score_array) finds the highest score. ARRAY_POSITION extracts the index. All canonical_* fields are populated from that index across the parallel arrays.
tmp_int_combined_no_whisp
4
Add Whispers
Optional enrichment step. Dimensional summary statistics are computed and joined in, adding context without affecting canonical rate selection.
tmp_int_combined

Canonical Rate Score Translation

Canonical ScoreInternal ScoreMeaning
57.xPayer + hospital MRF independently agreed within ±20%
46.xSingle MRF source, within outlier bounds
34.x or 5.xWithin bounds, no counterparty validation
22.x or 3.xImputed estimate
11.xOutlier — outside all acceptable bounds
00No rate — ROID has no usable data

Output Columns

ColumnMeaningExample
canonical_rateThe selected dollar amount18500.00
canonical_rate_score1–5 confidence5
canonical_rate_sourceWhich source won"payer_hospital"
canonical_rate_typeExact rate column with prefix"raw: payer_negotiated_rate"
canonical_contract_methodologyHospital's contract methodology"Fee Schedule"
canonical_rate_class"Raw", "Transform", or "Impute""Raw"
canonical_gross_charge_typeGC source for enhanced rates"mrf_gross_charge_cbsa_median"

Common Filters

FilterSQLUse Case
Non-outlier ratescanonical_rate_score > 1Primary analysis
Any rate existscanonical_rate_score > 0Coverage counts
No ratecanonical_rate_score = 0Gap analysis
Validated onlycanonical_rate_score = 5Highest confidence
Raw rates onlycanonical_rate_class = 'Raw'Exclude imputations
QA tip

Always filter on canonical_rate_score > 1 to exclude outliers, or canonical_rate_score > 0 to exclude empty ROIDs. A canonical_rate_score = 1 row has a rate value, but it failed outlier bounds and should not be used for analysis without careful review.