Before adding workers

This commit is contained in:
Jason Jordan
2026-03-20 10:46:53 -04:00
parent 3300819ed5
commit a43c8bf6b5
70 changed files with 533 additions and 457 deletions
+3 -1
View File
@@ -77,4 +77,6 @@ yarn-debug.log*
/app/assets/svg/* /app/assets/svg/*
!/app/assets/builds/.keep !/app/assets/builds/.keep
/mssql-data /mssql-data
/logo_files
/employer_word_docs
+1 -1
View File
@@ -18,7 +18,7 @@ class EmployerSetupController < ApplicationController
word_doc = params[:employer_setup_process][:import_from_word] word_doc = params[:employer_setup_process][:import_from_word]
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK") @plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile) if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile)
@employer_setup = BenefitsWordDocProcessor.new(word_doc.tempfile).call @employer_setup = WordDocProcessor.new(word_doc.tempfile).call
render :edit render :edit
else else
@employer_setup = EmployerSetupProcess.new @employer_setup = EmployerSetupProcess.new
+2 -2
View File
@@ -18,7 +18,7 @@ class EmployersController < ApplicationController
# word_doc = params[:employer][:import_from_word] # word_doc = params[:employer][:import_from_word]
# @plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK") # @plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
# if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile) # if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile)
# @employer = BenefitsWordDocProcessor.new(word_doc.tempfile).call # @employer = WordDocProcessor.new(word_doc.tempfile).call
# else # else
# @employer = Employer.new # @employer = Employer.new
# @employer.build_plan_with_default_benefits # @employer.build_plan_with_default_benefits
@@ -72,7 +72,7 @@ class EmployersController < ApplicationController
def import def import
word_doc = params[:employer][:import_from_word] word_doc = params[:employer][:import_from_word]
if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile) if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile)
@employer = BenefitsWordDocProcessor.new(word_doc.tempfile).call @employer = WordDocProcessor.new(word_doc.tempfile).call
@employer.save @employer.save
redirect_to employer_path(@employer.slug), notice: 'Employer Imported' redirect_to employer_path(@employer.slug), notice: 'Employer Imported'
else else
+43 -23
View File
@@ -3,19 +3,19 @@ module IdCard
# View Methods # View Methods
def index def index
@employer_configs = IdCard::Configuration.active.to_a @employer_setups = IdCard::Setup.active.to_a
@queue_counts = EmployerCards::GetQueuedCounts.new().call @queue_counts = IdCardQueueService::GetQueuedCounts.new().call
add_queued_count_to_card_configuration add_queued_count_to_card_setup
@queued = @employer_configs.select { |config| config.queued_card_count > 0 }.sort_by { |config| config.pl_plan_key.to_i } @queued = @employer_setups.select { |setup| setup.queued_card_count > 0 }.sort_by { |setup| setup.pl_plan_key.to_i }
@not_queued = @employer_configs.select { |config| config.queued_card_count == 0 }.sort_by { |config| config.pl_plan_key.to_i } @not_queued = @employer_setups.select { |setup| setup.queued_card_count == 0 }.sort_by { |setup| setup.pl_plan_key.to_i }
render :index render :index
end end
# API Methods # API Methods
def print_all_queued def print_all_queued
@queue_members = EmployerCards::GetQueuedCards.new().call @queue_members = IdCardQueueService::GetQueuedCards.new().call
cards_pdf = IdCardPrinter::QueuedCardsGenerator.new(@queue_members).call cards_pdf = IdCardPrinterService::QueuedCardsGenerator.new(@queue_members).call
if cards_pdf.is_a?(CombinePDF::PDF) if cards_pdf.is_a?(CombinePDF::PDF)
send_data cards_pdf.to_pdf, send_data cards_pdf.to_pdf,
@@ -35,8 +35,8 @@ module IdCard
def print_queued_by_employer def print_queued_by_employer
pl_plan_key = params[:id].to_s pl_plan_key = params[:id].to_s
@employer = Employer.find_by(pl_plan_key: pl_plan_key) @employer = Employer.find_by(pl_plan_key: pl_plan_key)
@queue_members = EmployerCards::GetQueuedCards.new(pl_plan_key).call @queue_members = IdCardQueueService::GetQueuedCards.new(pl_plan_key).call
cards_pdf = IdCardPrinter::QueuedCardsGenerator.new(@queue_members).call cards_pdf = IdCardPrinterService::QueuedCardsGenerator.new(@queue_members).call
send_data cards_pdf.to_pdf, send_data cards_pdf.to_pdf,
filename: "#{@employer.name.parameterize(separator: "_")}_queued_cards_#{Date.today}.pdf", filename: "#{@employer.name.parameterize(separator: "_")}_queued_cards_#{Date.today}.pdf",
@@ -46,9 +46,14 @@ module IdCard
end end
def generate_sample def generate_sample
pl_plan_key = params[:id].to_s if Integer(params[:id], exception: false).is_a?(Integer)
@employer = Employer.find_by(pl_plan_key: pl_plan_key) pl_plan_key = params[:id].to_s
sample_cards_pdf = IdCardPrinter::SampleCardsGenerator.new(@employer).call @employer = Employer.find_by(pl_plan_key: pl_plan_key)
else
slug = params[:id]
@employer = Employer.find_by(slug: slug)
end
sample_cards_pdf = IdCardPrinterService::SampleCardsGenerator.new(@employer).call
send_data sample_cards_pdf.to_pdf, send_data sample_cards_pdf.to_pdf,
filename: "#{@employer.name.parameterize(separator: "_")}_sample_cards_#{Date.today}.pdf", filename: "#{@employer.name.parameterize(separator: "_")}_sample_cards_#{Date.today}.pdf",
@@ -58,9 +63,14 @@ module IdCard
end end
def generate_print def generate_print
pl_plan_key = params[:id].to_s if Integer(params[:id], exception: false).is_a?(Integer)
@employer = Employer.find_by(pl_plan_key: pl_plan_key) pl_plan_key = params[:id].to_s
cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "PrintCard").call @employer = Employer.find_by(pl_plan_key: pl_plan_key)
else
slug = params[:id]
@employer = Employer.find_by(slug: slug)
end
cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "PrintCard").call
send_data cards_pdf.to_pdf, send_data cards_pdf.to_pdf,
filename: "#{@employer.name.parameterize(separator: "_")}_print_cards_#{Date.today}.pdf", filename: "#{@employer.name.parameterize(separator: "_")}_print_cards_#{Date.today}.pdf",
@@ -70,9 +80,14 @@ module IdCard
end end
def generate_mobile_display def generate_mobile_display
pl_plan_key = params[:id].to_s if Integer(params[:id], exception: false).is_a?(Integer)
@employer = Employer.find_by(pl_plan_key: pl_plan_key) pl_plan_key = params[:id].to_s
cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "MobileDisplayCard").call @employer = Employer.find_by(pl_plan_key: pl_plan_key)
else
slug = params[:id]
@employer = Employer.find_by(slug: slug)
end
cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "MobileDisplayCard").call
send_data cards_pdf.to_pdf, send_data cards_pdf.to_pdf,
filename: "#{@employer.name.parameterize(separator: "_")}_mobile_display_cards_#{Date.today}.pdf", filename: "#{@employer.name.parameterize(separator: "_")}_mobile_display_cards_#{Date.today}.pdf",
@@ -82,9 +97,14 @@ module IdCard
end end
def generate_full_page def generate_full_page
pl_plan_key = params[:id].to_s if Integer(params[:id], exception: false).is_a?(Integer)
@employer = Employer.find_by(pl_plan_key: pl_plan_key) pl_plan_key = params[:id].to_s
cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "FullPageCard", true).call @employer = Employer.find_by(pl_plan_key: pl_plan_key)
else
slug = params[:id]
@employer = Employer.find_by(slug: slug)
end
cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "FullPageCard", true).call
cards_pdf.rewind cards_pdf.rewind
send_data cards_pdf.sysread, send_data cards_pdf.sysread,
@@ -97,9 +117,9 @@ module IdCard
private private
def add_queued_count_to_card_configuration def add_queued_count_to_card_setup
@queue_counts.each do |qc| @queue_counts.each do |qc|
match = @employer_configs.find { |config| config.pl_plan_key == qc["PLPlanKey"] } match = @employer_setups.find { |setup| setup.pl_plan_key == qc["PLPlanKey"] }
if match.present? if match.present?
match.queued_card_count = qc["QueuedCardsCount"] match.queued_card_count = qc["QueuedCardsCount"]
end end
@@ -3,7 +3,7 @@ module IdCard
def generate_sample def generate_sample
@employer = Employer.find_by(slug: params[:employer_slug]) @employer = Employer.find_by(slug: params[:employer_slug])
sample_cards_pdf = IdCardPrinter::SampleCardsGenerator.new(@employer).call sample_cards_pdf = IdCardPrinterService::SampleCardsGenerator.new(@employer).call
send_data sample_cards_pdf.to_pdf, send_data sample_cards_pdf.to_pdf,
filename: "#{@employer.name.parameterize(separator: "_")}_sample_cards_#{Date.today}.pdf", filename: "#{@employer.name.parameterize(separator: "_")}_sample_cards_#{Date.today}.pdf",
@@ -14,7 +14,7 @@ module IdCard
def generate_print def generate_print
@employer = Employer.find_by(slug: params[:employer_slug]) @employer = Employer.find_by(slug: params[:employer_slug])
cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "PrintCard").call cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "PrintCard").call
send_data cards_pdf.to_pdf, send_data cards_pdf.to_pdf,
filename: "#{@employer.name.parameterize(separator: "_")}_print_cards_#{Date.today}.pdf", filename: "#{@employer.name.parameterize(separator: "_")}_print_cards_#{Date.today}.pdf",
@@ -25,7 +25,7 @@ module IdCard
def generate_mobile_display def generate_mobile_display
@employer = Employer.find_by(slug: params[:employer_slug]) @employer = Employer.find_by(slug: params[:employer_slug])
cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "MobileDisplayCard").call cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "MobileDisplayCard").call
send_data cards_pdf.to_pdf, send_data cards_pdf.to_pdf,
filename: "#{@employer.name.parameterize(separator: "_")}_mobile_display_cards_#{Date.today}.pdf", filename: "#{@employer.name.parameterize(separator: "_")}_mobile_display_cards_#{Date.today}.pdf",
@@ -36,7 +36,7 @@ module IdCard
def generate_full_page def generate_full_page
@employer = Employer.find_by(slug: params[:employer_slug]) @employer = Employer.find_by(slug: params[:employer_slug])
cards_pdf = IdCardPrinter::EmployerCardsGenerator.new(@employer, "FullPageCard", true).call cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "FullPageCard", true).call
cards_pdf.rewind cards_pdf.rewind
send_data cards_pdf.sysread, send_data cards_pdf.sysread,
@@ -1,56 +1,56 @@
module IdCard module IdCard
class ConfigurationController < ApplicationController class SetupController < ApplicationController
before_action :set_employer_and_setup before_action :set_employer_and_setup
# View Methods # View Methods
def edit # def edit
@employer = Employer.find_by(slug: params[:employer_id]) # @employer = Employer.find_by(slug: params[:employer_id])
if @employer.id_card_enabled? # if @employer.id_card_enabled?
@configuration = @employer.id_card_configuration # @setup = @employer.id_card_setup
else # else
@configuration = @employer.create_id_card_configuration # @setup = @employer.create_id_card_setup
end # end
render :edit # render :edit
end # end
def update # def update
setup_params = IdCard::Configuration.permitted_params(params) # setup_params = IdCard::Setup.permitted_params(params)
@configuration = IdCard::Configuration.find(params[:id]) # @setup = IdCard::Setup.find(params[:id])
if @configuration.update(setup_params) # if @setup.update(setup_params)
puts "sucess" # puts "sucess"
redirect_to employer_path(@configuration.employer.slug), notice: 'ID Card Configuration was successfully updated.' # redirect_to employer_path(@setup.employer.slug), notice: 'ID Card Setup was successfully updated.'
else # else
puts "fail" # puts "fail"
render :edit, status: :unprocessable_entity # render :edit, status: :unprocessable_entity
end # end
end # end
def general def index
provider_defaults = IdCard::ProviderSection.defaults provider_defaults = IdCard::ProviderSection.defaults
@provider_options = provider_defaults.map { |p| ["Default #{p.title}", p.id] }.concat(provider_defaults.map { |p| ["New #{p.title}", "new|#{p.id}"] }) @provider_options = provider_defaults.map { |p| ["Default #{p.title}", p.id] }.concat(provider_defaults.map { |p| ["New #{p.title}", "new|#{p.id}"] })
if @configuration.provider_section_id.present? && provider_defaults.map(&:id).exclude?(@configuration.provider_section_id) if @setup.provider_section_id.present? && provider_defaults.map(&:id).exclude?(@setup.provider_section_id)
@provider_options.insert(0, ["#{@employer.name} Custom", @configuration.provider_section_id]) @provider_options.insert(0, ["#{@employer.name} Custom", @setup.provider_section_id])
end end
@rx_options = IdCard::RxSection.all @rx_options = IdCard::RxSection.all
@fairos_rx_id = IdCard::RxSection.find_by(title: "FairosRx").id @fairos_rx_id = IdCard::RxSection.find_by(title: "FairosRx").id
render :general render :index
end end
def update_general def update
if params[:id_card_configuration]["provider_section_id"].include?("new|") if params[:id_card_setup]["provider_section_id"].include?("new|")
new_provider_section_params = IdCard::ProviderSection.permitted_params(params) new_provider_section_params = IdCard::ProviderSection.permitted_params(params)
new_provider_section = IdCard::ProviderSection.create(new_provider_section_params) new_provider_section = IdCard::ProviderSection.create(new_provider_section_params)
params[:id_card_configuration]["provider_section_id"] = new_provider_section.id params[:id_card_setup]["provider_section_id"] = new_provider_section.id
end end
general_params = IdCard::Configuration.permitted_params(params) setup_params = IdCard::Setup.permitted_params(params)
if @configuration.update(general_params) if @setup.update(setup_params)
puts "sucess" puts "sucess"
redirect_to employer_path(@employer.slug), notice: 'ID Card Configuration was successfully updated.' redirect_to employer_path(@employer.slug), notice: 'ID Card Setup was successfully updated.'
else else
puts "fail" puts "fail"
render :general, status: :unprocessable_entity render :index, status: :unprocessable_entity
end end
end end
@@ -61,9 +61,9 @@ module IdCard
def update_plans def update_plans
plans_params = IdCard::Plan.permitted_params(params) plans_params = IdCard::Plan.permitted_params(params)
if @configuration.update(plans_params) if @setup.update(plans_params)
puts "sucess" puts "sucess"
redirect_to employer_path(@configuration.employer.slug), notice: 'ID Card Plans successfully updated.' redirect_to employer_path(@setup.employer.slug), notice: 'ID Card Plans successfully updated.'
else else
puts "fail" puts "fail"
render :plans, status: :unprocessable_entity render :plans, status: :unprocessable_entity
@@ -77,9 +77,9 @@ module IdCard
def update_field_exceptions def update_field_exceptions
field_exceptions_params = IdCard::FieldException.permitted_params(params) field_exceptions_params = IdCard::FieldException.permitted_params(params)
if @configuration.update(field_exceptions_params) if @setup.update(field_exceptions_params)
puts "sucess" puts "sucess"
redirect_to employer_path(@configuration.employer.slug), notice: 'ID Card Exceptions successfully updated.' redirect_to employer_path(@setup.employer.slug), notice: 'ID Card Exceptions successfully updated.'
else else
puts "fail" puts "fail"
render :field_exceptions, status: :unprocessable_entity render :field_exceptions, status: :unprocessable_entity
@@ -99,10 +99,10 @@ module IdCard
def set_employer_and_setup def set_employer_and_setup
@employer = Employer.find_by(slug: params[:employer_id]) @employer = Employer.find_by(slug: params[:employer_id])
if @employer.id_card_configuration.present? if @employer.id_card_setup.present?
@configuration = @employer.id_card_configuration @setup = @employer.id_card_setup
else else
@configuration = @employer.create_id_card_configuration @setup = @employer.create_id_card_setup
end end
end end
@@ -190,7 +190,7 @@ module IdCard
# def form_for_step # def form_for_step
# step_name = @top_form.current_step # step_name = @top_form.current_step
# form_method = "EmployerConfiguration#{step_name.camelize}Form".constantize # form_method = "EmployerSetup#{step_name.camelize}Form".constantize
# # puts "/////\\\\\\||||||" # # puts "/////\\\\\\||||||"
# # puts session[:employer_setup_data] # # puts session[:employer_setup_data]
# # puts session[:employer_setup_data]['employer_setup_process_id'] # # puts session[:employer_setup_data]['employer_setup_process_id']
@@ -199,7 +199,7 @@ module IdCard
# end # end
# def process_step(step_name) # def process_step(step_name)
# @form_method = "EmployerConfiguration#{step_name.camelize}Form".constantize # @form_method = "EmployerSetup#{step_name.camelize}Form".constantize
# session_data_name = "#{step_name}_data" # session_data_name = "#{step_name}_data"
# # puts "1--------------params----" # # puts "1--------------params----"
# # puts params # # puts params
@@ -233,7 +233,7 @@ module IdCard
# def global_params(step_name) # def global_params(step_name)
# form_name_sym = "employer_setup_#{step_name}_form".to_sym # form_name_sym = "employer_setup_#{step_name}_form".to_sym
# params.require(form_name_sym).permit(EmployerConfigurationForm.permitted_params) # params.require(form_name_sym).permit(EmployerSetupForm.permitted_params)
# end # end
# def process_step(step_name) # def process_step(step_name)
@@ -54,7 +54,7 @@ export default class extends Controller {
const providerFieldTargetsList = this.providerFieldTargets const providerFieldTargetsList = this.providerFieldTargets
console.log(templateSectionData) console.log(templateSectionData)
providerFieldTargetsList.forEach(function(formField) { providerFieldTargetsList.forEach(function(formField) {
const dbField = formField.id.replace('id_card_configuration_provider_section_', '') const dbField = formField.id.replace('id_card_setup_provider_section_', '')
const dbValue = templateSectionData[dbField] const dbValue = templateSectionData[dbField]
formField.value = dbValue; formField.value = dbValue;
+2 -2
View File
@@ -1,6 +1,6 @@
class Employer < ApplicationRecord class Employer < ApplicationRecord
has_many :members has_many :members
has_one :id_card_configuration, class_name: 'IdCard::Configuration', dependent: :destroy has_one :id_card_setup, class_name: 'IdCard::Setup', dependent: :destroy
scope :active, -> { where(active: true) } scope :active, -> { where(active: true) }
scope :inactive, -> { where(active: false) } scope :inactive, -> { where(active: false) }
@@ -39,7 +39,7 @@ class Employer < ApplicationRecord
end end
def id_card_enabled? def id_card_enabled?
self.id_card_configuration.present? self.id_card_setup.present?
end end
def claims_check_enabled? def claims_check_enabled?
+2 -2
View File
@@ -1,6 +1,6 @@
module IdCard module IdCard
class FieldException < ApplicationRecord class FieldException < ApplicationRecord
belongs_to :configuration belongs_to :setup
has_many :field_exception_items, dependent: :destroy has_many :field_exception_items, dependent: :destroy
accepts_nested_attributes_for :field_exception_items, allow_destroy: true, reject_if: :all_blank accepts_nested_attributes_for :field_exception_items, allow_destroy: true, reject_if: :all_blank
@@ -13,7 +13,7 @@ module IdCard
class << self class << self
def permitted_params(params) def permitted_params(params)
params.require(:id_card_configuration).permit( params.require(:id_card_setup).permit(
field_exceptions_attributes: [ field_exceptions_attributes: [
:exception_type, :exception_type,
:exception_value, :exception_value,
+2 -2
View File
@@ -1,6 +1,6 @@
module IdCard module IdCard
class ExceptionItem < ApplicationRecord class FieldExceptionItem < ApplicationRecord
belongs_to :exception belongs_to :field_exception
belongs_to :network_logo, optional: true belongs_to :network_logo, optional: true
belongs_to :provider_section, optional: true belongs_to :provider_section, optional: true
+2 -2
View File
@@ -1,6 +1,6 @@
module IdCard module IdCard
class Plan < ApplicationRecord class Plan < ApplicationRecord
belongs_to :configuration, optional: true belongs_to :setup, optional: true
has_many :plan_benefits, dependent: :destroy has_many :plan_benefits, dependent: :destroy
accepts_nested_attributes_for :plan_benefits, allow_destroy: true, reject_if: :all_blank accepts_nested_attributes_for :plan_benefits, allow_destroy: true, reject_if: :all_blank
@@ -45,7 +45,7 @@ module IdCard
# end # end
def permitted_params(params) def permitted_params(params)
params.require(:id_card_configuration).permit( params.require(:id_card_setup).permit(
plans_attributes: [ plans_attributes: [
:id, :id,
:title, :title,
+1 -1
View File
@@ -4,7 +4,7 @@ module IdCard
scope :defaults, -> { where(default: true) } scope :defaults, -> { where(default: true) }
def self.permitted_params(params) def self.permitted_params(params)
params.require(:id_card_configuration).require(:provider_section).permit( params.require(:id_card_setup).require(:provider_section).permit(
:provider_line_1, :provider_line_1,
:provider_line_2, :provider_line_2,
:provider_line_3, :provider_line_3,
@@ -1,5 +1,5 @@
module IdCard module IdCard
class Configuration < ApplicationRecord class Setup < ApplicationRecord
belongs_to :employer, class_name: 'Employer' belongs_to :employer, class_name: 'Employer'
belongs_to :employer_logo, optional: true belongs_to :employer_logo, optional: true
belongs_to :network_logo, optional: true belongs_to :network_logo, optional: true
@@ -37,7 +37,7 @@ module IdCard
end end
def self.permitted_params(params) def self.permitted_params(params)
params.require(:id_card_configuration).permit( params.require(:id_card_setup).permit(
:print_name, :print_name,
:network_provider, :network_provider,
:card_template, :card_template,
@@ -1,33 +0,0 @@
class BenefitsWordDocProcessor
def initialize(word_doc, employer=nil)
@word_doc = word_doc
if employer
@employer = employer
else
@employer = Employer.new
@employer.build_id_card_configuration
end
end
def call
doc = Docx::Document.open(@word_doc)
data_lines = doc.paragraphs.map { |p| p.to_s.squish }.reject!(&:empty?)
employer_information, plans_and_network = data_lines.split("Medical Plan")
plan_information, network_information = plans_and_network.split("Claims Submission")
# employer_information = data_lines.slice(0, start_of_plans_index)
# plan_information = data_lines.slice(start_of_plans_index + 1..)
# network_information = data_lines.slice(start_of_network_index + 1..)
@employer = BenefitsWordDoc::MapEmployerInformation.new(@employer, employer_information).call
@employer = BenefitsWordDoc::MapEmployerLogo.new(@employer, @word_doc).call
@employer = BenefitsWordDoc::MapPlansInformation.new(@employer, plan_information).call
@employer = BenefitsWordDoc::MapNetworkInformation.new(@employer, network_information).call
@employer
end
end
@@ -1,4 +1,4 @@
class BenefitsWordDocProcessorOld class WordDocProcessorOld
def initialize(word_doc, process=nil) def initialize(word_doc, process=nil)
@word_doc = word_doc @word_doc = word_doc
@@ -1,9 +1,9 @@
module BenefitsWordDoc module BenefitsWordDocService
class MapEmployerInformation class MapEmployerInformation
def initialize(employer, word_doc_section) def initialize(employer, word_doc_section)
@employer = employer @employer = employer
@card_config = @employer.id_card_configuration @card_setup = @employer.id_card_setup
@word_doc_section = word_doc_section @word_doc_section = word_doc_section
end end
@@ -28,7 +28,9 @@ module BenefitsWordDoc
end end
end end
end end
@card_config.rx_group_number = @employer.group_number @card_setup.print_name = @employer.name
@employer.name = @employer.name.titleize
@card_setup.rx_group_number = @employer.group_number
@employer @employer
end end
@@ -1,9 +1,9 @@
module BenefitsWordDoc module BenefitsWordDocService
class MapEmployerLogo class MapEmployerLogo
def initialize(employer, word_doc) def initialize(employer, word_doc)
@employer = employer @employer = employer
@card_config = @employer.id_card_configuration @card_setup = @employer.id_card_setup
@word_doc = word_doc @word_doc = word_doc
end end
@@ -41,7 +41,7 @@ module BenefitsWordDoc
# @employer.single_card_template = "FairosRxIDCard" # @employer.single_card_template = "FairosRxIDCard"
# end # end
@card_config.employer_logo = logo @card_setup.employer_logo = logo
end end
end end
@employer @employer
@@ -1,9 +1,9 @@
module BenefitsWordDoc module BenefitsWordDocService
class MapNetworkInformation class MapNetworkInformation
def initialize(employer, word_doc_section) def initialize(employer, word_doc_section)
@employer = employer @employer = employer
@card_config = @employer.id_card_configuration @card_setup = @employer.id_card_setup
@word_doc_section = word_doc_section @word_doc_section = word_doc_section
end end
@@ -29,11 +29,11 @@ module BenefitsWordDoc
# end # end
if network if network
@card_config.network_provider = network @card_setup.network_provider = network
logo_name = "#{network}Logo.png" logo_name = "#{network}Logo.png"
@card_config.network_logo = IdCard::NetworkLogo.find_by(filename: logo_name) @card_setup.network_logo = IdCard::NetworkLogo.find_by(filename: logo_name)
@card_config.provider_section = IdCard::ProviderSection.find_by(title: network) @card_setup.provider_section = IdCard::ProviderSection.find_by(title: network)
@card_config.rx_section = IdCard::RxSection.find_by(title: "FairosRx") @card_setup.rx_section = IdCard::RxSection.find_by(title: "FairosRx")
end end
@@ -1,9 +1,9 @@
module BenefitsWordDoc module BenefitsWordDocService
class MapPlansInformation class MapPlansInformation
def initialize(employer, word_doc_section) def initialize(employer, word_doc_section)
@employer = employer @employer = employer
@card_config = @employer.id_card_configuration @card_setup = @employer.id_card_setup
@word_doc_section = word_doc_section @word_doc_section = word_doc_section
end end
@@ -12,7 +12,7 @@ module BenefitsWordDoc
plans_indexes = @word_doc_section.each_index.select { |index| @word_doc_section[index].match?(/\d*\.?\d+k/i) } plans_indexes = @word_doc_section.each_index.select { |index| @word_doc_section[index].match?(/\d*\.?\d+k/i) }
plans_indexes.each do |plan_index| plans_indexes.each do |plan_index|
new_plan = @card_config.plans.build(title: @word_doc_section[plan_index]) new_plan = @card_setup.plans.build(title: @word_doc_section[plan_index])
plan_lines = @word_doc_section.slice(plan_index + 1, 14) plan_lines = @word_doc_section.slice(plan_index + 1, 14)
plan_lines.each_with_index do |line, i| plan_lines.each_with_index do |line, i|
field_mapping = mapping_array[i] field_mapping = mapping_array[i]
@@ -0,0 +1,35 @@
module BenefitsWordDocService
class WordDocProcessor
def initialize(word_doc, employer=nil)
@word_doc = word_doc
if employer
@employer = employer
else
@employer = Employer.new
@employer.build_id_card_setup
end
end
def call
doc = Docx::Document.open(@word_doc)
data_lines = doc.paragraphs.map { |p| p.to_s.squish }.reject!(&:empty?)
employer_information, plans_and_network = data_lines.split("Medical Plan")
plan_information, network_information = plans_and_network.split("Claims Submission")
# employer_information = data_lines.slice(0, start_of_plans_index)
# plan_information = data_lines.slice(start_of_plans_index + 1..)
# network_information = data_lines.slice(start_of_network_index + 1..)
@employer = BenefitsWordDocService::MapEmployerInformation.new(@employer, employer_information).call
@employer = BenefitsWordDocService::MapEmployerLogo.new(@employer, @word_doc).call
@employer = BenefitsWordDocService::MapPlansInformation.new(@employer, plan_information).call
@employer = BenefitsWordDocService::MapNetworkInformation.new(@employer, network_information).call
@employer
end
end
end
@@ -5,7 +5,7 @@ module EmployerCards
@pl_plan_key = pl_plan_key @pl_plan_key = pl_plan_key
@family_id = family_id @family_id = family_id
@layout = layout @layout = layout
@card_config = IdCard::Configuration.find_by(pl_plan_key: pl_plan_key) @card_setup = IdCard::Setup.find_by(pl_plan_key: pl_plan_key)
end end
def call def call
@@ -1,4 +1,4 @@
module IdCardPrinter module IdCardPrinterService
class EmployerCardsGenerator class EmployerCardsGenerator
def initialize(employer, layout, zip=false) def initialize(employer, layout, zip=false)
@@ -9,9 +9,9 @@ module IdCardPrinter
def call def call
IdCard::PrintData.where(pl_plan_key: @employer.pl_plan_key).destroy_all IdCard::PrintData.where(pl_plan_key: @employer.pl_plan_key).destroy_all
IdCardPrinter::EmployerDataFormatter.new(@employer).call IdCardPrinterService::EmployerDataFormatter.new(@employer).call
pdf_array = IdCardPrinter::PdfProcessor.new(@employer, @layout, @zip).call pdf_array = IdCardPrinterService::PdfProcessor.new(@employer, @layout, @zip).call
group_pdfs = combine_pdfs(pdf_array) group_pdfs = combine_pdfs(pdf_array)
group_pdfs group_pdfs
@@ -1,9 +1,9 @@
module IdCardPrinter module IdCardPrinterService
class EmployerDataFormatter class EmployerDataFormatter
def initialize(employer, member_keys = nil) def initialize(employer, member_keys = nil)
@employer = employer @employer = employer
@card_config = @employer.id_card_configuration @card_setup = @employer.id_card_setup
if member_keys if member_keys
@members = @employer.members.where(pb_entity_key: member_keys).order(:name) @members = @employer.members.where(pb_entity_key: member_keys).order(:name)
@@ -29,20 +29,23 @@ module IdCardPrinter
private private
def set_common_fields def set_common_fields
employer_attributes = {
employer_name: @card_config.print_name,
pl_plan_key: @card_config.pl_plan_key,
group_number: @employer.group_number,
rx_group: @card_config.rx_group_number,
network_provider: @card_config.network_provider
}
rx_attributes = @card_config.rx_section.attributes.with_indifferent_access.slice( employer_attributes = {
pl_plan_key: @card_setup.pl_plan_key,
group_number: @employer.group_number,
rx_group: @card_setup.rx_group_number,
network_provider: @card_setup.network_provider
}
unless @card_setup.has_divisions
employer_attributes.merge!({employer_name: @card_setup.print_name})
end
rx_attributes = @card_setup.rx_section.attributes.with_indifferent_access.slice(
:customer_service, :customer_service,
:web_url :web_url
) )
provider_attributes = @card_config.provider_section.attributes.with_indifferent_access.slice( provider_attributes = @card_setup.provider_section.attributes.with_indifferent_access.slice(
:provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6, :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6,
:provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12, :provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12,
:claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6, :claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6,
@@ -53,33 +56,8 @@ module IdCardPrinter
@base_card.assign_attributes(selected_attributes) @base_card.assign_attributes(selected_attributes)
end end
def set_common_fields_old
employer_attributes = {
employer_name: @card_config.print_name,
group_number: @employer.group_number,
rx_group: @card_config.rx_group_number
}
rx_attributes = @card_config.rx_section.attributes.with_indifferent_access.slice(
:customer_service,
:web_url
)
provider_attributes = @card_config.provider_section.attributes.with_indifferent_access.slice(
:provider_code, :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6,
:provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12,
:claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6,
:claim_to_7, :claim_to_8, :claim_to_9, :claim_to_10, :claim_to_11, :claim_to_12
)
selected_attributes = employer_attributes.merge(rx_attributes).merge(provider_attributes)
@employer_cards.each do |card|
card.assign_attributes(selected_attributes)
end
end
def set_plan_fields def set_plan_fields
@card_config.plans.each do |plan| @card_setup.plans.each do |plan|
selected_attributes = {} selected_attributes = {}
plan.plan_benefits.each do |bene| plan.plan_benefits.each do |bene|
selected_attributes["benefit_desc_#{bene.sequence}".to_sym] = bene.benefit_desc selected_attributes["benefit_desc_#{bene.sequence}".to_sym] = bene.benefit_desc
@@ -106,6 +84,10 @@ module IdCardPrinter
medical_eff_date: effect_date.strftime("%m/%d/%Y") medical_eff_date: effect_date.strftime("%m/%d/%Y")
} }
if @card_setup.has_divisions
member_attributes.merge!({employer_name: me.division})
end
dependent_attributes = get_dependent_fields(me) dependent_attributes = get_dependent_fields(me)
if dependent_attributes.present? if dependent_attributes.present?
selected_attributes = member_attributes.merge(dependent_attributes) selected_attributes = member_attributes.merge(dependent_attributes)
@@ -1,4 +1,4 @@
module IdCardPrinter module IdCardPrinterService
class JasperPdfGenerator class JasperPdfGenerator
def initialize(jasper_url) def initialize(jasper_url)
@@ -1,9 +1,9 @@
module IdCardPrinter module IdCardPrinterService
class JasperUrlGenerator class JasperUrlGenerator
def initialize(pl_plan_key, family_id, layout) def initialize(pl_plan_key, family_id, layout)
@pl_plan_key = pl_plan_key @pl_plan_key = pl_plan_key
@card_config = IdCard::Configuration.find_by(pl_plan_key: pl_plan_key) @card_setup = IdCard::Setup.find_by(pl_plan_key: pl_plan_key)
@family_id = family_id @family_id = family_id
@layout = layout @layout = layout
end end
@@ -24,7 +24,7 @@ module IdCardPrinter
# end # end
# end # end
# @network_logos.find_by(default: true).net_logo # @network_logos.find_by(default: true).net_logo
@card_config.network_logo.filename @card_setup.network_logo.filename
end end
# http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF # http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF
# http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF # http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF
@@ -33,7 +33,7 @@ module IdCardPrinter
host: '10.41.1.115', host: '10.41.1.115',
port: 8080, port: 8080,
path: '/trunk/IdCardsServlet', path: '/trunk/IdCardsServlet',
query: "reportConn=BrittonConnect&cardTemplate=#{@card_config.card_template}&printType=#{@layout}&family_id=#{@family_id }&employer_logo=#{@card_config.employer_logo.filename}&network_logo=#{determine_network_logo}&FileType=PDF" query: "reportConn=BrittonConnect&cardTemplate=#{@card_setup.card_template}&printType=#{@layout}&family_id=#{@family_id }&employer_logo=#{@card_setup.employer_logo.filename}&network_logo=#{determine_network_logo}&FileType=PDF"
} }
end end
@@ -1,4 +1,4 @@
module IdCardPrinter module IdCardPrinterService
class MemberCardsGenerator class MemberCardsGenerator
def initialize(member_keys, layout) def initialize(member_keys, layout)
@@ -10,9 +10,9 @@ module IdCardPrinter
def call def call
IdCard::PrintData.where(mb_member_key: @employer.pl_plan_key).destroy_all IdCard::PrintData.where(mb_member_key: @employer.pl_plan_key).destroy_all
IdCardPrinter::EmployerDataFormatter.new(@employer).call IdCardPrinterService::EmployerDataFormatter.new(@employer).call
pdf_array = IdCardPrinter::PdfProcessor.new(@employer, @layout, @zip).call pdf_array = IdCardPrinterService::PdfProcessor.new(@employer, @layout, @zip).call
group_pdfs = combine_pdfs(pdf_array) group_pdfs = combine_pdfs(pdf_array)
group_pdfs group_pdfs
@@ -1,9 +1,9 @@
module IdCardPrinter module IdCardPrinterService
class PdfProcessor class PdfProcessor
def initialize(employer, layout, zip = false) def initialize(employer, layout, zip = false)
@employer = employer @employer = employer
@card_config = @employer.id_card_configuration @card_setup = @employer.id_card_setup
@layout = layout @layout = layout
@zip = zip @zip = zip
end end
@@ -16,9 +16,9 @@ module IdCardPrinter
# end # end
group_cards_pdf_array = [] group_cards_pdf_array = []
IdCard::PrintData.where(pl_plan_key: @employer.pl_plan_key).each do |card| IdCard::PrintData.where(pl_plan_key: @employer.pl_plan_key).each do |card|
url = IdCardPrinter::JasperUrlGenerator.new(@employer.pl_plan_key, card.family_id, @layout).call url = IdCardPrinterService::JasperUrlGenerator.new(@employer.pl_plan_key, card.family_id, @layout).call
puts url puts url
card_pdf = IdCardPrinter::JasperPdfGenerator.new(url).call card_pdf = IdCardPrinterService::JasperPdfGenerator.new(url).call
if @zip if @zip
card_filename = "#{card.full_name_last_name_first.gsub(", ", "_")}_digital_card_#{Date.today}.pdf" card_filename = "#{card.full_name_last_name_first.gsub(", ", "_")}_digital_card_#{Date.today}.pdf"
group_cards_pdf_array << { name: card_filename, data: card_pdf.to_pdf } group_cards_pdf_array << { name: card_filename, data: card_pdf.to_pdf }
@@ -1,4 +1,4 @@
module IdCardPrinter module IdCardPrinterService
class QueuedCardsGenerator class QueuedCardsGenerator
def initialize(employer_member_keys) def initialize(employer_member_keys)
@@ -13,12 +13,13 @@ module IdCardPrinter
IdCard::PrintData.where(pl_plan_key: @pl_plan_keys).destroy_all IdCard::PrintData.where(pl_plan_key: @pl_plan_keys).destroy_all
@employer_member_keys.each do |emk| @employer_member_keys.each do |emk|
employer = Employer.find_by(pl_plan_key: emk["PlanKey"]) employer = Employer.find_by(pl_plan_key: emk["PlanKey"])
card_setup = employer.id_card_setup
member_keys = emk["MemberKeys"].split(", ").map(&:to_i) member_keys = emk["MemberKeys"].split(", ").map(&:to_i)
IdCardPrinter::EmployerDataFormatter.new(employer, member_keys).call IdCardPrinterService::EmployerDataFormatter.new(employer, member_keys).call
if emk["PlanKey"] == "3" if card_setup.card_color = "blue"
blue_card_array = IdCardPrinter::PdfProcessor.new(employer, @layout).call blue_card_array = IdCardPrinterService::PdfProcessor.new(employer, @layout).call
else else
white_card_array = IdCardPrinter::PdfProcessor.new(employer, @layout).call white_card_array = IdCardPrinterService::PdfProcessor.new(employer, @layout).call
end end
end end
@@ -1,4 +1,4 @@
module IdCardPrinter module IdCardPrinterService
class SampleCardsGenerator class SampleCardsGenerator
def initialize(employer) def initialize(employer)
@@ -7,9 +7,9 @@ module IdCardPrinter
def call def call
IdCard::PrintData.where(employer_name: @employer.name).destroy_all IdCard::PrintData.where(employer_name: @employer.name).destroy_all
IdCardPrinter::SampleDataFormatter.new(@employer).call IdCardPrinterService::SampleDataFormatter.new(@employer).call
IdCardPrinter::SamplePdfProcessor.new(@employer).call IdCardPrinterService::SamplePdfProcessor.new(@employer).call
end end
end end
end end
@@ -1,9 +1,9 @@
module IdCardPrinter module IdCardPrinterService
class SampleDataFormatter class SampleDataFormatter
def initialize(employer) def initialize(employer)
@employer = employer @employer = employer
@card_config = @employer.id_card_configuration @card_setup = @employer.id_card_setup
end end
def call def call
@@ -33,8 +33,8 @@ module IdCardPrinter
def set_plan_fields def set_plan_fields
plans_base_cards = [] plans_base_cards = []
@card_config.plans.each do |plan| @card_setup.plans.each do |plan|
@base_card.sample_key = @card_config.print_name.titleize.split.map(&:first).push(plan.id).join @base_card.sample_key = @card_setup.print_name.titleize.split.map(&:first).push(plan.id).join
plan_base_card = @base_card.dup plan_base_card = @base_card.dup
plan_name = plan.title.split(/(?<=\d[kK])/).first plan_name = plan.title.split(/(?<=\d[kK])/).first
plan.plan_benefits.each do |bene| plan.plan_benefits.each do |bene|
@@ -58,23 +58,23 @@ module IdCardPrinter
end end
def set_network_fields def set_network_fields
selected_attributes = @card_config.provider_section.attributes.with_indifferent_access.slice( selected_attributes = @card_setup.provider_section.attributes.with_indifferent_access.slice(
:provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6, :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6,
:provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12, :provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12,
:claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6, :claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6,
:claim_to_7, :claim_to_8, :claim_to_9, :claim_to_10, :claim_to_11, :claim_to_12 :claim_to_7, :claim_to_8, :claim_to_9, :claim_to_10, :claim_to_11, :claim_to_12
) )
# if @card_config.network_provider == "Cigna" # if @card_setup.network_provider == "Cigna"
# @base_card.provider_code = "5" # @base_card.provider_code = "5"
# end # end
@base_card.network_provider = @card_config.network_provider @base_card.network_provider = @card_setup.network_provider
@base_card.assign_attributes(selected_attributes) @base_card.assign_attributes(selected_attributes)
end end
def set_rx_fields def set_rx_fields
# fairos_information = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first # fairos_information = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first
selected_attributes = @card_config.rx_section.attributes.with_indifferent_access.slice( selected_attributes = @card_setup.rx_section.attributes.with_indifferent_access.slice(
:customer_service, :customer_service,
:web_url :web_url
) )
@@ -1,10 +1,10 @@
module IdCardPrinter module IdCardPrinterService
class SampleJasperUrlGenerator class SampleJasperUrlGenerator
def initialize(employer, sample_key, sample_title) def initialize(employer, sample_key, sample_title)
@sample_key = sample_key @sample_key = sample_key
@sample_title = sample_title @sample_title = sample_title
@card_config = employer.id_card_configuration @card_setup = employer.id_card_setup
end end
def call def call
@@ -25,7 +25,7 @@ module IdCardPrinter
# end # end
# end # end
# @network_logos.find_by(default: true).net_logo # @network_logos.find_by(default: true).net_logo
@card_config.network_logo.filename @card_setup.network_logo.filename
end end
# http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF # http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF
# http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF # http://localhost:8080/trunk/PdfServlet?reportConn=BrittonConnect&id=&reportName=FairosRxSampleIDCard-Half&family_id=Classic%202K&employer_logo=BryanPestControl.jpeg&network_logo=CignaLogo.png&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF
@@ -34,7 +34,7 @@ module IdCardPrinter
host: '10.41.1.115', host: '10.41.1.115',
port: 8080, port: 8080,
path: '/trunk/IdCardsServlet', path: '/trunk/IdCardsServlet',
query: "reportConn=BrittonConnect&cardTemplate=#{@card_config.card_template}&printType=SampleCard&sample_key=#{@sample_key}&sample_plan_title=#{@sample_title}&employer_logo=#{@card_config.employer_logo.filename}&network_logo=#{determine_network_logo}&FileType=PDF" query: "reportConn=BrittonConnect&cardTemplate=#{@card_setup.card_template}&printType=SampleCard&sample_key=#{@sample_key}&sample_plan_title=#{@sample_title}&employer_logo=#{@card_setup.employer_logo.filename}&network_logo=#{determine_network_logo}&FileType=PDF"
} }
end end
@@ -1,17 +1,17 @@
module IdCardPrinter module IdCardPrinterService
class SamplePdfProcessor class SamplePdfProcessor
def initialize(employer) def initialize(employer)
@employer = employer @employer = employer
@card_config = @employer.id_card_configuration @card_setup = @employer.id_card_setup
end end
def call def call
group_cards_pdf = CombinePDF.new group_cards_pdf = CombinePDF.new
IdCard::PrintData.where(employer_name: @employer.name).each do |card| IdCard::PrintData.where(employer_name: @employer.name).each do |card|
url = IdCardPrinter::SampleJasperUrlGenerator.new(@employer, card.sample_key, card.sample_plan_title).call url = IdCardPrinterService::SampleJasperUrlGenerator.new(@employer, card.sample_key, card.sample_plan_title).call
puts url puts url
card_pdf = IdCardPrinter::JasperPdfGenerator.new(url).call card_pdf = IdCardPrinterService::JasperPdfGenerator.new(url).call
group_cards_pdf << card_pdf group_cards_pdf << card_pdf
end end
@@ -1,11 +1,11 @@
module EmployerCards module IdCardQueueService
class GetQueuedCards class GetQueuedCards
def initialize(pl_plan_keys = nil) def initialize(pl_plan_keys = nil)
if pl_plan_keys if pl_plan_keys
@employer_pl_plan_keys = pl_plan_keys @employer_pl_plan_keys = pl_plan_keys
else else
@employer_pl_plan_keys = IdCard::Configuration.active.pluck(:pl_plan_key).join(',') @employer_pl_plan_keys = IdCard::Setup.active.pluck(:pl_plan_key).join(',')
end end
end end
@@ -1,8 +1,8 @@
module EmployerCards module IdCardQueueService
class GetQueuedCounts class GetQueuedCounts
def initialize() def initialize()
@employer_pl_plan_keys = IdCard::Configuration.active.pluck(:pl_plan_key).join(',') @employer_pl_plan_keys = IdCard::Setup.active.pluck(:pl_plan_key).join(',')
end end
def call def call
@@ -1,4 +1,4 @@
class ImageProcessor class ImageProcessorService
ALLOWED_LOGO_TYPES = ['Network', 'Employer'].freeze ALLOWED_LOGO_TYPES = ['Network', 'Employer'].freeze
def initialize(image_path, logo_type, new_filename = nil) def initialize(image_path, logo_type, new_filename = nil)
+3 -3
View File
@@ -32,7 +32,7 @@ module SampleCard
def set_plan_fields def set_plan_fields
plans_sample_cards = [] plans_sample_cards = []
@employer.id_card_configuration.plans.each do |plan| @employer.id_card_setup.plans.each do |plan|
plan_sample_card = @sample_card.dup plan_sample_card = @sample_card.dup
plan_name = plan.title.split(/(?<=\d[kK])/).first plan_name = plan.title.split(/(?<=\d[kK])/).first
plan_sample_card.family_id = plan_name plan_sample_card.family_id = plan_name
@@ -56,7 +56,7 @@ module SampleCard
end end
def set_network_fields def set_network_fields
selected_attributes = @employer.id_card_configuration.provider_section.attributes.with_indifferent_access.slice( selected_attributes = @employer.id_card_setup.provider_section.attributes.with_indifferent_access.slice(
:provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6, :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6,
:provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12, :provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12,
:claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6, :claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6,
@@ -71,7 +71,7 @@ module SampleCard
def set_rx_fields def set_rx_fields
# fairos_information = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first # fairos_information = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first
selected_attributes = @employer.id_card_configuration.rx_section.attributes.with_indifferent_access.slice( selected_attributes = @employer.id_card_setup.rx_section.attributes.with_indifferent_access.slice(
:customer_service, :customer_service,
:web_url :web_url
) )
@@ -4,8 +4,8 @@
<% end %> <% end %>
</div> </div>
<div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[i]}" %> rounded-bl-lg"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Setup::FORM_COLORS[i]}" %> rounded-bl-lg"></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Setup::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %> <%= "Plan #{i + 1}" %>
</div> </div>
<div class="pl-1 w-full"> <div class="pl-1 w-full">
+7 -7
View File
@@ -1,6 +1,6 @@
<div class="bg-deepcove h-full w-full flex flex-col"> <div class="bg-deepcove h-full w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum my-5">Edit Employer</h1> <h1 class="font-bold text-4xl text-platinum my-5">Edit Employer</h1>
<%= form_with model: @employer_configuration, url: employer_configuration_index_path, local: true, multipart: true do |f| %> <%= form_with model: @employer_setup, url: employer_setup_index_path, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6"> <div class="flex flex-col space-y-6">
<div class="w-full flex items-center"> <div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">General Information</h3> <h3 class="font-bold text-2xl text-bluemana">General Information</h3>
@@ -51,17 +51,17 @@
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3> <h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer_configuration.plans.each_with_index do |plan, index| %> <% @employer_setup.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker"> <div class="inline-flex flex-col pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[index]}" %>"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Setup::FORM_COLORS[index]}" %>"></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Setup::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %> <%= "Plan #{index + 1}" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Setup::FORM_COLORS[index]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div> <div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
@@ -106,7 +106,7 @@
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3> <h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>"> <div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container"> <div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %> <%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div> </div>
+1 -1
View File
@@ -1,6 +1,6 @@
<div class="bg-deepcove h-full w-full flex flex-col"> <div class="bg-deepcove h-full w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum my-5">Employer Setups</h1> <h1 class="font-bold text-4xl text-platinum my-5">Employer Setups</h1>
<% plan_colors = IdCard::Configuration::FORM_COLORS.push('copper', 'bronze').shuffle %> <% plan_colors = IdCard::Setup::FORM_COLORS.push('copper', 'bronze').shuffle %>
<% @employer_setups.each_with_index do |es, index| %> <% @employer_setups.each_with_index do |es, index| %>
<% item_color_index = index == 0 ? 0 : index % plan_colors.length %> <% item_color_index = index == 0 ? 0 : index % plan_colors.length %>
<div class="w-full flex text-2xl text-platinum font-bold px-4 py-4 ml-10 rounded-lg border-l-5 border-b-2 <%= "border-#{plan_colors[item_color_index]}" %>"> <div class="w-full flex text-2xl text-platinum font-bold px-4 py-4 ml-10 rounded-lg border-l-5 border-b-2 <%= "border-#{plan_colors[item_color_index]}" %>">
@@ -1,4 +1,4 @@
<div class="min-h-screen w-full flex flex-col" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>"> <div class="min-h-screen w-full flex flex-col" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1> <h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Provider Network</h3> <h3 class="font-bold text-2xl text-bluemana">Provider Network</h3>
<%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %> <%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %>
+5 -5
View File
@@ -57,16 +57,16 @@
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3> <h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<%= f.fields_for :plans, @employer_setup.plans.first, child_index: 0 do |plan_fields| %> <%= f.fields_for :plans, @employer_setup.plans.first, child_index: 0 do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[0]}" %> "></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Setup::FORM_COLORS[0]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[0]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Setup::FORM_COLORS[0]}" %> -ml-[6px] z-2 w-full">
<%= "Plan 1" %> <%= "Plan 1" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: 0 %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: 0 %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[0]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Setup::FORM_COLORS[0]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r bg-bronze ml-[3px]"></div> <div class="w-full h-[3px] rounded-r bg-bronze ml-[3px]"></div>
@@ -110,7 +110,7 @@
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3> <h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>"> <div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container"> <div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %> <%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div> </div>
+3 -3
View File
@@ -1,4 +1,4 @@
<div class="min-h-screen w-full flex flex-col" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>"> <div class="min-h-screen w-full flex flex-col" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1> <h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Medical Plans</h3> <h3 class="font-bold text-2xl text-bluemana">Medical Plans</h3>
<div class="flex flex-col pl-6"> <div class="flex flex-col pl-6">
@@ -17,8 +17,8 @@
</div> </div>
<% @form.plans.each_with_index do |plan, i| %> <% @form.plans.each_with_index do |plan, i| %>
<div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[i]}" %> rounded-bl-lg"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Setup::FORM_COLORS[i]}" %> rounded-bl-lg"></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Setup::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %> <%= "Plan #{i + 1}" %>
</div> </div>
<%= f.fields_for :plans, index: i do |plan_fields| %> <%= f.fields_for :plans, index: i do |plan_fields| %>
+1 -1
View File
@@ -6,7 +6,7 @@
<% end %> <% end %>
</div> </div>
<% plan_colors = IdCard::Configuration::FORM_COLORS.push('copper', 'bronze').shuffle %> <% plan_colors = IdCard::Setup::FORM_COLORS.push('copper', 'bronze').shuffle %>
<% @color_index = 0 %> <% @color_index = 0 %>
<h2 class="font-bold text-3xl text-brightlava my-5">In Process:</h2> <h2 class="font-bold text-3xl text-brightlava my-5">In Process:</h2>
<% @employers.inactive.each_with_index do |emp, index| %> <% @employers.inactive.each_with_index do |emp, index| %>
+57 -42
View File
@@ -2,13 +2,16 @@
<%= link_to employers_path, class: "flex h-10 w-10 text-xl transition duration-100" do %> <%= link_to employers_path, class: "flex h-10 w-10 text-xl transition duration-100" do %>
<%= icon "arrow-big-left-dash", library: "lucide", class: "h-full w-full text-center text-bluemana hover:text-bronze" %> <%= icon "arrow-big-left-dash", library: "lucide", class: "h-full w-full text-center text-bluemana hover:text-bronze" %>
<% end %> <% end %>
<div class="flex w-full items-center space-x-4"> <div class="flex w-full items-center space-x-8">
<h1 class="font-bold text-4xl text-platinum my-5"><%= @employer.name %></h1> <h1 class="font-bold text-4xl text-platinum my-5"><%= @employer.name %></h1>
<div class="h-[50px] max-w-[200px]"> <div class="h-[50px] max-w-[200px]">
<% if @employer&.id_card_configuration&.employer_logo&.filename %> <% if @employer&.id_card_setup&.employer_logo&.filename %>
<%= image_tag image_id_card_employer_logo_path(@employer.id_card_configuration.employer_logo.id), class: "max-h-[50px] object-contain shadow-[0_0_10px_3px_#93c5fd]" %> <%= image_tag image_id_card_employer_logo_path(@employer.id_card_setup.employer_logo.id), class: "max-h-[50px] object-contain shadow-[0_0_10px_3px_#93c5fd] bg-platinum" %>
<% end %> <% end %>
</div> </div>
<div class="w-1/2 flex ml-8">
<%= link_to 'Edit Employer', edit_employer_path(@employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-1/3 cursor-pointer bg-bluetang hover:bg-deepcove border-2 border-bluetang text-platinum text-lg font-bold px-3 rounded-lg h-10 transition duration-100" %>
</div>
</div> </div>
<div class="flex space-x-6"> <div class="flex space-x-6">
<div class="flex flex-col space-y-1 w-1/4"> <div class="flex flex-col space-y-1 w-1/4">
@@ -22,9 +25,9 @@
<%= @employer.active == false ? "inactive" : "active" %> <%= @employer.active == false ? "inactive" : "active" %>
</p> </p>
<p class="ml-9 text-bluemana"> <p class="ml-9 text-bluemana">
<strong class="text-platinum mr-2">├── Effective Date:</strong> <strong class="text-platinum mr-2">├── Effective Date:</strong>
<%= @employer.effective_date %> <%= @employer.effective_date %>
</p> </p>
<div> <div>
<strong class="text-bluemana mr-2">└── Key Chain</strong> <strong class="text-bluemana mr-2">└── Key Chain</strong>
</div> </div>
@@ -34,11 +37,11 @@
<%= attribute_value.present? ? attribute_value.to_s : "waiting" %> <%= attribute_value.present? ? attribute_value.to_s : "waiting" %>
</p> </p>
<% end %> <% end %>
<% if @employer&.id_card_configuration&.plans.present? %> <% if @employer&.id_card_setup&.plans.present? %>
<div> <div>
<strong class="text-atmosphere mr-2">└── Plans</strong> <strong class="text-atmosphere mr-2">└── Plans</strong>
</div> </div>
<% @employer.id_card_configuration.plans.pluck(:title, :pb_product_key).each do |plan| %> <% @employer.id_card_setup.plans.pluck(:title, :pb_product_key).each do |plan| %>
<div class="ml-9"> <div class="ml-9">
├── <%= plan.first %> ├── <%= plan.first %>
</div> </div>
@@ -48,13 +51,22 @@
</p> </p>
<% end %> <% end %>
<% end %> <% end %>
<div class="w-full flex items-end mt-10"> </div>
<%= link_to 'Edit Employer', edit_employer_path(@employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-brightlava hover:bg-deepcove border-2 border-brightlava text-platinum text-lg font-bold px-3 rounded-lg h-10 transition duration-100" %> <div class="flex flex-col items-center w-full my-8">
<div class="w-full flex flex-col items-center my-3">
<div class="font-bold text-lg text-bronze">
Admin
</div>
<span class="block w-full h-0.5 bg-copper mt-[-4]"></span>
</div>
<div class="flex flex-col items-center space-y-6 w-full">
<%= link_to 'Sync Employer with VHCS', generate_sample_id_card_print_path(id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-brightlava hover:bg-deepcove border-2 border-brightlava text-platinum text-lg font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Sync Members with VHCS', generate_print_id_card_print_path(id: @employer.slug),data: { turbo: false }, class: "flex justify-center items-center w-full bg-brightlava hover:bg-deepcove border-2 border-brightlava text-platinum text-lg font-bold px-3 rounded-lg h-10 transition duration-100" %>
</div>
</div> </div>
</div> </div>
</div>
<div class="flex flex-col space-y w-[23%] mb-5"> <div class="flex flex-col space-y w-[23%] mb-5">
<% module_color = IdCard::Configuration::MODULE_COLOR %> <% module_color = IdCard::Setup::MODULE_COLOR %>
<div class="w-full flex flex-none items-center justify-between"> <div class="w-full flex flex-none items-center justify-between">
<h3 class="flex-none font-bold text-2xl text-<%= module_color %>">ID Card Module</h3> <h3 class="flex-none font-bold text-2xl text-<%= module_color %>">ID Card Module</h3>
<div class="grow h-[1px] mt-2 ml-1 bg-bronze"></div> <div class="grow h-[1px] mt-2 ml-1 bg-bronze"></div>
@@ -69,9 +81,9 @@
<span class="block w-full h-0.5 bg-copper mt-[-4]"></span> <span class="block w-full h-0.5 bg-copper mt-[-4]"></span>
</div> </div>
<div class="flex flex-col items-center space-y-6 w-full"> <div class="flex flex-col items-center space-y-6 w-full">
<%= link_to "General", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> <%= link_to "General", employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to "Plans", plans_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> <%= link_to "Plans", plans_employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Exceptions (Optional)', field_exceptions_employer_id_card_configuration_index_path(employer_id: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> <%= link_to 'Exceptions (Optional)', field_exceptions_employer_id_card_setup_index_path(employer_id: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
</div> </div>
</div> </div>
<div class="grow-1 flex flex-col items-center w-full"> <div class="grow-1 flex flex-col items-center w-full">
@@ -82,40 +94,43 @@
<span class="block w-full h-0.5 bg-copper mt-[-4]"></span> <span class="block w-full h-0.5 bg-copper mt-[-4]"></span>
</div> </div>
<div class="flex flex-col items-center space-y-6 w-full"> <div class="flex flex-col items-center space-y-6 w-full">
<%= link_to 'Generate Sample Cards', generate_sample_id_card_print_path(@employer.pl_plan_key), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> <%= link_to 'Generate Sample Cards', generate_sample_id_card_print_path(id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for print)', generate_print_id_card_print_path(@employer.pl_plan_key),data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> <%= link_to 'Generate Group Cards (for print)', generate_print_id_card_print_path(id: @employer.slug),data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for display)', generate_mobile_display_id_card_print_path(@employer.pl_plan_key), data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> <%= link_to 'Generate Group Cards (for display)', generate_mobile_display_id_card_print_path(id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for download)', generate_full_page_id_card_print_path(@employer.pl_plan_key), data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %> <%= link_to 'Generate Group Cards (for download)', generate_full_page_id_card_print_path(id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
</div>
</div>
<div class="grow-1 flex flex-col items-center w-full">
<div class="w-full flex flex-col items-center my-3">
<div class="font-bold text-lg text-bronze">
Admin
</div>
<span class="block w-full h-0.5 bg-copper mt-[-4]"></span>
</div>
<div class="flex flex-col items-center space-y-6 w-full">
<%= link_to 'Sync Employer with VHCS', generate_sample_id_card_print_path(@employer.pl_plan_key), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Sync Members with VHCS', generate_print_id_card_print_path(@employer.pl_plan_key),data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
</div> </div>
</div> </div>
<% else %> <% else %>
<%= link_to "Enable ID Card", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-4 border-atmosphere text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %> <%= link_to "Enable ID Card", employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-4 border-atmosphere text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="flex flex-col space-y w-[23%] mb-5"> <div class="flex flex-col space-y w-[23%] mb-5">
<div class="w-full flex items-center"> <div class="flex flex-col space-y w-full h-1/2 mb-2">
<h3 class="flex-none font-bold text-2xl text-cobalt-vivid">Claims Check Module</h3> <div class="w-full flex items-center">
<div class="grow h-[1px] mt-2 ml-1 bg-bronze"></div> <h3 class="flex-none font-bold text-2xl text-copper">Britton Web Module</h3>
</div> <div class="grow h-[1px] mt-2 ml-1 bg-bronze"></div>
<div class="grow flex flex-col w-full border-l-4 border-b-4 border-cobalt-vivid rounded-xl pl-2 pb-2"> </div>
<% if @employer.claims_check_enabled? %> <div class="grow flex flex-col w-full border-l-4 border-b-4 border-copper rounded-xl pl-2 pb-2">
<% if @employer.claims_check_enabled? %>
<% else %> <% else %>
<%= link_to "Enable Claims Check", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-cobalt-vivid hover:bg-deepcove border-4 border-cobalt-vivid text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %> <%= link_to "Enable Britton Web", employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-copper hover:bg-deepcove border-4 border-copper text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %>
<% end %> <% end %>
</div>
</div>
<div class="flex flex-col space-y w-full h-1/2">
<div class="w-full flex items-center">
<h3 class="flex-none font-bold text-2xl text-cobalt-vivid">Claims Check Module</h3>
<div class="grow h-[1px] mt-2 ml-1 bg-bronze"></div>
</div>
<div class="grow flex flex-col w-full border-l-4 border-b-4 border-cobalt-vivid rounded-xl pl-2 pb-2">
<% if @employer.claims_check_enabled? %>
<% else %>
<%= link_to "Enable Claims Check", employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-cobalt-vivid hover:bg-deepcove border-4 border-cobalt-vivid text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100 pointer-events-none opacity-50 cursor-not-allowed" %>
<% end %>
</div>
</div> </div>
</div> </div>
<div class="flex flex-col space-y w-[23%] mb-5"> <div class="flex flex-col space-y w-[23%] mb-5">
@@ -127,7 +142,7 @@
<% if @employer.claims_check_enabled? %> <% if @employer.claims_check_enabled? %>
<% else %> <% else %>
<%= link_to "Enable FairosRx Eligibility", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-verdigris-vivid hover:bg-deepcove border-4 border-verdigris-vivid text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %> <%= link_to "Enable FairosRx Eligibility", employer_id_card_setup_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-verdigris-vivid hover:bg-deepcove border-4 border-verdigris-vivid text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100 pointer-events-none opacity-50 cursor-not-allowed" %>
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -4,8 +4,8 @@
<% end %> <% end %>
</div> </div>
<div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[i]}" %> rounded-bl-lg"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Setup::FORM_COLORS[i]}" %> rounded-bl-lg"></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Setup::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %> <%= "Plan #{i + 1}" %>
</div> </div>
<div class="pl-1 w-full"> <div class="pl-1 w-full">
@@ -5,9 +5,10 @@
<div class="pl-1 w-full"> <div class="pl-1 w-full">
<%= plan_fields.text_field :pb_product_key, label: { text: "Plan Product Key" }, class: "w-full" %> <%= plan_fields.text_field :pb_product_key, label: { text: "Plan Product Key" }, class: "w-full" %>
</div> </div>
<% else %>
<div class="pl-1 pb-2 w-full">
<%= f.select :template_id, options_from_collection_for_select(@plan_templates, :id, :title), { prompt: "Select Plan Template", class: "w-full" }, { data: { action: "benefits-template-picker#fetchData" }} %>
</div>
<% end %> <% end %>
<div class="pl-1 pb-2 w-full">
<%= f.select :template_id, options_from_collection_for_select(@plan_templates, :id, :title), { prompt: "Select Plan Template", class: "w-full" }, { data: { action: "benefits-template-picker#fetchData" }} %>
</div>
+5 -5
View File
@@ -51,17 +51,17 @@
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3> <h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %> <% @employer.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker"> <div class="inline-flex flex-col pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[index]}" %>"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Setup::FORM_COLORS[index]}" %>"></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Setup::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %> <%= "Plan #{index + 1}" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Setup::FORM_COLORS[index]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div> <div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
@@ -106,7 +106,7 @@
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3> <h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>"> <div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container"> <div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %> <%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div> </div>
+1 -1
View File
@@ -6,7 +6,7 @@
<% end %> <% end %>
</div> </div>
<% plan_colors = IdCard::Configuration::FORM_COLORS.push('copper', 'bronze').shuffle %> <% plan_colors = IdCard::Setup::FORM_COLORS.push('copper', 'bronze').shuffle %>
<% @color_index = 0 %> <% @color_index = 0 %>
<h2 class="font-bold text-3xl text-brightlava my-5">In Process:</h2> <h2 class="font-bold text-3xl text-brightlava my-5">In Process:</h2>
<% @employers.inactive.each_with_index do |emp, index| %> <% @employers.inactive.each_with_index do |emp, index| %>
@@ -1,4 +1,4 @@
<div class="min-h-screen w-full flex flex-col" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>"> <div class="min-h-screen w-full flex flex-col" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1> <h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Provider Network</h3> <h3 class="font-bold text-2xl text-bluemana">Provider Network</h3>
<%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %> <%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %>
+5 -5
View File
@@ -61,17 +61,17 @@
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3> <h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %> <% @employer.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[index]}" %> "></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Setup::FORM_COLORS[index]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Setup::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %> <%= "Plan #{index + 1}" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Setup::FORM_COLORS[index]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div> <div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
@@ -116,7 +116,7 @@
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3> <h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>"> <div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container"> <div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %> <%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div> </div>
+5 -5
View File
@@ -61,17 +61,17 @@
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3> <h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %> <% @employer.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[index]}" %> "></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Setup::FORM_COLORS[index]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Setup::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %> <%= "Plan #{index + 1}" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Setup::FORM_COLORS[index]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div> <div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
@@ -116,7 +116,7 @@
<h3 class="font-bold text-2xl text-bluemana">ID Card Exceptions Information</h3> <h3 class="font-bold text-2xl text-bluemana">ID Card Exceptions Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="flex flex-wrap w-full justify-start my-8" data-controller="add-exception" data-add-exception-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>"> <div class="flex flex-wrap w-full justify-start my-8" data-controller="add-exception" data-add-exception-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>">
<%= button_tag "Add an Exception", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-35 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-exception#addExemption", add_exception_target: "exceptionButton" } %> <%= button_tag "Add an Exception", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-35 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-exception#addExemption", add_exception_target: "exceptionButton" } %>
<template data-add-exception-target="exceptionTemplate"> <template data-add-exception-target="exceptionTemplate">
<%= f.fields_for :card_exceptions, CardException.new, child_index: 'NEW_RECORD' do |exception_fields| %> <%= f.fields_for :card_exceptions, CardException.new, child_index: 'NEW_RECORD' do |exception_fields| %>
+3 -3
View File
@@ -1,4 +1,4 @@
<div class="min-h-screen w-full flex flex-col" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>"> <div class="min-h-screen w-full flex flex-col" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1> <h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Medical Plans</h3> <h3 class="font-bold text-2xl text-bluemana">Medical Plans</h3>
<div class="flex flex-col pl-6"> <div class="flex flex-col pl-6">
@@ -17,8 +17,8 @@
</div> </div>
<% @form.plans.each_with_index do |plan, i| %> <% @form.plans.each_with_index do |plan, i| %>
<div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[i]}" %> rounded-bl-lg"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Setup::FORM_COLORS[i]}" %> rounded-bl-lg"></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Setup::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %> <%= "Plan #{i + 1}" %>
</div> </div>
<%= f.fields_for :plans, index: i do |plan_fields| %> <%= f.fields_for :plans, index: i do |plan_fields| %>
+1 -1
View File
@@ -35,7 +35,7 @@
<%= nq.pl_plan_key %> - <%= nq.pl_plan_key %> -
<%= nq.employer.name %> <%= nq.employer.name %>
( (
<div class="mx-1 text-bluetang"> <div class="mx-1 text-verdigris-vivid">
<%= nq.queued_card_count %> <%= nq.queued_card_count %>
</div> </div>
) )
@@ -3,11 +3,11 @@
<h1 class="text-platinum">ID Card Exceptions:</h1> <h1 class="text-platinum">ID Card Exceptions:</h1>
<h1 class="text-atmosphere">(<%= @employer.name %>)</h1> <h1 class="text-atmosphere">(<%= @employer.name %>)</h1>
</div> </div>
<%= form_with model: @configuration, url: update_field_exceptions_employer_id_card_configuration_index_path(@employer.slug), local: true, multipart: true do |f| %> <%= form_with model: @setup, url: update_field_exceptions_employer_id_card_setup_index_path(@employer.slug), local: true, multipart: true do |f| %>
<div class="flex flex-col"> <div class="flex flex-col">
<div class="w-full flex pb-10"> <div class="w-full flex pb-10">
<div class="flex flex-wrap w-full justify-start space-y-12 my-8" data-controller="add-exception" data-add-exception-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>"> <div class="flex flex-wrap w-full justify-start space-y-12 my-8" data-controller="add-exception" data-add-exception-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>">
<% @configuration.field_exceptions.each_with_index do |exc, index| %> <% @setup.field_exceptions.each_with_index do |exc, index| %>
<%= f.fields_for :field_exceptions, exc, child_index: index do |exception_fields| %> <%= f.fields_for :field_exceptions, exc, child_index: index do |exception_fields| %>
<div class="flex flex-col pr-6 w-1/2"> <div class="flex flex-col pr-6 w-1/2">
<div class="flex justify-between items-end w-full pb-2"> <div class="flex justify-between items-end w-full pb-2">
@@ -69,7 +69,7 @@
<% end %> <% end %>
<%= button_tag "Add an Exception", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/2 h-4/5 mt-3 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-exception#addExemption", add_exception_target: "exceptionButton" } %> <%= button_tag "Add an Exception", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/2 h-4/5 mt-3 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-exception#addExemption", add_exception_target: "exceptionButton" } %>
<template data-add-exception-target="exceptionTemplate"> <template data-add-exception-target="exceptionTemplate">
<%= f.fields_for :field_exceptions, @configuration.field_exceptions.build, child_index: 'NEW_RECORD' do |exception_fields| %> <%= f.fields_for :field_exceptions, @setup.field_exceptions.build, child_index: 'NEW_RECORD' do |exception_fields| %>
<div class="flex flex-col pr-6 w-1/2 pl-1"> <div class="flex flex-col pr-6 w-1/2 pl-1">
<div class="flex justify-between items-end w-full pb-2"> <div class="flex justify-between items-end w-full pb-2">
<div class="w-[48%]"> <div class="w-[48%]">
@@ -3,7 +3,7 @@
<h1 class="text-platinum">ID Card Setup:</h1> <h1 class="text-platinum">ID Card Setup:</h1>
<h1 class="text-atmosphere">(<%= @employer.name %>)</h1> <h1 class="text-atmosphere">(<%= @employer.name %>)</h1>
</div> </div>
<%= form_with model: @configuration, url: update_general_employer_id_card_configuration_index_path(@employer.slug), local: true, multipart: true do |f| %> <%= form_with model: @setup, url: employer_id_card_setup_path(id: @employer.slug), local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10"> <div class="flex flex-col space-y-6 pb-10">
<div class="flex w-full items-end"> <div class="flex w-full items-end">
<div class="flex flex-col space-y-6 w-3/5" data-controller="general-form provider-update"> <div class="flex flex-col space-y-6 w-3/5" data-controller="general-form provider-update">
@@ -17,10 +17,13 @@
</div> </div>
<div class="flex space-x-10"> <div class="flex space-x-10">
<div class="w-full"> <div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "MedCost", "Other"], @configuration.network_provider), { label: { text: "Provider Network" }, include_blank: "Select", class: "w-full" }, data: { provider_update_target: "providerNetworkField", action: "change->provider-update#syncDefaults" } %> <%= f.select :network_provider, options_for_select(["Cigna", "MedCost", "Other"], @setup.network_provider), { label: { text: "Provider Network" }, include_blank: "Select", class: "w-full" }, data: { provider_update_target: "providerNetworkField", action: "change->provider-update#syncDefaults" } %>
</div> </div>
<div class="w-full"> <div class="w-full">
<%= f.select :card_template, options_for_select([["FairosRx", "FairosRxIDCard"], ["Tandemloc", "TandemlocIDCard"], ["smART", "SmartIDCard"], ["QRCode (Healthbus)", "QRCodeIDCard"]], @configuration.card_template || "FairosRxIDCard" ), { label: { text: "Card Template" }, include_blank: "Select", class: "w-full" } %> <%= f.select :card_template, options_for_select([["FairosRx", "FairosRxIDCard"], ["Tandemloc", "TandemlocIDCard"], ["smART", "SmartIDCard"], ["QRCode (Healthbus)", "QRCodeIDCard"]], @setup.card_template || "FairosRxIDCard" ), { label: { text: "Card Template" }, include_blank: "Select", class: "w-full" } %>
</div>
<div class="w-full">
<%= f.select :card_color, options_for_select([["White", "white"], ["Blue", "blue"]], @setup.card_color || "white" ), { label: { text: "Card Color" }, include_blank: "Select", class: "w-full" } %>
</div> </div>
</div> </div>
<div class="flex space-x-10"> <div class="flex space-x-10">
@@ -45,7 +48,7 @@
<div class="flex flex-col items-start space-y-3 w-full" data-controller="logo-upload" data-logo-upload-logo-type-value="network"> <div class="flex flex-col items-start space-y-3 w-full" data-controller="logo-upload" data-logo-upload-logo-type-value="network">
<div class="flex w-full"> <div class="flex w-full">
<div class="flex flex-col w-full"> <div class="flex flex-col w-full">
<%= f.select :network_logo_id, options_for_select(IdCard::NetworkLogo.pluck(:filename, :id), @configuration.network_logo_id), { include_blank: "Select/Add Network Logo", class: "rounded-r-none flex flex-col" }, data: { provider_update_target: "networkLogoField", logo_upload_target: "logoIdField", action: "change->logo-upload#setSelectPreview" } %> <%= f.select :network_logo_id, options_for_select(IdCard::NetworkLogo.pluck(:filename, :id), @setup.network_logo_id), { include_blank: "Select/Add Network Logo", class: "rounded-r-none flex flex-col" }, data: { provider_update_target: "networkLogoField", logo_upload_target: "logoIdField", action: "change->logo-upload#setSelectPreview" } %>
</div> </div>
<div class="flex items-center justify-center self-end cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-r h-10 transition duration-100"> <div class="flex items-center justify-center self-end cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-r h-10 transition duration-100">
<label for="network_logo_file" class="text-center cursor-pointer"> <label for="network_logo_file" class="text-center cursor-pointer">
@@ -61,10 +64,10 @@
</div> </div>
<div class="flex space-x-10"> <div class="flex space-x-10">
<div class="w-full"> <div class="w-full">
<%= f.select :rx_section_id, options_from_collection_for_select(@rx_options, :id, :title, @configuration.rx_section_id || @fairos_rx_id), { include_blank: "Select Rx", class: "flex-col w-full" } %> <%= f.select :rx_section_id, options_from_collection_for_select(@rx_options, :id, :title, @setup.rx_section_id || @fairos_rx_id), { include_blank: "Select Rx", class: "flex-col w-full" } %>
</div> </div>
<div class="w-full"> <div class="w-full">
<%= f.select :provider_section_id, options_for_select(@provider_options, @configuration.provider_section_id), { label: { text: "Claims Submission Section" }, include_blank: "Select/Add Claims Submission", class: "flex flex-col w-full" }, data: { provider_update_target: "providerSectionField", general_form_target: "selectField", action: "change->general-form#toggleNewFieldSection" } %> <%= f.select :provider_section_id, options_for_select(@provider_options, @setup.provider_section_id), { label: { text: "Claims Submission Section" }, include_blank: "Select/Add Claims Submission", class: "flex flex-col w-full" }, data: { provider_update_target: "providerSectionField", general_form_target: "selectField", action: "change->general-form#toggleNewFieldSection" } %>
</div> </div>
</div> </div>
<div class="w-full hidden" data-general-form-target="dependentField"> <div class="w-full hidden" data-general-form-target="dependentField">
@@ -3,7 +3,7 @@
<h1 class="text-platinum">ID Card Network:</h1> <h1 class="text-platinum">ID Card Network:</h1>
<h1 class="text-atmosphere">(<%= @employer.name %>)</h1> <h1 class="text-atmosphere">(<%= @employer.name %>)</h1>
</div> </div>
<%= form_with model: @configuration, url: update_network_employer_id_card_configuration_index_path(@employer.slug), local: true, multipart: true do |f| %> <%= form_with model: @setup, url: update_network_employer_id_card_setup_index_path(@employer.slug), local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10"> <div class="flex flex-col space-y-6 pb-10">
<div class="flex flex-col space-y-6 w-full" data-controller="logo-upload" data-logo-upload-logo-type-value="network"> <div class="flex flex-col space-y-6 w-full" data-controller="logo-upload" data-logo-upload-logo-type-value="network">
@@ -3,19 +3,19 @@
<h1 class="text-platinum">ID Card Plans:</h1> <h1 class="text-platinum">ID Card Plans:</h1>
<h1 class="text-atmosphere">(<%= @employer.name %>)</h1> <h1 class="text-atmosphere">(<%= @employer.name %>)</h1>
</div> </div>
<%= form_with model: @configuration, url: update_plans_employer_id_card_configuration_index_path(@employer.slug), local: true, multipart: true do |f| %> <%= form_with model: @setup, url: update_plans_employer_id_card_setup_index_path(@employer.slug), local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10"> <div class="flex flex-col space-y-6 pb-10">
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Setup::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @configuration.plans.each_with_index do |plan, index| %> <% @setup.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan do |plan_fields| %> <%= f.fields_for :plans, plan do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[index]}" %> "></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Setup::FORM_COLORS[index]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Setup::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %> <%= "Plan #{index + 1}" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Setup::FORM_COLORS[index]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div> <div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
@@ -32,7 +32,7 @@
<%= button_tag "Add a Plan", class: "cursor-pointer text-2xl font-bold py-2 pr-6 mt-10 w-[calc(24%-1rem)] w-1/4 min-h-[940px] text-[#E0E0E0] rounded-lg font-medium border border-[#E0E0E0] bg-[#173057] hover:bg-transparent hover:shadow-[0_0_10px_3px_#93c5fd] transition-colors duration-150", data: { action: "add-plan#add", add_plan_target: "button" } %> <%= button_tag "Add a Plan", class: "cursor-pointer text-2xl font-bold py-2 pr-6 mt-10 w-[calc(24%-1rem)] w-1/4 min-h-[940px] text-[#E0E0E0] rounded-lg font-medium border border-[#E0E0E0] bg-[#173057] hover:bg-transparent hover:shadow-[0_0_10px_3px_#93c5fd] transition-colors duration-150", data: { action: "add-plan#add", add_plan_target: "button" } %>
</div> </div>
<template data-add-plan-target="template"> <template data-add-plan-target="template">
<%= f.fields_for :plans, @configuration.plans.build, child_index: 'NEW_RECORD' do |plan_fields| %> <%= f.fields_for :plans, @setup.plans.build, child_index: 'NEW_RECORD' do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 border-NEXT_COLOR"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 border-NEXT_COLOR"></div>
<div class="font-bold text-2xl text-NEXT_COLOR -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl text-NEXT_COLOR -ml-[6px] z-2 w-full">
+1 -3
View File
@@ -40,10 +40,8 @@ Rails.application.routes.draw do
post 'import' post 'import'
end end
namespace :id_card do namespace :id_card do
resources :configuration, only: [:destroy] do resources :setup, only: [:index, :update, :destroy] do
collection do collection do
get 'general'
patch 'update_general'
get 'plans' get 'plans'
patch 'update_plans' patch 'update_plans'
get 'field_exceptions' get 'field_exceptions'
@@ -1,12 +1,14 @@
class CreateIdCardConfigurations < ActiveRecord::Migration[7.2] class CreateIdCardSetups < ActiveRecord::Migration[7.2]
def change def change
create_table :id_card_configurations do |t| create_table :id_card_setups do |t|
t.string :print_name t.string :print_name
t.string :network_provider t.string :network_provider
t.string :card_template t.string :card_template
t.string :card_color
t.string :rx_group_number t.string :rx_group_number
t.string :pl_plan_key t.string :pl_plan_key
t.boolean :active, default: false t.boolean :active, default: false
t.boolean :has_divisions, default: false
t.belongs_to :employer, null: false, foreign_key: true t.belongs_to :employer, null: false, foreign_key: true
t.belongs_to :employer_logo, null: true, foreign_key: { to_table: :id_card_employer_logos } t.belongs_to :employer_logo, null: true, foreign_key: { to_table: :id_card_employer_logos }
t.belongs_to :network_logo, null: true, foreign_key: { to_table: :id_card_network_logos } t.belongs_to :network_logo, null: true, foreign_key: { to_table: :id_card_network_logos }
@@ -5,7 +5,7 @@ class CreateIdCardPlans < ActiveRecord::Migration[7.2]
t.integer :pb_product_key t.integer :pb_product_key
t.string :pl_plan_key t.string :pl_plan_key
t.boolean :template t.boolean :template
t.belongs_to :configuration, null: true, foreign_key: { to_table: :id_card_configurations } t.belongs_to :setup, null: true, foreign_key: { to_table: :id_card_setups }
t.timestamps t.timestamps
end end
@@ -3,7 +3,7 @@ class CreateIdCardFieldExceptions < ActiveRecord::Migration[7.2]
create_table :id_card_field_exceptions do |t| create_table :id_card_field_exceptions do |t|
t.string :exception_type t.string :exception_type
t.string :exception_value t.string :exception_value
t.belongs_to :configuration, null: false, foreign_key: { to_table: :id_card_configurations } t.belongs_to :setup, null: false, foreign_key: { to_table: :id_card_setups }
t.timestamps t.timestamps
end end
+34 -32
View File
@@ -24,27 +24,6 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
end end
create_table "id_card_configurations", force: :cascade do |t|
t.string "print_name"
t.string "network_provider"
t.string "card_template"
t.string "rx_group_number"
t.string "pl_plan_key"
t.boolean "active", default: false
t.bigint "employer_id", null: false
t.bigint "employer_logo_id"
t.bigint "network_logo_id"
t.bigint "provider_section_id"
t.bigint "rx_section_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["employer_id"], name: "index_id_card_configurations_on_employer_id"
t.index ["employer_logo_id"], name: "index_id_card_configurations_on_employer_logo_id"
t.index ["network_logo_id"], name: "index_id_card_configurations_on_network_logo_id"
t.index ["provider_section_id"], name: "index_id_card_configurations_on_provider_section_id"
t.index ["rx_section_id"], name: "index_id_card_configurations_on_rx_section_id"
end
create_table "id_card_employer_logos", force: :cascade do |t| create_table "id_card_employer_logos", force: :cascade do |t|
t.string "filename" t.string "filename"
t.binary "image_data" t.binary "image_data"
@@ -71,10 +50,10 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
create_table "id_card_field_exceptions", force: :cascade do |t| create_table "id_card_field_exceptions", force: :cascade do |t|
t.string "exception_type" t.string "exception_type"
t.string "exception_value" t.string "exception_value"
t.bigint "configuration_id", null: false t.bigint "setup_id", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["configuration_id"], name: "index_id_card_field_exceptions_on_configuration_id" t.index ["setup_id"], name: "index_id_card_field_exceptions_on_setup_id"
end end
create_table "id_card_network_logos", force: :cascade do |t| create_table "id_card_network_logos", force: :cascade do |t|
@@ -103,10 +82,10 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.integer "pb_product_key" t.integer "pb_product_key"
t.string "pl_plan_key" t.string "pl_plan_key"
t.boolean "template" t.boolean "template"
t.bigint "configuration_id" t.bigint "setup_id"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["configuration_id"], name: "index_id_card_plans_on_configuration_id" t.index ["setup_id"], name: "index_id_card_plans_on_setup_id"
end end
create_table "id_card_print_data", force: :cascade do |t| create_table "id_card_print_data", force: :cascade do |t|
@@ -247,6 +226,29 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
end end
create_table "id_card_setups", force: :cascade do |t|
t.string "print_name"
t.string "network_provider"
t.string "card_template"
t.string "card_color"
t.string "rx_group_number"
t.string "pl_plan_key"
t.boolean "active", default: false
t.boolean "has_divisions", default: false
t.bigint "employer_id", null: false
t.bigint "employer_logo_id"
t.bigint "network_logo_id"
t.bigint "provider_section_id"
t.bigint "rx_section_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["employer_id"], name: "index_id_card_setups_on_employer_id"
t.index ["employer_logo_id"], name: "index_id_card_setups_on_employer_logo_id"
t.index ["network_logo_id"], name: "index_id_card_setups_on_network_logo_id"
t.index ["provider_section_id"], name: "index_id_card_setups_on_provider_section_id"
t.index ["rx_section_id"], name: "index_id_card_setups_on_rx_section_id"
end
create_table "members", force: :cascade do |t| create_table "members", force: :cascade do |t|
t.string "name" t.string "name"
t.string "family_id" t.string "family_id"
@@ -263,17 +265,17 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.index ["id_card_plan_id"], name: "index_members_on_id_card_plan_id" t.index ["id_card_plan_id"], name: "index_members_on_id_card_plan_id"
end end
add_foreign_key "id_card_configurations", "employers"
add_foreign_key "id_card_configurations", "id_card_employer_logos", column: "employer_logo_id"
add_foreign_key "id_card_configurations", "id_card_network_logos", column: "network_logo_id"
add_foreign_key "id_card_configurations", "id_card_provider_sections", column: "provider_section_id"
add_foreign_key "id_card_configurations", "id_card_rx_sections", column: "rx_section_id"
add_foreign_key "id_card_field_exception_items", "id_card_field_exceptions", column: "field_exception_id" add_foreign_key "id_card_field_exception_items", "id_card_field_exceptions", column: "field_exception_id"
add_foreign_key "id_card_field_exception_items", "id_card_network_logos", column: "network_logo_id" add_foreign_key "id_card_field_exception_items", "id_card_network_logos", column: "network_logo_id"
add_foreign_key "id_card_field_exception_items", "id_card_provider_sections", column: "provider_section_id" add_foreign_key "id_card_field_exception_items", "id_card_provider_sections", column: "provider_section_id"
add_foreign_key "id_card_field_exceptions", "id_card_configurations", column: "configuration_id" add_foreign_key "id_card_field_exceptions", "id_card_setups", column: "setup_id"
add_foreign_key "id_card_plan_benefits", "id_card_plans", column: "plan_id" add_foreign_key "id_card_plan_benefits", "id_card_plans", column: "plan_id"
add_foreign_key "id_card_plans", "id_card_configurations", column: "configuration_id" add_foreign_key "id_card_plans", "id_card_setups", column: "setup_id"
add_foreign_key "id_card_setups", "employers"
add_foreign_key "id_card_setups", "id_card_employer_logos", column: "employer_logo_id"
add_foreign_key "id_card_setups", "id_card_network_logos", column: "network_logo_id"
add_foreign_key "id_card_setups", "id_card_provider_sections", column: "provider_section_id"
add_foreign_key "id_card_setups", "id_card_rx_sections", column: "rx_section_id"
add_foreign_key "members", "employers" add_foreign_key "members", "employers"
add_foreign_key "members", "id_card_plans" add_foreign_key "members", "id_card_plans"
end end
+66 -33
View File
@@ -1,12 +1,10 @@
def determine_id_card_templates(pl_plan_key) def determine_id_card_templates(pl_plan_key)
pl_plan_key = pl_plan_key.to_i
case pl_plan_key case pl_plan_key
when 2 when "2"
"SmartIDCard" "SmartIDCard"
when 3 when "3"
"TandemlocIDCard" "TandemlocIDCard"
when 56 when "56"
"QRCodeIDCard" "QRCodeIDCard"
else else
"FairosRxIDCard" "FairosRxIDCard"
@@ -14,9 +12,7 @@ def determine_id_card_templates(pl_plan_key)
end end
def determine_id_card_rx(pl_plan_key) def determine_id_card_rx(pl_plan_key)
pl_plan_key = pl_plan_key.to_i if pl_plan_key == "56"
if pl_plan_key == 56
"TheHealthBus" "TheHealthBus"
else else
"FairosRx" "FairosRx"
@@ -24,16 +20,14 @@ def determine_id_card_rx(pl_plan_key)
end end
def determine_id_card_network(pl_plan_key) def determine_id_card_network(pl_plan_key)
pl_plan_key = pl_plan_key.to_i cigna_groups = ["13","20","39","48","49","51","53","54","56","58","60","61","62","65","67","68","69"]
medcost_groups = ["4","5","16","23","33","55","57","59","63","66"]
cigna_groups = [13,20,39,48,49,51,53,54,56,58,60,61,62,65,67,68] old_cigna_groups = ["19","21"]
medcost_groups = [4,5,16,23,33,55,57,59,63,66] smart_medcost = ["2"]
old_cigna_groups = [19,21] tan_medcost = ["3"]
smart_medcost = [2]
tan_medcost = [3]
case case
when cigna_groups.include?(pl_plan_key) when cigna_groups.include?(pl_plan_key) || pl_plan_key.blank?
{ provider: "Cigna", network_logo: "CignaLogo.png", provider_section: "Cigna" } { provider: "Cigna", network_logo: "CignaLogo.png", provider_section: "Cigna" }
when medcost_groups.include?(pl_plan_key) when medcost_groups.include?(pl_plan_key)
{ provider: "MedCost", network_logo: "MedcostLogo.png", provider_section: "MedCost" } { provider: "MedCost", network_logo: "MedcostLogo.png", provider_section: "MedCost" }
@@ -47,6 +41,22 @@ def determine_id_card_network(pl_plan_key)
end end
def determine_divisions(pl_plan_key)
if pl_plan_key == "16"
true
else
false
end
end
def determine_card_color(pl_plan_key)
if pl_plan_key == "3"
"blue"
else
"white"
end
end
puts "[**** IMPORT ID CARD TABLES ****]" puts "[**** IMPORT ID CARD TABLES ****]"
## SET UP DEFAULT LEVEL360 PLANS FOR PLAN PICKER ## SET UP DEFAULT LEVEL360 PLANS FOR PLAN PICKER
@@ -109,7 +119,7 @@ default_network_logos = ["CignaLogo.png", "MedCostLogo.png"]
file_names.each do |logo_upload| file_names.each do |logo_upload|
puts "-- #{logo_upload}" puts "-- #{logo_upload}"
new_logo = ImageProcessor.new("logo_files/network/#{logo_upload}", "Network").call new_logo = ImageProcessorService.new("logo_files/network/#{logo_upload}", "Network").call
if default_network_logos.include?(logo_upload) if default_network_logos.include?(logo_upload)
new_logo.default = true new_logo.default = true
end end
@@ -125,14 +135,15 @@ file_names = Dir.children(folder_path)
file_names.each do |logo_upload| file_names.each do |logo_upload|
puts "-- #{logo_upload}" puts "-- #{logo_upload}"
new_logo = ImageProcessor.new("logo_files/employer/#{logo_upload}", "Employer").call new_logo = ImageProcessorService.new("logo_files/employer/#{logo_upload}", "Employer").call
new_logo.active = true new_logo.active = true
new_logo.save new_logo.save
end end
##---------------- Import Employer/Member Setup------------------------------------
puts "[**** IMPORT EMPLOYERS ****]" puts "[**** IMPORT EMPLOYERS ****]"
##---------------- Import Employer/Member (VHCS) ------------------------------------
puts "Importing Employers From VHCS"
Rake::Task["employer:vhcs_sync_all"].invoke Rake::Task["employer:vhcs_sync_all"].invoke
# acentria = Carrier.find_or_create_by!(name: 'Acentria') # acentria = Carrier.find_or_create_by!(name: 'Acentria')
@@ -147,33 +158,55 @@ Rake::Task["employer:vhcs_sync_all"].invoke
# Imports employers and members from VHCS # Imports employers and members from VHCS
# use rake tasks # use rake tasks
puts "[**** UPDATE EMPLOYER ID CARDS CONFIGS ****]" ##---------------- Import Employers (Word Docs) ------------------------------------
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) puts "Importing Employers From Word Docs"
config.network_provider = network_information[:provider] folder_path = Rails.root.join('employer_word_docs')
file_names = Dir.children(folder_path)
file_names.each do |word_doc|
puts "-- Processing #{word_doc}"
new_employer = BenefitsWordDocService::WordDocProcessor.new("employer_word_docs/#{word_doc}").call
if new_employer.save
puts "Imported #{new_employer.name}"
end
end
##---------------- Update ID Card Setups------------------------------------
puts "[**** UPDATE EMPLOYER ID CARD SETUPS ****]"
IdCard::Setup.all.each do |setup|
setup.card_template = determine_id_card_templates(setup.pl_plan_key)
setup.card_color = determine_card_color(setup.pl_plan_key)
setup.has_divisions = determine_divisions(setup.pl_plan_key)
network_information = determine_id_card_network(setup.pl_plan_key)
setup.network_provider = network_information[:provider]
ps = IdCard::ProviderSection.find_by(title: network_information[:provider_section]) ps = IdCard::ProviderSection.find_by(title: network_information[:provider_section])
config.provider_section_id = ps.id setup.provider_section_id = ps.id
nl = IdCard::NetworkLogo.find_by(filename: network_information[:network_logo]) nl = IdCard::NetworkLogo.find_by(filename: network_information[:network_logo])
config.network_logo_id = nl.id setup.network_logo_id = nl.id
rx_title = determine_id_card_rx(config.pl_plan_key) rx_title = determine_id_card_rx(setup.pl_plan_key)
rs = IdCard::RxSection.find_by(title: rx_title) rs = IdCard::RxSection.find_by(title: rx_title)
config.rx_section_id = rs.id setup.rx_section_id = rs.id
employer_name = config.employer.employer_trim_name employer_name = setup.employer.employer_trim_name
name_segments = employer_name.titleize.split name_segments = employer_name.titleize.split
name_segments.each do |segment| name_segments.each do |segment|
logo = IdCard::EmployerLogo.where("filename LIKE ?", "%#{segment}%") logo = IdCard::EmployerLogo.where("filename LIKE ?", "%#{segment}%")
if logo&.first if logo&.first
config.employer_logo = logo.first setup.employer_logo = logo.first
break break
end end
end end
config.active = true if setup.pl_plan_key.present?
config.save setup.active = true
end
setup.save
end end
+73 -60
View File
@@ -7,48 +7,52 @@ namespace :employer do
plan_headers = VhcsRecord.connection.select_all(sql_query) plan_headers = VhcsRecord.connection.select_all(sql_query)
plan_headers.each do |ph| plan_headers.each do |ph|
import_employer = Employer.find_or_create_by!(pl_plan_key: ph['PLPlanKey']) do |em| plan_code = Vhcs::HlPlanCode.find_by(plan_key: ph['PLPlanKey'])
puts "Importing #{ph['ShortDesc'].strip}" if plan_code.present?
em.name = ph['ShortDesc'].strip.titleize import_employer = Employer.find_or_create_by!(pl_plan_key: ph['PLPlanKey']) do |em|
em.plan_id = ph['PlanId'].strip.to_i puts "Importing #{ph['ShortDesc'].strip}"
em.name = ph['ShortDesc'].strip.titleize
em.plan_id = ph['PlanId'].strip.to_i
id_card_templates = determine_id_card_templates(em.pl_plan_key) id_card_templates = determine_id_card_templates(em.pl_plan_key)
# em.single_card_template = id_card_templates[:single_card_template] # em.single_card_template = id_card_templates[:single_card_template]
# em.multiple_card_template = id_card_templates[:multiple_card_template] # em.multiple_card_template = id_card_templates[:multiple_card_template]
id_card_configuration = em.build_id_card_configuration(pl_plan_key: em.pl_plan_key) id_card_setup = em.build_id_card_setup(pl_plan_key: em.pl_plan_key)
plan_code = Vhcs::HlPlanCode.find_by(plan_key: em.pl_plan_key) # plan_code = Vhcs::HlPlanCode.find_by(plan_key: em.pl_plan_key)
em.group_number = plan_code.group_number em.group_number = plan_code.group_number
id_card_configuration.rx_group_number = plan_code.medical_number id_card_setup.rx_group_number = plan_code.medical_number
em.effective_date = plan_code.effect_date.strftime("%m/%d/%Y") em.effective_date = plan_code.effect_date.strftime("%m/%d/%Y")
pb_company_plan = Vhcs::PbCompanyPlans.find_by(pl_plan_key: em.pl_plan_key) pb_company_plan = Vhcs::PbCompanyPlans.find_by(pl_plan_key: em.pl_plan_key)
em.company_pb_entity_key = pb_company_plan.company_pb_entity_key em.company_pb_entity_key = pb_company_plan.company_pb_entity_key
card_print_name = Vhcs::PbEntity.find_by(company_pb_entity_key: em.company_pb_entity_key).last_name card_print_name = Vhcs::PbEntity.find_by(company_pb_entity_key: em.company_pb_entity_key).last_name
id_card_configuration.print_name = em.employer_trim_name(card_print_name) id_card_setup.print_name = em.employer_trim_name(card_print_name)
em.active = true em.active = true
# em.default_network_logo = determine_network_logos(em.pl_plan_key) # em.default_network_logo = determine_network_logos(em.pl_plan_key)
end end
vhcs_plans = Vhcs::PbProduct.where(company_pb_entity_key: import_employer.company_pb_entity_key) plan_codes = Vhcs::HlEgglestonCardBenefit.where(plan_key: import_employer.pl_plan_key).pluck(:plan_id).uniq
vhcs_plans.each do |vp| vhcs_plans = Vhcs::PbProduct.where(pb_product_key: plan_codes, is_active: 255)
puts "~~ Importing #{vp.short_description}" vhcs_plans.each do |vp|
import_plan = import_employer.id_card_configuration.plans.find_or_create_by!(pb_product_key: vp.pb_product_key) do |pl| puts "~~ Importing #{vp.short_description}"
pl.title = vp.short_description import_plan = import_employer.id_card_setup.plans.find_or_create_by!(pb_product_key: vp.pb_product_key) do |pl|
pl.pl_plan_key = import_employer.pl_plan_key pl.title = vp.short_description
pl.template = false pl.pl_plan_key = import_employer.pl_plan_key
end pl.template = false
#Find where benefits info comes from for plplankeys ["2", "3", "5", "13", "16", "19", "20", "21", "33", "49"] end
vhcs_plan_benefits = Vhcs::HlEgglestonCardBenefit.where(plan_id: import_plan.pb_product_key) #Find where benefits info comes from for plplankeys ["2", "3", "5", "13", "16", "19", "20", "21", "33", "49"]
vhcs_plan_benefits.each do |vb| vhcs_plan_benefits = Vhcs::HlEgglestonCardBenefit.where(plan_id: import_plan.pb_product_key)
import_benefit = import_plan.plan_benefits.find_by(sequence: vb.sequence) vhcs_plan_benefits.each do |vb|
import_benefit.update(benefit: vb.benefit) import_benefit = import_plan.plan_benefits.find_by(sequence: vb.sequence)
end import_benefit.update(benefit: vb.benefit)
end
end
end end
end end
end end
@@ -65,36 +69,45 @@ namespace :employer do
vw_mb_members_count = vw_mb_members.length vw_mb_members_count = vw_mb_members.length
vw_mb_members.each_with_index do |vwm, i| vw_mb_members.each_with_index do |vwm, i|
Member.find_or_create_by!(mb_member_key: vwm.mb_member_key) do |me|
me.name = vwm.full_name_last_name_first.titleize
me.pb_entity_key = vwm.pb_entity_key
me.family_id = vwm.family_id
me.pl_plan_key = vwm.pl_plan_key
me.employer = employer
card_display_name = Vhcs::PbEntity.find_by(pb_entity_key: me.pb_entity_key).full_name participation = Vhcs::PbProductParticipation.joins('INNER JOIN "PBCoveredEntities" ON "PBProductParticipation"."PBProductParticipationKey" = "PBCoveredEntities"."PBProductParticipationKey"').where('"PBCoveredEntities"."PBEntityKey" = ?', vwm.pb_entity_key).last
me.id_card_display_name = card_display_name
if participation.present?
in_effect = participation.in_effect
out_of_effect = participation.out_of_effect
if me.pl_plan_key == '16' if in_effect <= (Date.today + 90.days) && (out_of_effect - 1.day) > Date.today && out_of_effect > in_effect
division = Vhcs::PbEntity.joins(' Member.find_or_create_by!(mb_member_key: vwm.mb_member_key) do |me|
INNER JOIN "PBAffiliation" ON "PBAffiliation"."ParentPBEntityKey" = "PBEntity"."PBEntityKey" me.name = vwm.full_name_last_name_first.titleize
INNER JOIN "PBProductParticipation" ON "PBProductParticipation"."PBAffiliationKey" = "PBAffiliation"."PBAffiliationKey" me.pb_entity_key = vwm.pb_entity_key
INNER JOIN "PBCoveredEntities" ON "PBProductParticipation"."PBProductParticipationKey" = "PBCoveredEntities"."PBProductParticipationKey" me.family_id = vwm.family_id
').where('"PBCoveredEntities"."PBEntityKey" = ?', me.pb_entity_key).uniq.first.last_name me.pl_plan_key = vwm.pl_plan_key
me.division = division me.employer = employer
end
pb_product = Vhcs::PbProduct.joins('INNER JOIN "PBProductAvailability" ON "PBProductAvailability"."PBProductKey" = "PBProduct"."PBProductKey" INNER JOIN "PBProductParticipation" ON "PBProductParticipation"."PBProductAvailabilityKey" = "PBProductAvailability"."PBProductAvailabilityKey" INNER JOIN "PBCoveredEntities" ON "PBProductParticipation"."PBProductParticipationKey" = "PBCoveredEntities"."PBProductParticipationKey"').where('"PBCoveredEntities"."PBEntityKey" = ?', me.pb_entity_key).first card_display_name = Vhcs::PbEntity.find_by(pb_entity_key: me.pb_entity_key).full_name
if pb_product me.id_card_display_name = card_display_name
plan_pb_product_key = pb_product.pb_product_key
if plan = IdCard::Plan.find_by(pb_product_key: plan_pb_product_key) if employer.id_card_setup.has_divisions
me.id_card_plan = plan division = Vhcs::PbEntity.joins('
INNER JOIN "PBAffiliation" ON "PBAffiliation"."ParentPBEntityKey" = "PBEntity"."PBEntityKey"
INNER JOIN "PBProductParticipation" ON "PBProductParticipation"."PBAffiliationKey" = "PBAffiliation"."PBAffiliationKey"
INNER JOIN "PBCoveredEntities" ON "PBProductParticipation"."PBProductParticipationKey" = "PBCoveredEntities"."PBProductParticipationKey"
').where('"PBCoveredEntities"."PBEntityKey" = ?', me.pb_entity_key).uniq.first.last_name
me.division = division
end
pb_product = Vhcs::PbProduct.joins('INNER JOIN "PBProductAvailability" ON "PBProductAvailability"."PBProductKey" = "PBProduct"."PBProductKey" INNER JOIN "PBProductParticipation" ON "PBProductParticipation"."PBProductAvailabilityKey" = "PBProductAvailability"."PBProductAvailabilityKey" INNER JOIN "PBCoveredEntities" ON "PBProductParticipation"."PBProductParticipationKey" = "PBCoveredEntities"."PBProductParticipationKey"').where('"PBCoveredEntities"."PBEntityKey" = ?', me.pb_entity_key).first
if pb_product
plan_pb_product_key = pb_product.pb_product_key
if plan = IdCard::Plan.find_by(pb_product_key: plan_pb_product_key)
me.id_card_plan = plan
end
end end
end end
puts "Employer #{employer.name} (#{i}/#{vw_mb_members_count}) members processed"
end end
puts "Employer #{employer.name} (#{i}/#{vw_mb_members_count}) members imported" end
end end
end end
end end