Skip to content

Count blind people and use the individual or couple in the Medicaid medically needy test - #10370

Merged
hua7450 merged 7 commits into
PolicyEngine:mainfrom
hua7450:medicaid-medically-needy-blind-unit
Oct 29, 2026
Merged

hua7450 merged 7 commits into
PolicyEngine:mainfrom
hua7450:medicaid-medically-needy-blind-unit

Conversation

@hua7450

@hua7450 hua7450 commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #10366
Closes #10367

What and why

Two formula fixes in the Medicaid medically needy pathway.

Fix Before After Source
Blind people (#10366) is_in_medicaid_medically_needy_category checked is_ssi_disabled but never is_blind, so a blind adult under 65 who is not SSI-disabled could not qualify is_blind counts under the existing disabled flag 42 CFR 435.322 (blind) beside 435.324 (disabled)
Financial unit (#10367) Income, medical expenses and resources were summed over the tax unit, and the couple limits applied when tax_unit_is_joint Sums run over the marital unit; a child's resources include the parents' resources SSI deems to the child, and a child's income is reduced by a share of the parents' medical expenses; the couple limits apply when the marital unit has two people 42 CFR 435.602(a)(2)(i), 435.831(d), 435.845(a), 20 CFR 416.1202(b)

Blind under the disabled flag. The disabled parameter cites KFF's 50-state survey, whose medically needy column covers "seniors and people with disabilities" and counts blindness as a disability. KFF never reports blind coverage separately, so this PR adds no blind parameter.

Marital unit. Non-MAGI Medicaid counts only the income and resources of a spouse, or of a parent for a child. ssi_countable_income already carries a child's deemed parental income, an ineligible spouse's deemed income, and each half of an eligible couple's combined income. A child's marital unit holds only the child, so the formula adds ssi_resources_deemed_from_ineligible_parent (the January value of the parents' resources above SSI's $2,000 or $3,000 allowance) to the child's own resources. 42 CFR 435.831(d) also deducts medical expenses of "financially responsible relatives", so a child's countable income is reduced by the medical expenses of the tax unit's ineligible parents (is_ssi_ineligible_parent), split equally among the eligible children as SSI splits deemed parental income (parental_expense_share). The optional aged, blind and disabled pathway already sums over the marital unit in the same way (is_optional_senior_or_disabled_income_eligible, medicaid_optional_senior_or_disabled_income_limit).

The couple flag keeps its name, is_joint, so that the income-limit lines stay untouched. #10374 (closes #10357 and #10358) rewrites those lines, and git merge-file merges the formula cleanly in either order with the same result. Whichever of the two merges second should rename the local is_joint to is_couple, as the optional pathway names it; doing it here first would conflict with #10374's rewrite.

Examples

Massachusetts, 2026: $522 / $650 a month and $2,000 / $3,000 in resources.

Household main This PR
Blind adult, age 40, not SSI-disabled Not in a medically needy category In the disabled group
Aged filer (70): $17,760 countable income, $13,000 medical expenses, $500 resources. Claims their 92-year-old parent: $3,760 countable pension, $1,800 resources 8,520 > 6,264 and 2,300 > 2,000: ineligible 4,760 ≤ 6,264 and 500 ≤ 2,000: eligible
Aged married couple filing separately, $13,080 countable income and $8,000 medical expenses each Each passes alone: 5,080 ≤ 6,264 10,160 > 7,800 (couple limit): ineligible
Disabled child, 10: $21,358 countable income (deemed from the parents' $80,000 wages), $16,000 medical expenses. Married parents hold $4,000 (not a test case) Joint tax unit: couple limits; 4,000 > 3,000: ineligible Individual limits; 4,000 - 3,000 = 1,000 deemed ≤ 2,000 and 5,358 ≤ 6,264: eligible

Microsimulation effect

  • Blind people under 65 who are not SSI-disabled can now qualify as medically needy in the states with the disabled group on, if they fall in no other pathway and meet the limits after medical expenses. The flag is on in 32 states, 5 of which (AZ, ID, IN, NM, NV) have no limits, so the change reaches 27 states. Update Medicaid medically needy limits and switch on AR, IA, IL, NJ and ND #10374 also switches the flags on in AR, IA, IL, NJ and ND.
  • Aged, blind and disabled people who share a tax unit with relatives other than a spouse, such as parents claimed as dependents, are now tested on their own income and resources against the individual limits. Spouses who file separately are tested together against the couple limits.
  • Blind or disabled children under 18 are tested against the individual limits, counting the parents' resources only above SSI's $2,000 or $3,000 allowance, instead of the parents' full resources against the couple limits of a joint tax unit. A child who fails one of SSI's allocation gates (own resources above $2,000, SSI's immigration test, or the adjudicated-ineligible input) is deemed nothing, so in states whose individual limit is above $2,000 some children are tested on their own resources only (Medicaid medically needy: count a child's deemed parental resources without SSI's own-resource and immigration gates #10478).
  • Measured in review on the 2024 Populace data: weighted medically needy eligibility goes from 402,535 to 386,285. One Georgia record (11,510 weighted) gains through blindness. The losses are people whose tax unit pooled a non-spouse relative's expenses or assets; the Connecticut and Michigan records were checked and are correct under 42 CFR 435.602. The data have no medically needy children under 18, so the parent-expense and parent-resource rules change only household results. is_blind comes from CPS PEDISEYE, which is wider than the SSI blindness test (a data-side note).

Relation to #10240 and #10374

A local review of #10240 flagged the tax-unit sum (once that PR counts noncitizens' income, an aged dependent's pension removes the filer's eligibility). This PR fixes it, so #10240 need not.

#10240, #10374 and this PR each append cases to is_medically_needy_for_medicaid.yaml starting at Case 3, so whichever merges later gets a conflict at the end of that file and renumbers its cases. #10374 also appends a case (disabled adults in AR, IA, IL, ND and NJ) to is_in_medicaid_medically_needy_category.yaml, where this PR adds Cases 1-2: a second end-of-file conflict, resolved by keeping both sides. The conflict is placement and numbering only: #10374 leaves the Massachusetts limits and the Texas flags unchanged, so this PR's expected values hold in either order. The formula itself merges cleanly with #10374 in either order.

Draft #10394 adds blind people to the medically needy category for North Dakota only (N.D.A.C. 75-02-02.1-05(3)(e)) and adds a reference to the same variable. This PR's is_blind clause makes that North Dakota clause redundant, and the two edit the same line of is_in_medicaid_medically_needy_category.py.

Limitations

Tests

  • is_in_medicaid_medically_needy_category.yaml: a blind adult in Massachusetts (in the group) and in Texas, which has no disabled group (not in a group).
  • is_medically_needy_for_medicaid.yaml: the filer with a dependent parent (Case 3) and the couple filing separately (Case 4), both examples above. Cases 5 and 6: a disabled child of 10 whose married parents hold $20,000 (17,000 deemed > 2,000: ineligible) or $2,400 (nothing deemed: eligible). Case 7: a couple whose combined net income (7,000) is between the individual and couple limits. Case 8: a disabled child in a joint tax unit tested against the individual limit (6,358 > 6,264). Case 9: a parent's $8,000 of medical expenses brings the child to 3,358 <= 6,264. Case 10: a blind adult computed end to end through the category.
  • A static scan of the YAML suite found no existing case whose expected value changes: no multi-person case with an aged, blind or disabled member has a medically needy result that differs between the tax and marital units, and the existing blind cases already qualify through another pathway or live in states without the group. Partner contract tests (tests/policy/baseline/partners/**) are unaffected; their multi-person aged and disabled cases are in Texas, which has no medically needy aged or disabled group.

Test plan

axiom: TheAxiomFoundation/rulespec-us#1931 queued

🤖 Generated with Claude Code

Count blind people under the medically needy disabled group (42 CFR
435.322), and sum medically needy income and resources over the
individual or married couple, choosing the couple limits from the
marital unit (42 CFR 435.602).

Fixes PolicyEngine#10366
Fixes PolicyEngine#10367

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A blind or disabled child's resource test now adds the resources SSI deems
from ineligible parents (20 CFR 416.1202(b)), as countable income already
includes their deemed income. The variable cites 42 CFR 435.602, 435.831
and 435.845.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PavelMakarchuk PavelMakarchuk left a comment

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.

Program Review

PR #10370, "Count blind people and use the individual or couple in the Medicaid medically needy test" (hua7450). Round 1, full review.

IDs: C = critical, SA = should address, G = suggestion.

Paths: CAT = is_in_medicaid_medically_needy_category.py and ELIG = is_medically_needy_for_medicaid.py, both in policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/medically_needy/. CAT.yaml and ELIG.yaml are the matching test files. Line numbers refer to the reviewed head. PDF links use file page numbers. Dollar figures are Massachusetts 2026: $522 / $650 a month (individual / couple), $2,000 / $3,000 in resources.

Source Documents

Branch Status

  • 4 commits ahead and 19 behind main. No commit on main since the merge base touches the two formulas.
  • CI: 22 pass, 1 fail, 3 skipped. Baseline tests / Full Suite - Baseline (states-shard-2) was cancelled at the 60-minute limit with 0 test failures. Its 6 finished batches passed but ran 4-6x slower than on other runs that day; the same shard passed in 20-30 minutes on 5 other runs. Locally, the 8 unfinished batches pass 3,267 of 3,267 at the head. A slow runner caused it, not the PR. Re-run the shard before merge.
  • #10374 edits the same formula and moves the income limit into medicaid_medically_needy_income_limit, which also uses marital_unit.nb_persons() == 2. The formula merges cleanly in either order. #10374 and #10240 append cases to the same test files, so the PR that merges later keeps both blocks and renumbers. Draft #10394 edits the same CAT:20 line (G4).

What the PR gets right

  • Blind people. CAT:20 counts is_blind or is_ssi_disabled. 435.301(b)(2) lists "(iv) Blind" beside "(v) Disabled", and 435.530 uses the SSI blindness definition, which has no SGA test. A blind worker with $36,000 of earnings and $30,000 of medical expenses is medically needy at the head, not on main. KFF counts blindness as a disability, so the disabled flag is a fair source.
  • Individual or couple. ELIG:43-45 sums over the marital unit. 435.602(a)(2)(i): "Except for a spouse of an individual or a parent for a child who is under age 21 or blind or disabled, the agency must not consider income and resources of any relative". A dependent parent no longer pools with the filer (Case 3), and separate filers are tested together (Case 4). This matches the optional pathway and #10374.
  • No double count. ssi_countable_income is 0 for a person who is not SSI-eligible, and each member of an eligible couple carries half (policyengine_us/variables/gov/ssa/ssi/eligibility/income/ssi_countable_income.py:79-85).
  • Deemed parental resources. ELIG:37-39 follows 20 CFR 416.1202(b): Cases 5 and 6 deem 17,000 and 0.
  • Housekeeping. The four new eCFR anchors resolve and support the rules. The changelog and formatting are correct. The test comments and the PR body figures check out.

Critical (Must Fix)

C1. A parent's medical expenses no longer reduce a disabled child's countable income.

  • Where: ELIG:30 reads only the person's own expenses, ELIG:35-36 says "Parents' medical expenses are not deducted for the child.", and ELIG:44 sums over the child's one-person marital unit. ELIG:21 cites 435.831(d).
  • Evidence: 42 CFR 435.831(d): "the agency must deduct from income medical expenses incurred by the individual or family or financially responsible relatives". Under 435.602(a)(2)(i) a parent is responsible "for a child who is under age 21 or blind or disabled". The CMS guide: expenses "include expenses incurred by other members of the family and financially responsible relatives" (#page=2). Tennessee's plan page repeats 435.831(d) (#page=1). The Massachusetts plan page limits expenses by date and fee, not by whose they are (#page=4).
  • Probe: parents with $40,000 wages each, parent 1 with $8,000 of medical expenses; an SSI-disabled child of 10 with ssi_countable_income 21,358 and $10,000 of expenses. main gives [false, false, true], the head [false, false, false], the fix below [false, false, true]. By the rule, 21,358 - (10,000 + 8,000) = 3,358 <= 6,264: the child is eligible.
  • Why this severity: a regulatory mismatch, and a test proves the flip. It is a regression, because the tax-unit sum on main deducted the parents' expenses. "Must deduct" leaves no modeling choice, so the Limitations note does not save it. The 2024 microdata have no medically needy children under 18, so only household results change.
  • Fix: delete "Parents' medical expenses are not deducted for the child." at ELIG:35-36, and replace ELIG:44 with:
        # 42 CFR 435.831(d) deducts expenses of financially responsible
        # relatives. For a child these are the ineligible parents whose
        # income SSI deems (20 CFR 416.1165); split their expenses among the
        # eligible children as the deemed income is split, so that an
        # expense is deducted once.
        tax_unit = person.tax_unit
        eligible_child = is_aged_blind_or_disabled & person("is_child", period)
        parental_expenses = tax_unit.sum(
            medical_expenses * person("is_ssi_ineligible_parent", period)
        )
        eligible_children = tax_unit.sum(eligible_child)
        parental_expense_share = where(
            eligible_child, parental_expenses / max_(eligible_children, 1), 0
        )
        income = marital_unit.sum(
            personal_income - medical_expenses - parental_expense_share
        )

It finds parents and children as ssi_unearned_income_deemed_from_ineligible_parent does. The split among siblings is a modeling choice; the full amount per child is the other option. With the fix, 17 medically needy cases, 774 Medicaid and partner healthcare cases, and 1,153 other Medicaid-reading cases pass. If a caller omits marital units, the parents' expenses are deducted twice (G1). Remove the third Limitations bullet, and append this case (it fails at the head):

- name: Case 9, a parent's medical expenses reduce a disabled child's countable income.
  period: 2026
  input:
    people:
      person1:
        age: 40
        is_tax_unit_head: true
        is_parent: true
        employment_income_before_lsr: 40_000
        ssi_countable_resources: 1_200
        medicaid_medically_needy_medical_expenses: 8_000
      person2:
        age: 38
        is_tax_unit_spouse: true
        is_parent: true
        employment_income_before_lsr: 40_000
        ssi_countable_resources: 1_200
      person3:
        age: 10
        is_tax_unit_dependent: true
        is_ssi_disabled: true
        ssi_countable_income: 21_358
        medicaid_medically_needy_medical_expenses: 10_000
        is_optional_senior_or_disabled_for_medicaid: false
    tax_units:
      tax_unit:
        members: [person1, person2, person3]
    marital_units:
      marital_unit1:
        members: [person1, person2]
      marital_unit2:
        members: [person3]
    households:
      household:
        members: [person1, person2, person3]
        state_code: MA
  output:
    # 42 CFR 435.831(d): 21,358 - (10,000 own + 8,000 parent's) = 3,358
    # <= 522 x 12 = 6,264. Resources: nothing deemed (2,400 < 3,000).
    is_medically_needy_for_medicaid: [false, false, true]

Should Address

SA1. is_in_medicaid_medically_needy_category has no reference.

  • Where: CAT:4-9. The PR changes the variable's legal basis but cites 42 CFR 435.322 and 435.324 only in a comment (CAT:17-19).
  • Evidence: CLAUDE.md:143: "Always cite specific regulation sections in variable reference and documentation". 435.301(b)(2) lists "(iv) Blind (§§ 435.322, 435.330 and 435.340)" and "(v) Disabled (§§ 435.324, 435.330, and 435.340)".
  • Why this severity: the gap predates the PR and the comment names the right sections, so it is not critical. But the PR edits this legal basis, so the reference belongs here.
  • Fix (passes at the head; insert after CAT:9; the KFF URL is the disabled parameter's):
    reference = (
        "https://www.ecfr.gov/current/title-42/section-435.301#p-435.301(b)(2)",
        "https://www.ecfr.gov/current/title-42/section-435.322",
        "https://www.ecfr.gov/current/title-42/section-435.324",
        "https://www.kff.org/report-section/medicaid-financial-eligibility-for-seniors-and-people-with-disabilities-findings-from-a-50-state-survey-appendix-tables/",
    )

SA2. No test separates the individual limit from the couple limit.

  • Where: ELIG:48 (is_joint = marital_unit.nb_persons() == 2). Net income is above both limits in Case 4 and below both in Cases 3, 5 and 6.
  • Evidence: on a package copy, three wrong flags pass all 14 medically needy cases: the pre-PR person.tax_unit("tax_unit_is_joint", period), "couple if the tax unit has 2 or more people", and "always individual". Cases 7 and 8 catch all three.
  • Why this severity: a missing edge case for a tested variable. The couple flag is half of the #10367 fix.
  • Fix (both pass at the head and with the C1 fix):
- name: Case 7, married couple filing separately qualifies on the couple limit when combined net income is between the two limits.
  period: 2026
  input:
    people:
      person1:
        age: 68
        ssi_countable_income: 10_000
        medicaid_medically_needy_medical_expenses: 6_500
        ssi_countable_resources: 1_000
        is_optional_senior_or_disabled_for_medicaid: false
      person2:
        age: 66
        ssi_countable_income: 10_000
        medicaid_medically_needy_medical_expenses: 6_500
        ssi_countable_resources: 1_000
        is_optional_senior_or_disabled_for_medicaid: false
    tax_units:
      tax_unit1:
        members: [person1]
      tax_unit2:
        members: [person2]
    marital_units:
      marital_unit:
        members: [person1, person2]
    households:
      household:
        members: [person1, person2]
        state_code: MA
  output:
    # 2 x (10,000 - 6,500) = 7,000: above 6,264, at or below 7,800.
    is_medically_needy_for_medicaid: [true, true]

- name: Case 8, disabled child in a joint tax unit is tested against the individual limit.
  period: 2026
  input:
    people:
      person1:
        age: 40
        is_tax_unit_head: true
        is_parent: true
        employment_income_before_lsr: 40_000
        ssi_countable_resources: 1_200
      person2:
        age: 38
        is_tax_unit_spouse: true
        is_parent: true
        employment_income_before_lsr: 40_000
        ssi_countable_resources: 1_200
      person3:
        age: 10
        is_tax_unit_dependent: true
        is_ssi_disabled: true
        ssi_countable_income: 21_358
        medicaid_medically_needy_medical_expenses: 15_000
        is_optional_senior_or_disabled_for_medicaid: false
    tax_units:
      tax_unit:
        members: [person1, person2, person3]
    marital_units:
      marital_unit1:
        members: [person1, person2]
      marital_unit2:
        members: [person3]
    households:
      household:
        members: [person1, person2, person3]
        state_code: MA
  output:
    # 21,358 - 15,000 = 6,358 > 6,264 (the couple limit 7,800 would pass).
    is_medically_needy_for_medicaid: [false, false, false]

Suggestions

G1. Correct the Limitations text on omitted marital units.

  • Where: the first Limitations bullet; behavior at ELIG:43-48.
  • Evidence: without marital units, Core builds one unit for every person in the situation, across households. An SSI-disabled parent with a spouse and two children is eligible on main and ineligible at the head (4-person unit, individual limit: 6,500 > 6,264); with marital units given, both are eligible. Two unrelated aged people in two households are summed (10,160 > 7,800).
  • Why a suggestion: with the inputs the law requires, the head is correct. #10000 fixes the default, the optional pathway and #10374 behave the same, and microdata supply marital units.
  • Fix (body only): "When a caller omits marital units, Core puts every person in the situation into one marital unit, across households (#10000 changes this). A situation of exactly two people gets the couple limits and a larger one the individual limits. Partner API fixtures omit marital units, but none has an aged, blind or disabled member in a medically needy state."

G2. The couple limit applies even when SSI deems no spouse income.

  • Where: ELIG:48 with ELIG:50-59.
  • Evidence: 20 CFR 416.1163(d)(1): below the couple-minus-individual benefit gap "there is no income to deem", and SSI uses the individual rate. 130 CMR 520.002(A)(1) instead counts "the total countable-income amount and countable assets of the individual and the spouse who are living together" against the couple standard. The head applies the couple limit to own income only. An aged person with $20,000 of Social Security and $13,000 of expenses, whose spouse earns $4,800: separate filers are ineligible on main (6,760 > 6,264) and eligible at the head; joint filers are eligible on both.
  • Why a suggestion: main does the same for joint filers, and the PR documents the couple-limit half. The monthly gap is up to $391 (New York; Massachusetts $128; 0 in 7 states).
  • Fix: open a follow-up issue (couple limit only when SSI deeming applies, or full spouse income in couple-budget states), and say in the body that spouse income below the deeming threshold is not counted.

G3. Rename the local is_joint to is_couple.

  • ELIG:48 now means a two-person marital unit; the optional pathway uses is_couple. Rename it in whichever of this PR and #10374 merges second.

G4. Name #10394 in the PR body.

  • Draft #10394 changes CAT:20 to add blind people for North Dakota only (N.D.A.C. 75-02-02.1-05(3)(e)) and adds a reference to CAT. This PR makes that clause redundant, and the two conflict on the line.

G5. Add an end-to-end blind case.

  • ELIG.yaml Cases 1-2 take the category as an input, so no case computes it on the way to eligibility. Optional, because CAT.yaml Case 1 pins the change. Append to ELIG.yaml (passes at the head):
- name: Case 10, blind adult under 65 who is not SSI-disabled qualifies after spenddown.
  period: 2026
  input:
    age: 40
    is_blind: true
    is_adult_for_medicaid: false
    is_optional_senior_or_disabled_for_medicaid: false
    ssi_countable_income: 12_000
    medicaid_medically_needy_medical_expenses: 6_000
    ssi_countable_resources: 1_000
    state_code: MA
  output:
    # 12,000 - 6,000 = 6,000 <= 6,264; resources 1,000 <= 2,000.
    is_in_medicaid_medically_needy_category: true
    is_medically_needy_for_medicaid: true

G6. Report the measured population effect.

  • The body says the effect "has not been measured". On the 2024 populace data, weighted medically needy eligibility goes from 402,535 to 386,285. One Georgia record (11,510) gains through blindness. Losses are people whose tax unit pooled a non-spouse relative's expenses or assets; the Connecticut and Michigan records were checked and are correct under 435.602.
  • Data note: is_blind comes from CPS PEDISEYE ("blind or serious difficulty seeing even when wearing glasses"), wider than the SSI test. A data-side issue, not this PR's.

Investigated and cleared

  • Blind gate. is_ssi_aged_blind_disabled (ELIG:28) already includes is_blind, so only the category needed the change.
  • January read (ELIG:38): same value as the annual read for annual inputs.
  • Existing expectations. No existing YAML result changes in any suite that ran.
  • Partner contract tests. None edited; "Household API Partners" passed; the partner healthcare folder passes 70 of 70 read-only.
  • axiom: line. rulespec-us#1931 exists and is open. Process note only.

Out of scope / follow-up

  • policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/is_209b_ssi_recipient_income_eligible_for_medicaid.py:28-32 also omits the parents' expenses for a child. Apply the C1 approach in a follow-up.
  • Documented in the body: SSI allocation gates on deemed resources (#10478); parental resources only under 18; the optional pathway's asset test omits deemed parental resources.

Validation Summary

Check Result
CI 22 pass, 1 fail (states-shard-2 timeout, 0 test failures, not the PR), 3 skipped. Re-run before merge
Local tests Changed files 11/11; medically needy folder 14/14; gov/hhs/medicaid 701/701; shard-2 gap 3,267/3,267
Partner contract tests None edited; read-only healthcare folder 70/70
Regulatory Blind group and marital unit correct; parents' expenses dropped (C1)
References 4 new eCFR anchors correct; CAT has none (SA1)
Mutation 3 wrong couple flags survive (SA2); Cases 7-8 catch them
Fixes C1, SA1, SA2 fixes pass: 17, 774 and 1,153 cases
Microsimulation 402,535 to 386,285 weighted medically needy; no children under 18
Branch 4 ahead / 19 behind; overlaps #10374, #10240, #10394

Review Severity: REQUEST_CHANGES

One critical item (C1) and two should-address items (SA1, SA2) are open.

Next Steps

To auto-fix issues: run the fix-pr workflow for this PR.

  1. Fix C1: change ELIG:35-36 and ELIG:44, add Case 9, and remove the third Limitations bullet.
  2. Add the reference to CAT (SA1) and Cases 7-8 to ELIG.yaml (SA2).
  3. Take the suggestions that you agree with. G1, G4 and G6 are body edits; G2 needs an issue.
  4. Run make format, then the medically needy folder and gov/hhs/medicaid.
  5. Re-run the failed states-shard-2 job before merge (a new push also starts a full run).
  6. If #10240 or #10374 merges first, keep both test blocks and renumber.

hua7450 and others added 2 commits October 27, 2026 14:54
…needy

42 CFR 435.831(d) deducts expenses of financially responsible relatives.
A disabled child's countable income now subtracts an equal share of the
ineligible parents' medical expenses, split as SSI splits deemed income.
Adds the category variable's references and Cases 7-10 (couple versus
individual limit, the parent's expenses, and a blind adult end to end).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hua7450

hua7450 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. Round-1 changes are in 857cb94a22, and d70717ef5e merges main (4c65c82191). Dispositions:

Item Disposition
C1 parents' medical expenses Done. Removed the "not deducted" comment and added your parental_expense_share block, which splits the ineligible parents' expenses among the eligible children as SSI splits deemed income. Added your Case 9 (21,358 - 10,000 - 8,000 = 3,358 <= 6,264) and removed the Limitations bullet. The body now notes the equal split as a modeling choice.
SA1 category reference Done, with your four entries (435.301(b)(2), 435.322, 435.324 and the KFF appendix tables).
SA2 couple versus individual limit Done: Cases 7 (combined net 7,000, between the limits) and 8 (disabled child in a joint tax unit, 6,358 > 6,264).
G1 omitted marital units Done. The Limitations bullet now uses your wording and notes that the parents' expenses would also be counted twice.
G2 couple limit without deeming Done. Filed #10507 (couple limit only when SSI deems, or the spouse's full income in couple-budget states such as Massachusetts), and the body says spouse income below the deeming threshold is not counted.
G3 rename is_joint Not done here. #10374 is still open and rewrites the lines that use is_joint, so renaming it first would conflict with that rewrite. The body asks whichever of the two PRs merges second to rename it to is_couple.
G4 #10394 Done. The body names it: this PR's is_blind clause makes its North Dakota clause redundant, and both edit the same line.
G5 end-to-end blind case Done: Case 10.
G6 measured effect Done. The body now gives your 2024 Populace figures (402,535 to 386,285), the Georgia gain, the Connecticut and Michigan checks, the absence of children under 18, and the PEDISEYE data note.
Out of scope: 209(b) spenddown Filed #10508 to apply the same parental-expense share in is_209b_ssi_recipient_income_eligible_for_medicaid.
states-shard-2 timeout The new push starts a full run.

The formula still merges cleanly with #10374 in either order. Two test files have end-of-file conflicts with it (both blocks are kept; the PR that merges second renumbers). TheAxiomFoundation/rulespec-us#1931 now describes this head: parents' expenses deducted, and two companion cases added for the parent's expenses and the couple limit. No tests were run locally; I checked each new expected value by hand.

Brings in main's CI fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PavelMakarchuk PavelMakarchuk left a comment

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.

Program Review

PR #10370, "Count blind people and use the individual or couple in the Medicaid medically needy test" (hua7450). Round 2, incremental review of 5434a6c..9890e56.

IDs: C = critical, SA = should address, G = suggestion. New items continue the numbering after the highest prior ID in each class.

Paths: CAT = is_in_medicaid_medically_needy_category.py and ELIG = is_medically_needy_for_medicaid.py, both in policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/medically_needy/. CAT.yaml and ELIG.yaml are the matching test files. Line numbers refer to the reviewed head. Dollar figures are Massachusetts 2026: $522 / $650 a month (6,264 / 7,800 a year), $2,000 / $3,000 in resources.

Source Documents

  • Reviewed head SHA: 9890e56
  • Mode: incremental (round 2)
  • Scope: one fix commit, 857cb94a22, and two merges of main (d70717ef5e, 9890e56683). The fix commit changes 4 files: ELIG:31-35 (comment), ELIG:43-59 (parental expense share), CAT:10-15 (new reference), ELIG.yaml Cases 7-10 (+128 lines), and the changelog fragment. The merges bring no change to PR-scope files. The PR body was rewritten for G1, G2, G4 and G6.
  • Regulations (eCFR, fetched 2026-10-29): 42 CFR 435.301(b)(2), 435.322, 435.324, 435.831(d); 20 CFR 416.1165(e)(2).
  • Other: the KFF 50-state survey URL (now redirects with HTTP 200 to the survey's main page); issues #10507, #10508; PRs #10374, #10240, #10394; TheAxiomFoundation/rulespec-us#1931.

Branch Status

  • 7 commits ahead and 34 behind main. None of the 34 newer main commits touches gov/hhs/medicaid or gov/ssa/ssi. One touches ss_aime.py, which is not related.
  • CI at the head: 33 of 33 pass. Baseline tests / Full Suite - Baseline (states-shard-2) passed in 35 minutes. The round-1 re-run note is resolved.
  • #10374, #10240 and draft #10394 are still open. #10374 rewrites the income-limit lines at ELIG:63-69 and names its flag is_couple. Its new multi-person cases give two-person marital units, so they agree with this PR's couple flag. #10374 and #10240 append cases to ELIG.yaml (and #10374 to CAT.yaml), so the PR that merges later keeps both blocks and renumbers. #10394 edits CAT:26.

Round 1 items

ID Status Evidence
C1 RESOLVED ELIG:43-59 is the suggested block, word for word. The "not deducted" sentence is gone from ELIG:31-35. ELIG.yaml Case 9 (line 279) passes: 21,358 - (10,000 + 8,000) = 3,358 <= 6,264; parents hold 2,400 < 3,000, so nothing is deemed. A mutation that sets the share to 0 fails Case 9. The third Limitations bullet is replaced by a bullet that names the equal split as a modeling choice. 42 CFR 435.831(d) supports the rule ("medical expenses incurred by the individual or family or financially responsible relatives"), and 20 CFR 416.1165(e)(2) supports the equal split by analogy ("we divide the parental income to be deemed equally among those eligible children").
SA1 RESOLVED CAT:10-15 holds the four entries. 435.301(b)(2) lists "(iv) Blind (§§ 435.322, 435.330 and 435.340)" and "(v) Disabled (§§ 435.324, ...)". 435.322 covers blind individuals who meet 435.530 and subpart I. The KFF URL is the one in categories/disabled.yaml:9.
SA2 RESOLVED Cases 7 (line 208) and 8 (line 240) are in ELIG.yaml and pass. Case 7: 2 x (10,000 - 6,500) = 7,000, above 6,264 and at or below 7,800; resources 2,000 <= 3,000. Case 8: 21,358 - 15,000 = 6,358 > 6,264. A mutation back to tax_unit_is_joint fails both cases.
G1 RESOLVED The first Limitations bullet uses the suggested wording. It also says that the parents' expenses would then count twice for a child. That is correct: in one large marital unit, the child's sum holds the parents' own expenses and the child's share.
G2 RESOLVED #10507 is open. It cites 416.1163(d)(1) and 130 CMR 520.002(A)(1), gives the example, and proposes a state budgeting-method parameter. The second Limitations bullet says that spouse income below the deeming threshold is not counted.
G3 DECLINED (accepted) The author keeps is_joint because #10374 rewrites ELIG:63-69 and introduces is_couple there. A rename here would add a conflict for no behavior change. The body asks the PR that merges second to rename it. The reason holds.
G4 RESOLVED The body names draft #10394, its North Dakota clause, and the shared line in CAT.
G5 RESOLVED Case 10 (line 320) computes the category for a blind 40-year-old and passes: 12,000 - 6,000 = 6,000 <= 6,264; 1,000 <= 2,000.
G6 RESOLVED The body gives 402,535 to 386,285, the Georgia record (11,510), the Connecticut and Michigan checks, no medically needy children under 18, and the PEDISEYE note. The C1 change does not alter these figures, because the data have no medically needy children.

Round-1 out-of-scope item: the 209(b) spenddown gap is DEFERRED to #10508, which proposes the same parental_expense_share approach. Accepted.

New findings

Critical

None.

Should address

None.

Suggestions

G7. No test covers the split of a parent's expenses among two or more eligible children.

  • Where: ELIG:53-56 (parental_expenses / max_(eligible_children, 1)).
  • Evidence: every new case has one eligible child. On a package copy, the mutation "full amount for each child" (parental_expenses without the division) passes all 11 ELIG.yaml cases.
  • Why a suggestion: the split is a documented modeling choice (third Limitations bullet), and it follows 416.1165(e)(2). The code came from the round-1 review. A test only pins that choice.
  • Fix (passes at the head; fails under the mutation). Append to ELIG.yaml:
- name: Case 11, two disabled children split a parent's medical expenses equally.
  period: 2026
  input:
    people:
      person1:
        age: 40
        is_tax_unit_head: true
        is_parent: true
        employment_income_before_lsr: 40_000
        ssi_countable_resources: 1_200
        medicaid_medically_needy_medical_expenses: 8_000
      person2:
        age: 38
        is_tax_unit_spouse: true
        is_parent: true
        employment_income_before_lsr: 40_000
        ssi_countable_resources: 1_200
      person3:
        age: 10
        is_tax_unit_dependent: true
        is_ssi_disabled: true
        ssi_countable_income: 12_000
        medicaid_medically_needy_medical_expenses: 2_000
        is_optional_senior_or_disabled_for_medicaid: false
      person4:
        age: 8
        is_tax_unit_dependent: true
        is_ssi_disabled: true
        ssi_countable_income: 12_000
        medicaid_medically_needy_medical_expenses: 1_500
        is_optional_senior_or_disabled_for_medicaid: false
    tax_units:
      tax_unit:
        members: [person1, person2, person3, person4]
    marital_units:
      marital_unit1:
        members: [person1, person2]
      marital_unit2:
        members: [person3]
      marital_unit3:
        members: [person4]
    households:
      household:
        members: [person1, person2, person3, person4]
        state_code: MA
  output:
    # Each child gets 8,000 / 2 = 4,000 of the parent's expenses.
    # person3: 12,000 - 2,000 - 4,000 = 6,000 <= 6,264.
    # person4: 12,000 - 1,500 - 4,000 = 6,500 > 6,264.
    # Resources: nothing deemed (2,400 < 3,000).
    is_medically_needy_for_medicaid: [false, false, true, false]

If #10374 or #10240 merges first, renumber the case.

Investigated and cleared

  • Parent mask. is_ssi_ineligible_parent excludes the child, so a child's own expenses are not deducted twice. Case 8 catches a mutation that drops the mask (21,358 - 15,000 - 15,000 < 6,264).
  • Divide by zero. max_(eligible_children, 1) keeps the divisor at 1 or more, and where gives 0 to anyone who is not an eligible child.
  • Adult in the share. A mutation that drops is_child from eligible_child survives. It only matters for an aged, blind or disabled adult who shares a tax unit with an ineligible parent and an eligible child. The head matches ssi_unearned_income_deemed_from_ineligible_parent, so the code is right; this is not a finding.
  • Partner contract tests. None edited. "Household API Partners" passed at the head.
  • axiom: line. rulespec-us#1931 is open and was updated with the author's response. Process note only.

Tests run

  • policyengine-core test .../medically_needy -c policyengine_us at SNAPSHOT: 18 of 18 pass (CAT.yaml 4, ELIG.yaml 11, medicaid_medically_needy_medical_expenses.yaml 3).
  • Hand checks of Cases 7-10 against the Massachusetts parameters (limit/income/individual.yaml:50-51 522, couple.yaml:50-51 650, limit/assets/*.yaml:50-51 2,000 and 3,000): all four expected values are correct.
  • Mutations on a package copy, ELIG.yaml only:
    • share set to 0: Case 9 fails.
    • no ineligible-parent mask: Case 8 fails.
    • tax_unit_is_joint couple flag: Cases 7 and 8 fail.
    • full amount for each child: all pass (G7).
    • is_child dropped from eligible_child: all pass (cleared above).
  • Proposed Case 11: passes at the head and fails under the "full amount for each child" mutation.
  • CI at the head: 33 of 33 pass.

Verdict

APPROVE: C1, SA1 and SA2 are resolved, and CI is green. G7 (a two-child test for the expense split) is optional.

@hua7450
hua7450 merged commit e7f041c into PolicyEngine:main Oct 29, 2026
33 checks passed
hua7450 added a commit that referenced this pull request Oct 29, 2026
…SSP immigration mask, new cases

- C1: md_paa_imputed_federal_ssi reduces the couple rate by one third in another person's household (20 CFR 416.1131; POMS SI 01320.400 B.1.e); md_paa Cases 14-16
- SA1: medically needy Case 13 (a noncitizen dependent parent's pension does not count against the head), now that #10370 is on main
- SA2: the CA state supplement leaves out a member who fails SSI's noncitizen test, except a spouse in an SSI couple computation; Case 12; Case 11 and the CAPI mixed-couple case restated
- SA3: MSP Case 6 and SC OSS Case 8
- G1/G2/G7: MD PAA comment, Case 11 note on the public income-maintenance exclusion, KY SSP gate aligned

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants