MDClarity · Pricing & Estimation Output Data Dictionary

The Scoring
Engine Ledger

To “score” an account is to estimate what the payer will allow on its charges. This is a field-by-field reading of what the engine writes — and how every row joins back to the rest of the system.

engine  CalculationEngine.cs headline output  AmountAllowed granularity  account → charge → calculation
01

What “scoring” actually computes

There is no risk score or propensity-to-pay model here. Scoring = pricing. But the engine’s inputs aren’t one undifferentiated pile — they fall into three classes with three different lifecycles, entering from three directions. Activity flows through it; contract rules are the business logic dropped in from above; reference & fee schedules are lookup data it dips into from below.

Contract rules · business logic
The FeeLogic recipe: an ordered set of base calculations + adjustments. Selected per account by insurance · facility · bill type · service date.
BaseCalculations[]AdjustmentCalculations[]ContractMapSets
⟳ lifecycle: per-contract config
Activity data · flows through
The encounter being priced. Passed in as method args, converted to a transient Quote that carries through the pipeline.
AccountCharges[]FacilityServiceDateInsurance
⟳ lifecycle: per encounter
scores via
Calculation Engine
CalculationEngine.cs · CalculateAccountEstimate()
Outputs · 3 tiers
The estimate plus its full audit trail (detailed below).
AccountEstimateAccountEstimateChargeAccountEstimateCalculation
Lookup / reference data · dipped into
Rates the rules read from — cached, and refreshed on their own cadence, not per account. Two distinct lifecycles live in here:
Fee schedulescode→fee, EAPG / APC maps, outlier thresholds — the PricingRecord each step cites⟳ per-contract load
Medicare referenceRVU · ASC · DME · drug · lab — a separate national database (Customer.MedicareDatabase)⟳ CMS quarterly / annual
horizontal → continuous / per encounter from above ↓ per-contract config change from below ↑ periodic batch refresh
Mental model The three output tables are nested like Russian dolls. One AccountEstimate summarizes many AccountEstimateCharge rows; each charge is justified by many AccountEstimateCalculation rows. Read top-down for the answer, bottom-up for the “why.”
02

The three keys that stitch it together

Every output row carries the same composite key. Toggle a key below to light it up across all three tiers and see exactly what threads through. These keys are also how outputs join back to source data — the account, its charges, and the chosen contract.

Highlight join key click a key — it lights everywhere it appears ↓

How keys join back to source

  • AccountID → the Account being priced. One actual estimate per account.
  • ChargeNumber → the account’s individual charge line (CPT/HCPCS, units, amount charged).
  • ScenarioInsuranceNULL = the live, actual estimate. Non-null = a what-if priced against a different insurance/contract.

Two non-key joins worth knowing

  • FeeLogic → the fee-logic rule set that was applied (which methodologies, in what order).
  • PricingRecord → the specific fee-schedule record a calculation pulled its rate from.
  • CalculationError → enum explaining a failed score (see §05).
03

The output tiers, field by field

Tier 1 · account roll-up

AccountEstimate

AccountEstimate

One row per (account, scenario). This is the answer consumers read first: did we price it, and for how much. Keyed AccountID + ScenarioInsurance.

FieldTypeWhat it means & where it joins
AccountIDstringJoins to the Account. The thing being scored.
ScenarioInsurancestringNULL = actual estimate. Non-null keys a what-if scenario against another insurance/contract.
CalculatedboolDid pricing succeed? If false, read CalculationError for why.
AmountAllowed moneyheadlinedecimal?The estimate. Total allowed across all charges — the roll-up of every Tier-2 AmountAllowed.
FeeLogicstringWhich fee-logic rule set was applied (the recipe of methodologies).
CalculatedDateDateTime?When this score was produced (freshness / staleness signal).
CalculationErrorenum?Reason code when Calculated = false. See §05.
Tier 2 · per charge

AccountEstimateCharge

AccountEstimateCharge

One row per charge line. Splits the account total into per-charge allowed amounts, and exposes the value before vs. after adjustments. Keyed AccountID + ChargeNumber + ScenarioInsurance.

FieldTypeWhat it means & where it joins
AccountIDstringBack to the parent AccountEstimate / Account.
ChargeNumberintWhich charge line on the account this prices.
ScenarioInsurancestringSame scenario discriminator as Tier 1.
CalculatedboolDid this charge price out? Some charges can fail while others succeed.
AmountAllowedBase moneydecimal?Allowed before adjustments — the sum of base calculations for this charge.
AmountAllowed moneydecimal?Final per-charge allowed, after adjustments. These sum to the account total.
Tier 3 · show your work

AccountEstimateCalculation

AccountEstimateCalculation

Many rows per charge — the audit trail. Each row is one pricing step: a base calculation or an adjustment, with the dollars it contributed and the fee-schedule record it came from. This is what lets you reconstruct any AmountAllowed from scratch.

FieldTypeWhat it means & where it joins
AccountIDstringBack to account.
ChargeNumberintBack to the Tier-2 charge these steps explain.
ScenarioInsurancestringScenario discriminator.
CalculationTypestringThe methodology applied (e.g. MedicareRVU, CaseRate, PercentOfFees). Taxonomy in §04.
CalculationNamestringHuman-readable label for this step.
IsAdjustmentboolfalse = base calculation; true = adjustment layered on top. The split between Base and Final.
Amount moneydecimal?Dollars this step contributed — negative for downward adjustments.
DescriptionstringFree-text explanation of the step’s logic.
PricingRecordstringPointer to the fee-schedule record the rate was read from.

In code these three arrive bundled as AccountEstimateData{ Estimate, Charges[], Calculations[] } plus an ErrorDescription — with a helper GetCalculationsByChargeNumber() to pull one charge’s breakdown.

04

How the numbers roll up

Read this bottom-up: Tier-3 steps sum into a charge’s base, adjustments bend it to a final, and charge finals sum into the account total. (Illustrative figures.)

Account estimate breakdown AccountID = A-100482  ·  ScenarioInsurance = NULL (actual)
Tier 3 — calculation stepChargeAmount
MedicareRVUbase#1+ 412.00
MedicareSequestrationAdjustmentadj#1− 8.24
↳ Charge #1  base 412.00 → final#1403.76
PercentOfChargesbase#2+ 1,250.00
MultipleProcedureAdjustmentadj#2− 625.00
↳ Charge #2  base 1,250.00 → final#2625.00
AccountEstimate.AmountAllowed  = Σ charge finals1,028.76
Reading guide The teal base rows populate Tier-2 AmountAllowedBase. Base ± adjustments gives Tier-2 AmountAllowed. Those finals sum to Tier-1 AmountAllowed. Each italic line is a row you’d actually find in AccountEstimateCalculation.
05

Two controlled vocabularies

Two enums give the outputs their meaning: why a score failed, and how a charge was priced.

CalculationError — why Calculated = false

  • Other Unclassified failure.
  • MissingContractMap No contract mapping for the insurance.
  • MissingScheduleMap No fee-schedule mapping found.
  • NoBaseCalculations Nothing to price from — no base step ran.
  • InvalidChargeCodes Charge codes weren’t recognized.
  • SqlCalculationSyntaxError A SQL-based rule failed to parse.

CalculationType — how a charge was priced

MedicareRVU MedicareASC MedicareDrug MedicareLab MedicareAnesthesia PercentOfFees PercentOfCharges CaseRate FlatFee EAPG APC MultipleProcedureAdj BilateralSurgeryAdj LengthOfStayOutlierAdj SqlExpression + ~30 more

Gold = Medicare family · teal = adjustments · plain = base methodologies. ~45 values total.

06

When these rows get (re)written

Outputs aren’t static. AccountLoader compares incoming vs. current account data; if a pricing-relevant field changed, it enqueues the account via AccountScoringQueue, which deletes the prior actual rows (ScenarioInsurance IS NULL) and recomputes. Scenario rows are managed separately for contract modeling.

AmountCharged Facility Insurance PatientKey ServiceDate LengthOfStay MedicareAmountPatient MedicareAmountInsurance

Any one of these changing ⇒ the account is re-scored and its three output tiers are rebuilt.