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.

Direct — clean sourceProbable — transform neededGap — flagged, never guessed

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:

Stage 1

Calibrate on the known system

Prove the agent recovers the existing mapping the client can already check.

Stage 2

Map the new source

Classify each Gold column Direct / Probable / Gap, with a confidence score.

Stage 3

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).

Source
Platform 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_IDstringCLM00194233
TX_STAT_CDcode1
CRDHLDR_IDstringM00832145
SVC_DTinteger20260512
PROD_SVC_IDstring00093720198
DRUG_LBL_NMstringATORVASTATIN 20MG TAB
QTY_DISPinteger30000
DAYS_SUPinteger30
RX_NBRstringRX8842013
FILL_NUMinteger0
DAW_CDcode0
PRSCRBR_NPIstring1487652093
PHARM_NPIstring1275839201
ING_CST_SUBinteger1244
DISP_FEE_SUBinteger125
SLS_TAX_AMTinteger0
GRS_AMT_DUEinteger1369
PAT_PAY_AMTinteger1000
PLAN_PD_AMTinteger369
PHARM_REIMB_AMTinteger1369
FRMLRY_TIERcode1
CMPND_CDcode1
Target
Gold · claims_fact
22 fields · click to expand

The existing business-ready claims table. Downstream reports and apps depend on it. Unchanged by the migration.

claim_idstringCLM00194233
claim_statuscodePAID
member_idstringM00832145
date_of_servicedate2026-05-12
ndcstring00093720198
drug_namestringATORVASTATIN 20MG TAB
quantity_dispenseddecimal30.000
days_supplyinteger30
rx_numberstringRX8842013
fill_numberinteger0
daw_codecode0
prescriber_npistring1487652093
pharmacy_npistring1275839201
ingredient_costmoney12.44
dispensing_feemoney1.25
sales_taxmoney0.00
gross_amount_duemoney13.69
patient_pay_amountmoney10.00
plan_paid_amountmoney3.69
amount_reimbursed_pharmacymoney13.69
formulary_tiercode1
compound_codecode1
Source
Platform 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.

transactionIdstringCLM00194233
statusstringPAID
patient.memberIdstringM00832145
serviceDatedate2026-05-12
drug.ndc11string00093720198
drug.descriptionstringATORVASTATIN 20MG TAB
drug.isCompoundbooleanfalse
fill.quantityDispenseddecimal30.0
fill.daysSupplyinteger30
fill.rxNumberstringRX8842013
fill.fillSequenceinteger0
dawCodecode0
prescriber.npistring1487652093
pharmacy.npistring1275839201
pricing.ingredientCostdecimal12.44
pricing.dispensingFeedecimal1.25
pricing.totalAmountDuedecimal13.69
pricing.patientResponsibilitydecimal10.00
pricing.planPaiddecimal3.69
pricing.formularyTiercode1

Stage 1 · Calibrate

Reverse-engineer the known mapping — and prove it

What the agent does: it reads the actual pipeline code that fills the Gold table from Platform A today, and works out — column by column — which source field feeds each Gold column. It is not given the answer. We then score its answer against the mapping the client already knows. A high score is the trust signal: if the agent can recover a mapping we can verify, we can trust it on the new source we can't pre-check.
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

What the agent does: for each Gold column, it decides how the new source (RxLogic) fills it — Direct (a clean field exists), Probable (fillable with a transform — a rename, unit conversion, or code remap), or Gap (no faithful source — flag it, leave it empty, never guess). Each comes with a confidence score, the transform, and the type/unit/value checks it ran.

Stage 3 · Exception QA

A second agent scrutinizes the uncertain ones

What the agent does: it takes only the mappings that were Probable or below 80% confidence — the risky ones — and independently re-examines each. It either confirms the call, adjusts the classification/confidence (e.g. a transform makes it safe), or rejects it toward an honest Gap. This is the "don't let a shaky fit slip through" safety net.

Run Stage 2 first to produce mappings to review.