Calculation type
Reduces a charge's already-computed AmountAllowed by the federal sequestration coefficient, scaled up toward 1.0 by the patient's share of responsibility so only Medicare's portion of the payment is cut; applied outside the normal calc-type dispatch switches, directly from CalculateVisit/CalculateQuote whenever the resolved FeeLogic is Medicare-based.
Unused
This type appears in no customer's configuration in the snapshot.
MedicareSequestrationCalculator.AdjustCharge: no-op if charge.AmountAllowed <= 0. sequestration = IMedicareAdjustmentAdapter.GetMedicareSequestration(serviceDate) (looked up by date range against a Sequestration table). patientRatio = charge.PatientRatio ?? 0.2m. sequestrationCoefficient = sequestration.Coefficient + ((1 - sequestration.Coefficient) * patientRatio) (MedicareSequestration.ScaleCoefficientForPatientResponsibility). adjustedAmount = Math.Min(charge.AmountAllowed, MoneyMath.Multiply(charge.AmountAllowed, (double)sequestrationCoefficient)) -- MoneyMath.Multiply(decimal,double) rounds via Math.Round((double),2), which is banker's/ToEven rounding, not AwayFromZero. charge.AmountAllowed is set directly to adjustedAmount, and separately charge.AmountAllowedDetail?.Adjust(adjustedAmount, new MedicareSequestrationAdjustment()) records the audit entry only if AmountAllowedDetail is non-null. Invocation: for visits, MedicareSequestrationHandler.ApplyMedicareSequestrationToVisit groups charges by BillTypeKey, and for each group whose resolved FeeLogic.IsMedicareBased is true, sets charge.PatientRatio via GetPatientRatioForServiceType (visit/quote AmountPatient/(AmountPatient+AmountInsurance); returns 0.2m only if either amount is null OR both are exactly zero) and skips ChargeCoverageUtils.IsChargeNonCovered charges, before calling AdjustCharge. For quotes, ApplyMedicareSequestrationToQuote does the same FeeLogic.IsMedicareBased grouping but calls AdjustCharge directly with NO PatientRatio computation step and no non-covered-charge filter.
| Key | Meaning |
|---|---|
| (none on the Calculation class itself) | MedicareSequestrationAdjustment carries no configurable properties beyond Name/Type; it exists purely as an audit-trail record type created inline by MedicareSequestrationCalculator and attached via CalculationDetail.Adjust(). |
Gotchas
This type has NO case arm in either ApplyBaseCalculation or ApplyAdjustment -- it cannot be added to a FeeLogic's BaseCalculation/AdjustmentCalculations list and executed through the normal calc.Type switch dispatch at all. It is nonetheless real, executing code: CalculateVisit calls IMedicareSequestrationHandler.ApplyMedicareSequestrationToVisit directly (CalculationEngine.cs:171-172, after quote.Calculated), and the quote-pricing path calls ApplyMedicareSequestrationToQuote (CalculationEngine.cs:379-380; also wired at CustomerSchema.cs:4011-4014). Its ChoiceList entry (CustomerSchema.cs:2998, 3045) is instantiated as ReadOnly=true -- it exists in the admin UI purely for audit display, not for configuration; a reimplementer who only reads the dispatch switches (as the draft's own methodology does for every other type) will conclude this type is dead code, when in fact it always fires for any Medicare-based bill type. Visit-path and quote-path behavior diverge in two ways the draft did not capture: (1) only the visit path computes a fresh PatientRatio (via GetPatientRatioForServiceType, whose own 0.2m default fires only when both patient and insurance amounts are null-or-both-zero, not 'zero' generically); the quote path never sets PatientRatio before calling AdjustCharge, so quote-time sequestration falls through to AdjustCharge's own separate `charge.PatientRatio ?? 0.2m` null-coalesce, using whatever PatientRatio (often null) the charge already carried; (2) only the visit path skips ChargeCoverageUtils.IsChargeNonCovered charges -- the quote path adjusts every charge in a Medicare-based bill type regardless of coverage status. MedicareSequestration.AdjustedCoefficient is loaded from the DB (MedicareAdjustmentAdapter.cs:188) and exposed on the model but is never read by ScaleCoefficientForPatientResponsibility or anywhere else -- only Coefficient feeds the math, so 'Adjusted' is a misleading name for an inert field. The MoneyMath.Multiply(decimal,double) call rounds via double-based Math.Round (banker's rounding), unlike the AwayFromZero rounding used by the Base Medicare fee-schedule types in this same batch. Finally, `charge.AmountAllowedDetail?.Adjust(...)` is null-conditional while the `charge.AmountAllowed = adjustedAmount` line just above it is not -- if AmountAllowedDetail is null, the raw allowed amount still changes but no Adjustments audit entry is ever written, so history and value can silently diverge. (The implementation file itself is misspelled 'MedicareSequestrationCacluator.cs'.)
class · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/PricingEngine/Adjustments/MedicareSequestrationAdjustment.cs:6
calculator · /home/cary/src/mdc/MdClarity/MDClarity/MDClarityCore/Backend/PricingEngine/Implmentations/MedicareSequestrationCacluator.cs:8
CORRECTED: the draft's core coefficient formula and the general shape (patient-ratio-scaled, min-capped, per-charge) were accurate, and it correctly flagged the Field.Copy() copy-paste bug. But it left dispatch_site/is_dead_code unaddressed even though the harness's own methodology (grep the two switches) would have caught this as a total dispatch-switch outlier; it conflated two separate and differently-scoped 0.2m default mechanisms into one vague parenthetical, missing that the quote path never computes PatientRatio at all; and it omitted the dead AdjustedCoefficient field, the banker's-rounding MoneyMath.Multiply call, and the null-conditional gap between AmountAllowed and AmountAllowedDetail.