Skip to content

Conversation

@daphnehanse11
Copy link
Collaborator

Summary

  • Reorder medicaid_category formula to evaluate mandatory groups (parent, pregnant, SSI) before optional expansion groups
  • Federal Medicaid eligibility rules require this ordering per federal policy
  • Update test expected values to reflect correct category assignments

Test plan

  • All 147 Medicaid tests pass
  • Verified parent at 30% FPL is now correctly assigned to PARENT category instead of ADULT

Fixes #7267

🤖 Generated with Claude Code

Federal Medicaid eligibility rules require specific category evaluation order:

1. SSI recipients (42 CFR 435.120-138) - "mega-mandatory" non-MAGI pathway
   with automatic Medicaid eligibility in most states
2. Children: infants, young children, older children (42 CFR 435.118)
3. Pregnant women (42 CFR 435.116) - evaluated before parents per
   California MAGI hierarchy guidance
4. Parents/caretaker relatives (42 CFR 435.110)
5. Young adults 19-20 - optional state coverage
6. Adult expansion (42 CFR 435.119) - requires "not otherwise eligible
   for mandatory coverage", so evaluated last among mandatory groups
7. Optional aged/blind/disabled pathway (non-SSI)

Changes:
- Move SSI_RECIPIENT to first position (mega-mandatory)
- Move PREGNANT before PARENT per state hierarchy guidance
- Move YOUNG_ADULT after mandatory groups (it's optional)
- Add comprehensive regulatory citations in comments
- Update test expected values for correct category assignments

Fixes PolicyEngine#7267

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@daphnehanse11 daphnehanse11 force-pushed the fix/medicaid-category-order-7267 branch from 71b1563 to 793dca3 Compare January 28, 2026 16:19
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ed78e6c) to head (7c7b8b4).
⚠️ Report is 221 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #7272    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           16         1    -15     
  Lines          228        25   -203     
  Branches         1         0     -1     
==========================================
- Hits           228        25   -203     
Flag Coverage Δ
unittests 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.

Copy link
Collaborator

@PavelMakarchuk PavelMakarchuk left a comment

Choose a reason for hiding this comment

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

Formatting questions

@PavelMakarchuk
Copy link
Collaborator

📋 Review Summary

✅ Strengths

🔍 Issues Found

Minor Documentation Issues (Agree with @PavelMakarchuk's review)

  1. "mega-mandatory" terminology (line 44)

    • This term is informal and not used in federal regulations
    • Suggestion: Replace with "mandatory non-MAGI" or simply "mandatory categorically needy"
  2. California state reference (line 38)

    • The "California MAGI Hierarchy guidance" reference is state-specific
    • The federal CFR citations are sufficient; consider removing or replacing with federal source
    • Alternative federal reference: CMS State Medicaid Manual, Chapter 3
  3. "Order matters:" comment prefix (line 35)

    • Removing this makes the comment header cleaner while retaining the substance

📊 Validation Results

Check Status
Federal Compliance ✅ Hierarchy aligns with 42 CFR 435.119 requirement
Test Value Accuracy ✅ $4,631.1 correctly calculated from WI data
No Hard-coded Values ✅ All values parameterized
CI Status ✅ All checks passing

📝 Regulatory Verification

The PR correctly implements the federal hierarchy per 42 CFR 435.119, which states individuals must be "not otherwise eligible for and enrolled for mandatory coverage under a State's Medicaid State plan" before qualifying under the Adult group. This establishes the hierarchy:

  1. SSI Recipients (42 CFR 435.120-138)
  2. Children (42 CFR 435.118)
  3. Pregnant Women (42 CFR 435.116)
  4. Parents/Caretaker Relatives (42 CFR 435.110)
  5. Young Adults (optional state coverage)
  6. Adult Expansion (42 CFR 435.119 - residual category)
  7. Optional Aged/Blind/Disabled (non-SSI pathway)

🚀 Recommendation

Address the minor documentation suggestions from @PavelMakarchuk's review, then this PR is ready to merge.

- Remove 'Order matters:' prefix from comment
- Replace California MAGI Hierarchy reference with federal 42 CFR Part 435 Subpart B
- Remove 'mega-mandatory' informal term

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@PavelMakarchuk PavelMakarchuk merged commit d1fedc3 into PolicyEngine:main Jan 29, 2026
9 checks passed
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.

Medicaid category assignment order incorrect - mandatory groups should precede optional expansion

2 participants