Is your feature request related to a problem? Please describe.
Currently, the enrollment flagging logic in claims_enrollment__flag_claims_with_enrollment.sql uses claim line dates (claim_line_start_date) as the primary basis for determining member eligibility. However, financial accruals should be based on the claim header (claim_start_date) rather than individual claim lines, as this is the standard approach for healthcare financial reporting and more accurately reflects when services were provided at the encounter level.
Describe the solution you'd like
Modify the logic in claims_enrollment__flag_claims_with_enrollment.sql to prioritize claim_start_date from the claim header over claim_line_start_date when determining member eligibility. The hierarchy should be:
claim_start_date (claim header)
admission_date (if claim_start_date is null)
claim_line_start_date (only as last resort if both above are null)
This change will ensure that enrollment flagging and subsequent PMPM calculations are aligned with industry standards for claim-level financial reporting.
Describe alternatives you've considered
- Keeping the current logic but adding a configuration parameter to choose between header-based and line-based logic
- Creating separate models for header-based vs line-based enrollment flagging
Additional context
This affects the join in core__stg_claims_medical_claim.sql and will impact downstream PMPM calculations and financial reporting accuracy. The change aligns with how most healthcare payers and providers handle claim-level financial accruals.
Is your feature request related to a problem? Please describe.
Currently, the enrollment flagging logic in
claims_enrollment__flag_claims_with_enrollment.sqluses claim line dates (claim_line_start_date) as the primary basis for determining member eligibility. However, financial accruals should be based on the claim header (claim_start_date) rather than individual claim lines, as this is the standard approach for healthcare financial reporting and more accurately reflects when services were provided at the encounter level.Describe the solution you'd like
Modify the logic in
claims_enrollment__flag_claims_with_enrollment.sqlto prioritizeclaim_start_datefrom the claim header overclaim_line_start_datewhen determining member eligibility. The hierarchy should be:claim_start_date(claim header)admission_date(if claim_start_date is null)claim_line_start_date(only as last resort if both above are null)This change will ensure that enrollment flagging and subsequent PMPM calculations are aligned with industry standards for claim-level financial reporting.
Describe alternatives you've considered
Additional context
This affects the join in
core__stg_claims_medical_claim.sqland will impact downstream PMPM calculations and financial reporting accuracy. The change aligns with how most healthcare payers and providers handle claim-level financial accruals.