ROID — Rate Object ID
A ROID uniquely identifies a pricing question. It's a 24-character hex string (first 12 bytes of SHA256) derived from 9 fields.
The 9 ROID Components
| Field | Example | Source | Notes |
|---|---|---|---|
provider_type | 'Hospital' | provider_spine | Determines which code plausibility rules apply |
payer_id | '643' | network_spine | Partition key for all downstream chunking |
network_id | '-4821937561028374920' | network_spine | Deterministic xxhash64 of payer_id || network_name |
provider_id | 'abc123' | provider_spine | Clear Rates internal provider identifier |
bill_type | 'Inpatient' | code_spine | Inpatient / Outpatient / Professional |
billing_code | '470' | code_spine | The procedure or DRG being priced |
billing_code_type | 'MS-DRG' | code_spine | HCPCS, MS-DRG, APR-DRG |
facility | '' (empty) | code_spine | 'true'/'false' for PG codes, '' for all others |
billing_code_modifier | '' | code_spine | e.g. '26' (professional component), '' if none |
Hash Formula
ROID hash — Trino SQL
-- rate_object_space.sql
to_hex(
substr(
sha256(
json_format(
CAST(
ARRAY[
provider_type,
payer_id,
CAST(network_id AS VARCHAR),
provider_id,
bill_type,
billing_code,
billing_code_type,
facility,
billing_code_modifier
] AS JSON
)
)
),
1, 12
)
) AS roid
Worked Example
ROID generation — UHC Choice Plus PPO + Mass General + MS-DRG 470
payer_id:
'643' (UHC)network_id:
'-4821937561028374920' — xxhash64 of '643' || 'UHC Choice Plus PPO'provider_type:
'Hospital'provider_id:
'mgh_boston_001' (Mass General's Clear Rates internal ID)bill_type:
'Inpatient'billing_code:
'470'billing_code_type:
'MS-DRG'facility:
'' (empty — Hospital provider type)billing_code_modifier:
'' (no modifier for MS-DRG)9 fields assembled → JSON array → SHA256 → first 12 bytes → 24-char hex ROID. This ROID is inserted into tmp_rate_object_space. Every downstream phase (raw data, transformations, imputations, accuracy, rate selection) joins to this ROID to add columns.
warning
ROID depends on network_id, not network_name. network_id is the xxhash64 of (payer_id || network_name), so renaming a network changes its network_id, which changes all ROIDs for that network. Historical rates from prior Clear Rates versions won't join to the new ROIDs — they will appear as gaps rather than carrying forward.