Bounteous × EmpiRx · Synthetic Demo
Deriving & verifying claims mappings with agents
No standard fully governs a PBM's data — so mappings can't be looked up, they must be derived from the pipeline and proven. Watch the agents calibrate on a known source-to-Gold mapping, then map a brand-new source with per-field confidence — Direct, Probable, or Gap.
What you're looking at
Landing a new claims system into an unchanged reporting model
EmpiRx is migrating its claims platform (Tredium → RxLogic). Their Databricks Gold reporting tables must not change — everything downstream depends on them. The task: make a brand-new source feed those same Gold tables, without anyone being able to look the mapping up. These agents derive the mapping and prove it. Run the three stages in order:
Calibrate on the known system
Prove the agent recovers the existing mapping the client can already check.
Map the new source
Classify each Gold column Direct / Probable / Gap, with a confidence score.
QA the uncertain ones
A second agent scrutinizes low-confidence mappings and flags honest gaps.
The data
Same concepts, different systems
The Gold contract is fed by Platform A today. We're migrating to Platform B — same concepts, entirely different structure. Expand each to see the fields (synthetic, but realistic).
SourcePlatform A · legacy claims extract (Tredium-like)22 fields · click to expand
The current source of record. Flat file, cryptic column names, integer dates (YYYYMMDD), amounts in cents, numeric status codes.
| CLM_ID | string | CLM00194233 |
| TX_STAT_CD | code | 1 |
| CRDHLDR_ID | string | M00832145 |
| SVC_DT | integer | 20260512 |
| PROD_SVC_ID | string | 00093720198 |
| DRUG_LBL_NM | string | ATORVASTATIN 20MG TAB |
| QTY_DISP | integer | 30000 |
| DAYS_SUP | integer | 30 |
| RX_NBR | string | RX8842013 |
| FILL_NUM | integer | 0 |
| DAW_CD | code | 0 |
| PRSCRBR_NPI | string | 1487652093 |
| PHARM_NPI | string | 1275839201 |
| ING_CST_SUB | integer | 1244 |
| DISP_FEE_SUB | integer | 125 |
| SLS_TAX_AMT | integer | 0 |
| GRS_AMT_DUE | integer | 1369 |
| PAT_PAY_AMT | integer | 1000 |
| PLAN_PD_AMT | integer | 369 |
| PHARM_REIMB_AMT | integer | 1369 |
| FRMLRY_TIER | code | 1 |
| CMPND_CD | code | 1 |
TargetGold · claims_fact22 fields · click to expand
The existing business-ready claims table. Downstream reports and apps depend on it. Unchanged by the migration.
| claim_id | string | CLM00194233 |
| claim_status | code | PAID |
| member_id | string | M00832145 |
| date_of_service | date | 2026-05-12 |
| ndc | string | 00093720198 |
| drug_name | string | ATORVASTATIN 20MG TAB |
| quantity_dispensed | decimal | 30.000 |
| days_supply | integer | 30 |
| rx_number | string | RX8842013 |
| fill_number | integer | 0 |
| daw_code | code | 0 |
| prescriber_npi | string | 1487652093 |
| pharmacy_npi | string | 1275839201 |
| ingredient_cost | money | 12.44 |
| dispensing_fee | money | 1.25 |
| sales_tax | money | 0.00 |
| gross_amount_due | money | 13.69 |
| patient_pay_amount | money | 10.00 |
| plan_paid_amount | money | 3.69 |
| amount_reimbursed_pharmacy | money | 13.69 |
| formulary_tier | code | 1 |
| compound_code | code | 1 |
SourcePlatform B · RxLogic API (target source)20 fields · click to expand
The new cloud-native source. Nested JSON, camelCase names, ISO-8601 dates, dollar decimals, string statuses. Same concepts, entirely different structure. Some Gold columns have no clean source.
| transactionId | string | CLM00194233 |
| status | string | PAID |
| patient.memberId | string | M00832145 |
| serviceDate | date | 2026-05-12 |
| drug.ndc11 | string | 00093720198 |
| drug.description | string | ATORVASTATIN 20MG TAB |
| drug.isCompound | boolean | false |
| fill.quantityDispensed | decimal | 30.0 |
| fill.daysSupply | integer | 30 |
| fill.rxNumber | string | RX8842013 |
| fill.fillSequence | integer | 0 |
| dawCode | code | 0 |
| prescriber.npi | string | 1487652093 |
| pharmacy.npi | string | 1275839201 |
| pricing.ingredientCost | decimal | 12.44 |
| pricing.dispensingFee | decimal | 1.25 |
| pricing.totalAmountDue | decimal | 13.69 |
| pricing.patientResponsibility | decimal | 10.00 |
| pricing.planPaid | decimal | 3.69 |
| pricing.formularyTier | code | 1 |
Stage 1 · Calibrate
Reverse-engineer the known mapping — and prove it
What the agent reads → the existing pipeline SQL
-- silver.claims_conformed
-- Conforms the legacy Platform A extract to the Gold claims_fact contract.
-- Owner: EDW / claims-data-eng. (undocumented mapping — lives only in this job)
CREATE OR REPLACE TABLE silver.claims_conformed AS
SELECT
CLM_ID AS claim_id,
CASE TX_STAT_CD
WHEN '1' THEN 'PAID'
WHEN '2' THEN 'REVERSED'
WHEN '3' THEN 'REJECTED'
END AS claim_status,
CRDHLDR_ID AS member_id,
to_date(CAST(SVC_DT AS STRING), 'yyyyMMdd') AS date_of_service,
PROD_SVC_ID AS ndc,
DRUG_LBL_NM AS drug_name,
QTY_DISP / 1000.0 AS quantity_dispensed,
DAYS_SUP AS days_supply,
RX_NBR AS rx_number,
FILL_NUM AS fill_number,
DAW_CD AS daw_code,
PRSCRBR_NPI AS prescriber_npi,
PHARM_NPI AS pharmacy_npi,
ING_CST_SUB / 100.0 AS ingredient_cost,
DISP_FEE_SUB / 100.0 AS dispensing_fee,
SLS_TAX_AMT / 100.0 AS sales_tax,
GRS_AMT_DUE / 100.0 AS gross_amount_due,
PAT_PAY_AMT / 100.0 AS patient_pay_amount,
PLAN_PD_AMT / 100.0 AS plan_paid_amount,
PHARM_REIMB_AMT / 100.0 AS amount_reimbursed_pharmacy,
FRMLRY_TIER AS formulary_tier,
CMPND_CD AS compound_code
FROM bronze.platform_a_claims
WHERE TX_STAT_CD IN ('1', '2', '3');Stage 2 · Map the new source
Platform B → Gold, with per-field confidence
Stage 3 · Exception QA
A second agent scrutinizes the uncertain ones
Run Stage 2 first to produce mappings to review.