Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8674.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Retired `has_marketplace_health_coverage` from active input discovery by making it a compatibility alias, and canonicalized household health benefit accounting on annual health-value variables such as `assigned_aca_ptc`.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
description: The government counts these sources as household benefits.
values:
2022-01-01:
- medicaid
- medicaid_cost
- msp_cost
- chip
- premium_tax_credit
- per_capita_chip
- assigned_aca_ptc
- co_omnisalud
- or_healthier_oregon_cost

metadata:
unit: list
Expand Down
12 changes: 12 additions & 0 deletions policyengine_us/tests/core/test_input_variable_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ def test_input_variables_do_not_use_formulas_adds_or_subtracts():
assert invalid == {}


def test_legacy_marketplace_coverage_is_not_active_input_variable():
system = CountryTaxBenefitSystem()

legacy_variable = system.variables["has_marketplace_health_coverage"]
assert not legacy_variable.is_input_variable()
assert legacy_variable.formulas
assert system.variables[
"has_marketplace_health_coverage_at_interview"
].is_input_variable()
assert system.variables["takes_up_aca_if_eligible"].is_input_variable()


def test_state_input_variables_match_state_defined_for():
system = CountryTaxBenefitSystem()

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: Case 1, monthly Premium Tax Credit is one twelfth of assigned annual ACA PTC.
period: 2026-01
absolute_error_margin: 0.01
input:
assigned_aca_ptc: 1_200
output:
premium_tax_credit: 100
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- name: Case 1, legacy Marketplace coverage follows reported interview coverage.
period: 2026
input:
has_marketplace_health_coverage_at_interview: true
output:
has_marketplace_health_coverage: true

- name: Case 2, legacy Marketplace coverage defaults false without reported interview coverage.
period: 2026
input:
has_marketplace_health_coverage_at_interview: false
output:
has_marketplace_health_coverage: false
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,17 @@
msp_cost: 2_434.8
output:
healthcare_benefit_value: 2_434.8

- name: Case 3, annual assigned ACA PTC is the canonical ACA health benefit value.
period: 2026
absolute_error_margin: 0.01
input:
medicaid_cost: 0
msp_cost: 0
per_capita_chip: 0
assigned_aca_ptc: 1_200
premium_tax_credit: 99
co_omnisalud: 0
or_healthier_oregon_cost: 0
output:
healthcare_benefit_value: 1_200
Original file line number Diff line number Diff line change
@@ -1,33 +1,56 @@
- name: flag off
- name: Case 1, flag off excludes canonical and legacy health values.
period: 2026
absolute_error_margin: 0.01
input:
gov.simulation.include_health_benefits_in_net_income: false
premium_tax_credit: 1_000
medicaid: 500
gov.simulation.include_health_benefits_in_net_income: false
assigned_aca_ptc: 1_000
premium_tax_credit: 999
medicaid_cost: 500
medicaid: 777
snap: 0
output:
household_health_benefits: 0
household_benefits: 0

- name: flag on
- name: Case 2, flag on includes annual canonical ACA PTC and Medicaid value.
period: 2026
input:
absolute_error_margin: 0.01
input:
gov.simulation.include_health_benefits_in_net_income: true
premium_tax_credit: 1_000
medicaid: 500
assigned_aca_ptc: 1_000
medicaid_cost: 500
snap: 0
output:
household_health_benefits: 1_500
household_benefits: 1_500

- name: flag on includes MSP limited-benefit cost
- name: Case 3, flag on includes annual MSP and CHIP values.
period: 2026
absolute_error_margin: 0.01
input:
gov.simulation.include_health_benefits_in_net_income: true
assigned_aca_ptc: 1_000
medicaid_cost: 500
msp_cost: 2_434.8
per_capita_chip: 300
snap: 0
output:
household_health_benefits: 4_234.8
household_benefits: 4_234.8

- name: Case 4, legacy wrappers do not double count canonical health values.
period: 2026
absolute_error_margin: 0.01
input:
gov.simulation.include_health_benefits_in_net_income: true
premium_tax_credit: 1_000
medicaid: 500
assigned_aca_ptc: 1_000
premium_tax_credit: 999
medicaid_cost: 500
medicaid: 777
per_capita_chip: 300
chip: 888
msp_cost: 2_434.8
snap: 0
output:
household_health_benefits: 3_934.8
household_benefits: 3_934.8
household_health_benefits: 4_234.8
household_benefits: 4_234.8
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
class has_marketplace_health_coverage(Variable):
value_type = bool
entity = Person
label = "Deprecated legacy modeled Marketplace health coverage input"
label = "Deprecated legacy Marketplace health coverage compatibility alias"
definition_period = YEAR
default_value = True
documentation = """
Deprecated legacy modeled Marketplace coverage status.
Deprecated legacy Marketplace coverage status kept for compatibility.

Use has_marketplace_health_coverage_at_interview for reported Marketplace
coverage from survey data, and takes_up_aca_if_eligible for modeled ACA
Marketplace take-up. ACA PTC eligibility does not depend on this variable.
Marketplace take-up. ACA PTC eligibility and health benefit accounting do
not depend on this variable.
"""

def formula(person, period, parameters):
return person("has_marketplace_health_coverage_at_interview", period)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ class healthcare_benefit_value(Variable):
entity = Household
definition_period = YEAR
unit = USD
documentation = (
"Annual canonical household resource value of health coverage. This "
"uses annual health-value and government-cost proxy variables directly, "
"including assigned_aca_ptc for ACA premium tax credits."
)
adds = [
"medicaid_cost",
"msp_cost",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ class household_health_benefits(Variable):
label = "Household health benefits"
unit = USD
definition_period = YEAR
documentation = (
"Annual household health coverage value included in household_benefits "
"only when gov.simulation.include_health_benefits_in_net_income is "
"enabled. Uses annual canonical health-value variables to avoid "
"double-counting monthly compatibility wrappers."
)

def formula(household, period, parameters):
p = parameters(period)
Expand Down
Loading