Skip to content

Add at-interview health coverage rule inputs#7821

Merged
MaxGhenis merged 6 commits intomainfrom
codex/7816-health-coverage-rules
Apr 6, 2026
Merged

Add at-interview health coverage rule inputs#7821
MaxGhenis merged 6 commits intomainfrom
codex/7816-health-coverage-rules

Conversation

@daphnehanse11
Copy link
Copy Markdown
Collaborator

@daphnehanse11 daphnehanse11 commented Mar 20, 2026

Closes #7816

Summary

  • add person-level has_*_health_coverage_at_interview input variables for CPS current-coverage data imported in policyengine-us-data
  • add has_qualifying_non_marketplace_health_coverage_at_interview, qualifying_non_marketplace_health_coverage_type_count_at_interview, and coverage_report_model_conflict for ACA-facing reported-coverage reconciliation
  • add has_marketplace_health_coverage_at_interview so Marketplace/non-Marketplace conflict checks use an explicit reported current-coverage input
  • add Medicaid regression coverage for current-coverage inputs and preserve continuous-coverage behavior in the CA Medicaid immigration eligibility rule

Testing

  • uv run policyengine-core test policyengine_us/tests/policy/baseline/gov/aca/eligibility/has_qualifying_non_marketplace_health_coverage_at_interview.yaml policyengine_us/tests/policy/baseline/gov/aca/eligibility/coverage_report_model_conflict.yaml policyengine_us/tests/policy/baseline/gov/hhs/medicaid/medicaid_enrolled.yaml -c policyengine_us
  • make format

@baogorek
Copy link
Copy Markdown
Collaborator

Nice work — the mixin pattern keeps the input definitions clean, and the test coverage looks solid.

Two things worth double-checking before merge:

  1. has_marketplace_health_coverage default flips from True to False. Previously every person defaulted to having marketplace coverage, which fed into is_aca_ptc_eligible. Now it defaults to False (via the reported flag). That's more correct for microsim, but in the web app where users build individual households and don't set the reported flag, this could silently zero out ACA PTC for everyone. Worth confirming that pathway still works as expected.

  2. receives_medicaid was an explicit input variable (docstring says it "anchors takeup calibration"). Adding a formula that delegates to the reported flag changes it from a user-settable input to a derived value. Same question: does direct assignment still take priority over the formula in contexts that depend on it?

label = "Person has qualifying non-Marketplace health coverage at interview"
definition_period = YEAR

def formula(person, period, parameters):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use adds

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

one variable per file

from policyengine_us.model_api import *


class ReportedHealthCoverageAtInterview:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

frame around reality not surveys. what insurance do they have at the moment?

label = "Reported public health coverage at interview"


class reported_is_insured_at_interview(ReportedHealthCoverageAtInterview, Variable):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this would be a formula right

Comment thread policyengine_us/variables/input/health_coverage.py Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fd8a1f8) to head (2da9303).
⚠️ Report is 46 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7821   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        13    +1     
  Lines          174       101   -73     
  Branches         0         1    +1     
=========================================
- Hits           174       101   -73     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@daphnehanse11 daphnehanse11 changed the title Add reported health coverage rule inputs Add at-interview health coverage rule inputs Apr 2, 2026
Copy link
Copy Markdown
Contributor

@MaxGhenis MaxGhenis left a comment

Choose a reason for hiding this comment

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

Rechecked after the cleanup pass. The structural review comments are addressed and the targeted tests pass.

@MaxGhenis MaxGhenis merged commit 508261e into main Apr 6, 2026
9 checks passed
@MaxGhenis MaxGhenis deleted the codex/7816-health-coverage-rules branch April 6, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add effective health coverage variables separate from reported CPS coverage

3 participants