Align Medicare Part B premium modeling with enrollment targets#8697
Align Medicare Part B premium modeling with enrollment targets#8697daphnehanse11 wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8697 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 5 +4
Lines 13 86 +73
=========================================
+ Hits 13 86 +73
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f6c02cf to
ce96789
Compare
…bles Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MaxGhenis
left a comment
There was a problem hiding this comment.
Reviewed the full diff against issue #8677 and checked the mechanics rather than trusting the summary (agent-assisted). This is clean.
What I verified:
- The
medicare_irmaa_magi_two_years_priorextraction is exactly behavior-preserving: the old inlinetax_unit(tax_exempt_interest_income, prior_period)already summed the person-level component to the tax unit, so the newadd(tax_unit, prior_period, [...])is identical. Both IRMAA consumers route through it, and a grep confirms no other file still inlines the two-years-prior pattern. gross_medicare_part_b_premium_if_enrolledisn't a bare wrapper —defined_for = medicare_enrolledis the point, gating the gross premium to enrolled beneficiaries so CMS premiums map to an enrollment-consistent calibration total.- Test values hand-check out: MAGI 106,002 → 3,108 (a deliberate $1-over-threshold boundary), 500,000 → 7,546.80, Part D 500,000 → 1,029.60, and
medicare_cost12,280/10,060. Params are untouched here but line up with CMS 2026 (standard 202.90, first single IRMAA threshold above 109k).
One note: the medicare_cost switch to the enrollment-gated premium is numerically inert today (it's already defined_for = medicare_enrolled, and the two premiums are equal on that subset) — harmless, good for clarity.
I retyped the changelog fragment from .changed to .added on the branch since this adds two public variables (minor bump).
Heads up that #8532 also appends to test_part_b_msp_offset.py, so whichever lands second needs a trivial rebase; base is ~160 commits behind main, worth a rebase before merge.
Approving.
Summary
gross_medicare_part_b_premium_if_enrolledfor enrollment-consistent CMS premiums-from-enrollees calibration targets.medicare_irmaa_magi_two_years_prioras an explicit current-year input with fallback to AGI plus tax-exempt interest from two years prior.Tests
make formatuv run pytest policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.pyuv run policyengine-core test policyengine_us/tests/policy/baseline/gov/hhs/medicare/eligibility/income_adjusted_part_d_premium_surcharge.yaml -c policyengine_usuv run pytest policyengine_us/tests/test_system_import.pyCloses #8677