Add modeled Medicaid variables#8535
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
daphnehanse11
left a comment
There was a problem hiding this comment.
PolicyEngine Review: PR 8535
Recommendation: APPROVE
Findings
No findings.
Scope Reviewed
PR 8535 adds a parallel modeled Medicaid cost/value path for API partner household calculations:
modeled_medicaid_cost_if_enrolledmodeled_medicaid_costmodeled_medicaid- focused Medicaid YAML tests
- partner fixture updates from data-supplied
medicaid/medicaid_cost_if_enrolledexpectations tomodeled_medicaid
This is an API/partner contract restoration, not a regulatory parameter update.
Validation
- Compared the new modeled cost formula against the pre-data-backed
medicaid_cost_if_enrolledimplementation: it preserves the same per-capita helper path and Medicaid group handling under a new variable. - Reviewed PolicyEngine patterns for variable organization, aggregation, period handling, code style, references, and tests.
- Confirmed partner fixtures no longer request/output person-level
medicaid,medicaid_cost_if_enrolled, ormodeled_medicaid_cost. - Confirmed current
upstream/mainhas not changed the reviewed Medicaid or partner paths since the PR merge-base; the PR is mergeable despite being 52 commits behind. - GitHub CI is passing.
Local tests run in /private/tmp/policyengine-us-pr-8535-review with PYTHONPATH pinned to that temp checkout:
python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/hhs/medicaid/costs -c policyengine_usResult: 26 passed, 1 warning.
python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/partners/amplifi policyengine_us/tests/policy/baseline/partners/my_friend_ben policyengine_us/tests/policy/baseline/partners/analytics_coverage -c policyengine_usResult: 729 passed, 1 warning.
Notes
The warning in both local runs is a benign pytest plugin rewrite warning from the shared Python environment. No source files were edited.
Summary
Adds parallel modeled Medicaid variables for API partner household calculations without changing the existing data-backed Medicaid cost path.
medicaid_cost_if_enrolledandmedicaid_costas data-backed variables for datasetsmodeled_medicaid_cost_if_enrolledusing the pre-Make Medicaid cost if enrolled data-backed #8499 per-capita Medicaid formulamodeled_medicaid_costgated by Medicaid enrollmentmodeled_medicaidas the API partner-facing modeled Medicaid benefit amount, mirroringmedicaidwhile using the modeled cost pathmodeled_medicaidinstead of sendingmedicaid_cost_if_enrolledRoot cause
PR #8499 made
medicaid_cost_if_enrolleddata-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 requestmodeled_medicaid.Validation
policyengine-core test policyengine_us/tests/policy/baseline/gov/hhs/medicaid/costs -c policyengine_uspolicyengine-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_usmedicaid_cost_if_enrolled, person-levelmedicaid, ormodeled_medicaid_costoutputs.Fixes #8533