Before a few renames
This commit is contained in:
+85
-95
@@ -5,11 +5,21 @@ def determine_id_card_templates(pl_plan_key)
|
||||
when 2
|
||||
"SmartIDCard"
|
||||
when 3
|
||||
"TPAIDCardTan"
|
||||
"TandemlocIDCard"
|
||||
when 56
|
||||
"HealthBusIDCard"
|
||||
"QRCodeIDCard"
|
||||
else
|
||||
"FairosIDCard"
|
||||
"FairosRxIDCard"
|
||||
end
|
||||
end
|
||||
|
||||
def determine_id_card_rx(pl_plan_key)
|
||||
pl_plan_key = pl_plan_key.to_i
|
||||
|
||||
if pl_plan_key == 56
|
||||
"TheHealthBus"
|
||||
else
|
||||
"FairosRx"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,95 +47,18 @@ def determine_id_card_network(pl_plan_key)
|
||||
|
||||
end
|
||||
|
||||
def determine_network_logos(pl_plan_key)
|
||||
pl_plan_key = pl_plan_key.to_i
|
||||
exception_logos = []
|
||||
if [4, 5, 16, 23, 33, 55, 57, 63].include?(pl_plan_key)
|
||||
default_net_logo_image = 'Logo_MC_PMS.png'
|
||||
elsif [15, 18, 19, 20, 13, 21].include?(pl_plan_key)
|
||||
default_net_logo_image = 'CignaLogo.png'
|
||||
elsif [62].include?(pl_plan_key)
|
||||
default_net_logo_image = 'CignaLogo.png'
|
||||
else
|
||||
default_net_logo_image = 'CignaLogo.png'
|
||||
|
||||
puts "[**** IMPORT ID CARD TABLES ****]"
|
||||
|
||||
# exception_logos << ProviderNetworkLogo.new(
|
||||
# exception_type: 'zip',
|
||||
# exception_value: '49420',
|
||||
# net_logo: 'CignaPHLogo.jpg'
|
||||
# )
|
||||
|
||||
# exception_logos << ProviderNetworkLogo.new(
|
||||
# exception_type: 'zip',
|
||||
# exception_value: '48167',
|
||||
# net_logo: 'CignaPHLogo.jpg'
|
||||
# )
|
||||
|
||||
# exception_logos << ProviderNetworkLogo.new(
|
||||
# exception_type: 'zip',
|
||||
# exception_value: '55419',
|
||||
# net_logo: 'CignaHPLogo.jpg'
|
||||
# )
|
||||
|
||||
# exception_logos << ProviderNetworkLogo.new(
|
||||
# exception_type: 'zip',
|
||||
# exception_value: '55379',
|
||||
# net_logo: 'CignaHPLogo.jpg'
|
||||
# )
|
||||
end
|
||||
end
|
||||
|
||||
# benefit_descriptions = ["Primary Visit",
|
||||
# "Specialist Visit",
|
||||
# "Urgent Care",
|
||||
# "INN–Ind Ded",
|
||||
# "INN–Family Ded",
|
||||
# "OON–Ind Ded",
|
||||
# "OON–Family Ded",
|
||||
# "Co-Insurance",
|
||||
# "INN–Ind OOP",
|
||||
# "INN–Family OOP",
|
||||
# "OON–Ind OOP",
|
||||
# "OON–Family OOP",
|
||||
# "Emergency Room",
|
||||
# "Preventive Care"]
|
||||
|
||||
# default = IdCardBenefitsTemplate.create(title: "BLANK")
|
||||
# benefit_descriptions.each_with_index do |bene, i|
|
||||
# IdCardBenefit.create(sequence: i + 1, benefit_desc: bene, id_card_benefits_template: default)
|
||||
# end
|
||||
|
||||
# temp_2 = IdCard::Plan.create(title: "Jason's Template", template: true)
|
||||
# temp_2.plan_benefits.each do |bene|
|
||||
# bene.benefit = "#{bene.sequence} hit wonder"
|
||||
# bene.save
|
||||
# end
|
||||
## SET UP DEFAULT LEVEL360 PLANS FOR PLAN PICKER
|
||||
|
||||
# temp_1 = IdCardBenefitsTemplate.create(title: "Rebekah's Template")
|
||||
# (1..14).each do |seq|
|
||||
# IdCardBenefit.create(sequence: seq, benefit: "greatest hits vol #{seq}", id_card_benefits_template: temp_1)
|
||||
# end
|
||||
|
||||
##---------------- Provider/Claims Setup------------------------------------
|
||||
|
||||
# historical_id_card_docs = Dir['tmp/*.docx']
|
||||
# historical_id_card_docs.each do |card_doc|
|
||||
# puts card_doc
|
||||
# BenefitsWordDocProcessor.new(card_doc).call
|
||||
# end
|
||||
|
||||
# acentria = Carrier.find_or_create_by!(name: 'Acentria')
|
||||
|
||||
# mcswain_broker = Broker.find_or_create_by!(name: 'Tom McSwain') do |mc|
|
||||
# mc.carrier = acentria
|
||||
# end
|
||||
|
||||
# mcswain_employers = HebWeb::BrokerXRef.where(pl_plan_key: 99).pluck(:employer_pl_plan_key)
|
||||
|
||||
|
||||
# Imports employers and members from VHCS
|
||||
# use rake tasks
|
||||
|
||||
puts "Importing Card Provider/Claims Information"
|
||||
default_provider_codes = ["5", "2"]
|
||||
needed_codes_mapping = {
|
||||
"0": "MedCost VA Plus Network",
|
||||
@@ -148,9 +81,13 @@ vhcs_cp.each do |vhcs|
|
||||
end
|
||||
attributes_hash[:title] = needed_codes_mapping[vhcs.provider_code]
|
||||
|
||||
puts "-- #{attributes_hash[:title]}"
|
||||
IdCard::ProviderSection.find_or_create_by(attributes_hash)
|
||||
end
|
||||
|
||||
##---------------- Rx info Setup------------------------------------
|
||||
|
||||
puts "Importing Card Rx Information"
|
||||
Vhcs::HlrxCrosRef.all.each do |vhcs|
|
||||
rx = IdCard::RxSection.find_or_create_by(help_desk: vhcs.help_desk, customer_service: vhcs.customer_service, web_url: vhcs.web_url)
|
||||
title = rx.web_url.gsub(/^www\./, '').gsub(/\.com\Z/, '')
|
||||
@@ -158,36 +95,89 @@ Vhcs::HlrxCrosRef.all.each do |vhcs|
|
||||
title = title.capitalize
|
||||
end
|
||||
|
||||
puts "-- #{title}"
|
||||
rx.title = title
|
||||
rx.save
|
||||
end
|
||||
|
||||
["CignaLogo.png", "MedCostLogo.png"].each do |logo_upload|
|
||||
##---------------- Network Logos Setup------------------------------------
|
||||
|
||||
puts "Importing Network Logos"
|
||||
folder_path = Rails.root.join('logo_files', 'network')
|
||||
file_names = Dir.children(folder_path)
|
||||
default_network_logos = ["CignaLogo.png", "MedCostLogo.png"]
|
||||
|
||||
file_names.each do |logo_upload|
|
||||
puts "-- #{logo_upload}"
|
||||
new_logo = ImageProcessor.new("logo_files/network/#{logo_upload}", "Network").call
|
||||
new_logo.default = true
|
||||
if default_network_logos.include?(logo_upload)
|
||||
new_logo.default = true
|
||||
end
|
||||
new_logo.active = true
|
||||
new_logo.save
|
||||
end
|
||||
|
||||
##---------------- Active Employer Logo Setup------------------------------------
|
||||
|
||||
puts "Importing Employer Logos"
|
||||
folder_path = Rails.root.join('logo_files', 'employer')
|
||||
file_names = Dir.children(folder_path)
|
||||
|
||||
file_names.each do |logo_upload|
|
||||
puts "-- #{logo_upload}"
|
||||
new_logo = ImageProcessor.new("logo_files/employer/#{logo_upload}", "Employer").call
|
||||
new_logo.active = true
|
||||
new_logo.save
|
||||
end
|
||||
|
||||
##---------------- Import Employer/Member Setup------------------------------------
|
||||
|
||||
puts "[**** IMPORT EMPLOYERS ****]"
|
||||
Rake::Task["employer:vhcs_sync_all"].invoke
|
||||
|
||||
# acentria = Carrier.find_or_create_by!(name: 'Acentria')
|
||||
|
||||
# mcswain_broker = Broker.find_or_create_by!(name: 'Tom McSwain') do |mc|
|
||||
# mc.carrier = acentria
|
||||
# end
|
||||
|
||||
# mcswain_employers = HebWeb::BrokerXRef.where(pl_plan_key: 99).pluck(:employer_pl_plan_key)
|
||||
|
||||
|
||||
# Imports employers and members from VHCS
|
||||
# use rake tasks
|
||||
|
||||
puts "[**** UPDATE EMPLOYER ID CARDS CONFIGS ****]"
|
||||
IdCard::Configuration.all.each do |config|
|
||||
config.card_template = determine_id_card_templates(config.pl_plan_key)
|
||||
|
||||
network_information = determine_id_card_network(config.pl_plan_key)
|
||||
config.network_provider = network_information[:provider]
|
||||
ps_id = IdCard::ProviderSection.find_by(title: network_information[:provider_section]).id
|
||||
config.provider_section_id = ps_id
|
||||
nl_id = IdCard::NetworkLogo.find_by(filename: network_information[:network_logo]).id
|
||||
config.network_logo_id = nl_id
|
||||
ps = IdCard::ProviderSection.find_by(title: network_information[:provider_section])
|
||||
config.provider_section_id = ps.id
|
||||
nl = IdCard::NetworkLogo.find_by(filename: network_information[:network_logo])
|
||||
config.network_logo_id = nl.id
|
||||
|
||||
employer_name = configuration.employer.name
|
||||
logo_name = employer_name.titleize.gsub(' ', '')
|
||||
rx_title = determine_id_card_rx(config.pl_plan_key)
|
||||
rs = IdCard::RxSection.find_by(title: rx_title)
|
||||
config.rx_section_id = rs.id
|
||||
|
||||
logo = IdCard::EmployerLogo.where("filename LIKE ?", "%#{logo_name}%")
|
||||
if logo
|
||||
config.employer_logo_id = logo.first.id
|
||||
employer_name = config.employer.employer_trim_name
|
||||
name_segments = employer_name.titleize.split
|
||||
name_segments.each do |segment|
|
||||
logo = IdCard::EmployerLogo.where("filename LIKE ?", "%#{segment}%")
|
||||
if logo&.first
|
||||
config.employer_logo = logo.first
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
config.active = true
|
||||
config.save
|
||||
end
|
||||
|
||||
|
||||
|
||||
# 15, 18, 19, 20, 13, 21
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user