From a527e571bedd887ac1e916bba30202a06f93aaf1 Mon Sep 17 00:00:00 2001 From: Saipraveen Gudimetla Date: Mon, 18 Nov 2024 10:33:57 -0500 Subject: [PATCH 1/3] update 1095a csv report to populate spouse/insurance provider title information --- script/irs_1095a_csv_report.rb | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/script/irs_1095a_csv_report.rb b/script/irs_1095a_csv_report.rb index 71737264..57e77d77 100644 --- a/script/irs_1095a_csv_report.rb +++ b/script/irs_1095a_csv_report.rb @@ -59,6 +59,28 @@ 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 + +def fetch_carrier_title(title) + mapping = {"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"} + + 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" @@ -137,9 +159,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? @@ -162,7 +182,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, From ac2c26f8d5e531ed10b2d829d01b337ae8ca22d1 Mon Sep 17 00:00:00 2001 From: Saipraveen Gudimetla Date: Mon, 18 Nov 2024 10:38:17 -0500 Subject: [PATCH 2/3] fix rubocop issues --- script/irs_1095a_csv_report.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/script/irs_1095a_csv_report.rb b/script/irs_1095a_csv_report.rb index 57e77d77..e0e68c2d 100644 --- a/script/irs_1095a_csv_report.rb +++ b/script/irs_1095a_csv_report.rb @@ -64,7 +64,7 @@ def fetch_spouse(tax_household, recipient) 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] + 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' @@ -72,10 +72,10 @@ def fetch_spouse(tax_household, recipient) end def fetch_carrier_title(title) - mapping = {"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"} + mapping = { '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" } mapped_title = mapping[title.to_sym].to_s mapped_title.present? ? mapped_title : title From ef037663c93dd6c0aa3bdb1fbc394d1c30449a46 Mon Sep 17 00:00:00 2001 From: Saipraveen Gudimetla Date: Mon, 18 Nov 2024 12:02:49 -0500 Subject: [PATCH 3/3] move carrier title mapping to resource registry --- .../build_h36_insurance_policies_payload.rb | 11 +++++------ .../fdsh/h41/request/build_1095a_payload.rb | 11 +++++------ script/irs_1095a_csv_report.rb | 6 ++---- .../features/aca_individual_market/tax_forms.yml | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 system/config/templates/features/aca_individual_market/tax_forms.yml diff --git a/app/operations/fdsh/h36/request/build_h36_insurance_policies_payload.rb b/app/operations/fdsh/h36/request/build_h36_insurance_policies_payload.rb index a5c1cfb4..5f7ff3d6 100644 --- a/app/operations/fdsh/h36/request/build_h36_insurance_policies_payload.rb +++ b/app/operations/fdsh/h36/request/build_h36_insurance_policies_payload.rb @@ -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) diff --git a/app/operations/fdsh/h41/request/build_1095a_payload.rb b/app/operations/fdsh/h41/request/build_1095a_payload.rb index c1796997..958a32ec 100644 --- a/app/operations/fdsh/h41/request/build_1095a_payload.rb +++ b/app/operations/fdsh/h41/request/build_1095a_payload.rb @@ -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 end def construct_premium_information(tax_household) diff --git a/script/irs_1095a_csv_report.rb b/script/irs_1095a_csv_report.rb index e0e68c2d..9eafdd0d 100644 --- a/script/irs_1095a_csv_report.rb +++ b/script/irs_1095a_csv_report.rb @@ -72,11 +72,9 @@ def fetch_spouse(tax_household, recipient) end def fetch_carrier_title(title) - mapping = { '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" } + 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 diff --git a/system/config/templates/features/aca_individual_market/tax_forms.yml b/system/config/templates/features/aca_individual_market/tax_forms.yml new file mode 100644 index 00000000..ad92e964 --- /dev/null +++ b/system/config/templates/features/aca_individual_market/tax_forms.yml @@ -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"} \ No newline at end of file