-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Description
Problem
PR #7005 (Illinois HBI) adds state-specific logic directly into the federal medicaid_group variable. This approach doesn't scale well - if other states add similar programs (like California FFYP), the federal file will become cluttered with state-specific code.
Current implementation in medicaid_group.py:
# Illinois HBI-specific mapping (for those who fail immigration check
# but are eligible via state-funded HBI program)
il_hbi_eligible = person("il_hbi_eligible", period)
age = person("age", period)
p_hbi = parameters(period).gov.states.il.hfs.hbi.eligibility
il_hbi_child = il_hbi_eligible & (age <= p_hbi.child.max_age)
# ... more Illinois-specific logicProposed Solution
Create a generic state override pattern:
-
New file:
policyengine_us/variables/gov/states/il/hfs/hbi/il_hbi_medicaid_group.py- Returns appropriate
MedicaidGroupfor HBI-eligible people - Returns
NONEfor everyone else
- Returns appropriate
-
New file:
policyengine_us/variables/gov/hhs/medicaid/costs/state_medicaid_group_override.py- Aggregates all state-level Medicaid group overrides
- Future state programs just add their variable to this file
-
Edit:
policyengine_us/variables/gov/hhs/medicaid/costs/medicaid_group.py- Remove state-specific logic
- Add generic check for state override at the end:
state_override = person("state_medicaid_group_override", period) has_override = state_override != MedicaidGroup.NONE return where(has_override, state_override, federal_group)
Benefits
- Keeps federal variables clean of state-specific logic
- Scales to multiple states without modifying federal files
- State logic stays in state folders (
gov/states/il/...) - Follows existing patterns (similar to how
is_medicaid_eligiblehandles state programs)
Related
- Illinois medicaid for undocumented immigrants #7005 - Illinois Medicaid for undocumented immigrants
Metadata
Metadata
Assignees
Labels
No labels