Calculation type
Computes the Medicare anesthesia allowed amount via SQL as (base units for the procedure code + time units derived from billed units/minutes, rounded per configuration + a physical-status P1-P6 modifier unit value) times a locality-resolved conversion factor; unlike MedicareRVU/MedicareASC, the shared ChargeLevelSqlCalculator does NOT re-multiply this result by charge.Units, because Units are already folded into TimeUnits before the SQL runs.
TimeUnits (@RoundedUnits, computed in C# by MedicareAnesthesiaSqlGenerator.GetParameters, not in SQL) = round/floor/ceil(charge.Units / increment, UnitsRoundingPlaces) per UnitsRoundingType (Round uses MidpointRounding.AwayFromZero), where increment = MinutesPerBilledUnit if BilledUnitsMeaning=Minutes else 1 (so TimeUnits/TotalUnits both use increment=1, meaning charge.Units itself gets rounded per UnitsRoundingType/Places even though no division occurs). In SQL: BaseUnits = 0 if BilledUnitsMeaning=TotalUnits (avoids double-counting units already embedded in TotalUnits) else the MedicareAnesthesiaBaseUnit schedule value for the most recent year <= YEAR(@BaseDate); ModifierUnits = PhysicalStatusModifiers.P1Value..P6Value matching whichever single P1-P6 modifier is first found among the charge's modifier codes, else 0; PerUnitAmount = (BaseUnits + TimeUnits + ModifierUnits) * ConversionFactor, cast to MONEY, where ConversionFactor = FixedConversionFactor ?? the carrier/locality-resolved MedicareDataAnesthesia rate for @BaseDate. In C# (ChargeLevelSqlCalculator.SetDetails): units = 1 (hardcoded for MedicareAnesthesiaCalculation, NOT charge.Units); decimalAmount = PerUnitAmount * 1; round to 2dp AwayFromZero; multiplied by matched RuleMultipliers rule or Percentage/100 DefaultMultiplier; round to 2dp AwayFromZero again; detail.SetBase(decimalAmount, calc).
| Key | Meaning |
|---|---|
| FixedConversionFactor | Optional decimal override of the anesthesia conversion factor; if set, skips the carrier/locality/zip lookup entirely. |
| BilledUnitsMeaning | Enum Minutes (default)/TimeUnits/TotalUnits. Minutes divides charge.Units by MinutesPerBilledUnit to get TimeUnits and still adds schedule BaseUnits. TimeUnits treats charge.Units directly as time units (divisor 1) and still adds BaseUnits. TotalUnits also uses divisor 1 for the rounding step but zeroes BaseUnits in the SQL output so it isn't double-counted. |
| MinutesPerBilledUnit | Integer, default 15 -- minutes per Medicare anesthesia time unit; only used as divisor when BilledUnitsMeaning=Minutes. |
| UnitsRoundingType | Enum Round (default, MidpointRounding.AwayFromZero) / Floor / Ceiling -- controls how charge.Units/increment becomes TimeUnits; applies even for TimeUnits/TotalUnits where the division is by 1, so it can still alter a fractional Units value. |
| UnitsRoundingPlaces | Integer, default 1 -- decimal places TimeUnits is rounded to when UnitsRoundingType=Round; not used by Floor/Ceiling, which always produce an integer. |
| PhysicalStatusModifiers | Object holding P1Value..P6Value (defaults 0,0,1,2,3,0); only the first P1-P6 modifier found among the charge's modifier codes contributes ModifierUnits, everything else (including a charge with no P-modifier) contributes 0. |
| BaseDate | Inherited; effective date for conversion-factor/locality/base-unit-year lookups; defaults to context.ServiceDate if null. |
| Percentage | Inherited; percent multiplier applied by the shared ChargeLevelSqlCalculator when no RuleMultipliers rule matches (default 100) -- present in the draft's key_attrs but omitted from its formula. |
| RuleMultipliers | Inherited IHasRuleMultipliers list; matching rule's Multiplier replaces the Percentage-derived DefaultMultiplier -- also omitted from the draft's formula. |
Gotchas
(1) MOST IMPORTANT DISTINCTION FROM ITS SIBLING TYPES: ChargeLevelSqlCalculator.SetDetails special-cases `int units = calc is MedicareAnesthesiaCalculation ? 1 : charge.Units;` -- Anesthesia's SQL result is NOT multiplied by charge.Units again, because Units were already consumed when computing TimeUnits. A reimplementer who copies the 'multiply the per-unit SQL amount by Units' pattern that correctly applies to MedicareRVU/MedicareASC would double-count units here and overprice every multi-unit anesthesia charge. (2) TimeUnits rounding is computed entirely in C# (GetParameters), not SQL -- the SQL just consumes the pre-rounded @RoundedUnits parameter verbatim. (3) For BilledUnitsMeaning=TimeUnits or TotalUnits the code still runs charge.Units through the UnitsRoundingType/Places machinery (divisor forced to 1), so a fractional Units value is silently rounded/floored/ceiled even when the configuration's intent was 'use Units as-is'. (4) BaseUnits resolution is 'most recent MedicareAnesthesiaBaseUnit row with Year <= YEAR(@BaseDate), ORDER BY Year DESC' -- a coarse year-level match, not a true effective-date range. (5) Same Percentage/RuleMultipliers scaling and double decimal-AwayFromZero rounding as MedicareRVU/MedicareASC applies here too via the shared ChargeLevelSqlCalculator.ApplyMultipliers path, even though the draft's formula field stopped at '* ConversionFactor' and never mentioned it.
class · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/PricingEngine/Calculations/Medicare/MedicareAnesthesiaCalculation.cs:8
calculator · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/PricingEngine/Calculations/Medicare/MedicareAnesthesiaSqlGenerator.cs
dispatch · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/CalculationEngine.cs:703 (ApplyBaseCalculation switch: `case ChargeLevelSqlCalculation chargeLevelSqlCalc:`) -- same single shared case arm as MedicareRVU/MedicareASC. Factory (SqlCalculationSqlGeneratorFactory.cs:11-12) picks MedicareAnesthesiaSqlGenerator; execution runs through the generic ChargeLevelSqlCalculator.
CORRECTED: the draft's formula was substantively right for the SQL-side units/base-unit/modifier arithmetic, but it omitted the Percentage/RuleMultipliers scaling and rounding that the shared ChargeLevelSqlCalculator applies afterward, and it did not flag the units=1 special case that distinguishes Anesthesia from MedicareRVU/MedicareASC in that same shared method -- an omission that is actively dangerous if a reader assumes all three ChargeLevelSqlCalculation types are multiplied by charge.Units uniformly. No dispatch_site was given in the draft; class/file/line, BilledUnitsMeaning semantics, rounding-type semantics, and the base-unit year-fallback logic were confirmed correct as written.