Calculation type
Computes a per-unit Medicare RVU price via SQL (Work/PE/MP RVU x GPCI, budget-neutrality-adjusted, x conversion factor), then the shared ChargeLevelSqlCalculator multiplies that per-unit amount by the charge's Units and applies Percentage/RuleMultipliers before storing it as the base allowed amount.
Per row (SQL, MedicareRVUSqlGenerator.GetQuery): RVUAmount = WorkRVU*WorkGPCI*BudgetNeutralityAdjustment + PERVU*PEGPCI + MPRVU*MPGPCI; PerUnitAmount = RVUAmount * ConversionFactor (ConversionFactor = FixedConversionFactor ?? schedule row's conversion_factor), each cast to MONEY. BudgetNeutralityAdjustment is hardcoded 0.8994 for ScheduleKey 'RVU07D', 0.8806 for 'RVU08D', else 1. Candidate schedule rows are filtered by MissingCodeLogic/StatusCode-exclusion/NonCoveredHandling rules, then TOP 1 is picked ORDER BY LEN(ProcedureModifier) DESC, Ordinal DESC, Amount DESC (most-specific-modifier match wins, then most recent schedule row, then highest dollar amount). In C# (ChargeLevelSqlCalculator.SetDetails, shared by all ChargeLevelSqlCalculation subtypes): decimalAmount = PerUnitAmount * charge.Units; decimalAmount = Math.Round(decimalAmount, 2, AwayFromZero); decimalAmount *= (matched RuleMultipliers rule's Multiplier, else calc.DefaultMultiplier = Percentage/100 ?? 1); decimalAmount = Math.Round(decimalAmount, 2, AwayFromZero) again; detail.SetBase(decimalAmount, calc).
| Key | Meaning |
|---|---|
| FixedConversionFactor | Optional decimal override; if set, used instead of the schedule row's per-locality conversion factor (COALESCE in SQL). |
| FixedFacilityType | Optional override of facility type ('Clinic' or 'Hospital/ASC'); if unset, derived first from the charge's POS code (computed in C#, GetPOSFacilityType), falling back to the Facility record's FacilityType only if POS yields nothing. |
| FixedZipCode | Optional override zip code for GPCI locality lookup; if unset and GPCIAdjusted is true, the Facility's own zip is used. |
| GPCIAdjusted | Boolean, default true. When false, locality lookup is skipped entirely and Carrier/LocalityCode are forced to '' with an open StartDate/EndDate range (1900-01-01 to 2999-12-31), matching only schedule rows that themselves have empty Carrier/LocalityCode -- it does not disable GPCI multiplication, it disables locality resolution. |
| MissingCodeLogic | Enum None/FirstOccurrence/Current. None requires @BaseDate to fall within a schedule row's StartDateEffective/EndDateEffective. FirstOccurrence and Current both instead keep any row where @BaseDate <= EndDateEffective (i.e. not-yet-expired rows), ranked by Ordinal = ROW_NUMBER() OVER (PARTITION BY code, modifier ORDER BY StartDateEffective ASC); Current additionally deletes all kept rows except ones whose date range actually covers @BaseDate, but only if at least one such row exists -- if none covers @BaseDate exactly, all forward-looking rows survive and the final ORDER BY (modifier length, Ordinal, Amount, all descending) picks among them, which is not necessarily the temporally nearest row. |
| NonCoveredHandling | Enum Skip (default)/Zero/Calculate, keyed off Medicare StatusCode='N'. Skip excludes status codes B,C,E,I,J,M,N,P,Q,X from the query entirely. Zero and Calculate both remove 'N' from that exclusion list (so N-status rows are queried), but only Zero additionally zeroes WorkRVU, MPRVU, OPPSMPRVU, PERVU and OPPSPERVU for those rows; Calculate leaves them as normal RVU values. |
| BaseDate | Inherited from MedicareCalculation; effective date for schedule/GPCI lookup; defaults to context.ServiceDate (the charge's service date) if null. |
| Percentage | Inherited from ChargeLevelSqlCalculation; DefaultMultiplier = Percentage/100 ?? 1, applied by the shared ChargeLevelSqlCalculator when no RuleMultipliers rule matches the charge (default 100). |
| RuleMultipliers | Inherited IHasRuleMultipliers list; a matching rule's Multiplier replaces (not stacks with) the Percentage-derived DefaultMultiplier, applied by the same shared ChargeLevelSqlCalculator.ApplyMultipliers used for MedicareASC/Anesthesia/DME/Drug/Lab. |
Gotchas
(1) BIGGEST MISS IN THE DRAFT: the SQL query returns a PER-UNIT dollar amount; ChargeLevelSqlCalculator.SetDetails (not the SQL generator) multiplies it by charge.Units before storing it as the charge's base allowed amount. A formula that stops at 'RVUAmount * ConversionFactor' silently produces a per-unit price, wrong by a factor of Units for any multi-unit charge. (2) That same method special-cases MedicareRVUCalculationDetail: it stores WorkAmount/MPAmount/PEAmount (used later by MultipleRadiologyAdjustment/MultipleProcedureAdjustment for MPPR sorting) as PER-UNIT values with Percentage/RuleMultipliers already baked in, but explicitly NOT multiplied by Units (comment: 'Work/MP/PE ... are per-unit ... OPPSAmount is a charge total') -- mixing these sub-fields with the unit-scaled base Amount gives wrong totals. (3) Rounding is decimal Math.Round(...,2,AwayFromZero) applied twice (once right after the Units multiply, once after the Percentage/RuleMultipliers multiply) -- consistent internally, but different from the double-based banker's rounding MoneyMath uses elsewhere in the engine. (4) RuleMultipliers and Percentage are mutually exclusive, not additive: a matched rule's Multiplier is used instead of Percentage/100, never on top of it. (5) The ChargeLevelSqlCalculator loop starts at i=1 (`for (int i = 1; i < context.NumCharges; i++)`), so Details[0] (the account-level pseudo-charge) is never written by this base calculation at all -- not zeroed, just untouched, which matters if something downstream reads it uninitialized. (6) GPCIAdjusted=false does not skip the GPCI multiplication in the formula, only the zip->locality lookup that supplies WorkGPCI/PEGPCI/MPGPCI and the Carrier/LocalityCode key.
class · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/PricingEngine/Calculations/Medicare/MedicareRVUCalculation.cs:8
calculator · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/PricingEngine/Calculations/Medicare/MedicareRVUSqlGenerator.cs
dispatch · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/CalculationEngine.cs:703 (ApplyBaseCalculation switch: `case ChargeLevelSqlCalculation chargeLevelSqlCalc:`) -- MedicareRVUCalculation is a ChargeLevelSqlCalculation subclass, so it hits this single shared case arm, not a type-specific one. The arm calls SqlCalculationSqlGeneratorFactory.Get(...) (SqlCalculationSqlGeneratorFactory.cs:21-22) to pick MedicareRVUSqlGenerator, then executes it via the generic ChargeLevelSqlCalculator (ChargeLevelSqlCalculator.cs).
CORRECTED: the draft's formula omitted the post-SQL multiplication by charge.Units (and the subsequent Percentage/RuleMultipliers scaling and double AwayFromZero rounding) that ChargeLevelSqlCalculator.SetDetails applies to every ChargeLevelSqlCalculation subtype; it also had no dispatch_site and no is_dead_code field, and its notes omitted the MPPR-detail per-unit-vs-total-scale distinction and the schedule row tie-break order. Class/file/line, category, application_level, budget-neutrality constants, and the RVU/GPCI/conversion-factor formula components were all confirmed correct as written.