Calculation type

MedicareMultipleEndoscopyAdjustment

Implements Medicare's special multiple-endoscopy rule (Ch.12 40.6.C.13): within each base-endoscopy-code family (grouped purely by rollup/schedule membership, not by any configurable code list), the single highest-per-unit-ranked charge in the family has one unit priced in full and every other unit in the family is priced at the differential between its own price and a synthesized 'base/parent' endoscopy procedure's price.

945
uses
22
customers
Adjustment
category
Charge
applies at

What it computes

baseCodes = charges (i=1..NumCharges-1) grouped by rollup Code (via medicareAdjustmentRepo, MedicareDataRVU.EndoscopyBaseCode + TC/26 modifier match), skipping IgnoreCharge()'d or null-rollup charges. For each base-code group: affected = calculationEngine.GetChargeOrder(context, group, SortBy) (per-unit amount descending). baseAmount = the allowed amount from re-pricing a synthetic charge: BuildSharedContextCharge intersects the group's charges — any Charge attribute (ChargeTypeID, BillTypeKey, ProviderID, Coverage, ScheduledTime, PatientAge, IsCustom, or any DimensionMember code) that differs across the group's members is cleared/nulled on the synthetic charge — then the base code is substituted in, Units set to 1, and the synthetic charge is re-priced via CalculateAmountAllowedBase in a cloned 2-row context (account row + synthetic charge); baseAmount = that context's Details[1].Amount. Then, walking `affected` in rank order: adjustedUnits = charge.Units; for the FIRST charge in that order only, if adjustedUnits > 0, adjustedUnits -= 1 (one 'free' unit). adjustmentAmount = MoneyMath.Multiply(baseAmount, adjustedUnits). detail.Adjust(0, adjustment) if adjustmentAmount > detail.Amount; detail.Adjust(detail.Amount - adjustmentAmount, adjustment) if 0 < adjustmentAmount <= detail.Amount; detail.Adjust(detail.Amount, adjustment) (no-op tag) if adjustmentAmount == 0 and the group has more than one affected charge; otherwise (lone charge, $0 adjustment) no Adjust call at all.

Parameters

KeyMeaning
SortByRanks charges within each base-code family; Medicare subclass constructor sets AmountCharged (base MultipleEndoscopyAdjustment default is AmountAllowed) — confirmed in the Medicare constructor
ScheduleTypeExplicitly set to null in the Medicare constructor, so endoscopy base-code family membership comes from medicareAdjustmentRepo (MedicareDataRVU.EndoscopyBaseCode) rather than a named customer schedule; the field is also not exposed in MedicareMultipleEndoscopyAdjustmentField's UI (only SortBy is)

Gotchas

(1) The 'base/parent procedure' price is not a direct fee-schedule lookup on the base code — it comes from a synthetic charge whose non-code attributes are the INTERSECTION of the family's members (BuildSharedContextCharge nulls out ChargeTypeID/BillTypeKey/ProviderID/Coverage/ScheduledTime/PatientAge/IsCustom/any non-common code wherever the family's charges disagree). Differing Coverage or ProviderID among family members silently degrades the inputs to that re-pricing call. (2) 'Highest-ranked' means highest per-unit amount (Amount/Units or AmountCharged/Units, descending) per GetChargeOrder, not highest total. (3) A lone qualifying charge in a family that computes a $0 adjustment amount gets no Adjust call at all (the affected.Count>1 guard), unlike a multi-charge family where it's still tagged via a no-op Adjust. (4) This type has no configurable Percentages/BaseCodes of its own — the payoff rule is fixed algorithmically; only SortBy is admin-configurable. (5) MoneyMath.Multiply(baseAmount, adjustedUnits) multiplies decimal by an int (exact, no rounding ambiguity), unlike sibling adjustments that multiply by a double percentage.

In the source

class · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/PricingEngine/Adjustments/MedicareMultipleEndoscopyAdjustment.cs:6
calculator · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/PricingEngine/Adjustments/Calculators/MultipleEndoscopyAdjustmentCalculator.cs
dispatch · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/CalculationEngine.cs:765-768

CORRECTED — the draft's rule description (first unit free, rest at differential, schedule/rollup-driven family membership, SortBy default AmountCharged) checked out against MultipleEndoscopyAdjustmentCalculator.cs. It described the base amount as coming from 'a synthetic charge built with that base code' without noting that BuildSharedContextCharge also intersects and nulls out attributes that differ across the family, and it omitted the lone-charge/zero-adjustment no-touch edge case.