Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update 1095a csv report to populate spouse/insurance provider title information #262

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,11 @@ def construct_insurance_coverage(tax_households, policy)
end

def fetch_insurance_provider_title(title)
{
"Anthem Blue Cross and Blue Shield" => "Anthem Health Plans of Maine Inc",
"Harvard Pilgrim Health Care" => "Harvard Pilgrim Health Care Inc",
"Community Health Options" => "Maine Community Health Options",
"Taro Health" => "Taro Health Plan of Maine Inc"
}[title] || title
return title unless FdshGatewayRegistry.feature_enabled?(:modify_carrier_legal_names)

mapping = FdshGatewayRegistry[:modify_carrier_legal_names].settings(:carrier_names_mapping).item
mapped_title = mapping[title.to_sym].to_s
mapped_title.present? ? mapped_title : title
end

def effectuated_for_month?(tax_households, calendar_month)
Expand Down
11 changes: 5 additions & 6 deletions app/operations/fdsh/h41/request/build_1095a_payload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ def construct_policy(policy, provider)
end

def fetch_insurance_provider_title(title)
{
"Anthem Blue Cross and Blue Shield" => "Anthem Health Plans of Maine Inc",
"Harvard Pilgrim Health Care" => "Harvard Pilgrim Health Care Inc",
"Community Health Options" => "Maine Community Health Options",
"Taro Health" => "Taro Health Plan of Maine Inc"
}[title] || title
return title unless FdshGatewayRegistry.feature_enabled?(:modify_carrier_legal_names)

mapping = FdshGatewayRegistry[:modify_carrier_legal_names].settings(:carrier_names_mapping).item
mapped_title = mapping[title.to_sym].to_s
mapped_title.present? ? mapped_title : title
saipraveen18 marked this conversation as resolved.
Show resolved Hide resolved
end

def construct_premium_information(tax_household)
Expand Down
26 changes: 22 additions & 4 deletions script/irs_1095a_csv_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,26 @@ def recipient(aptc_csr_tax_household, contract_holder, family)
end
end

def fetch_spouse(tax_household, recipient)
spouse = tax_household[:tax_household_members].detect do |thh_member|
thh_member.dig(:family_member_reference, :relation_with_primary) == 'spouse'
end
return spouse if spouse.present? &&
spouse[:family_member_reference][:family_member_hbx_id] != recipient[:person][:hbx_id]

tax_household[:tax_household_members].detect do |thh_member|
thh_member.dig(:family_member_reference, :relation_with_primary) == 'self'
end
end
saipraveen18 marked this conversation as resolved.
Show resolved Hide resolved

def fetch_carrier_title(title)
return title unless FdshGatewayRegistry.feature_enabled?(:modify_carrier_legal_names)

mapping = FdshGatewayRegistry[:modify_carrier_legal_names].settings(:carrier_names_mapping).item
mapped_title = mapping[title.to_sym].to_s
mapped_title.present? ? mapped_title : title
end

def fetch_transmission_type
case @transmission.class.name
when "H41::Transmissions::Outbound::OriginalTransmission"
Expand Down Expand Up @@ -137,9 +157,7 @@ def process_aptc_csr_tax_households(transactions, file_name, offset_count)

@recipient = recipient(valid_tax_household, contract_holder, family)
covered_individuals = valid_tax_household.covered_individuals
@spouse = valid_tax_household.covered_individuals.detect do |covered_individual|
covered_individual.relation_with_primary == 'spouse'
end
@spouse = fetch_spouse(valid_tax_household, @recipient)

@has_aptc = valid_tax_household.months_of_year.any? do |month|
month.coverage_information && month.coverage_information.tax_credit.cents.positive?
Expand All @@ -162,7 +180,7 @@ def process_aptc_csr_tax_households(transactions, file_name, offset_count)
@recipient.person.hbx_id,
"ME",
valid_policy.policy_id,
insurance_provider.title,
fetch_carrier_title(insurance_provider.title),
"#{@recipient.person.person_name.first_name} #{@recipient.person.person_name.last_name}",
decrypt_ssn(@recipient&.person&.person_demographics&.encrypted_ssn),
@recipient&.person&.person_demographics&.dob,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
registry:
- namespace:
- :fdsh_gateway
- :aca_individual_market
- :tax_forms
features:
- key: :modify_carrier_legal_names
is_enabled: true
settings:
- key: :carrier_names_mapping
item: {"Anthem Blue Cross and Blue Shield": "Anthem Health Plans of Maine Inc",
"Harvard Pilgrim Health Care": "Harvard Pilgrim Health Care Inc",
"Community Health Options": "Maine Community Health Options",
"Taro Health": "Taro Health Plan of Maine Inc"}
Loading