From abb89135b01dc04d33a63465c2eaee18f10c0532 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 12 Nov 2026 00:53:09 -0500 Subject: [PATCH 01/12] Exclude dependents deducted premiums from Schedule A Co-Authored-By: Claude Opus 5.5 --- ...ependent-deducted-health-premiums.fixed.md | 1 + .../test_long_term_care_premium_properties.py | 28 ++- ...st_medical_expense_premium_conservation.py | 159 ++++++++++++--- ..._expenses_excluded_dependent_premiums.yaml | 184 ++++++++++++++++++ .../itemizing/itemized_medical_expenses.py | 19 +- ...ized_medical_expenses_applied_exclusion.py | 5 +- ...al_expenses_excluded_dependent_premiums.py | 31 +++ .../mt_medical_expense_deduction_joint.py | 24 ++- .../nj_medical_expense_deduction.py | 23 +-- 9 files changed, 410 insertions(+), 64 deletions(-) create mode 100644 changelog.d/fix-dependent-deducted-health-premiums.fixed.md create mode 100644 policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml create mode 100644 policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.py diff --git a/changelog.d/fix-dependent-deducted-health-premiums.fixed.md b/changelog.d/fix-dependent-deducted-health-premiums.fixed.md new file mode 100644 index 00000000000..4d18486fdaa --- /dev/null +++ b/changelog.d/fix-dependent-deducted-health-premiums.fixed.md @@ -0,0 +1 @@ +Removed premiums deducted by dependents as self-employed health insurance from their parents' Schedule A medical expenses. diff --git a/policyengine_us/tests/core/test_long_term_care_premium_properties.py b/policyengine_us/tests/core/test_long_term_care_premium_properties.py index e93f308ed5f..4f5dddbdfad 100644 --- a/policyengine_us/tests/core/test_long_term_care_premium_properties.py +++ b/policyengine_us/tests/core/test_long_term_care_premium_properties.py @@ -22,12 +22,13 @@ medical part = min(filers' medical premiums, deduction); long-term care part = min(filers' eligible premiums, deduction - medical part); together they equal min(filers' medical + eligible premiums, deduction), and the - applied exclusion of a computed subtotal is their sum. + computed subtotal's applied exclusion also includes the medical parts of + dependents' own deductions. 3. Accounting: the subtotal is members' medical premiums - medical part + members' eligible premiums - long-term care part - dependents' own - long-term care parts + other expenses. A person's own long-term care part - is what that person's deduction leaves after their medical premiums, - limited to their eligible premiums. The long-term care premiums + medical and long-term care parts + other expenses. A person's own + long-term care part is what that person's deduction leaves after their + medical premiums, limited to their eligible premiums. The long-term care premiums inside it lie between what the dependents' own deductions left of their eligible premiums and all members' eligible premiums. 4. Conservation (derived deduction): every eligible premium is deducted once, @@ -290,6 +291,10 @@ def unit_sum(values): eligible * self_employed, person_deduction - np.minimum(health * self_employed, person_deduction), ) + dependent = ~filer.astype(bool) + dependent_medical_part = unit_sum( + np.minimum(health, person_deduction - own_long_term_care_part) * dependent + ) np.testing.assert_allclose( run["itemized_medical_expenses_excluded_premiums"], medical_part, @@ -307,15 +312,14 @@ def unit_sum(values): ) np.testing.assert_allclose( run["itemized_medical_expenses_applied_exclusion"], - medical_part + long_term_care_part, + medical_part + long_term_care_part + dependent_medical_part, atol=TOLERANCE, ) - # 3. Accounting identity for the subtotal, from the raw inputs. Each - # dependent's own deduction took that dependent's long-term care part. + # 3. Each dependent excludes the medical and long-term care premiums + # they deducted on their own return from the parents' subtotal. inside = run["itemized_medical_expenses_long_term_care_premiums"] all_eligible = unit_sum(eligible) - dependent = ~filer.astype(bool) dependents_part = unit_sum(own_long_term_care_part * dependent) np.testing.assert_allclose( inside, @@ -329,7 +333,11 @@ def unit_sum(values): subtotal = run["itemized_medical_expenses"] np.testing.assert_allclose( subtotal, - unit_sum(health) - medical_part + inside + unit_sum(other), + unit_sum(health) + - medical_part + - dependent_medical_part + + inside + + unit_sum(other), atol=TOLERANCE, ) @@ -340,7 +348,7 @@ def unit_sum(values): subtotal - unit_sum(other) + run["self_employed_health_insurance_ald"] - + dependents_part, + + unit_sum(person_deduction * dependent), unit_sum(health) + all_eligible, atol=TOLERANCE, ) diff --git a/policyengine_us/tests/core/test_medical_expense_premium_conservation.py b/policyengine_us/tests/core/test_medical_expense_premium_conservation.py index 387f788e431..fb1c3a12f8e 100644 --- a/policyengine_us/tests/core/test_medical_expense_premium_conservation.py +++ b/policyengine_us/tests/core/test_medical_expense_premium_conservation.py @@ -6,10 +6,11 @@ tax units. Premium inputs use payer attribution: a person's inputs include all premiums that person paid, including family coverage regardless of who is covered. -The federal conservation properties generate deductions within the filers' -paid premiums; beneficiary-assigned inputs cannot establish that invariant. +The federal conservation properties generate each deduction within the +deducting person's paid premiums, including eligible long-term care premiums. +Supplied filer deductions stay within the head's and spouse's paid pool. The independent accounting invariant is that Schedule A's premium base plus -the self-employed health insurance deduction never exceeds premiums paid. +every self-employed health insurance deduction never exceeds premiums paid. Non-premium medical expenses must remain available in full before the floor. Examples use small vectorized simulations and a shared read-only reference @@ -38,17 +39,19 @@ def reference_system(): @st.composite def person_expenses(draw): - premiums = draw(st.integers(0, 25_000)) + premiums = draw(st.integers(0, 500_000)) / 100 direct = draw(st.booleans()) self_employed = draw(st.booleans()) - covered = draw(st.integers(0, premiums)) if self_employed else 0 + covered = draw(st.integers(0, round(premiums * 100))) / 100 if self_employed else 0 # A direct premium can also exercise the default derivation of the SE # premium input. Decomposed premiums need the covered subset explicitly. if direct and draw(st.booleans()): covered = None return { "premiums": premiums, - "other": draw(st.integers(0, 10_000)), + "long_term_care": draw(st.integers(0, 800_000)) / 100, + "age": draw(st.sampled_from([17, 40, 41, 50, 51, 60, 61, 70, 71])), + "other": draw(st.integers(0, 200_000)) / 100, "earnings": draw(st.integers(-25_000, 50_000)) if self_employed else 0, "self_employed": self_employed, "direct": direct, @@ -57,12 +60,20 @@ def person_expenses(draw): units = st.lists( - st.lists(person_expenses(), min_size=1, max_size=3), + st.lists(person_expenses(), min_size=1, max_size=5), min_size=2, max_size=4, ) +def _eligible_long_term_care(person): + limit = system.parameters( + f"{PERIOD}-01-01" + ).gov.irs.deductions.itemized.medical.long_term_care_premium_limit + age_limit = limit.calc(np.array([person.get("age", 40)]), right=True)[0] + return min(person.get("long_term_care", 0), age_limit) + + @st.composite def units_with_deduction(draw): members = draw(units) @@ -70,7 +81,19 @@ def units_with_deduction(draw): # Payer attribution puts parent-paid family premiums on that parent. # The head's and spouse's deduction covers their paid premium pool. A # dependent's own SE deduction belongs on their separate return. - draw(st.integers(0, sum(person["premiums"] for person in unit[:2]))) + draw( + st.integers( + 0, + round( + sum( + person["premiums"] + _eligible_long_term_care(person) + for person in unit[:2] + ) + * 100 + ), + ) + ) + / 100 for unit in members ] return members, deductions @@ -89,14 +112,15 @@ def _simulation(members, reference_system, deductions=None): else "health_insurance_premiums_without_medicare_part_b" ) values = { - "age": 12 if person_index == 2 else 40, + "age": person.get("age", 12 if person_index >= 2 else 40), "is_tax_unit_head": person_index == 0, "is_tax_unit_spouse": person_index == 1, - "is_tax_unit_dependent": person_index == 2, + "is_tax_unit_dependent": person_index >= 2, "is_self_employed": person["self_employed"], "self_employment_income": person["earnings"], "medicare_enrolled": False, premium_variable: person["premiums"], + "long_term_health_insurance_premiums": person.get("long_term_care", 0), "other_medical_expenses": person["other"], } if person["covered"] is not None: @@ -115,8 +139,10 @@ def _simulation(members, reference_system, deductions=None): "state_code": {PERIOD: "TX"}, } marital_units[f"marital_unit_{unit_index}"] = {"members": names[:2]} - for name in names[2:]: - marital_units[f"dependent_marital_unit_{unit_index}"] = {"members": [name]} + for person_index, name in enumerate(names[2:], start=2): + marital_units[f"dependent_marital_unit_{unit_index}_{person_index}"] = { + "members": [name] + } return Simulation( tax_benefit_system=reference_system, situation={ @@ -129,26 +155,78 @@ def _simulation(members, reference_system, deductions=None): def _assert_conservation(members, simulation): - paid = np.array([sum(person["premiums"] for person in unit) for unit in members]) + paid = np.array( + [ + sum(person["premiums"] + person.get("long_term_care", 0) for person in unit) + for unit in members + ] + ) + eligible_paid = np.array( + [ + sum( + person["premiums"] + _eligible_long_term_care(person) for person in unit + ) + for unit in members + ] + ) other = np.array([sum(person["other"] for person in unit) for unit in members]) - dependent_premiums = np.array( - [sum(person["premiums"] for person in unit[2:]) for unit in members] + medical_base = simulation.calculate("itemized_medical_expenses", PERIOD).astype( + np.float64 ) - medical_base = simulation.calculate("itemized_medical_expenses", PERIOD) - se_deduction = simulation.calculate("self_employed_health_insurance_ald", PERIOD) + se_deduction = simulation.calculate( + "self_employed_health_insurance_ald", PERIOD + ).astype(np.float64) + dependent_deductions = simulation.calculate( + "dependents_self_employed_health_insurance_ald", PERIOD + ).astype(np.float64) + all_deductions = se_deduction + dependent_deductions schedule_a_premium_use = medical_base - other - # Neither the SE deduction nor a different filing unit can consume the - # non-premium expenses. Check the bound separately from conservation. - assert (schedule_a_premium_use >= 0).all() - assert (schedule_a_premium_use >= dependent_premiums).all() - # The Form 7206 earnings limit leaves cents in the derived deduction, so - # the sums carry float32 rounding: allow a cent. - assert (schedule_a_premium_use + se_deduction <= paid + 0.01).all() - # All premiums here are otherwise eligible: unused premiums remain in - # Schedule A's base, even when earnings cap the SE deduction. + flat_people = [person for unit in members for person in unit] + medical_premiums = np.array([person["premiums"] for person in flat_people]) + eligible_care = np.array( + [_eligible_long_term_care(person) for person in flat_people] + ) + medical_exclusion_bound = simulation.calculate( + "self_employed_health_insurance_ald_excluded_premiums", PERIOD + ).astype(np.float64) + care_excluded = simulation.calculate( + "self_employed_health_insurance_ald_long_term_care_part", PERIOD + ).astype(np.float64) + person_deductions = simulation.calculate( + "self_employed_health_insurance_ald_person", PERIOD + ).astype(np.float64) + medical_excluded = np.minimum( + medical_exclusion_bound, np.maximum(0, person_deductions) - care_excluded + ) + unit_ends = np.cumsum([len(unit) for unit in members]) + unit_starts = np.concatenate(([0], unit_ends[:-1])) + expected_dependent_deductions = np.array( + [ + person_deductions[start + 2 : end].sum() + for start, end in zip(unit_starts, unit_ends) + ] + ) + np.testing.assert_allclose( + dependent_deductions, expected_dependent_deductions, rtol=0, atol=0.01 + ) + + # Each person can consume only their own premiums, across medical and + # long-term care coverage. A dependent cannot consume a sibling's costs. + assert (medical_excluded >= 0).all() + assert (medical_excluded <= medical_premiums + 0.01).all() + assert (care_excluded >= 0).all() + assert (care_excluded <= eligible_care + 0.01).all() + np.testing.assert_allclose( + medical_excluded + care_excluded, person_deductions, rtol=0, atol=0.01 + ) + # Preserve every non-premium expense and every eligible premium nobody + # deducts, including premiums above a dependent's earned income limit. + # Model arrays use float32, so compare the combined uses within one cent. + assert (medical_base >= other - 0.01).all() + assert (schedule_a_premium_use + all_deductions <= paid + 0.01).all() np.testing.assert_allclose( - schedule_a_premium_use + se_deduction, paid, rtol=0, atol=0.01 + schedule_a_premium_use + all_deductions, eligible_paid, rtol=0, atol=0.01 ) @@ -156,6 +234,8 @@ def _assert_conservation(members, simulation): [ dict( premiums=6_000, + long_term_care=600, + age=40, other=500, earnings=1_000, self_employed=True, @@ -164,6 +244,8 @@ def _assert_conservation(members, simulation): ), dict( premiums=2_000, + long_term_care=1_500, + age=51, other=300, earnings=5_000, self_employed=True, @@ -172,12 +254,34 @@ def _assert_conservation(members, simulation): ), dict( premiums=12_000, + long_term_care=700, + age=17, other=200, earnings=15_000, self_employed=True, direct=True, covered=None, ), + dict( + premiums=3_000.01, + long_term_care=480, + age=40, + other=200.01, + earnings=1_000, + self_employed=True, + direct=False, + covered=2_000, + ), + dict( + premiums=0, + long_term_care=600, + age=71, + other=100, + earnings=0, + self_employed=False, + direct=True, + covered=0, + ), ], [ dict( @@ -203,6 +307,7 @@ def test_premiums_are_not_duplicated_with_derived_se_deduction( @settings(max_examples=12, deadline=None, derandomize=True) @example(case=(EXAMPLE_UNITS, [8_000, 0])) +@example(case=(EXAMPLE_UNITS, [9_500, 0])) @given(case=units_with_deduction()) def test_premiums_are_not_duplicated_with_tax_unit_se_deduction(reference_system, case): members, deductions = case diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml new file mode 100644 index 00000000000..fe91605a974 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml @@ -0,0 +1,184 @@ +- name: Parents exclude the medical and long-term care premiums their dependent deducts. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + head: + age: 45 + employment_income: 50_000 + other_medical_expenses: 50_000 + is_tax_unit_head: true + spouse: + age: 45 + employment_income: 50_000 + is_tax_unit_spouse: true + dependent: + age: 20 + is_tax_unit_dependent: true + is_self_employed: true + self_employment_income: 10_000 + health_insurance_premiums: 3_000 + long_term_health_insurance_premiums: 500 + tax_units: + parents: + members: [head, spouse, dependent] + marital_units: + parents: + members: [head, spouse] + dependent: + members: [dependent] + households: + household: + members: [head, spouse, dependent] + state_code: TX + output: + # The age-20 limit admits 480 of the 500 long-term care premiums. + eligible_long_term_care_premiums: [0, 0, 480] + # 10,000 - (10,000 x 0.9235 x 0.153 / 2) exceeds 3,000 + 480. + self_employed_health_insurance_ald_person: [0, 0, 3_480] + self_employed_health_insurance_ald: 0 + dependents_self_employed_health_insurance_ald: 3_480 + itemized_medical_expenses_long_term_care_premiums: 0 + # 50,000 + 3,000 + 480 - 3,480 = 50,000. + itemized_medical_expenses: 50_000 + # The parents' AGI excludes the dependent's income and deduction. + adjusted_gross_income: 100_000 + medical_expense_deduction: 42_500 # 50,000 - 7.5% x 100,000. + tax_unit_itemizes: true + +- name: Parents exclude premiums their dependent deducts against partnership earnings. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + head: + age: 45 + employment_income: 50_000 + other_medical_expenses: 50_000 + is_tax_unit_head: true + spouse: + age: 45 + employment_income: 50_000 + is_tax_unit_spouse: true + dependent: + age: 20 + is_tax_unit_dependent: true + is_self_employed: true + partnership_self_employment_net_earnings: 10_000 + health_insurance_premiums: 3_000 + long_term_health_insurance_premiums: 500 + tax_units: + parents: + members: [head, spouse, dependent] + marital_units: + parents: + members: [head, spouse] + dependent: + members: [dependent] + households: + household: + members: [head, spouse, dependent] + state_code: TX + output: + # The age-20 limit admits 480 of the 500 long-term care premiums. + eligible_long_term_care_premiums: [0, 0, 480] + # 10,000 - (10,000 x 0.9235 x 0.153 / 2) exceeds 3,000 + 480. + self_employed_health_insurance_ald_person: [0, 0, 3_480] + self_employed_health_insurance_ald: 0 + dependents_self_employed_health_insurance_ald: 3_480 + itemized_medical_expenses_long_term_care_premiums: 0 + # 50,000 + 3,000 + 480 - 3,480 = 50,000. + itemized_medical_expenses: 50_000 + # The parents' AGI excludes the dependent's income and deduction. + adjusted_gross_income: 100_000 + medical_expense_deduction: 42_500 # 50,000 - 7.5% x 100,000. + tax_unit_itemizes: true + +- name: Parents retain premiums above their dependent's earnings limit. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + head: + age: 45 + employment_income: 50_000 + other_medical_expenses: 50_000 + is_tax_unit_head: true + spouse: + age: 45 + employment_income: 50_000 + is_tax_unit_spouse: true + dependent: + age: 20 + is_tax_unit_dependent: true + is_self_employed: true + self_employment_income: 1_000 + health_insurance_premiums: 3_000 + long_term_health_insurance_premiums: 500 + tax_units: + parents: + members: [head, spouse, dependent] + marital_units: + parents: + members: [head, spouse] + dependent: + members: [dependent] + households: + household: + members: [head, spouse, dependent] + state_code: TX + output: + # 1,000 - (1,000 x 0.9235 x 0.153 / 2) = 929.35225. + self_employed_health_insurance_ald_person: [0, 0, 929.35225] + self_employed_health_insurance_ald: 0 + dependents_self_employed_health_insurance_ald: 929.35225 + # The deduction consumes medical premiums first, leaving all 480 LTC. + itemized_medical_expenses_long_term_care_premiums: 480 + # 50,000 + (3,000 - 929.35225) + 480 = 52,550.64775. + itemized_medical_expenses: 52_550.64775 + adjusted_gross_income: 100_000 + medical_expense_deduction: 45_050.64775 # 52,550.64775 - 7,500. + tax_unit_itemizes: true + +- name: Parents retain long-term care premiums above their dependent's earnings limit. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + head: + age: 45 + employment_income: 50_000 + other_medical_expenses: 50_000 + is_tax_unit_head: true + spouse: + age: 45 + employment_income: 50_000 + is_tax_unit_spouse: true + dependent: + age: 20 + is_tax_unit_dependent: true + is_self_employed: true + self_employment_income: 3_500 + health_insurance_premiums: 3_000 + long_term_health_insurance_premiums: 500 + tax_units: + parents: + members: [head, spouse, dependent] + marital_units: + parents: + members: [head, spouse] + dependent: + members: [dependent] + households: + household: + members: [head, spouse, dependent] + state_code: TX + output: + # 3,500 - (3,500 x 0.9235 x 0.153 / 2) = 3,252.732875. + self_employed_health_insurance_ald_person: [0, 0, 3_252.732875] + self_employed_health_insurance_ald: 0 + # Medical premiums consume 3,000; LTC consumes 252.732875 of 480. + itemized_medical_expenses_long_term_care_premiums: 227.267125 + itemized_medical_expenses: 50_227.267125 + medical_expense_deduction: 42_727.267125 + tax_unit_itemizes: true diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py index c046795c4f2..5138184e183 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py @@ -25,12 +25,13 @@ class itemized_medical_expenses(Variable): "long-term care premiums (recorded on the insured person) and other " "medical expenses, excluding general over-the-counter health " "expenses. Premiums deducted through the " - "filer's self-employed health insurance deduction are excluded under " + "filers' or a dependent's own self-employed health insurance deduction " + "are excluded under " "IRC Section 162(l)(3) before the medical expense floor is applied. " "Premium inputs use payer attribution: each person reports premiums " "that person paid, including the full cost of family coverage regardless " "of whom it covers. A parent-paid dependent policy belongs on the parent. " - "The exclusion is bounded to filer-paid premiums; beneficiary-attributed " + "Each exclusion is bounded to the deducting person's premium pool; beneficiary-attributed " "inputs with an ALD exceeding that pool are inconsistent with this contract " "and cannot establish conservation of the supplied ALD. A supplied value " "bypasses this formula and is used as given. By default it is taken as " @@ -48,11 +49,15 @@ class itemized_medical_expenses(Variable): def formula(tax_unit, period, parameters): premiums = add(tax_unit, period, ["medical_expense_health_insurance_premiums"]) - # The federal ALD covers the head and spouse; dependents take their - # own SE deductions on their own returns. Bound the exclusion to the - # corresponding filer premiums, leaving other medical costs intact. - excluded_premiums = tax_unit( - "itemized_medical_expenses_excluded_premiums", period + # Filers and dependents deduct their own premiums on their own + # returns. Exclude each deducted payment once, within its paid pool. + excluded_premiums = add( + tax_unit, + period, + [ + "itemized_medical_expenses_excluded_premiums", + "itemized_medical_expenses_excluded_dependent_premiums", + ], ) # Eligible long-term care premiums less the part the same deduction # took. diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py index a2b0efd8469..a325c0668b8 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py @@ -12,7 +12,9 @@ class itemized_medical_expenses_applied_exclusion(Variable): "https://www.irs.gov/instructions/i1040sca", ] documentation = ( - "Premiums actually excluded by the federal medical expense formula. " + "Filer premiums and dependent medical premiums excluded by the " + "federal medical expense formula. Dependent long-term care premiums " + "remain outside this state addback, as under the existing state bases. " "A caller-supplied subtotal bypasses that formula, so no exclusion " "was applied, unless the caller also supplies this amount: all the " "premiums, medical and long-term care, that a supplied Schedule A " @@ -42,5 +44,6 @@ def formula(tax_unit, period, parameters): [ "itemized_medical_expenses_excluded_premiums", "itemized_medical_expenses_excluded_long_term_care_premiums", + "itemized_medical_expenses_excluded_dependent_premiums", ], ) diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.py new file mode 100644 index 00000000000..70f9dbbf988 --- /dev/null +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.py @@ -0,0 +1,31 @@ +from policyengine_us.model_api import * + + +class itemized_medical_expenses_excluded_dependent_premiums(Variable): + value_type = float + entity = TaxUnit + label = "Dependents' deducted medical insurance premiums excluded from Schedule A" + unit = USD + definition_period = YEAR + reference = ( + "https://www.law.cornell.edu/uscode/text/26/162#l_3", + "https://www.law.cornell.edu/uscode/text/26/213#a", + ) + documentation = ( + "Medical insurance premiums each dependent deducts through their own " + "self-employed health insurance deduction. Each exclusion is limited " + "to that person's paid medical premiums and the deduction left after " + "its long-term care part. Premium inputs identify one payment per " + "person without a separate payer, so the same payment cannot enter " + "both the dependent's deduction and the parents' Schedule A. " + "Undeducted premiums remain in the parents' medical expense base." + ) + + def formula(tax_unit, period, parameters): + person = tax_unit.members + medical_part = min_( + person("self_employed_health_insurance_ald_excluded_premiums", period), + max_(0, person("self_employed_health_insurance_ald_person", period)) + - person("self_employed_health_insurance_ald_long_term_care_part", period), + ) + return tax_unit.sum(medical_part * person("is_tax_unit_dependent", period)) diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py index 8bf845b16ac..e65b2c23577 100644 --- a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py @@ -27,9 +27,7 @@ def formula(person, period, parameters): # insurance premiums deducted in full on lines 2 and 3. Start # from the federal subtotal and take out the premiums still in # it: the members' medical insurance premiums less the part of - # the self-employed exclusion applied to them, which is bounded by - # the head's and spouse's medical premiums (any excess covered - # long-term care premiums, which are not in the subtotal), and the + # the self-employed exclusion applied to them, and the # long-term care premiums the subtotal includes. For a computed # subtotal this leaves the members' other medical expenses. premiums = add( @@ -38,8 +36,24 @@ def formula(person, period, parameters): filer_premiums = tax_unit_non_dep_sum( "medical_expense_health_insurance_premiums", tax_unit, period ) - excluded = tax_unit("itemized_medical_expenses_applied_exclusion", period) - premiums_in_subtotal = premiums - min_(filer_premiums, max_(0, excluded)) + if has_input_for_period( + tax_unit.simulation, "itemized_medical_expenses", period + ): + # Supplied subtotals use the pooled filer-first split. + excluded = tax_unit( + "itemized_medical_expenses_applied_exclusion", period + ) + medical_exclusion = min_(filer_premiums, max_(0, excluded)) + else: + medical_exclusion = add( + tax_unit, + period, + [ + "itemized_medical_expenses_excluded_premiums", + "itemized_medical_expenses_excluded_dependent_premiums", + ], + ) + premiums_in_subtotal = premiums - medical_exclusion expense = max_( 0, tax_unit("itemized_medical_expenses", period) diff --git a/policyengine_us/variables/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.py b/policyengine_us/variables/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.py index 81b37a91495..755b3b4e5b5 100644 --- a/policyengine_us/variables/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.py +++ b/policyengine_us/variables/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.py @@ -36,20 +36,15 @@ def formula(tax_unit, period, parameters): # C.54A:3-3 excludes premiums counted by the separate SE deduction # under C.54A:3-5, including a dependent's deduction on their own # return. - # The federal base already excludes the filers' deduction and the - # long-term care part (Form 7206 line 2) of each dependent's own - # deduction. Remove the medical part (line 1) of each dependent's - # deduction (the deduction less its long-term care part), limited to - # that person's own paid medical premiums. - person = tax_unit.members - dependent_medical_part = min_( - person("self_employed_health_insurance_ald_excluded_premiums", period), - max_(0, person("self_employed_health_insurance_ald_person", period)) - - person("self_employed_health_insurance_ald_long_term_care_part", period), - ) - excluded_dependent_premiums = tax_unit.sum( - dependent_medical_part * person("is_tax_unit_dependent", period) - ) + # The computed federal base excludes each dependent's deduction. + # Supplied subtotals retain the separate state medical exclusion. + excluded_dependent_premiums = 0 + if has_input_for_period( + tax_unit.simulation, "itemized_medical_expenses", period + ): + excluded_dependent_premiums = tax_unit( + "itemized_medical_expenses_excluded_dependent_premiums", period + ) # New Jersey includes salary-reduction cafeteria-plan premiums in # taxable wages (TB-39(R)), so these employee-paid premiums also # qualify for the medical expense deduction. The separate payroll From e75eb50b8e17dad873449892fe5422eaaa14b745 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 12 Nov 2026 00:59:32 -0500 Subject: [PATCH 02/12] Cover dependent premium boundaries and preserve state inputs Co-Authored-By: Claude Opus 5.5 --- ..._expenses_excluded_dependent_premiums.yaml | 395 ++++++++++++++++++ .../nj_medical_expense_deduction.yaml | 93 +++++ .../mt_medical_expense_deduction_joint.py | 13 +- source_conflicts/candidates.yaml | 26 ++ .../us/usc-26-162-2024-coordination.txt | 58 +++ .../us/usc-26-213-2024-coordination.txt | 10 + 6 files changed, 593 insertions(+), 2 deletions(-) create mode 100644 source_conflicts/sources/us/usc-26-162-2024-coordination.txt create mode 100644 source_conflicts/sources/us/usc-26-213-2024-coordination.txt diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml index fe91605a974..40fd2b479d2 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml @@ -182,3 +182,398 @@ itemized_medical_expenses: 50_227.267125 medical_expense_deduction: 42_727.267125 tax_unit_itemizes: true + +- name: A supplied dependent deduction of -1 excludes only its own premium parts. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + health_insurance_premiums: 500 + other_medical_expenses: 100 + dependent: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + health_insurance_premiums: 1_000 + long_term_health_insurance_premiums: 500 + self_employed_health_insurance_ald_person: -1 + sibling: + age: 15 + is_tax_unit_dependent: true + health_insurance_premiums: 1_000 + tax_units: + parents: + members: [parent, dependent, sibling] + output: + # min(1,000, max(0, -1) - 0) = 0. + itemized_medical_expenses_excluded_dependent_premiums: 0 + # Parent and sibling premiums (1,500) and other costs (100) stay intact. + # LTC remaining: 480 - 0. + itemized_medical_expenses_long_term_care_premiums: 480 + itemized_medical_expenses: 3080 + +- name: A supplied dependent deduction of 0 excludes only its own premium parts. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + health_insurance_premiums: 500 + other_medical_expenses: 100 + dependent: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + health_insurance_premiums: 1_000 + long_term_health_insurance_premiums: 500 + self_employed_health_insurance_ald_person: 0 + sibling: + age: 15 + is_tax_unit_dependent: true + health_insurance_premiums: 1_000 + tax_units: + parents: + members: [parent, dependent, sibling] + output: + # min(1,000, max(0, 0) - 0) = 0. + itemized_medical_expenses_excluded_dependent_premiums: 0 + # Parent and sibling premiums (1,500) and other costs (100) stay intact. + # LTC remaining: 480 - 0. + itemized_medical_expenses_long_term_care_premiums: 480 + itemized_medical_expenses: 3080 + +- name: A supplied dependent deduction of 0.01 excludes only its own premium parts. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + health_insurance_premiums: 500 + other_medical_expenses: 100 + dependent: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + health_insurance_premiums: 1_000 + long_term_health_insurance_premiums: 500 + self_employed_health_insurance_ald_person: 0.01 + sibling: + age: 15 + is_tax_unit_dependent: true + health_insurance_premiums: 1_000 + tax_units: + parents: + members: [parent, dependent, sibling] + output: + # min(1,000, max(0, 0.01) - 0) = 0.01. + itemized_medical_expenses_excluded_dependent_premiums: 0.01 + # Parent and sibling premiums (1,500) and other costs (100) stay intact. + # LTC remaining: 480 - 0. + itemized_medical_expenses_long_term_care_premiums: 480 + itemized_medical_expenses: 3079.99 + +- name: A supplied dependent deduction of 999.99 excludes only its own premium parts. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + health_insurance_premiums: 500 + other_medical_expenses: 100 + dependent: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + health_insurance_premiums: 1_000 + long_term_health_insurance_premiums: 500 + self_employed_health_insurance_ald_person: 999.99 + sibling: + age: 15 + is_tax_unit_dependent: true + health_insurance_premiums: 1_000 + tax_units: + parents: + members: [parent, dependent, sibling] + output: + # min(1,000, max(0, 999.99) - 0) = 999.99. + itemized_medical_expenses_excluded_dependent_premiums: 999.99 + # Parent and sibling premiums (1,500) and other costs (100) stay intact. + # LTC remaining: 480 - 0. + itemized_medical_expenses_long_term_care_premiums: 480 + itemized_medical_expenses: 2080.01 + +- name: A supplied dependent deduction of 1000 excludes only its own premium parts. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + health_insurance_premiums: 500 + other_medical_expenses: 100 + dependent: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + health_insurance_premiums: 1_000 + long_term_health_insurance_premiums: 500 + self_employed_health_insurance_ald_person: 1000 + sibling: + age: 15 + is_tax_unit_dependent: true + health_insurance_premiums: 1_000 + tax_units: + parents: + members: [parent, dependent, sibling] + output: + # min(1,000, max(0, 1000) - 0) = 1000. + itemized_medical_expenses_excluded_dependent_premiums: 1000 + # Parent and sibling premiums (1,500) and other costs (100) stay intact. + # LTC remaining: 480 - 0. + itemized_medical_expenses_long_term_care_premiums: 480 + itemized_medical_expenses: 2080 + +- name: A supplied dependent deduction of 1000.01 excludes only its own premium parts. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + health_insurance_premiums: 500 + other_medical_expenses: 100 + dependent: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + health_insurance_premiums: 1_000 + long_term_health_insurance_premiums: 500 + self_employed_health_insurance_ald_person: 1000.01 + sibling: + age: 15 + is_tax_unit_dependent: true + health_insurance_premiums: 1_000 + tax_units: + parents: + members: [parent, dependent, sibling] + output: + # min(1,000, max(0, 1000.01) - 0.01) = 1000. + itemized_medical_expenses_excluded_dependent_premiums: 1000 + # Parent and sibling premiums (1,500) and other costs (100) stay intact. + # LTC remaining: 480 - 0.01. + itemized_medical_expenses_long_term_care_premiums: 479.99 + itemized_medical_expenses: 2079.99 + +- name: A supplied dependent deduction of 1480 excludes only its own premium parts. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + health_insurance_premiums: 500 + other_medical_expenses: 100 + dependent: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + health_insurance_premiums: 1_000 + long_term_health_insurance_premiums: 500 + self_employed_health_insurance_ald_person: 1480 + sibling: + age: 15 + is_tax_unit_dependent: true + health_insurance_premiums: 1_000 + tax_units: + parents: + members: [parent, dependent, sibling] + output: + # min(1,000, max(0, 1480) - 480) = 1000. + itemized_medical_expenses_excluded_dependent_premiums: 1000 + # Parent and sibling premiums (1,500) and other costs (100) stay intact. + # LTC remaining: 480 - 480. + itemized_medical_expenses_long_term_care_premiums: 0 + itemized_medical_expenses: 1600 + +- name: A supplied dependent deduction of 2000 excludes only its own premium parts. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + health_insurance_premiums: 500 + other_medical_expenses: 100 + dependent: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + health_insurance_premiums: 1_000 + long_term_health_insurance_premiums: 500 + self_employed_health_insurance_ald_person: 2000 + sibling: + age: 15 + is_tax_unit_dependent: true + health_insurance_premiums: 1_000 + tax_units: + parents: + members: [parent, dependent, sibling] + output: + # min(1,000, max(0, 2000) - 480) = 1000. + itemized_medical_expenses_excluded_dependent_premiums: 1000 + # Parent and sibling premiums (1,500) and other costs (100) stay intact. + # LTC remaining: 480 - 480. + itemized_medical_expenses_long_term_care_premiums: 0 + itemized_medical_expenses: 1600 + +- name: North Dakota retains its medical cost base after a dependent deducts premiums. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + employment_income: 40_000 + other_medical_expenses: 2_000 + dependent: + age: 17 + is_tax_unit_dependent: true + health_insurance_premiums: 3_000 + self_employed_health_insurance_ald_person: 1_000 + tax_units: + parents: + members: [parent, dependent] + households: + household: + members: [parent, dependent] + state_code: ND + output: + itemized_medical_expenses: 4_000 # 2,000 + 3,000 - 1,000. + itemized_medical_expenses_applied_exclusion: 1_000 + nd_renters_refund_income: 35_000 # 40,000 - (4,000 + 1,000). + +- name: New Mexico retains its senior medical credit at the paid cost boundary. + period: 2025 + input: + people: + parent: + age: 65 + medicare_enrolled: false + dependent: + age: 17 + is_tax_unit_dependent: true + health_insurance_premiums: 28_000 + self_employed_health_insurance_ald_person: 1_000 + tax_units: + parents: + members: [parent, dependent] + households: + household: + members: [parent, dependent] + state_code: NM + output: + itemized_medical_expenses: 27_000 # 28,000 - 1,000. + itemized_medical_expenses_applied_exclusion: 1_000 + nm_medical_expense_credit: 2_800 # The paid cost base stays 28,000. + nm_medical_expense_exemption: 0 # The exemption requires more than 28,000. + +- name: Montana retains non-premium expenses after a dependent deducts medical premiums. + period: 2023 + input: + people: + parent: + age: 40 + employment_income: 100_000 + other_medical_expenses: 8_000 + dependent: + age: 17 + is_tax_unit_dependent: true + health_insurance_premiums: 3_000 + self_employed_health_insurance_ald_person: 1_000 + tax_units: + parents: + members: [parent, dependent] + households: + household: + members: [parent, dependent] + state_code: MT + output: + itemized_medical_expenses: 10_000 # 8,000 + (3,000 - 1,000). + # Remove the remaining premiums (2,000); 8,000 - 7.5% x 100,000 = 500. + # The parent paid no premiums for Montana's separate deduction. + mt_medical_expense_deduction_joint: [500, 0] + +- name: A dependent deducting only long-term care leaves medical premiums available. + period: 2025 + input: + people: + parent: + age: 40 + other_medical_expenses: 100 + dependent: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + self_employment_income: 10_000 + health_insurance_premiums: 1_000 + self_employed_health_insurance_premiums: 0 + long_term_health_insurance_premiums: 480 + tax_units: + parents: + members: [parent, dependent] + output: + self_employed_health_insurance_ald_person: [0, 480] + self_employed_health_insurance_ald_long_term_care_part: [0, 480] + itemized_medical_expenses_excluded_dependent_premiums: 0 + itemized_medical_expenses_long_term_care_premiums: 0 + itemized_medical_expenses: 1_100 # 100 + 1,000; the 480 was deducted. + +- name: Montana preserves a supplied exclusion with a computed subtotal. + period: 2023 + input: + people: + parent: + age: 40 + employment_income: 100_000 + health_insurance_premiums: 1_000 + other_medical_expenses: 8_000 + dependent: + age: 17 + is_tax_unit_dependent: true + health_insurance_premiums: 3_000 + self_employed_health_insurance_ald_person: 1_000 + tax_units: + parents: + members: [parent, dependent] + itemized_medical_expenses_applied_exclusion: 500 + households: + household: + members: [parent, dependent] + state_code: MT + output: + itemized_medical_expenses: 11_000 # 1,000 + 3,000 - 1,000 + 8,000. + itemized_medical_expenses_applied_exclusion: 500 + # Main: 12,000 - (4,000 - 500) = 8,500, then a 7,500 floor. + # The computed subtotal removes 1,000 more premiums; Montana restores + # that amount when separating premiums from the other expenses. + # The parent's 1,000 premium deduction adds to the 1,000 floored amount. + mt_medical_expense_deduction_joint: [2_000, 0] + +- name: Montana preserves a supplied exclusion without a dependent deduction. + period: 2023 + input: + age: 40 + employment_income: 100_000 + health_insurance_premiums: 1_000 + other_medical_expenses: 8_000 + itemized_medical_expenses_applied_exclusion: 500 + state_code: MT + output: + itemized_medical_expenses: 9_000 + # (9,000 - (1,000 - 500) - 7,500) + 1,000 premiums = 2,000. + mt_medical_expense_deduction_joint: 2_000 diff --git a/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.yaml b/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.yaml index 56b037f6c2c..f24718a2b04 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.yaml @@ -176,8 +176,101 @@ dependents_self_employed_health_insurance_ald: 1_000 # The child deducts the 1,000 of premiums on their own return. Only the # 500 of other expenses remains, under the 600 floor (2% of 30,000). + itemized_medical_expenses: 500 nj_medical_expense_deduction: 0 +- name: New Jersey excludes a dependent's deducted premiums once with a computed federal subtotal + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 45 + is_tax_unit_head: true + employment_income: 30_000 + medicare_enrolled: false + other_medical_expenses: 10_000 + child: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + self_employment_income: 10_000 + medicare_enrolled: false + health_insurance_premiums: 3_000 + long_term_health_insurance_premiums: 480 + tax_units: + tax_unit: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + households: + household: + members: [parent, child] + state_code: NJ + output: + # The child deducts 3,000 medical + min(480, 480) long-term care = 3,480. + # The earnings limit, 10,000 - 10,000 x 0.9235 x 0.153 / 2 = 9,293.52, + # exceeds those premiums. + dependents_self_employed_health_insurance_ald: 3_480 + itemized_medical_expenses_excluded_dependent_premiums: 3_000 + itemized_medical_expenses_long_term_care_premiums: 0 + # Federal medical expenses: 3,000 - 3,000 + 480 - 480 + 10,000 = 10,000. + itemized_medical_expenses: 10_000 + itemized_medical_expenses_applied_exclusion: 3_000 + nj_agi: 30_000 + # New Jersey deducts 10,000 - 0.02 x 30,000 = 9,400. The parent takes + # no separate self-employed deduction or second dependent exclusion. + nj_medical_expense_deduction: 9_400 + +- name: New Jersey retains its dependent premium exclusion for a supplied federal subtotal + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 45 + is_tax_unit_head: true + employment_income: 30_000 + medicare_enrolled: false + other_medical_expenses: 10_000 + child: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + self_employment_income: 10_000 + medicare_enrolled: false + health_insurance_premiums: 3_000 + long_term_health_insurance_premiums: 480 + tax_units: + tax_unit: + members: [parent, child] + # This subtotal includes 3,000 medical premiums and 10,000 other + # expenses, after leaving out the child's deducted 480 LTC premiums. + itemized_medical_expenses: 13_000 + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + households: + household: + members: [parent, child] + state_code: NJ + output: + # The child deducts 3,480, below the 9,293.52 earned income limit. + dependents_self_employed_health_insurance_ald: 3_480 + itemized_medical_expenses_excluded_dependent_premiums: 3_000 + itemized_medical_expenses_long_term_care_premiums: 0 + itemized_medical_expenses: 13_000 + itemized_medical_expenses_applied_exclusion: 0 + nj_agi: 30_000 + # New Jersey removes the 3,000 medical premiums from the supplied + # subtotal: 13,000 - 3,000 - 0.02 x 30,000 = 9,400. + nj_medical_expense_deduction: 9_400 + - name: New Jersey cannot subtract one dependent's deduction from another dependent's premiums period: 2025 input: diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py index e65b2c23577..54291fed510 100644 --- a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py @@ -36,14 +36,23 @@ def formula(person, period, parameters): filer_premiums = tax_unit_non_dep_sum( "medical_expense_health_insurance_premiums", tax_unit, period ) - if has_input_for_period( + supplied_subtotal = has_input_for_period( tax_unit.simulation, "itemized_medical_expenses", period + ) + if supplied_subtotal or has_input_for_period( + tax_unit.simulation, + "itemized_medical_expenses_applied_exclusion", + period, ): - # Supplied subtotals use the pooled filer-first split. + # Supplied amounts use the pooled filer-first split. excluded = tax_unit( "itemized_medical_expenses_applied_exclusion", period ) medical_exclusion = min_(filer_premiums, max_(0, excluded)) + if not supplied_subtotal: + medical_exclusion += tax_unit( + "itemized_medical_expenses_excluded_dependent_premiums", period + ) else: medical_exclusion = add( tax_unit, diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index 9d02eda84fd..bbcd95e386b 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -14335,3 +14335,29 @@ candidates: - https://github.com/PolicyEngine/policyengine-us/pull/10053 state: ruled note: Neither source prescribes a fallback when residence data are missing. Keep the existing false default. +- id: us:dependent-se-health-premiums-parents-schedule-a + program: federal_income_tax + years: + from: 2013 + type: tax + question: May parents count a dependent's medical premiums under section 213(a) after the dependent deducts the same payment under section 162(l)? + sources: + - kind: statute + citation: 26 U.S.C. 162(l)(1)-(3) + url: https://www.law.cornell.edu/uscode/text/26/162#l + - kind: statute + citation: 26 U.S.C. 213(a) + url: https://www.law.cornell.edu/uscode/text/26/213#a + readings: + statute: A dependent's section 162(l) deduction removes the same premium payment from the parents' section 213(a) expenses. The canon against double deductions supplies the cross-return coordination. + other: Section 162(l)(3) refers to the taxpayer taking the deduction, so a taxpayer-only reading leaves the dependent's deducted medical premiums in the parents' medical expense base. + example: A dependent deducts 3,480 from 3,000 medical premiums and 480 eligible long-term care premiums. Parents retain none of those premiums. With a 929.35225 deduction, they retain 2,070.64775 medical premiums and 480 eligible long-term care premiums. + pe_us: + follows: statute + code: + - policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.py + - policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py + prs: + - https://github.com/PolicyEngine/policyengine-us/pull/10831 + state: ruled + note: Premium inputs hold one payment per person without a separate payer. Bound each dependent's exclusion to their own medical premiums and deduction after its long-term care part. Preserve the existing long-term care exclusion and state paid-cost bases. Captures of the operative statutes accompany this candidate in source_conflicts/sources/us/usc-26-162-2024-coordination.txt and usc-26-213-2024-coordination.txt. The household cases in itemized_medical_expenses_excluded_dependent_premiums.yaml pin the reading. Add the shared-register marker after registration, as CONTRIBUTING.md requires. diff --git a/source_conflicts/sources/us/usc-26-162-2024-coordination.txt b/source_conflicts/sources/us/usc-26-162-2024-coordination.txt new file mode 100644 index 00000000000..b45c04f153d --- /dev/null +++ b/source_conflicts/sources/us/usc-26-162-2024-coordination.txt @@ -0,0 +1,58 @@ +Source: https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partVI-sec162.htm +Retrieved: 2026-11-12 +Extraction: HTML text, operative subsections only. + +(l) Special rules for health insurance costs of self-employed individuals + + +(1) Allowance of deduction + + +In the case of a taxpayer who is an employee within the meaning of section 401(c)(1), there shall be allowed as a deduction under this section an amount equal to the amount paid during the taxable year for insurance which constitutes medical care for— + + +(A) the taxpayer, + + +(B) the taxpayer's spouse, + + +(C) the taxpayer's dependents, and + + +(D) any child (as defined in section 152(f)(1)) of the taxpayer who as of the end of the taxable year has not attained age 27. + + +(2) Limitations + + +(A) Dollar amount + + +No deduction shall be allowed under paragraph (1) to the extent that the amount of such deduction exceeds the taxpayer's earned income (within the meaning of section 401(c)) derived by the taxpayer from the trade or business with respect to which the plan providing the medical care coverage is established. + + +(B) Other coverage + + +Paragraph (1) shall not apply to any taxpayer for any calendar month for which the taxpayer is eligible to participate in any subsidized health plan maintained by any employer of the taxpayer or of the spouse of, or any dependent, or individual described in subparagraph (D) of paragraph (1) with respect to, the taxpayer. The preceding sentence shall be applied separately with respect to— + + +(i) plans which include coverage for qualified long-term care services (as defined in section 7702B(c)) or are qualified long-term care insurance contracts (as defined in section 7702B(b)), and + + +(ii) plans which do not include such coverage and are not such contracts. + + +(C) Long-term care premiums + + +In the case of a qualified long-term care insurance contract (as defined in section 7702B(b)), only eligible long-term care premiums (as defined in section 213(d)(10)) shall be taken into account under paragraph (1). + + +(3) Coordination with medical deduction + + +Any amount paid by a taxpayer for insurance to which paragraph (1) applies shall not be taken into account in computing the amount allowable to the taxpayer as a deduction under section 213(a). + + diff --git a/source_conflicts/sources/us/usc-26-213-2024-coordination.txt b/source_conflicts/sources/us/usc-26-213-2024-coordination.txt new file mode 100644 index 00000000000..e267e8bd32d --- /dev/null +++ b/source_conflicts/sources/us/usc-26-213-2024-coordination.txt @@ -0,0 +1,10 @@ +Source: https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partVII-sec213.htm +Retrieved: 2026-11-12 +Extraction: HTML text, operative subsections only. + +(a) Allowance of deduction + + +There shall be allowed as a deduction the expenses paid during the taxable year, not compensated for by insurance or otherwise, for medical care of the taxpayer, his spouse, or a dependent (as defined in section 152, determined without regard to subsections (b)(1), (b)(2), and (d)(1)(B) thereof), to the extent that such expenses exceed 7.5 percent of adjusted gross income. + + From 1210c47fa956128d8b8e2eaeb051e03245a322a6 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 12 Nov 2026 01:40:39 -0500 Subject: [PATCH 03/12] Clarify the pooled filer premium exclusion Co-Authored-By: Claude Opus 5.5 --- .../deductions/itemizing/itemized_medical_expenses.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py index 5138184e183..3df19f3d27a 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py @@ -31,7 +31,8 @@ class itemized_medical_expenses(Variable): "Premium inputs use payer attribution: each person reports premiums " "that person paid, including the full cost of family coverage regardless " "of whom it covers. A parent-paid dependent policy belongs on the parent. " - "Each exclusion is bounded to the deducting person's premium pool; beneficiary-attributed " + "The filer exclusion is bounded to the head's and spouse's premium pool; " + "each dependent exclusion is bounded to their own premiums. Beneficiary-attributed " "inputs with an ALD exceeding that pool are inconsistent with this contract " "and cannot establish conservation of the supplied ALD. A supplied value " "bypasses this formula and is used as given. By default it is taken as " From 440cc863f11c438487e1906f1fdcc4f731b8176c Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 02:30:58 -0500 Subject: [PATCH 04/12] Ground dependent premium exclusion in expenses paid Co-Authored-By: Claude Opus 5.5 --- .../itemizing/itemized_medical_expenses.py | 14 +++++----- ...al_expenses_excluded_dependent_premiums.py | 13 ++++++---- source_conflicts/candidates.yaml | 26 ------------------- 3 files changed, 16 insertions(+), 37 deletions(-) diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py index 3df19f3d27a..bba6046bad7 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py @@ -8,8 +8,9 @@ class itemized_medical_expenses(Variable): unit = USD definition_period = YEAR reference = [ - "https://www.law.cornell.edu/uscode/text/26/213", - "https://www.law.cornell.edu/uscode/text/26/162#l_3", + "https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partVII-sec213.htm", + "https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partVI-sec162.htm", + "https://www.ecfr.gov/current/title-26/section-1.213-1#p-1.213-1(a)(1)", "https://www.irs.gov/instructions/i1040sca", "https://www.irs.gov/pub/irs-prior/i1040sca--2022.pdf#page=2", ] @@ -24,10 +25,11 @@ class itemized_medical_expenses(Variable): "age. Current modeling uses health insurance premiums, those eligible " "long-term care premiums (recorded on the insured person) and other " "medical expenses, excluding general over-the-counter health " - "expenses. Premiums deducted through the " - "filers' or a dependent's own self-employed health insurance deduction " - "are excluded under " - "IRC Section 162(l)(3) before the medical expense floor is applied. " + "expenses. Section 162(l)(3) excludes premiums the filers deduct " + "through their self-employed health insurance deduction. Section " + "213(a) and Treasury regulation 1.213-1(a)(1) allow only expenses " + "the filers paid, so premiums a dependent deducts on their own " + "return also leave the subtotal before the medical expense floor. " "Premium inputs use payer attribution: each person reports premiums " "that person paid, including the full cost of family coverage regardless " "of whom it covers. A parent-paid dependent policy belongs on the parent. " diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.py index 70f9dbbf988..aefc4a80117 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.py @@ -8,17 +8,20 @@ class itemized_medical_expenses_excluded_dependent_premiums(Variable): unit = USD definition_period = YEAR reference = ( - "https://www.law.cornell.edu/uscode/text/26/162#l_3", - "https://www.law.cornell.edu/uscode/text/26/213#a", + "https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partVI-sec162.htm", + "https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partVII-sec213.htm", + "https://www.ecfr.gov/current/title-26/section-1.213-1#p-1.213-1(a)(1)", ) documentation = ( "Medical insurance premiums each dependent deducts through their own " "self-employed health insurance deduction. Each exclusion is limited " "to that person's paid medical premiums and the deduction left after " "its long-term care part. Premium inputs identify one payment per " - "person without a separate payer, so the same payment cannot enter " - "both the dependent's deduction and the parents' Schedule A. " - "Undeducted premiums remain in the parents' medical expense base." + "person without a separate payer. Under section 213(a) and Treasury " + "regulation 1.213-1(a)(1), parents may count only medical expenses " + "they paid. A dependent who deducts their own premiums paid those " + "premiums, so this amount leaves the parents' Schedule A. The formula " + "retains the existing treatment of undeducted dependent premiums." ) def formula(tax_unit, period, parameters): diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index bbcd95e386b..9d02eda84fd 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -14335,29 +14335,3 @@ candidates: - https://github.com/PolicyEngine/policyengine-us/pull/10053 state: ruled note: Neither source prescribes a fallback when residence data are missing. Keep the existing false default. -- id: us:dependent-se-health-premiums-parents-schedule-a - program: federal_income_tax - years: - from: 2013 - type: tax - question: May parents count a dependent's medical premiums under section 213(a) after the dependent deducts the same payment under section 162(l)? - sources: - - kind: statute - citation: 26 U.S.C. 162(l)(1)-(3) - url: https://www.law.cornell.edu/uscode/text/26/162#l - - kind: statute - citation: 26 U.S.C. 213(a) - url: https://www.law.cornell.edu/uscode/text/26/213#a - readings: - statute: A dependent's section 162(l) deduction removes the same premium payment from the parents' section 213(a) expenses. The canon against double deductions supplies the cross-return coordination. - other: Section 162(l)(3) refers to the taxpayer taking the deduction, so a taxpayer-only reading leaves the dependent's deducted medical premiums in the parents' medical expense base. - example: A dependent deducts 3,480 from 3,000 medical premiums and 480 eligible long-term care premiums. Parents retain none of those premiums. With a 929.35225 deduction, they retain 2,070.64775 medical premiums and 480 eligible long-term care premiums. - pe_us: - follows: statute - code: - - policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.py - - policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses.py - prs: - - https://github.com/PolicyEngine/policyengine-us/pull/10831 - state: ruled - note: Premium inputs hold one payment per person without a separate payer. Bound each dependent's exclusion to their own medical premiums and deduction after its long-term care part. Preserve the existing long-term care exclusion and state paid-cost bases. Captures of the operative statutes accompany this candidate in source_conflicts/sources/us/usc-26-162-2024-coordination.txt and usc-26-213-2024-coordination.txt. The household cases in itemized_medical_expenses_excluded_dependent_premiums.yaml pin the reading. Add the shared-register marker after registration, as CONTRIBUTING.md requires. From 3dd4f8e6f23a15461bc4367bb65a20901efcd7bb Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 02:40:06 -0500 Subject: [PATCH 05/12] Cover filer premium exclusions and clarify state overrides Co-Authored-By: Claude Opus 5.5 --- ...st_medical_expense_premium_conservation.py | 3 + ..._expenses_excluded_dependent_premiums.yaml | 101 ++++++++++++++++++ ...ized_medical_expenses_applied_exclusion.py | 23 ++-- .../nd_renters_refund_income.py | 18 ++-- .../credits/nm_medical_expense_credit.py | 4 + .../nm_medical_expense_exemption.py | 4 + 6 files changed, 139 insertions(+), 14 deletions(-) diff --git a/policyengine_us/tests/core/test_medical_expense_premium_conservation.py b/policyengine_us/tests/core/test_medical_expense_premium_conservation.py index fb1c3a12f8e..a6fd0ea99b6 100644 --- a/policyengine_us/tests/core/test_medical_expense_premium_conservation.py +++ b/policyengine_us/tests/core/test_medical_expense_premium_conservation.py @@ -12,6 +12,9 @@ The independent accounting invariant is that Schedule A's premium base plus every self-employed health insurance deduction never exceeds premiums paid. Non-premium medical expenses must remain available in full before the floor. +This accounting identity retains the existing inclusion of undeducted +dependent-paid premiums. Section 213(a) allows parents only expenses they paid; +the broader payer-attribution correction needs separate coverage. Examples use small vectorized simulations and a shared read-only reference system. Supplied and computed subtotal scenarios use separate simulations to diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml index 40fd2b479d2..02fd01371f4 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml @@ -46,6 +46,50 @@ medical_expense_deduction: 42_500 # 50,000 - 7.5% x 100,000. tax_unit_itemizes: true +- name: A filer excludes each premium payment once alongside a dependent deduction. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + head: + age: 45 + is_tax_unit_head: true + is_self_employed: true + self_employment_income: 20_000 + health_insurance_premiums: 5_000 + other_medical_expenses: 50_000 + dependent: + age: 20 + is_tax_unit_dependent: true + is_self_employed: true + self_employment_income: 10_000 + health_insurance_premiums: 3_000 + long_term_health_insurance_premiums: 500 + tax_units: + family: + members: [head, dependent] + marital_units: + head: + members: [head] + dependent: + members: [dependent] + households: + household: + members: [head, dependent] + state_code: TX + output: + eligible_long_term_care_premiums: [0, 480] + # 20,000 - (20,000 x 0.9235 x 0.153 / 2) = 18,587.045 > 5,000. + # 10,000 - (10,000 x 0.9235 x 0.153 / 2) = 9,293.5225 > 3,480. + self_employed_health_insurance_ald_person: [5_000, 3_480] + self_employed_health_insurance_ald: 5_000 + dependents_self_employed_health_insurance_ald: 3_480 + itemized_medical_expenses_excluded_premiums: 5_000 + itemized_medical_expenses_excluded_dependent_premiums: 3_000 + itemized_medical_expenses_long_term_care_premiums: 0 + # 5,000 + 3,000 + 480 - 5,000 - 3,000 - 480 + 50,000 = 50,000. + itemized_medical_expenses: 50_000 + - name: Parents exclude premiums their dependent deducts against partnership earnings. period: 2025 absolute_error_margin: 0.01 @@ -457,6 +501,35 @@ itemized_medical_expenses_applied_exclusion: 1_000 nd_renters_refund_income: 35_000 # 40,000 - (4,000 + 1,000). +- name: North Dakota uses a supplied zero exclusion with a computed subtotal. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + employment_income: 40_000 + other_medical_expenses: 2_000 + dependent: + age: 17 + is_tax_unit_dependent: true + health_insurance_premiums: 3_000 + self_employed_health_insurance_ald_person: 1_000 + tax_units: + parents: + members: [parent, dependent] + itemized_medical_expenses_applied_exclusion: 0 + households: + household: + members: [parent, dependent] + state_code: ND + output: + itemized_medical_expenses: 4_000 # 2,000 + 3,000 - 1,000. + # The supplied zero omits the dependent's 1,000 medical exclusion. + itemized_medical_expenses_applied_exclusion: 0 + # North Dakota uses the supplied zero: 40,000 - (4,000 + 0) = 36,000. + nd_renters_refund_income: 36_000 + - name: New Mexico retains its senior medical credit at the paid cost boundary. period: 2025 input: @@ -482,6 +555,34 @@ nm_medical_expense_credit: 2_800 # The paid cost base stays 28,000. nm_medical_expense_exemption: 0 # The exemption requires more than 28,000. +- name: New Mexico uses a supplied zero exclusion with a computed subtotal. + period: 2025 + input: + people: + parent: + age: 65 + medicare_enrolled: false + dependent: + age: 17 + is_tax_unit_dependent: true + health_insurance_premiums: 28_001 + self_employed_health_insurance_ald_person: 1_000 + tax_units: + parents: + members: [parent, dependent] + itemized_medical_expenses_applied_exclusion: 0 + households: + household: + members: [parent, dependent] + state_code: NM + output: + itemized_medical_expenses: 27_001 # 28,001 - 1,000. + # The supplied zero omits the dependent's 1,000 medical exclusion. + itemized_medical_expenses_applied_exclusion: 0 + # New Mexico uses 27,001 + 0, below the 28,000 expense threshold. + nm_medical_expense_credit: 0 + nm_medical_expense_exemption: 0 + - name: Montana retains non-premium expenses after a dependent deducts medical premiums. period: 2023 input: diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py index a325c0668b8..92e2fefc4fc 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py @@ -15,18 +15,27 @@ class itemized_medical_expenses_applied_exclusion(Variable): "Filer premiums and dependent medical premiums excluded by the " "federal medical expense formula. Dependent long-term care premiums " "remain outside this state addback, as under the existing state bases. " - "A caller-supplied subtotal bypasses that formula, so no exclusion " - "was applied, unless the caller also supplies this amount: all the " - "premiums, medical and long-term care, that a supplied Schedule A " - "subtotal already leaves out because they were taken as the " - "self-employed health insurance deduction, taken from the head's and " - "spouse's medical insurance premiums first. In a simulation with " + "A caller-supplied subtotal bypasses that formula. Supply this amount " + "when that subtotal already leaves out premiums taken as the " + "self-employed health insurance deduction. Include medical and " + "long-term care premiums. Allocate the exclusion to the head's and " + "spouse's medical premiums first. In a simulation with " "several tax units, supply it for each of them, since a formula " "variable supplied for some units is 0 for the rest. States retaining " "gross paid medical costs restore this amount; Montana's 2021-2023 " "schedule uses it to take only the medical premiums still inside the " "subtotal out of line 1. Premium inputs use payer attribution, " - "including family coverage paid by a filer. The required " + "including family coverage paid by a filer. " + "For a computed subtotal, a supplied exclusion replaces only the " + "filers' exclusion and excludes dependents' medical premiums. " + "Montana restores the computed dependent amount separately. North " + "Dakota and New Mexico use the supplied amount unchanged, so their " + "full paid-cost bases require the derived exclusion or a supplied " + "subtotal with its complete exclusion. A supplied exclusion for a " + "supplied subtotal includes all premiums that subtotal leaves out, " + "including dependents' medical premiums, for North Dakota and New " + "Mexico's addbacks. Montana caps the medical part of any supplied " + "exclusion at the filers' premiums. The required " "policyengine-core>=3.32.27 clears input provenance on deletion, so " "recalculating a deleted subtotal also restores its applied exclusion." ) diff --git a/policyengine_us/variables/gov/states/nd/tax/property/renters_refund/nd_renters_refund_income.py b/policyengine_us/variables/gov/states/nd/tax/property/renters_refund/nd_renters_refund_income.py index 686edf58952..efa9486f2d3 100644 --- a/policyengine_us/variables/gov/states/nd/tax/property/renters_refund/nd_renters_refund_income.py +++ b/policyengine_us/variables/gov/states/nd/tax/property/renters_refund/nd_renters_refund_income.py @@ -16,13 +16,13 @@ class nd_renters_refund_income(Variable): documentation = ( "Renter refund income: the listed income sources, less the parts of " "market income that federal law excludes and the unreimbursed medical " - "costs actually paid, and at least zero. The excluded parts are those " - "of each person's market income components " - "(nd_renters_refund_federally_excluded_income) and the federal " - "exclusions the model deducts above the line (excluded_deductions), " - "each of which comes out of the tax unit's income that holds it, or, " - "for income from Puerto Rico and American Samoa, out of market income " - "before losses. Social security counts in full. " + "costs actually paid, and at least zero. The model removes excluded " + "parts of each person's market income components " + "(nd_renters_refund_federally_excluded_income) and federal exclusions " + "deducted above the line (excluded_deductions). It subtracts each " + "exclusion from the tax unit's income that holds it. For Puerto Rico " + "and American Samoa income, it subtracts the exclusion from market " + "income before losses. Social security counts in full. " "The paid-cost base restores the self-employed premiums excluded from " "the federal subtotal: by the federal formula, or as supplied with a " "caller's subtotal in itemized_medical_expenses_applied_exclusion. A " @@ -30,6 +30,10 @@ class nd_renters_refund_income(Variable): "including when components are supplied. Premium inputs use payer " "attribution: each person reports premiums that person paid, including " "family coverage regardless of whom it covers." + " With a computed subtotal, a supplied applied exclusion omits the " + "dependent medical exclusion and overrides the addback unchanged. " + "Full paid-cost preservation requires a derived applied exclusion " + "or a supplied subtotal with its complete exclusion." ) def formula(tax_unit, period, parameters): diff --git a/policyengine_us/variables/gov/states/nm/tax/income/credits/nm_medical_expense_credit.py b/policyengine_us/variables/gov/states/nm/tax/income/credits/nm_medical_expense_credit.py index f7a54906c80..0baf77f2fa1 100644 --- a/policyengine_us/variables/gov/states/nm/tax/income/credits/nm_medical_expense_credit.py +++ b/policyengine_us/variables/gov/states/nm/tax/income/credits/nm_medical_expense_credit.py @@ -23,6 +23,10 @@ class nm_medical_expense_credit(Variable): "This assumes qualifying costs were funded from income included in AGI. " "Premium inputs use payer attribution: each person reports premiums that " "person paid, including family coverage regardless of whom it covers. " + "With a computed subtotal, a supplied applied exclusion omits the " + "dependent medical exclusion and overrides the addback unchanged. " + "Full paid-cost preservation requires a derived applied exclusion " + "or a supplied subtotal with its complete exclusion." ) def formula(tax_unit, period, parameters): diff --git a/policyengine_us/variables/gov/states/nm/tax/income/exemptions/nm_medical_expense_exemption.py b/policyengine_us/variables/gov/states/nm/tax/income/exemptions/nm_medical_expense_exemption.py index 7b7d8c53b41..c17d5c16ce9 100644 --- a/policyengine_us/variables/gov/states/nm/tax/income/exemptions/nm_medical_expense_exemption.py +++ b/policyengine_us/variables/gov/states/nm/tax/income/exemptions/nm_medical_expense_exemption.py @@ -24,6 +24,10 @@ class nm_medical_expense_exemption(Variable): "included in AGI. Premium inputs use payer attribution: each person " "reports premiums that person paid, including family coverage regardless " "of whom it covers. " + "With a computed subtotal, a supplied applied exclusion omits the " + "dependent medical exclusion and overrides the addback unchanged. " + "Full paid-cost preservation requires a derived applied exclusion " + "or a supplied subtotal with its complete exclusion." ) def formula(tax_unit, period, parameters): From 40afcd9766abcd6e50e9d3c62326abb6a0fb3c6a Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 15:45:52 -0500 Subject: [PATCH 06/12] Restore dependents' exclusions in North Dakota and New Mexico With a computed subtotal, a supplied applied exclusion covers the filers only. North Dakota and New Mexico now add back the dependents' computed exclusion, as Montana does, so their paid-cost bases match the derived path. The govinfo copy of 26 U.S.C. 162 replaces the Cornell link. Co-Authored-By: Claude Opus 5.5 --- ..._expenses_excluded_dependent_premiums.yaml | 22 +++++++++++-------- ...ized_medical_expenses_applied_exclusion.py | 8 +++---- .../nd_renters_refund_income.py | 21 ++++++++++++++---- .../credits/nm_medical_expense_credit.py | 20 +++++++++++++---- .../nm_medical_expense_exemption.py | 20 +++++++++++++---- 5 files changed, 65 insertions(+), 26 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml index 02fd01371f4..6f7687a27e0 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml @@ -501,7 +501,7 @@ itemized_medical_expenses_applied_exclusion: 1_000 nd_renters_refund_income: 35_000 # 40,000 - (4,000 + 1,000). -- name: North Dakota uses a supplied zero exclusion with a computed subtotal. +- name: North Dakota restores a dependent's exclusion beside a supplied zero filer exclusion. period: 2025 absolute_error_margin: 0.01 input: @@ -525,10 +525,12 @@ state_code: ND output: itemized_medical_expenses: 4_000 # 2,000 + 3,000 - 1,000. - # The supplied zero omits the dependent's 1,000 medical exclusion. + # The supplied zero covers the filers' exclusion only. itemized_medical_expenses_applied_exclusion: 0 - # North Dakota uses the supplied zero: 40,000 - (4,000 + 0) = 36,000. - nd_renters_refund_income: 36_000 + itemized_medical_expenses_excluded_dependent_premiums: 1_000 + # NDCC 57-02-08.1(5)(c) counts costs the applicant's dependent paid: + # 40,000 - (4,000 + 0 + 1,000) = 35,000. + nd_renters_refund_income: 35_000 - name: New Mexico retains its senior medical credit at the paid cost boundary. period: 2025 @@ -555,7 +557,7 @@ nm_medical_expense_credit: 2_800 # The paid cost base stays 28,000. nm_medical_expense_exemption: 0 # The exemption requires more than 28,000. -- name: New Mexico uses a supplied zero exclusion with a computed subtotal. +- name: New Mexico restores a dependent's exclusion beside a supplied zero filer exclusion. period: 2025 input: people: @@ -577,11 +579,13 @@ state_code: NM output: itemized_medical_expenses: 27_001 # 28,001 - 1,000. - # The supplied zero omits the dependent's 1,000 medical exclusion. + # The supplied zero covers the filers' exclusion only. itemized_medical_expenses_applied_exclusion: 0 - # New Mexico uses 27,001 + 0, below the 28,000 expense threshold. - nm_medical_expense_credit: 0 - nm_medical_expense_exemption: 0 + itemized_medical_expenses_excluded_dependent_premiums: 1_000 + # 27,001 + 0 + 1,000 = 28,001: at least 28,000 for the credit and more + # than 28,000 for the exemption. + nm_medical_expense_credit: 2_800 + nm_medical_expense_exemption: 3_000 - name: Montana retains non-premium expenses after a dependent deducts medical premiums. period: 2023 diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py index 92e2fefc4fc..ff82c8eba26 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py @@ -8,7 +8,7 @@ class itemized_medical_expenses_applied_exclusion(Variable): unit = USD definition_period = YEAR reference = [ - "https://www.law.cornell.edu/uscode/text/26/162#l_3", + "https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partVI-sec162.htm", "https://www.irs.gov/instructions/i1040sca", ] documentation = ( @@ -28,10 +28,8 @@ class itemized_medical_expenses_applied_exclusion(Variable): "including family coverage paid by a filer. " "For a computed subtotal, a supplied exclusion replaces only the " "filers' exclusion and excludes dependents' medical premiums. " - "Montana restores the computed dependent amount separately. North " - "Dakota and New Mexico use the supplied amount unchanged, so their " - "full paid-cost bases require the derived exclusion or a supplied " - "subtotal with its complete exclusion. A supplied exclusion for a " + "Montana, North Dakota and New Mexico each restore the computed " + "dependent amount separately. A supplied exclusion for a " "supplied subtotal includes all premiums that subtotal leaves out, " "including dependents' medical premiums, for North Dakota and New " "Mexico's addbacks. Montana caps the medical part of any supplied " diff --git a/policyengine_us/variables/gov/states/nd/tax/property/renters_refund/nd_renters_refund_income.py b/policyengine_us/variables/gov/states/nd/tax/property/renters_refund/nd_renters_refund_income.py index efa9486f2d3..cd9cb5e5327 100644 --- a/policyengine_us/variables/gov/states/nd/tax/property/renters_refund/nd_renters_refund_income.py +++ b/policyengine_us/variables/gov/states/nd/tax/property/renters_refund/nd_renters_refund_income.py @@ -30,10 +30,9 @@ class nd_renters_refund_income(Variable): "including when components are supplied. Premium inputs use payer " "attribution: each person reports premiums that person paid, including " "family coverage regardless of whom it covers." - " With a computed subtotal, a supplied applied exclusion omits the " - "dependent medical exclusion and overrides the addback unchanged. " - "Full paid-cost preservation requires a derived applied exclusion " - "or a supplied subtotal with its complete exclusion." + " With a computed subtotal, a supplied applied exclusion covers the " + "filers' premiums only, so the model also restores the dependents' " + "computed medical exclusion, as Montana does." ) def formula(tax_unit, period, parameters): @@ -103,6 +102,20 @@ def formula(tax_unit, period, parameters): "itemized_medical_expenses_applied_exclusion", ], ) + # NDCC 57-02-08.1(5)(c) takes out of income the medical expenses "paid + # during the year by the applicant or the applicant's dependent". A + # supplied exclusion beside a computed subtotal covers the filers + # only, so restore the dependents' computed exclusion as well, as + # Montana does. + simulation = tax_unit.simulation + if not has_input_for_period( + simulation, "itemized_medical_expenses", period + ) and has_input_for_period( + simulation, "itemized_medical_expenses_applied_exclusion", period + ): + medical_expenses = medical_expenses + tax_unit( + "itemized_medical_expenses_excluded_dependent_premiums", period + ) return max_( add(tax_unit, period, p.income_sources) - person_exclusions diff --git a/policyengine_us/variables/gov/states/nm/tax/income/credits/nm_medical_expense_credit.py b/policyengine_us/variables/gov/states/nm/tax/income/credits/nm_medical_expense_credit.py index 0baf77f2fa1..5646461bec5 100644 --- a/policyengine_us/variables/gov/states/nm/tax/income/credits/nm_medical_expense_credit.py +++ b/policyengine_us/variables/gov/states/nm/tax/income/credits/nm_medical_expense_credit.py @@ -23,10 +23,9 @@ class nm_medical_expense_credit(Variable): "This assumes qualifying costs were funded from income included in AGI. " "Premium inputs use payer attribution: each person reports premiums that " "person paid, including family coverage regardless of whom it covers. " - "With a computed subtotal, a supplied applied exclusion omits the " - "dependent medical exclusion and overrides the addback unchanged. " - "Full paid-cost preservation requires a derived applied exclusion " - "or a supplied subtotal with its complete exclusion." + "With a computed subtotal, a supplied applied exclusion covers the " + "filers' premiums only, so the model also restores the dependents' " + "computed medical exclusion, as Montana does." ) def formula(tax_unit, period, parameters): @@ -44,6 +43,19 @@ def formula(tax_unit, period, parameters): "itemized_medical_expenses_applied_exclusion", ], ) + # PIT-RC line 23 counts costs "for the care of any combination of + # you, your spouse, or dependents". A supplied exclusion beside a + # computed subtotal covers the filers only, so restore the + # dependents' computed exclusion as well, as Montana does. + simulation = tax_unit.simulation + if not has_input_for_period( + simulation, "itemized_medical_expenses", period + ) and has_input_for_period( + simulation, "itemized_medical_expenses_applied_exclusion", period + ): + medical_expense = medical_expense + tax_unit( + "itemized_medical_expenses_excluded_dependent_premiums", period + ) expense_eligible = medical_expense >= p.min_expenses # NMSA 7-2-18.13(A) allows the credit to "a taxpayer ... who is # sixty-five years of age or older and who is not a dependent of diff --git a/policyengine_us/variables/gov/states/nm/tax/income/exemptions/nm_medical_expense_exemption.py b/policyengine_us/variables/gov/states/nm/tax/income/exemptions/nm_medical_expense_exemption.py index c17d5c16ce9..4319c66f2c7 100644 --- a/policyengine_us/variables/gov/states/nm/tax/income/exemptions/nm_medical_expense_exemption.py +++ b/policyengine_us/variables/gov/states/nm/tax/income/exemptions/nm_medical_expense_exemption.py @@ -24,10 +24,9 @@ class nm_medical_expense_exemption(Variable): "included in AGI. Premium inputs use payer attribution: each person " "reports premiums that person paid, including family coverage regardless " "of whom it covers. " - "With a computed subtotal, a supplied applied exclusion omits the " - "dependent medical exclusion and overrides the addback unchanged. " - "Full paid-cost preservation requires a derived applied exclusion " - "or a supplied subtotal with its complete exclusion." + "With a computed subtotal, a supplied applied exclusion covers the " + "filers' premiums only, so the model also restores the dependents' " + "computed medical exclusion, as Montana does." ) def formula(tax_unit, period, parameters): @@ -46,6 +45,19 @@ def formula(tax_unit, period, parameters): "itemized_medical_expenses_applied_exclusion", ], ) + # PIT-ADJ line 18 counts costs "for the care of any combination of + # you, your spouse, or your dependents". A supplied exclusion beside a + # computed subtotal covers the filers only, so restore the + # dependents' computed exclusion as well, as Montana does. + simulation = tax_unit.simulation + if not has_input_for_period( + simulation, "itemized_medical_expenses", period + ) and has_input_for_period( + simulation, "itemized_medical_expenses_applied_exclusion", period + ): + medical_expense = medical_expense + tax_unit( + "itemized_medical_expenses_excluded_dependent_premiums", period + ) # NMSA 7-2-5.9(A) allows the exemption to "any individual sixty-five # years of age or older" for expenses paid "for that individual or # for the individual's spouse or dependent", and PIT-ADJ line 18 asks From 40f2f8ecbaa28ea70b2d976b01b035a194902c8a Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 15:45:59 -0500 Subject: [PATCH 07/12] Drop the 26 U.S.C. 162 and 213 captures no entry cites No source-conflict register entry cites these captures, and the source captures folder holds texts that register entries cite. Co-Authored-By: Claude Opus 5.5 --- .../us/usc-26-162-2024-coordination.txt | 58 ------------------- .../us/usc-26-213-2024-coordination.txt | 10 ---- 2 files changed, 68 deletions(-) delete mode 100644 source_conflicts/sources/us/usc-26-162-2024-coordination.txt delete mode 100644 source_conflicts/sources/us/usc-26-213-2024-coordination.txt diff --git a/source_conflicts/sources/us/usc-26-162-2024-coordination.txt b/source_conflicts/sources/us/usc-26-162-2024-coordination.txt deleted file mode 100644 index b45c04f153d..00000000000 --- a/source_conflicts/sources/us/usc-26-162-2024-coordination.txt +++ /dev/null @@ -1,58 +0,0 @@ -Source: https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partVI-sec162.htm -Retrieved: 2026-11-12 -Extraction: HTML text, operative subsections only. - -(l) Special rules for health insurance costs of self-employed individuals - - -(1) Allowance of deduction - - -In the case of a taxpayer who is an employee within the meaning of section 401(c)(1), there shall be allowed as a deduction under this section an amount equal to the amount paid during the taxable year for insurance which constitutes medical care for— - - -(A) the taxpayer, - - -(B) the taxpayer's spouse, - - -(C) the taxpayer's dependents, and - - -(D) any child (as defined in section 152(f)(1)) of the taxpayer who as of the end of the taxable year has not attained age 27. - - -(2) Limitations - - -(A) Dollar amount - - -No deduction shall be allowed under paragraph (1) to the extent that the amount of such deduction exceeds the taxpayer's earned income (within the meaning of section 401(c)) derived by the taxpayer from the trade or business with respect to which the plan providing the medical care coverage is established. - - -(B) Other coverage - - -Paragraph (1) shall not apply to any taxpayer for any calendar month for which the taxpayer is eligible to participate in any subsidized health plan maintained by any employer of the taxpayer or of the spouse of, or any dependent, or individual described in subparagraph (D) of paragraph (1) with respect to, the taxpayer. The preceding sentence shall be applied separately with respect to— - - -(i) plans which include coverage for qualified long-term care services (as defined in section 7702B(c)) or are qualified long-term care insurance contracts (as defined in section 7702B(b)), and - - -(ii) plans which do not include such coverage and are not such contracts. - - -(C) Long-term care premiums - - -In the case of a qualified long-term care insurance contract (as defined in section 7702B(b)), only eligible long-term care premiums (as defined in section 213(d)(10)) shall be taken into account under paragraph (1). - - -(3) Coordination with medical deduction - - -Any amount paid by a taxpayer for insurance to which paragraph (1) applies shall not be taken into account in computing the amount allowable to the taxpayer as a deduction under section 213(a). - - diff --git a/source_conflicts/sources/us/usc-26-213-2024-coordination.txt b/source_conflicts/sources/us/usc-26-213-2024-coordination.txt deleted file mode 100644 index e267e8bd32d..00000000000 --- a/source_conflicts/sources/us/usc-26-213-2024-coordination.txt +++ /dev/null @@ -1,10 +0,0 @@ -Source: https://www.govinfo.gov/content/pkg/USCODE-2024-title26/html/USCODE-2024-title26-subtitleA-chap1-subchapB-partVII-sec213.htm -Retrieved: 2026-11-12 -Extraction: HTML text, operative subsections only. - -(a) Allowance of deduction - - -There shall be allowed as a deduction the expenses paid during the taxable year, not compensated for by insurance or otherwise, for medical care of the taxpayer, his spouse, or a dependent (as defined in section 152, determined without regard to subsections (b)(1), (b)(2), and (d)(1)(B) thereof), to the extent that such expenses exceed 7.5 percent of adjusted gross income. - - From e7a4603e56745942461c99230239bf44dc4f3c35 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 16:54:52 -0500 Subject: [PATCH 08/12] Count dependents' deducted premiums in Montana's supplied exclusion The computed subtotal leaves out the medical premiums dependents deduct, and the computed applied exclusion holds them. Beside a supplied subtotal, the Montana formula capped the exclusion's medical part at the filers' premiums, so it took those dependent premiums out of line 1 a second time. It now caps the medical part at the filers' premiums plus the dependents' computed exclusion. A subtotal and exclusion supplied at their computed values then give the computed deduction, as test_mt_medical_premium_deduction_invariants.py requires. Co-Authored-By: Claude Fable 5.2 --- ..._expenses_excluded_dependent_premiums.yaml | 69 +++++++++++++++++++ ...ized_medical_expenses_applied_exclusion.py | 8 ++- .../mt_medical_expense_deduction_joint.py | 26 +++++-- 3 files changed, 95 insertions(+), 8 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml index 6f7687a27e0..01bfa007dad 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml @@ -682,3 +682,72 @@ itemized_medical_expenses: 9_000 # (9,000 - (1,000 - 500) - 7,500) + 1,000 premiums = 2,000. mt_medical_expense_deduction_joint: 2_000 + +- name: Montana keeps other expenses on line 1 when a supplied subtotal leaves out a dependent's deducted premiums. + period: 2023 + input: + people: + parent: + age: 40 + employment_income: 100_000 + other_medical_expenses: 8_000 + dependent: + age: 17 + is_tax_unit_dependent: true + health_insurance_premiums: 3_000 + self_employed_health_insurance_ald_person: 1_000 + tax_units: + parents: + members: [parent, dependent] + # The subtotal and exclusion the formulas compute for these people. + itemized_medical_expenses: 10_000 # 8,000 + (3,000 - 1,000). + itemized_medical_expenses_applied_exclusion: 1_000 + households: + household: + members: [parent, dependent] + state_code: MT + output: + itemized_medical_expenses_excluded_dependent_premiums: 1_000 + # Medical premiums the subtotal leaves out: min(0 + 1,000, 1,000) = 1,000. + # Premiums left in it: 3,000 - 1,000 = 2,000. + # Line 1: (10,000 - 2,000) - 7.5% x 100,000 = 500, as computed. + mt_medical_expense_deduction_joint: [500, 0] + +- name: Montana takes a supplied exclusion from the premiums a dependent deducted and leaves the rest in the subtotal. + period: 2022 + absolute_error_margin: 0.01 + input: + people: + parent: + is_tax_unit_head: true + age: 30 + health_insurance_premiums: 6_000 + long_term_health_insurance_premiums: 400 + self_employed_health_insurance_ald_person: 6_400 + dependent: + is_tax_unit_dependent: true + age: 10 + health_insurance_premiums: 1_000 + self_employed_health_insurance_ald_person: 600 + tax_units: + parents: + members: [parent, dependent] + # Schedule A line 1: 10,000 of other expenses + the 400 of premiums + # the dependent did not deduct. The exclusion holds the parent's + # 6,000 of medical and 400 of long-term care premiums and the + # dependent's 600. + itemized_medical_expenses: 10_400 + itemized_medical_expenses_applied_exclusion: 7_000 + mt_agi_joint: 40_000 + households: + household: + members: [parent, dependent] + state_code: MT + output: + itemized_medical_expenses_excluded_dependent_premiums: 600 + # Medical premiums the subtotal leaves out: min(6,000 + 600, 7,000) = + # 6,600. Premiums left in it: 7,000 - 6,600 = 400. + # Line 1: (10,400 - 400) - 7.5% x 40,000 = 7,000. + # Lines 2 and 3: 6,000 + 400 - 6,400 = 0. + mt_premium_deduction_joint: 0 + mt_medical_expense_deduction_joint: [7_000, 0] diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py index ff82c8eba26..eae5b218c96 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py @@ -32,8 +32,12 @@ class itemized_medical_expenses_applied_exclusion(Variable): "dependent amount separately. A supplied exclusion for a " "supplied subtotal includes all premiums that subtotal leaves out, " "including dependents' medical premiums, for North Dakota and New " - "Mexico's addbacks. Montana caps the medical part of any supplied " - "exclusion at the filers' premiums. The required " + "Mexico's addbacks. Montana takes the medical premiums out of a " + "supplied exclusion first: up to the filers' premiums beside a " + "computed subtotal, and up to the filers' premiums plus the " + "dependents' computed medical exclusion beside a supplied subtotal, " + "so a subtotal and exclusion supplied at their computed values give " + "the computed deduction. The required " "policyengine-core>=3.32.27 clears input provenance on deletion, so " "recalculating a deleted subtotal also restores its applied exclusion." ) diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py index 54291fed510..8524b5031df 100644 --- a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py @@ -45,13 +45,27 @@ def formula(person, period, parameters): period, ): # Supplied amounts use the pooled filer-first split. - excluded = tax_unit( - "itemized_medical_expenses_applied_exclusion", period + excluded = max_( + 0, + tax_unit("itemized_medical_expenses_applied_exclusion", period), ) - medical_exclusion = min_(filer_premiums, max_(0, excluded)) - if not supplied_subtotal: - medical_exclusion += tax_unit( - "itemized_medical_expenses_excluded_dependent_premiums", period + dependent_exclusion = tax_unit( + "itemized_medical_expenses_excluded_dependent_premiums", period + ) + if supplied_subtotal: + # The exclusion supplied with a subtotal holds every + # premium that subtotal leaves out. Take the medical + # premiums first: up to the filers' premiums plus the + # medical premiums the dependents deducted. The rest + # covered long-term care premiums. + medical_exclusion = min_( + filer_premiums + dependent_exclusion, excluded + ) + else: + # Beside a computed subtotal, a supplied exclusion covers + # the filers only, so add the dependents' exclusion. + medical_exclusion = ( + min_(filer_premiums, excluded) + dependent_exclusion ) else: medical_exclusion = add( From 2455d61eae0c4e77dd8861009f9b0c64c9f35c20 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 17:08:31 -0500 Subject: [PATCH 09/12] Keep main's Montana result when a supplied exclusion covers filers only Beside a supplied subtotal, the Montana formula now reads the part of the supplied exclusion above the filers' own computed exclusion as the dependents' deducted premiums, up to the dependents' computed exclusion. An exclusion that covers the filers only then leaves the dependents' premiums in the subtotal, as on main, and an exclusion supplied at its computed value still gives the computed deduction. Co-Authored-By: Claude Fable 5.2 --- ..._expenses_excluded_dependent_premiums.yaml | 51 +++++++++++++++++-- ...ized_medical_expenses_applied_exclusion.py | 12 ++--- .../mt_medical_expense_deduction_joint.py | 24 ++++++--- 3 files changed, 71 insertions(+), 16 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml index 01bfa007dad..2e07288c5a9 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml @@ -708,8 +708,9 @@ state_code: MT output: itemized_medical_expenses_excluded_dependent_premiums: 1_000 - # Medical premiums the subtotal leaves out: min(0 + 1,000, 1,000) = 1,000. - # Premiums left in it: 3,000 - 1,000 = 2,000. + # The filers excluded nothing, so the 1,000 exclusion holds the + # dependent's deducted premiums: min(1,000, 1,000 - 0) = 1,000. + # Premiums left in the subtotal: 3,000 - 1,000 = 2,000. # Line 1: (10,000 - 2,000) - 7.5% x 100,000 = 500, as computed. mt_medical_expense_deduction_joint: [500, 0] @@ -745,9 +746,51 @@ state_code: MT output: itemized_medical_expenses_excluded_dependent_premiums: 600 - # Medical premiums the subtotal leaves out: min(6,000 + 600, 7,000) = - # 6,600. Premiums left in it: 7,000 - 6,600 = 400. + # The filers' own exclusion: 6,000 + 400 = 6,400. The other + # 7,000 - 6,400 = 600 of the supplied exclusion holds the dependent's + # deducted premiums. Medical premiums the subtotal leaves out: + # min(6,000, 7,000 - 600) + 600 = 6,600; premiums left in it: + # 7,000 - 6,600 = 400. # Line 1: (10,400 - 400) - 7.5% x 40,000 = 7,000. # Lines 2 and 3: 6,000 + 400 - 6,400 = 0. mt_premium_deduction_joint: 0 mt_medical_expense_deduction_joint: [7_000, 0] + +- name: Montana leaves a dependent's deducted premiums in a supplied subtotal when its exclusion covers the filers only. + period: 2022 + absolute_error_margin: 0.01 + input: + people: + parent: + is_tax_unit_head: true + age: 30 + health_insurance_premiums: 6_000 + long_term_health_insurance_premiums: 400 + self_employed_health_insurance_ald_person: 6_400 + dependent: + is_tax_unit_dependent: true + age: 10 + health_insurance_premiums: 1_000 + self_employed_health_insurance_ald_person: 600 + tax_units: + parents: + members: [parent, dependent] + # This subtotal holds 10,000 of other expenses and all 1,000 of the + # dependent's premiums. Its exclusion holds only the parent's 6,000 + # of medical and 400 of long-term care premiums. + itemized_medical_expenses: 11_000 + itemized_medical_expenses_applied_exclusion: 6_400 + mt_agi_joint: 40_000 + households: + household: + members: [parent, dependent] + state_code: MT + output: + itemized_medical_expenses_excluded_dependent_premiums: 600 + # The supplied exclusion equals the filers' own 6,400, so none of it + # holds the dependent's premiums: min(600, 6,400 - 6,400) = 0. + # Medical premiums the subtotal leaves out: min(6,000, 6,400) = 6,000; + # premiums left in it: 7,000 - 6,000 = 1,000. + # Line 1: (11,000 - 1,000) - 7.5% x 40,000 = 7,000. + mt_premium_deduction_joint: 0 + mt_medical_expense_deduction_joint: [7_000, 0] diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py index eae5b218c96..876cbb81098 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py @@ -32,12 +32,12 @@ class itemized_medical_expenses_applied_exclusion(Variable): "dependent amount separately. A supplied exclusion for a " "supplied subtotal includes all premiums that subtotal leaves out, " "including dependents' medical premiums, for North Dakota and New " - "Mexico's addbacks. Montana takes the medical premiums out of a " - "supplied exclusion first: up to the filers' premiums beside a " - "computed subtotal, and up to the filers' premiums plus the " - "dependents' computed medical exclusion beside a supplied subtotal, " - "so a subtotal and exclusion supplied at their computed values give " - "the computed deduction. The required " + "Mexico's addbacks. Beside a supplied subtotal, Montana reads the " + "part of a supplied exclusion above the filers' own computed " + "exclusion as the dependents' deducted medical premiums, up to the " + "dependents' computed exclusion, and takes the rest from the filers' " + "medical premiums first. A subtotal and exclusion supplied at their " + "computed values then give the computed deduction. The required " "policyengine-core>=3.32.27 clears input provenance on deletion, so " "recalculating a deleted subtotal also restores its applied exclusion." ) diff --git a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py index 8524b5031df..9f57153f0ae 100644 --- a/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py +++ b/policyengine_us/variables/gov/states/mt/tax/income/deductions/itemized/medical/mt_medical_expense_deduction_joint.py @@ -54,12 +54,24 @@ def formula(person, period, parameters): ) if supplied_subtotal: # The exclusion supplied with a subtotal holds every - # premium that subtotal leaves out. Take the medical - # premiums first: up to the filers' premiums plus the - # medical premiums the dependents deducted. The rest - # covered long-term care premiums. - medical_exclusion = min_( - filer_premiums + dependent_exclusion, excluded + # premium that subtotal leaves out. Read the part above + # the filers' own exclusion as the medical premiums the + # dependents deducted, up to their computed exclusion. + # Take the rest from the filers' medical premiums first; + # what remains covered long-term care premiums. + filer_exclusion = add( + tax_unit, + period, + [ + "itemized_medical_expenses_excluded_premiums", + "itemized_medical_expenses_excluded_long_term_care_premiums", + ], + ) + dependent_part = min_( + dependent_exclusion, max_(0, excluded - filer_exclusion) + ) + medical_exclusion = ( + min_(filer_premiums, excluded - dependent_part) + dependent_part ) else: # Beside a computed subtotal, a supplied exclusion covers From f49d9056cbdee5c21ad780920a8f8457c1204d9d Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 17:48:24 -0500 Subject: [PATCH 10/12] Pin the cap on the dependents' part of Montana's supplied exclusion A caller can supply an exclusion above what the return's people deducted. Beside a supplied subtotal, the Montana formula reads no more of that exclusion as a dependent's premiums than the dependent deducted. The new case gives 7,500 in place of 7,000 when the formula drops that cap. Co-Authored-By: Claude Fable 5.2 --- ..._expenses_excluded_dependent_premiums.yaml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml index 2e07288c5a9..f15786cadae 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml @@ -794,3 +794,41 @@ # Line 1: (11,000 - 1,000) - 7.5% x 40,000 = 7,000. mt_premium_deduction_joint: 0 mt_medical_expense_deduction_joint: [7_000, 0] + +- name: Montana reads no more of a supplied exclusion as a dependent's premiums than the dependent deducted. + period: 2022 + absolute_error_margin: 0.01 + input: + people: + parent: + is_tax_unit_head: true + age: 30 + health_insurance_premiums: 6_000 + long_term_health_insurance_premiums: 400 + self_employed_health_insurance_ald_person: 6_400 + dependent: + is_tax_unit_dependent: true + age: 10 + health_insurance_premiums: 1_000 + self_employed_health_insurance_ald_person: 600 + tax_units: + parents: + members: [parent, dependent] + # The subtotal holds 10,000 of other expenses + the 400 of premiums + # the dependent did not deduct. The exclusion exceeds the 7,000 these + # people deducted by 500. + itemized_medical_expenses: 10_400 + itemized_medical_expenses_applied_exclusion: 7_500 + mt_agi_joint: 40_000 + households: + household: + members: [parent, dependent] + state_code: MT + output: + # 7,500 - 6,400 = 1,100 of the exclusion sits above the filers' own; + # min(600, 1,100) = 600 of it holds the dependent's deducted premiums. + # Medical premiums the subtotal leaves out: + # min(6,000, 7,500 - 600) + 600 = 6,600; premiums left in it: 400. + # Line 1: (10,400 - 400) - 7.5% x 40,000 = 7,000. + mt_premium_deduction_joint: 0 + mt_medical_expense_deduction_joint: [7_000, 0] From a91ff3cb76aa8b6ed9bad601e5c47f4ca4c061a1 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 17:48:24 -0500 Subject: [PATCH 11/12] Take dependents' deducted premiums out of New Jersey's supplied subtotal once The computed subtotal leaves out the medical premiums dependents deduct, and the computed applied exclusion holds them. Beside a supplied subtotal, the New Jersey formula subtracted the dependents' computed exclusion again, so a subtotal and exclusion supplied at their computed values gave 6,400 where the computed path gives 9,400. The formula now reads the part of the supplied exclusion above the filers' own computed exclusion as the dependents' deducted premiums, up to the dependents' computed exclusion, and subtracts only the rest. A subtotal supplied alone, or with an exclusion that covers the filers only, still loses the dependents' deducted premiums, as on main. Co-Authored-By: Claude Fable 5.2 --- .../nj_medical_expense_deduction.yaml | 133 ++++++++++++++++++ ...ized_medical_expenses_applied_exclusion.py | 14 +- .../nj_medical_expense_deduction.py | 27 +++- 3 files changed, 165 insertions(+), 9 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.yaml b/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.yaml index f24718a2b04..50b27d66b16 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.yaml @@ -271,6 +271,139 @@ # subtotal: 13,000 - 3,000 - 0.02 x 30,000 = 9,400. nj_medical_expense_deduction: 9_400 +- name: New Jersey takes nothing more out of a supplied subtotal that already leaves out a dependent's deducted premiums + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 45 + is_tax_unit_head: true + employment_income: 30_000 + medicare_enrolled: false + other_medical_expenses: 10_000 + child: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + self_employment_income: 10_000 + medicare_enrolled: false + health_insurance_premiums: 3_000 + long_term_health_insurance_premiums: 480 + tax_units: + tax_unit: + members: [parent, child] + # The subtotal and exclusion the formulas compute for these people: + # 10,000 of other expenses, with the child's 3,000 of deducted + # medical premiums in the exclusion. + itemized_medical_expenses: 10_000 + itemized_medical_expenses_applied_exclusion: 3_000 + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + households: + household: + members: [parent, child] + state_code: NJ + output: + dependents_self_employed_health_insurance_ald: 3_480 + itemized_medical_expenses_excluded_dependent_premiums: 3_000 + nj_agi: 30_000 + # The parent excluded nothing, so the 3,000 exclusion holds the child's + # deducted premiums: min(3,000, 3,000 - 0) = 3,000, and none remain to + # take out. New Jersey deducts 10,000 - 0.02 x 30,000 = 9,400, as + # computed. + nj_medical_expense_deduction: 9_400 + +- name: New Jersey reads no more of a supplied exclusion as a dependent's premiums than the dependent deducted + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 45 + is_tax_unit_head: true + employment_income: 30_000 + medicare_enrolled: false + other_medical_expenses: 10_000 + child: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + self_employment_income: 10_000 + medicare_enrolled: false + health_insurance_premiums: 3_000 + long_term_health_insurance_premiums: 480 + tax_units: + tax_unit: + members: [parent, child] + itemized_medical_expenses: 10_000 + itemized_medical_expenses_applied_exclusion: 5_000 + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + households: + household: + members: [parent, child] + state_code: NJ + output: + itemized_medical_expenses_excluded_dependent_premiums: 3_000 + nj_agi: 30_000 + # min(3,000, 5,000 - 0) = 3,000 of the exclusion holds the child's + # deducted premiums, so none remain to take out: + # 10,000 - 0.02 x 30,000 = 9,400. + nj_medical_expense_deduction: 9_400 + +- name: New Jersey takes a dependent's deducted premiums out of a supplied subtotal when its exclusion covers the filers only + period: 2025 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 45 + is_tax_unit_head: true + medicare_enrolled: false + health_insurance_premiums: 6_000 + other_medical_expenses: 10_000 + child: + age: 17 + is_tax_unit_dependent: true + is_self_employed: true + self_employment_income: 10_000 + medicare_enrolled: false + health_insurance_premiums: 3_000 + tax_units: + tax_unit: + members: [parent, child] + self_employed_health_insurance_ald: 1_000 + # This subtotal holds 10,000 of other expenses, the parent's 5,000 + # of premiums not deducted and all 3,000 of the child's premiums. + # Its exclusion holds only the parent's 1,000 of deducted premiums. + itemized_medical_expenses: 18_000 + itemized_medical_expenses_applied_exclusion: 1_000 + nj_agi: 30_000 + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + households: + household: + members: [parent, child] + state_code: NJ + output: + itemized_medical_expenses_excluded_premiums: 1_000 + itemized_medical_expenses_excluded_dependent_premiums: 3_000 + # The supplied exclusion equals the filers' own 1,000, so none of it + # holds the child's premiums: min(3,000, 1,000 - 1,000) = 0. New Jersey + # takes all 3,000 out: (18,000 - 3,000 - 0.02 x 30,000) + the parent's + # 1,000 deduction = 15,400. + nj_medical_expense_deduction: 15_400 + - name: New Jersey cannot subtract one dependent's deduction from another dependent's premiums period: 2025 input: diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py index 876cbb81098..625f011366b 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_applied_exclusion.py @@ -32,12 +32,14 @@ class itemized_medical_expenses_applied_exclusion(Variable): "dependent amount separately. A supplied exclusion for a " "supplied subtotal includes all premiums that subtotal leaves out, " "including dependents' medical premiums, for North Dakota and New " - "Mexico's addbacks. Beside a supplied subtotal, Montana reads the " - "part of a supplied exclusion above the filers' own computed " - "exclusion as the dependents' deducted medical premiums, up to the " - "dependents' computed exclusion, and takes the rest from the filers' " - "medical premiums first. A subtotal and exclusion supplied at their " - "computed values then give the computed deduction. The required " + "Mexico's addbacks. Beside a supplied subtotal, Montana and New " + "Jersey read the part of a supplied exclusion above the filers' own " + "computed exclusion as the dependents' deducted medical premiums, up " + "to the dependents' computed exclusion. Montana takes the rest from " + "the filers' medical premiums first, and New Jersey takes only the " + "dependents' other deducted premiums out of the subtotal. A subtotal " + "and exclusion supplied at their computed values then give the " + "computed deductions. The required " "policyengine-core>=3.32.27 clears input provenance on deletion, so " "recalculating a deleted subtotal also restores its applied exclusion." ) diff --git a/policyengine_us/variables/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.py b/policyengine_us/variables/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.py index 755b3b4e5b5..789ab6cd4e7 100644 --- a/policyengine_us/variables/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.py +++ b/policyengine_us/variables/gov/states/nj/tax/income/deductions/nj_medical_expense_deduction.py @@ -16,7 +16,10 @@ class nj_medical_expense_deduction(Variable): "regardless of who is covered. Each dependent's exclusion is limited " "to that dependent's own medical premiums. A dependent aggregate ALD " "override must identify the corresponding person ALDs for exclusion; " - "the total alone does not establish which person paid the premiums." + "the total alone does not establish which person paid the premiums. " + "A supplied subtotal loses the dependents' deducted premiums once: " + "the formula takes out only those that the applied exclusion supplied " + "with the subtotal does not already cover." ) reference = ( "https://pub.njleg.gov/bills/9899/PL99/222_.HTM", @@ -37,14 +40,32 @@ def formula(tax_unit, period, parameters): # under C.54A:3-5, including a dependent's deduction on their own # return. # The computed federal base excludes each dependent's deduction. - # Supplied subtotals retain the separate state medical exclusion. + # Supplied subtotals retain the separate state medical exclusion, + # less the dependents' premiums that the exclusion supplied with the + # subtotal already covers: the part of that exclusion above the + # filers' own, up to the dependents' computed exclusion. excluded_dependent_premiums = 0 if has_input_for_period( tax_unit.simulation, "itemized_medical_expenses", period ): - excluded_dependent_premiums = tax_unit( + dependent_exclusion = tax_unit( "itemized_medical_expenses_excluded_dependent_premiums", period ) + filer_exclusion = add( + tax_unit, + period, + [ + "itemized_medical_expenses_excluded_premiums", + "itemized_medical_expenses_excluded_long_term_care_premiums", + ], + ) + supplied_exclusion = max_( + 0, tax_unit("itemized_medical_expenses_applied_exclusion", period) + ) + already_excluded = min_( + dependent_exclusion, max_(0, supplied_exclusion - filer_exclusion) + ) + excluded_dependent_premiums = dependent_exclusion - already_excluded # New Jersey includes salary-reduction cafeteria-plan premiums in # taxable wages (TB-39(R)), so these employee-paid premiums also # qualify for the medical expense deduction. The separate payroll From 44fb51ba828c570ad7d22633060777b066cdf75e Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Mon, 16 Nov 2026 10:44:17 -0500 Subject: [PATCH 12/12] Enter the North Dakota parents' wages where TANF reads them Since #10724, main counts SSI and TANF in North Dakota renter's refund income. The two North Dakota cases supplied the parent's $40,000 of wages as employment_income and left employment_income_before_lsr at zero. The TANF formulas read earnings from the second input, so the model paid the family the full standard of need, 9 x $704 + 3 x $739 = $8,553, and refund income came to $43,553 against the expected $35,000. Both cases now supply the wages as employment_income_before_lsr, as main's North Dakota cases do. The family's countable earnings, $1,216.67 a month or more, exceed the $704 and $739 standards, so the family gets no TANF and every expectation holds as written. Co-Authored-By: Claude Fable 5.2 --- ...itemized_medical_expenses_excluded_dependent_premiums.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml index f15786cadae..85a5576d653 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/itemizing/itemized_medical_expenses_excluded_dependent_premiums.yaml @@ -482,7 +482,7 @@ people: parent: age: 40 - employment_income: 40_000 + employment_income_before_lsr: 40_000 # TANF formulas read wages here, so the family gets no TANF. other_medical_expenses: 2_000 dependent: age: 17 @@ -508,7 +508,7 @@ people: parent: age: 40 - employment_income: 40_000 + employment_income_before_lsr: 40_000 # TANF formulas read wages here, so the family gets no TANF. other_medical_expenses: 2_000 dependent: age: 17