Skip to content

Commit

Permalink
updating npt aqhp check to consider applied aptc rather than eligibility
Browse files Browse the repository at this point in the history
  • Loading branch information
erubinst committed Jan 7, 2025
1 parent 1338276 commit 31ae864
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ def construct_annual_premiums(months_of_year)
end

def construct_coverage_information(insurance_policy, covered_individuals, tax_household)
has_applied_aptc = false
(1..12).collect do |month|
enrollments_for_month = insurance_policy.enrollments_for_month(month, insurance_policy.start_on.year)
if insurance_policy.aasm_state == "canceled"
Expand All @@ -431,8 +432,11 @@ def construct_coverage_information(insurance_policy, covered_individuals, tax_ho
next unless any_thh_members_enrolled?(tax_household, enrollments_for_month)
next if enrollments_tax_household_for_month_empty?(enrollments_for_month, tax_household)

aptc_tax_credit = insurance_policy.applied_aptc_amount_for(enrollments_for_month, month, tax_household)
has_applied_aptc = true if aptc_tax_credit.to_f > 0.0

# if npt and mid month end date, do not include that month if aqhp
next if insurance_policy.term_for_np && mid_month_end?(insurance_policy.end_on, month) && tax_household.is_aqhp
next if insurance_policy.term_for_np && mid_month_end?(insurance_policy.end_on, month) && has_applied_aptc

if tax_household.is_aqhp && covered_individuals.present?
update_covered_individuals_end_date(covered_individuals, enrollments_for_month, tax_household)
Expand All @@ -442,7 +446,6 @@ def construct_coverage_information(insurance_policy, covered_individuals, tax_ho
pediatric_dental_pre = enrollments_for_month.first
&.pediatric_dental_premium(enrollments_for_month, thh_members, month)
pre_amt_tot = calculate_ehb_premium_for(insurance_policy, tax_household, enrollments_for_month, month)
aptc_tax_credit = insurance_policy.applied_aptc_amount_for(enrollments_for_month, month, tax_household)

slcsp = insurance_policy.fetch_slcsp_premium(enrollments_for_month, month, tax_household, aptc_tax_credit)
total_premium = format('%.2f', (pre_amt_tot.to_f + pediatric_dental_pre))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@
it "should include mid month for uqhp npt policies" do
result = subject.call({ insurance_policy: npt_mid_month_uqhp_insurance_policy })
expect(result.value![:aptc_csr_tax_households][0][:months_of_year].count).to eq 3
print(result.value![:aptc_csr_tax_households][0][:months_of_year])
expect(result.success?).to be_truthy
end
end
Expand Down

0 comments on commit 31ae864

Please sign in to comment.