Skip to content

Add modeled Medicaid variables#8535

Draft
hua7450 wants to merge 4 commits into
PolicyEngine:mainfrom
hua7450:codex/modeled-medicaid-cost
Draft

Add modeled Medicaid variables#8535
hua7450 wants to merge 4 commits into
PolicyEngine:mainfrom
hua7450:codex/modeled-medicaid-cost

Conversation

@hua7450
Copy link
Copy Markdown
Collaborator

@hua7450 hua7450 commented May 27, 2026

Summary

Adds parallel modeled Medicaid variables for API partner household calculations without changing the existing data-backed Medicaid cost path.

  • keeps medicaid_cost_if_enrolled and medicaid_cost as data-backed variables for datasets
  • adds modeled_medicaid_cost_if_enrolled using the pre-Make Medicaid cost if enrolled data-backed #8499 per-capita Medicaid formula
  • adds modeled_medicaid_cost gated by Medicaid enrollment
  • adds modeled_medicaid as the API partner-facing modeled Medicaid benefit amount, mirroring medicaid while using the modeled cost path
  • updates partner contract fixtures so partners request modeled_medicaid instead of sending medicaid_cost_if_enrolled
  • adds focused YAML tests and a changelog fragment

Root cause

PR #8499 made medicaid_cost_if_enrolled data-backed, which is correct for datasets but removed the formula-backed value API partner household calculations need when they do not provide a Medicaid cost input.

Partner contract

API partners should not send medicaid_cost_if_enrolled. When they want PolicyEngine to estimate Medicaid value for household calculations, they should request modeled_medicaid.

Validation

  • policyengine-core test policyengine_us/tests/policy/baseline/gov/hhs/medicaid/costs -c policyengine_us
  • policyengine-core test policyengine_us/tests/policy/baseline/partners/amplifi policyengine_us/tests/policy/baseline/partners/my_friend_ben policyengine_us/tests/policy/baseline/partners/impactica -c policyengine_us
  • Static scan confirms partner fixtures no longer contain medicaid_cost_if_enrolled, person-level medicaid, or modeled_medicaid_cost outputs.

Fixes #8533

@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ee131a9) to head (7429c36).
⚠️ Report is 43 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #8535    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            9         3     -6     
  Lines          149        32   -117     
==========================================
- Hits           149        32   -117     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

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.

@hua7450 hua7450 changed the title [codex] Add modeled Medicaid cost variables [codex] Add modeled Medicaid variables May 28, 2026
@hua7450 hua7450 changed the title [codex] Add modeled Medicaid variables Add modeled Medicaid variables May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore formula-backed Medicaid cost fallback for API partner household calculations

1 participant