Skip to content

Model Medicare Part B premiums net of MSP coverage#7972

Open
MaxGhenis wants to merge 13 commits intomainfrom
codex/medicare-partb-msp-clean
Open

Model Medicare Part B premiums net of MSP coverage#7972
MaxGhenis wants to merge 13 commits intomainfrom
codex/medicare-partb-msp-clean

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

@MaxGhenis MaxGhenis commented Apr 10, 2026

Summary

  • Models Medicare Part B premiums as beneficiary out-of-pocket premiums net of Medicare Savings Program coverage.
  • Adds gross_medicare_part_b_premium for the pre-MSP premium used by Medicare cost/value calculations.
  • Keeps reported Part B premiums as a separate audit input and removes the legacy plural Part B premium formula path after the clean MOOP decomposition.
  • Nets out a cycle-free MSP proxy so likely MSP-covered standard premiums do not count toward baseline SPM MOOP, while IRMAA above the standard premium remains out of pocket.

Testing

  • uv run pytest -q policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.py
  • uv run python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml policyengine_us/tests/policy/baseline/gov/hhs/medicare/eligibility/medicare_part_b_premium.yaml policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/msp_part_b_premium_coverage.yaml policyengine_us/tests/policy/baseline/household/income/spm_unit/spm_unit_medical_out_of_pocket_expenses.yaml policyengine_us/tests/policy/baseline/household/income/spm_unit/spm_unit_medical_out_of_pocket_expenses_medicare_part_b.yaml policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/exclusions/nj_other_retirement_income_exclusion.yaml policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/integration.yaml policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/subtractions/nj_social_security_exclusion.yaml policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/integration.yaml policyengine_us/tests/policy/baseline/gov/states/oh/tax/income/integration.yaml -c policyengine_us
  • uv run ruff check policyengine_us/variables/gov/hhs/medicare/eligibility/part_b/gross_medicare_part_b_premium.py policyengine_us/variables/gov/hhs/medicare/eligibility/part_b/medicare_part_b_premium.py policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.py
  • git diff --check

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d888043) to head (188d7b1).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##             main     #7972       +/-   ##
============================================
+ Coverage   86.04%   100.00%   +13.95%     
============================================
  Files           3         7        +4     
  Lines          43       104       +61     
  Branches        2         1        -1     
============================================
+ Hits           37       104       +67     
+ Misses          6         0        -6     
Flag Coverage Δ
unittests 100.00% <100.00%> (+13.95%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MaxGhenis MaxGhenis marked this pull request as ready for review April 27, 2026 22:21
@MaxGhenis MaxGhenis enabled auto-merge (squash) April 27, 2026 22:21
# Conflicts:
#	policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/exclusions/nj_other_retirement_income_exclusion.yaml
#	policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/integration.yaml
#	policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/subtractions/nj_social_security_exclusion.yaml
#	policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/integration.yaml
#	policyengine_us/tests/policy/baseline/gov/states/oh/tax/income/integration.yaml
#	policyengine_us/tools/default_uprating.py
#	policyengine_us/variables/household/expense/health/medicare_part_b_premiums.py
@MaxGhenis MaxGhenis requested a review from daphnehanse11 April 30, 2026 02:03
Copy link
Copy Markdown
Collaborator

@daphnehanse11 daphnehanse11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one P1 policy issue in the MSP asset-test parameterization. Details and sources are inline.

2024-01-01: true
MA:
0000-01-01: true
2024-01-01: true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MA and ME should not apply the MSP asset test here. Maine's MSP statute says DHHS may not apply an asset test when determining MSP eligibility, and Massachusetts eliminated MSP resource tests for these programs in 2024. With the current true entries, I reproduced a 2025 low-income Medicare enrollee in both MA and ME with $20k in bank assets returning msp_asset_eligible = false, msp_part_b_premium_coverage = 0, and medicare_part_b_premium = 2,220, which overstates SPM MOOP by the standard Part B premium. Please set ME and MA to false from the applicable effective dates and add regression coverage.

Sources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants