Employers working - onboarding to card print
CI / scan_ruby (push) Failing after 10m41s
CI / lint (push) Failing after 7m31s
CI / test (push) Failing after 8m29s
Docker / build-and-test-image (push) Failing after 11m32s

This commit is contained in:
Jason Jordan
2026-01-15 11:37:50 -05:00
parent 0464ba8929
commit 4fac3b1036
108 changed files with 4113 additions and 431 deletions
+2
View File
@@ -86,3 +86,5 @@ gem 'docx'
gem 'rubyzip'
gem 'httparty'
gem 'combine_pdf'
gem 'rails_icons'
gem 'fastimage'
+6
View File
@@ -125,6 +125,7 @@ GEM
drb (2.2.3)
erb (5.1.3)
erubi (1.13.1)
fastimage (2.4.0)
globalid (1.3.0)
activesupport (>= 6.1)
httparty (0.23.2)
@@ -246,6 +247,9 @@ GEM
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails_icons (1.5.1)
nokogiri (~> 1.16, >= 1.16.4)
rails (>= 7.0)
railties (7.2.3)
actionpack (= 7.2.3)
activesupport (= 7.2.3)
@@ -405,6 +409,7 @@ DEPENDENCIES
combine_pdf
devise
docx
fastimage
httparty
importmap-rails
jbuilder
@@ -413,6 +418,7 @@ DEPENDENCIES
pundit
rack-mini-profiler
rails (~> 7.2)
rails_icons
rspec-rails
rubocop-rails
rubocop-rails-omakase
@@ -0,0 +1,57 @@
class CardLogoFilesController < ApplicationController
def index
end
def show
end
def image
logo_file = CardLogoFile.find_by(filename: params[:id])
puts params[:id]
logo_binary = logo_file.image_data
logo_filename = logo_file.filename
logo_file_type = logo_file.content_type
send_data logo_binary,
filename: logo_filename,
# type: logo_file_type,
disposition: 'inline'
end
def new
end
def create
file = card_logo_file_params["logo_file"]
if file.present? && file.is_a?(ActionDispatch::Http::UploadedFile)
filename = file.original_filename
# binary_data = file.read
binary_data = File.binread(file)
meme_type = Marcel::MimeType.for(file)
CardLogoFile.create(
filename: filename,
image_data: binary_data,
content_type: meme_type,
logo_type: card_logo_file_params["logo_type"]
)
end
end
def edit
end
def update
end
def destroy
end
private
def card_logo_file_params
params.require(:card_logo_file).permit(:logo_file, :logo_type)
end
end
@@ -0,0 +1,70 @@
class CardProvidersController < ApplicationController
before_action :set_card_provider, only: %i[ show edit update destroy ]
# GET /card_providers or /card_providers.json
def index
@card_providers = CardProvider.all
end
# GET /card_providers/1 or /card_providers/1.json
def show
end
# GET /card_providers/new
def new
@card_provider = CardProvider.new
end
# GET /card_providers/1/edit
def edit
end
# POST /card_providers or /card_providers.json
def create
@card_provider = CardProvider.new(card_provider_params)
respond_to do |format|
if @card_provider.save
format.html { redirect_to @card_provider, notice: "Card provider was successfully created." }
format.json { render :show, status: :created, location: @card_provider }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @card_provider.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /card_providers/1 or /card_providers/1.json
def update
respond_to do |format|
if @card_provider.update(card_provider_params)
format.html { redirect_to @card_provider, notice: "Card provider was successfully updated.", status: :see_other }
format.json { render :show, status: :ok, location: @card_provider }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @card_provider.errors, status: :unprocessable_entity }
end
end
end
# DELETE /card_providers/1 or /card_providers/1.json
def destroy
@card_provider.destroy!
respond_to do |format|
format.html { redirect_to card_providers_path, notice: "Card provider was successfully destroyed.", status: :see_other }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_card_provider
@card_provider = CardProvider.find(params[:id])
end
# Only allow a list of trusted parameters through.
def card_provider_params
params.require(:card_provider).permit(:provider_code, :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :mail_to, :mail_to_2, :contact_line_1, :contact_line_2, :contact_line_3, :group_number, :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, :provider_line_6, :provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :rx_group_id, :rx_contact, :provider_lookup_1, :provider_lookup_2, :precert_1, :precert_2, :precert_3, :precert_4, :precert_5, :precert_6, :provider_line_12, :claim_to_12)
end
end
+70
View File
@@ -0,0 +1,70 @@
class CardRxesController < ApplicationController
before_action :set_card_rx, only: %i[ show edit update destroy ]
# GET /card_rxes or /card_rxes.json
def index
@card_rxes = CardRx.all
end
# GET /card_rxes/1 or /card_rxes/1.json
def show
end
# GET /card_rxes/new
def new
@card_rx = CardRx.new
end
# GET /card_rxes/1/edit
def edit
end
# POST /card_rxes or /card_rxes.json
def create
@card_rx = CardRx.new(card_rx_params)
respond_to do |format|
if @card_rx.save
format.html { redirect_to @card_rx, notice: "Card rx was successfully created." }
format.json { render :show, status: :created, location: @card_rx }
else
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @card_rx.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /card_rxes/1 or /card_rxes/1.json
def update
respond_to do |format|
if @card_rx.update(card_rx_params)
format.html { redirect_to @card_rx, notice: "Card rx was successfully updated.", status: :see_other }
format.json { render :show, status: :ok, location: @card_rx }
else
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @card_rx.errors, status: :unprocessable_entity }
end
end
end
# DELETE /card_rxes/1 or /card_rxes/1.json
def destroy
@card_rx.destroy!
respond_to do |format|
format.html { redirect_to card_rxes_path, notice: "Card rx was successfully destroyed.", status: :see_other }
format.json { head :no_content }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_card_rx
@card_rx = CardRx.find(params[:id])
end
# Only allow a list of trusted parameters through.
def card_rx_params
params.require(:card_rx).permit(:help_desk, :customer_service, :web_url)
end
end
+93 -2
View File
@@ -1,24 +1,54 @@
class EmployerSetupController < ApplicationController
def index
@employer_setups = EmployerSetupProcess.all
end
def show
end
def new
@employer_setup = EmployerSetupProcess.new
@employer_setup.plans.build
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
render 'employer_setup/employer_information'
render :new
end
def import
word_doc = params[:employer_setup_process][:import_from_word]
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile)
@employer_setup = BenefitsWordDocProcessor.new(word_doc.tempfile).call
render :edit
else
@employer_setup = EmployerSetupProcess.new
@employer_setup.plans.build
render :new
end
end
def create
employer_setup_process_params = EmployerSetupProcess.permitted_params(params)
puts "---Params---"
puts employer_setup_process_params
# post_image_processing_params = process_logos(employer_setup_process_params)
@employer_setup = EmployerSetupProcess.new(employer_setup_process_params)
if @employer_setup.save
# update_logos_with_employer_setup_information()
redirect_to @employer_setup, notice: 'Employer Setup Process initiated'
else
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
render 'employer_setup/employer_information'
render :new
end
end
def edit
@employer_setup = EmployerSetupProcess.find_by(slug: params[:id])
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
render :edit
# @resource = Resource.find(params[:id])
end
def update
@form = RegistrationForm.new(registration_params)
@@ -31,8 +61,69 @@ class EmployerSetupController < ApplicationController
render :new
end
def destroy
# @resource = Resource.find(params[:id])
# @resource.destroy
# redirect_to resources_url, notice: 'Resource was successfully destroyed.'
end
private
def process_logos(employer_setup_process_params)
@uploaded_logos = []
employer_logo = employer_setup_process_params["employer_logo"]
if employer_logo.present? && employer_logo.is_a?(ActionDispatch::Http::UploadedFile)
filename = employer_logo.original_filename
binary_data = employer_logo.read
meme_type = Marcel::MimeType.for(employer_logo)
CardLogoFile.create(
filename: filename,
image_data: binary_data,
content_type: meme_type,
logo_type: "employer"
)
@uploaded_logos.push(filename)
employer_setup_process_params["employer_logo"] = filename
end
network_logos = employer_setup_process_params["alternate_network_logos_attributes"]
if network_logos.present?
network_logos.each do |alt|
network_logo = alt.last["network_logo"]
if network_logo.present? && network_logo.is_a?(ActionDispatch::Http::UploadedFile)
filename = network_logo.original_filename
binary_data = network_logo.read
meme_type = Marcel::MimeType.for(network_logo)
CardLogoFile.create(
filename: filename,
image_data: binary_data,
content_type: meme_type,
logo_type: "network"
)
@uploaded_logos.push(filename)
end
alt.last["network_logo"] = @uploaded_logos.last
end
end
employer_setup_process_params
end
def update_logos_with_employer_setup_information()
@uploaded_logos.each do |logo|
logo_file = CardLogoFile.find_by(filename: logo)
if logo_file.present? && @employer_setup.present?
logo_file.employer_setup_process = @employer_setup
logo_file.save
end
end
end
# def general_information_params
# params.require(:employer_setup_general_information_form).permit(
# :name,
+259
View File
@@ -0,0 +1,259 @@
class EmployersController < ApplicationController
def index
@employers = Employer.all
end
def show
@employer = Employer.find_by(slug: params[:id])
end
def new
@employer = Employer.new
@employer.build_plan_with_default_benefits
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
render :new
end
def import
word_doc = params[:employer][:import_from_word]
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
if word_doc.present? && word_doc.is_a?(ActionDispatch::Http::UploadedFile)
@employer = BenefitsWordDocProcessor.new(word_doc.tempfile).call
else
@employer = Employer.new
@employer.build_plan_with_default_benefits
end
render :new
end
def create
employer_params = Employer.permitted_params(params)
puts "---Params---"
puts employer_params
# post_image_processing_params = process_logos(employer_setup_process_params)
@employer = Employer.new(employer_params)
if @employer.save
# update_logos_with_employer_setup_information()
redirect_to employer_path(@employer.slug), notice: 'Employer Saved'
else
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
render :new
end
end
def edit
@employer = Employer.find_by(slug: params[:id])
@plan_templates = IdCardBenefitsTemplate.where.not(title: "BLANK")
render :edit
# @resource = Resource.find(params[:id])
end
def update
puts "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
employer_params = Employer.permitted_params(params)
@employer = Employer.find(params[:id])
if @employer.update(employer_params)
puts "sucess"
redirect_to employer_path(@employer.slug), notice: 'Employer was successfully updated.'
else
puts "fail"
render :edit, status: :unprocessable_entity
end
end
def destroy
# @resource = Resource.find(params[:id])
# @resource.destroy
# redirect_to resources_url, notice: 'Resource was successfully destroyed.'
end
private
# def process_logos(employer_setup_process_params)
# @uploaded_logos = []
# employer_logo = employer_setup_process_params["employer_logo"]
# if employer_logo.present? && employer_logo.is_a?(ActionDispatch::Http::UploadedFile)
# filename = employer_logo.original_filename
# binary_data = employer_logo.read
# meme_type = Marcel::MimeType.for(employer_logo)
# CardLogoFile.create(
# filename: filename,
# image_data: binary_data,
# content_type: meme_type,
# logo_type: "employer"
# )
# @uploaded_logos.push(filename)
# employer_setup_process_params["employer_logo"] = filename
# end
# network_logos = employer_setup_process_params["alternate_network_logos_attributes"]
# if network_logos.present?
# network_logos.each do |alt|
# network_logo = alt.last["network_logo"]
# if network_logo.present? && network_logo.is_a?(ActionDispatch::Http::UploadedFile)
# filename = network_logo.original_filename
# binary_data = network_logo.read
# meme_type = Marcel::MimeType.for(network_logo)
# CardLogoFile.create(
# filename: filename,
# image_data: binary_data,
# content_type: meme_type,
# logo_type: "network"
# )
# @uploaded_logos.push(filename)
# end
# alt.last["network_logo"] = @uploaded_logos.last
# end
# end
# employer_setup_process_params
# end
# def update_logos_with_employer_setup_information()
# @uploaded_logos.each do |logo|
# logo_file = CardLogoFile.find_by(filename: logo)
# if logo_file.present? && @employer.present?
# logo_file.employer_setup_process = @employer
# logo_file.save
# end
# end
# end
# def general_information_params
# params.require(:employer_setup_general_information_form).permit(
# :name,
# :employer_logo,
# :group_number,
# :dental,
# :pl_plan_key,
# :effect_date,
# :number_of_plans,
# :network,
# :number_of_additional_network_logos
# )
# end
# def plans_params
# params.require(:employer_setup_plans_form).permit(
# plans: permited_plans_keys,
# benefit_descs: benefit_sequence_keys
# )
# end
# def network_exceptions_params
# params.require(:employer_setup_network_exceptions_form).permit(
# network_exceptions: [:network_logo, exceptions: [:type, :value]],
# )
# end
# def form_for_step
# step_name = @top_form.current_step
# form_method = "EmployerSetup#{step_name.camelize}Form".constantize
# # puts "/////\\\\\\||||||"
# # puts session[:employer_setup_data]
# # puts session[:employer_setup_data]['employer_setup_process_id']
# puts form_method
# form_method.new(session[:employer_setup_data]['employer_setup_process_id'])
# end
# def process_step(step_name)
# @form_method = "EmployerSetup#{step_name.camelize}Form".constantize
# session_data_name = "#{step_name}_data"
# # puts "1--------------params----"
# # puts params
# # puts "8--------------session----"
# # puts session[:employer_setup_data]
# employer_setup_process_id = session[:employer_setup_data]['employer_setup_process_id']
# # puts session[:employer_setup_data]
# puts "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
# puts params
# @form = @form_method.new(employer_setup_process_id, params)
# if @form.pl_plan_key.blank?
# @form.pl_plan_key = session[:employer_setup_data]['pl_plan_key']
# end
# if @form.valid? && @form.save
# pl_plan_key = @top_form.pl_plan_key || @form.pl_plan_key
# # session[:employer_setup_data].merge!({current_step: step_name, pl_plan_key: pl_plan_key})
# # form_fields = @form.attributes.merge!(global_params(step_name))
# # session[:employer_setup_data][session_data_name] = form_fields
# # session[:employer_setup_data].merge!(global_params(step_name))
# # puts session[:employer_setup_data][session_data_name]
# true
# else
# false
# end
# end
# def step_params(step_name)
# form_name_sym = "employer_setup_#{step_name}_form".to_sym
# params.require(form_name_sym).permit(@form_method.permitted_params)
# end
# def global_params(step_name)
# form_name_sym = "employer_setup_#{step_name}_form".to_sym
# params.require(form_name_sym).permit(EmployerSetupForm.permitted_params)
# end
# def process_step(step_name)
# form_name = "employer_setup_#{step_name}_form".camelize.constantize
# form_params_name = "#{step_name}_params".to_sym
# allowed_params = [:general_information_params, :plans_params, :network_exceptions_params]
# if allowed_params.include?(form_params_name)
# form_params = send(form_params_name)
# @form = form_name.new(form_params)
# if @form.valid?
# session[:employer_setup_data]["#{step_name}_data"] = form_params
# true
# else
# false
# end
# end
# false
# end
# def employer_setup_params
# params.require(:employer_setup_form).permit(
# :current_step,
# :name,
# :employer_logo,
# :group_number,
# :pl_plan_key,
# :effect_date,
# :number_of_plans,
# :network,
# :number_of_additional_network_logos,
# network_exceptions: [:network_logo, exceptions: [:type, :value]],
# plans: permited_plans_keys,
# benefit_descs: benefit_sequence_keys
# )
# end
# def benefit_sequence_keys
# (1..14).map { |i| i.to_s.to_sym }
# end
# def permited_plans_keys
# benefit_sequence_keys.push(:plan_id)
# end
# def plans_params
# plans_keys = params[:plans]&.keys || []
# plans_keys.each_with_object({}) do |key, hash|
# if key == 'benefit_descs' || key.match?(/^plan_\d$/)
# hash[key.to_sym] = permited_plan_param_list
# end
# end
# end
# def permited_plan_param_list
# (1..14).map { |i| i.to_s.to_sym }.push(:plan_id)
# end
end
@@ -0,0 +1,25 @@
class SampleIdCardsController < ApplicationController
def generate_sample
@employer = Employer.find_by(slug: params[:employer_slug])
sample_cards_pdf = SampleCardGenerator.new(@employer).call
send_data sample_cards_pdf.to_pdf,
filename: "#{@employer.name.parameterize(separator: "_")}_sample_cards_#{Date.today}.pdf",
type: "application/pdf",
disposition: 'attachment'
end
def generate_print
@employer = Employer.find_by(slug: params[:employer_slug])
sample_cards_pdf = EmployerCardsGenerator.new(@employer).call
send_data sample_cards_pdf.to_pdf,
filename: "#{@employer.name.parameterize(separator: "_")}_print_cards_#{Date.today}.pdf",
type: "application/pdf",
disposition: 'attachment'
end
end
@@ -36,6 +36,12 @@ class TailwindFormBuilder < ActionView::Helpers::FormBuilder
labels + field
end
def file_field(method, options = {})
options[:class] = Array(options[:class]) << "block w-full px-1 py-[1px] text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100"
# You can add more classes as needed for padding, margin, etc., e.g., p-2.5
super(method, options)
end
private
def text_like_field(field_method, object_method, options = {})
+1 -1
View File
@@ -2,7 +2,7 @@ class EmployerSetupPlansForm
include ActiveModel::Model
include ActiveModel::Attributes
PLAN_COLORS = ['atmosphere', 'verdigris', 'cobalt', 'bluemana']
PLAN_COLORS = ['atmosphere', 'verdigris', 'bluemana', 'cobalt']
attribute :plans, array: true, default: -> { [Plan.new] }
attribute :pl_plan_key, :string
@@ -16,6 +16,20 @@ export default class extends Controller {
// this.containerTarget.insertAdjacentHTML("beforeend", content)
}
remove(event) {
event.preventDefault();
const wrapper = event.target.closest(".network-item");
if (wrapper.dataset.newRecord === "true") {
wrapper.remove();
} else {
wrapper.style.display = "none";
const destroyInput = wrapper.querySelector("input[name*='[_destroy]']");
if (destroyInput) {
destroyInput.value = "1";
}
}
}
#updateTemplateNetwork() {
const nextIndex = this.networkLogoTargets.length
const num_of_colors = this.formColorValue.length
@@ -17,6 +17,20 @@ export default class extends Controller {
}
remove(event) {
event.preventDefault();
const wrapper = event.target.closest(".plan-item");
if (wrapper.dataset.newRecord === "true") {
wrapper.remove();
} else {
wrapper.style.display = "none";
const destroyInput = wrapper.querySelector("input[name*='[_destroy]']");
if (destroyInput) {
destroyInput.value = "1";
}
}
}
#updateTemplatePlan() {
const nextIndex = this.planTargets.length
const num_of_colors = this.formColorValue.length
@@ -0,0 +1,119 @@
import { Controller } from "@hotwired/stimulus";
export default class extends Controller {
static targets = ["preview", "previewContainer", "logoSelect", "logofield", "initialLogoFile"];
async connect() {
console.log(this.logofieldTarget.value)
if (this.logofieldTarget.value.includes("Logo.")) {
const response = await fetch(`/card_logo_files/${this.logofieldTarget.value}/image`); // Fetch the binary data
const blob = await response.blob();
const objectUrl = URL.createObjectURL(blob);
this.previewTarget.src = objectUrl;
this.previewContainerTarget.classList.remove("hidden");
}
// Remember to revoke the URL when the controller is disconnected if necessary
// this.disconnect = () => URL.revokeObjectURL(objectUrl);
}
uploadLogo(event) {
console.log('in uploadLogo');
event.preventDefault()
const file = event.target.files[0];
if (!file) return;
const logoType = event.params.type
let newFileName = file.name
if (logoType == "network") {
console.log("n " + newFileName);
newFileName = this.determineNetworkFilename(file)
this.addOptionToSelect(newFileName)
} else if (logoType == "employer") {
newFileName = this.determineEmployerFilename(file)
this.logofieldTarget.value = newFileName;
}
this.previewFile(file);
// this.uploadLogoToServer(file);
}
previewFile(file) {
console.log('in previewFile');
const reader = new FileReader();
reader.onload = (e) => {
this.previewTarget.src = e.target.result;
this.previewContainerTarget.classList.remove("hidden");
};
reader.readAsDataURL(file);
}
async uploadLogoToServer(file) {
console.log('in uploadLogoToServer');
const formData = new FormData();
formData.append("card_logo_file[logo_file]", file);
formData.append("card_logo_file[logo_type]", "employer");
const csrfToken = document.querySelector("meta[name='csrf-token']").content;
try {
const response = await fetch("/card_logo_files/", {
method: "POST",
headers: {
"X-CSRF-Token": csrfToken
},
body: formData
});
if (response.ok) {
console.log('Upload successful!')
} else {
console.error("Failed to track event.");
}
} catch (error) {
console.error("Network error:", error);
}
}
addOptionToSelect(name) {
const blankOptionIndex = 0;
const newOption = new Option(name, name, true, true)
if (this.logoSelectTarget.options.length > blankOptionIndex + 1) {
this.logoSelectTarget.insertBefore(newOption, this.logoSelectTarget.options[blankOptionIndex + 1]);
} else {
this.logoSelectTarget.appendChild(newOption);
}
this.logoSelectTarget.value = name;
}
determineNetworkFilename(file) {
const fileExtension = file.name.split('.').pop();
const primaryNetworkName = prompt("Enter the name for the primary network (Usually 'Cigna' or 'MedCost':");
const secondaryNetworkName = prompt("Enter the name for the primary network (ex: Health Partners):");
const logoFilename = this.titleizeText(primaryNetworkName).concat(this.titleizeText(secondaryNetworkName)).concat("Logo.").concat(fileExtension).replaceAll(' ', '');
return logoFilename
}
determineEmployerFilename(file) {
const fileExtension = file.name.split('.').pop();
const employerName = prompt("Enter the name for the new Employer (minus any 'The's, 'LLC', or 'Health Plan'):");
const logoFilename = this.titleizeText(employerName).concat("Logo.").concat(fileExtension).replaceAll(' ', '');
return logoFilename
}
titleizeText(text) {
const titleized = text.toLowerCase();
return titleized.replace(/(^|\s)\S/g, function(match) {
return match.toUpperCase();
});
}
}
@@ -1,10 +1,10 @@
class AlternativeNetworkLogo < ApplicationRecord
belongs_to :employer_setup_process
class AlternateNetworkLogo < ApplicationRecord
belongs_to :employer
before_save :process_network_logo
# before_save :process_network_logo
def process_network_logo
unless self.network_logo.is_a?(String)
if self.network_logo.present? && !self.network_logo.is_a?(String)
self.employer_setup_process.card_logo_files.new(
filename: self.network_logo.filename,
logo_type: 'network',
+1 -1
View File
@@ -3,5 +3,5 @@
class ApplicationRecord < ActiveRecord::Base
primary_abstract_class
establish_connection :dev_tools
establish_connection :baclight
end
-83
View File
@@ -1,83 +0,0 @@
module BrittonWeb
class SampleIdCards < BrittonWebRecord
self.table_name = 'sample_id_cards'
alias_attribute :id, :id
alias_attribute :full_name, :full_name
alias_attribute :family_id, :family_id
alias_attribute :primary_mb_member_key, :primary_mb_member_key
alias_attribute :employer_name, :employer_name
alias_attribute :pl_plan_key, :pl_plan_key -moved to esp/not used in template
alias_attribute :group_number, :group_number
alias_attribute :rx_group, :rx_group
alias_attribute :network_image, :network_image -moved to esp/not used in template
alias_attribute :medical_eff_date, :medical_eff_date
alias_attribute :provider_code, :provider_code
alias_attribute :provider_line_1, :provider_line_1
alias_attribute :provider_line_2, :provider_line_2
alias_attribute :provider_line_3, :provider_line_3
alias_attribute :provider_line_4, :provider_line_4
alias_attribute :provider_line_5, :provider_line_5
alias_attribute :provider_line_6, :provider_line_6
alias_attribute :provider_line_7, :provider_line_7
alias_attribute :provider_line_8, :provider_line_8
alias_attribute :provider_line_9, :provider_line_9
alias_attribute :provider_line_10, :provider_line_10
alias_attribute :provider_line_11, :provider_line_11
alias_attribute :mail_to, :mail_to - dont need/not used in template
alias_attribute :claim_to_1, :claim_to_1
alias_attribute :claim_to_2, :claim_to_2
alias_attribute :claim_to_3, :claim_to_3
alias_attribute :claim_to_4, :claim_to_4
alias_attribute :claim_to_5, :claim_to_5
alias_attribute :claim_to_6, :claim_to_6
alias_attribute :claim_to_7, :claim_to_7
alias_attribute :claim_to_8, :claim_to_8
alias_attribute :claim_to_9, :claim_to_9
alias_attribute :claim_to_10, :claim_to_10
alias_attribute :claim_to_11, :claim_to_11
alias_attribute :customer_service, :customer_service
alias_attribute :web_url, :web_url
alias_attribute :dependent_1, :dependent_1 - keep for now
alias_attribute :dependent_2, :dependent_2
alias_attribute :dependent_3, :dependent_3
alias_attribute :dependent_4, :dependent_4
alias_attribute :dependent_5, :dependent_5
alias_attribute :dependent_6, :dependent_6
alias_attribute :dependent_7, :dependent_7
alias_attribute :dependent_8, :dependent_8
alias_attribute :benefit_desc_1, :benefit_desc_1
alias_attribute :benefit_1, :benefit_1
alias_attribute :benefit_desc_2, :benefit_desc_2
alias_attribute :benefit_2, :benefit_2
alias_attribute :benefit_desc_3, :benefit_desc_3
alias_attribute :benefit_3, :benefit_3
alias_attribute :benefit_desc_4, :benefit_desc_4
alias_attribute :benefit_4, :benefit_4
alias_attribute :benefit_desc_5, :benefit_desc_5
alias_attribute :benefit_5, :benefit_5
alias_attribute :benefit_desc_6, :benefit_desc_6
alias_attribute :benefit_6, :benefit_6
alias_attribute :benefit_desc_7, :benefit_desc_7
alias_attribute :benefit_7, :benefit_7
alias_attribute :benefit_desc_8, :benefit_desc_8
alias_attribute :benefit_8, :benefit_8
alias_attribute :benefit_desc_9, :benefit_desc_9
alias_attribute :benefit_9, :benefit_9
alias_attribute :benefit_desc_10, :benefit_desc_10
alias_attribute :benefit_10, :benefit_10
alias_attribute :benefit_desc_11, :benefit_desc_11
alias_attribute :benefit_11, :benefit_11
alias_attribute :benefit_desc_12, :benefit_desc_12
alias_attribute :benefit_12, :benefit_12
alias_attribute :benefit_desc_13, :benefit_desc_13
alias_attribute :benefit_13, :benefit_13
alias_attribute :benefit_desc_14, :benefit_desc_14
alias_attribute :benefit_14, :benefit_14
alias_attribute :created_at, :created_at
alias_attribute :updated_at, :updated_at
end
end
+2 -1
View File
@@ -1,3 +1,4 @@
class CardLogoFile < ApplicationRecord
belongs_to :employer_setup_process, optional: true
has_many :employer_card_logos, dependent: :destroy
has_many :employers, through: :employer_card_logos
end
+3
View File
@@ -0,0 +1,3 @@
class CardProvider < ApplicationRecord
has_many :employers
end
+3
View File
@@ -0,0 +1,3 @@
class CardRx < ApplicationRecord
has_many :employers
end
+155
View File
@@ -0,0 +1,155 @@
class Employer < ApplicationRecord
has_many :members
has_many :plans, dependent: :destroy
accepts_nested_attributes_for :plans, allow_destroy: true, reject_if: :all_blank
has_many :alternate_network_logos, dependent: :destroy
accepts_nested_attributes_for :alternate_network_logos, allow_destroy: true, reject_if: :all_blank
has_many :employer_card_logos, dependent: :destroy
accepts_nested_attributes_for :employer_card_logos
has_many :card_logo_files, through: :employer_card_logos
has_one :employer_brand_logo, -> { where(logo_type: 'employer') },
class_name: 'EmployerCardLogo',
dependent: :destroy
has_one :employer_logo, through: :employer_brand_logo, source: :card_logo_file
has_many :network_images, -> { where(logo_type: 'network') },
class_name: 'EmployerCardLogo',
dependent: :destroy
has_many :network_logos, through: :network_images, source: :card_logo_file
belongs_to :card_provider, optional: true
belongs_to :card_rx, optional: true
scope :active, -> { where(active: true) }
scope :inactive, -> { where(active: false) }
# before_save :process_employer_logo
# before_save :process_employer_logo, if: :employer_logo_filename_changed?
before_save :create_slug, if: :new_record?
after_save :process_employer_logo, if: :saved_change_to_employer_logo_filename?
def process_employer_logo
# if self.employer_logo.present? && !self.employer_logo.is_a?(String)
# self.card_logo_files.new(
# filename: self.employer_logo.filename,
# logo_type: 'employer',
# image: self.employer_logo.data,
# pl_plan_key: self.pl_plan_key || ""
# )
# end
if self.employer_logo_filename.present? && self.employer_logo_filename.is_a?(String)
image_file = CardLogoFile.find_by(filename: self.employer_logo_filename)
if image_file.present?
if self.employer_brand_logo.present?
self.employer_brand_logo.update(card_logo_file: image_file)
else
self.create_employer_brand_logo(card_logo_file: image_file, logo_type: 'employer')
end
end
end
end
def create_slug
self.slug = employer_trim_name(self.name).parameterize
end
def name_to_logo_filename(extension)
self.employer_trim_name(self.name).titleize.gsub(/\s+/, '').concat('Logo').concat(extension.downcase)
end
def employer_trim_name(name)
regex_source = Regexp.union(["health", "plan", "the", "inc", "llc"]).source
case_insensitive_regex = Regexp.new(regex_source, "i")
name.gsub(case_insensitive_regex, "").squish
end
def self.permitted_params(params)
params.require(:employer).permit(
:name,
:group_number,
:pl_plan_key,
:effective_date,
:employer_logo_filename,
:network_provider,
:default_network_logo,
:single_card_template,
:card_provider_id,
:card_rx_id,
plans_attributes: [
:id,
:title,
:pb_product_key,
:_destroy,
plan_benefits_attributes: [
:id,
:benefit_desc,
:benefit,
:sequence,
:_destroy,
]
],
alternate_network_logos_attributes: [
:id,
:network_logo,
:exception_type,
:exception_value,
:_destroy
]
)
end
def save_to_prod
VhcsRecord.transaction do
Vhcs::HlPlanCode.create!(
group_number: self.group_number,
medical_number: self.group_number,
dental_number: '',
plan_key: self.pl_plan_key,
effect_date: self.effective_date
)
# Replace fairos_info with template like for benefits
fairos_info = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first
Vhcs::HlrxCrosRef.create!(
group_no: self.group_number,
rx_group_id: self.group_number,
help_desk: fairos_info.help_desk,
customer_service: fairos_info.customer_service,
web_url: fairos_info.web_url,
pl_plan_key: self.pl_plan_key
)
self.plans.each_with_index do |plan, i|
plan.plan_benefits.each do |bene|
Vhcs::HlEgglestonCardBenefit.create!(
plan_id: plan.plan_id,
benefit_desc: bene.benefit_desc,
benefit: bene.benefit,
sequence: bene.sequence,
plan_key: self.pl_plan_key
)
end
end
end
end
def build_plan_with_default_benefits(attributes = {})
plan = plans.new(attributes)
benefits = IdCardBenefitsTemplate.find_by(title: "BLANK").id_card_benefits.sort_by(&:sequence)
benefits.each do |ben|
plan.plan_benefits.new(benefit_desc: ben.benefit_desc, sequence: ben.sequence)
end
plan
end
private
end
+5
View File
@@ -0,0 +1,5 @@
class EmployerCardLogo < ApplicationRecord
belongs_to :employer
belongs_to :card_logo_file
end
+57 -5
View File
@@ -2,15 +2,16 @@ class EmployerSetupProcess < ApplicationRecord
has_many :plans, dependent: :destroy
accepts_nested_attributes_for :plans, allow_destroy: true, reject_if: :all_blank
has_many :alternative_network_logos, dependent: :destroy
accepts_nested_attributes_for :alternative_network_logos, allow_destroy: true, reject_if: :all_blank
has_many :alternate_network_logos, dependent: :destroy
accepts_nested_attributes_for :alternate_network_logos, allow_destroy: true, reject_if: :all_blank
has_many :card_logo_files
before_save :process_employer_logo
# before_save :process_employer_logo
before_save :create_slug, if: :new_record?
def process_employer_logo
unless self.employer_logo.is_a?(String)
if self.employer_logo.present? && !self.employer_logo.is_a?(String)
self.card_logo_files.new(
filename: self.employer_logo.filename,
logo_type: 'employer',
@@ -20,6 +21,20 @@ class EmployerSetupProcess < ApplicationRecord
end
end
def create_slug
self.slug = employer_trimmed_name.parameterize
end
def employer_name_to_logo_filename(extension)
self.employer_trimmed_name.titleize.gsub(/\s+/, '').concat('Logo').concat(extension.downcase)
end
def employer_trimmed_name
regex_source = Regexp.union(["health", "plan", "the", "inc", "llc"]).source
case_insensitive_regex = Regexp.new(regex_source, "i")
self.employer_name.gsub(case_insensitive_regex, "").squish
end
def self.permitted_params(params)
params.require(:employer_setup_process).permit(
:employer_name,
@@ -41,7 +56,7 @@ class EmployerSetupProcess < ApplicationRecord
:_destroy,
]
],
alternative_network_logos_attributes: [
alternate_network_logos_attributes: [
:id,
:network_logo,
:exception_type,
@@ -51,4 +66,41 @@ class EmployerSetupProcess < ApplicationRecord
)
end
def save_to_prod
VhcsRecord.transaction do
Vhcs::HlPlanCode.create!(
group_number: self.group_number,
medical_number: self.group_number,
dental_number: '',
plan_key: self.pl_plan_key,
effect_date: self.effective_date
)
# Replace fairos_info with template like for benefits
fairos_info = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first
Vhcs::HlrxCrosRef.cdarreate!(
group_no: self.group_number,
rx_group_id: self.group_number,
help_desk: fairos_info.help_desk,
customer_service: fairos_info.customer_service,
web_url: fairos_info.web_url,
pl_plan_key: self.pl_plan_key
)
self.plans.each_with_index do |plan, i|
plan.plan_benefits.each do |bene|
Vhcs::HlEgglestonCardBenefit.create!(
plan_id: plan.plan_id,
benefit_desc: bene.benefit_desc,
benefit: bene.benefit,
sequence: bene.sequence,
plan_key: self.pl_plan_key
)
end
end
end
end
end
+6
View File
@@ -0,0 +1,6 @@
class Member < ApplicationRecord
belongs_to :plan
belongs_to :employer
end
+3 -3
View File
@@ -1,15 +1,15 @@
class Plan < ApplicationRecord
belongs_to :employer_setup_process
belongs_to :employer
has_many :plan_benefits, dependent: :destroy
accepts_nested_attributes_for :plan_benefits, allow_destroy: true, reject_if: :all_blank
after_initialize :create_default_benefits, if: :new_record?
# after_initialize :create_default_benefits, if: :new_record?
private
def create_default_benefits
def build_and_create_default_benefits
benefits = IdCardBenefitsTemplate.find_by(title: "BLANK").id_card_benefits.sort_by(&:sequence)
benefits.each do |ben|
plan_benefits.new(benefit_desc: ben.benefit_desc, sequence: ben.sequence)
+14
View File
@@ -0,0 +1,14 @@
class SampleIdCard < ApplicationRecord
STRING_ATTRIBUTES = %w[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 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 dependent_1 dependent_2 dependent_3 dependent_4 dependent_5 dependent_6 dependent_7 dependent_8]
before_validation :assign_blank_strings_to_unassigned_params
def assign_blank_strings_to_unassigned_params
STRING_ATTRIBUTES.each do |attr|
# Use the blank? method which checks for nil, false, empty, or whitespace strings
self[attr] = "" if self[attr].blank?
end
end
end
+57 -7
View File
@@ -1,7 +1,8 @@
module Vhcs
class HLIDCardProvider < VhcsRecord
class HlidCardProvider < VhcsRecord
self.table_name = 'HLIDCardProvider'
self.primary_key = 'ProviderCode'
alias_attribute :provider_code, :ProviderCode
alias_attribute :provider_line_1, :ProviderLine1
@@ -36,12 +37,61 @@ module Vhcs
alias_attribute :rx_contact, :RXContact
alias_attribute :provider_lookup_1, :ProviderLookup1
alias_attribute :provider_lookup_2, :ProviderLookup2
alias_attribute :precert1, :Precert1
alias_attribute :precert2, :Precert2
alias_attribute :precert3, :Precert3
alias_attribute :precert4, :Precert4
alias_attribute :precert5, :Precert5
alias_attribute :precert6, :Precert6
alias_attribute :precert_1, :Precert1
alias_attribute :precert_2, :Precert2
alias_attribute :precert_3, :Precert3
alias_attribute :precert_4, :Precert4
alias_attribute :precert_5, :Precert5
alias_attribute :precert_6, :Precert6
alias_attribute :provider_line_12, :ProviderLine12
alias_attribute :claim_to_12, :ClaimTo12
def attributes
rails_like = {
provider_code: self.provider_code,
provider_line_1: self.provider_line_1,
provider_line_2: self.provider_line_2,
provider_line_3: self.provider_line_3,
provider_line_4: self.provider_line_4,
provider_line_5: self.provider_line_5,
mail_to: self.mail_to,
mail_to_2: self.mail_to_2,
contact_line_1: self.contact_line_1,
contact_line_2: self.contact_line_2,
contact_line_3: self.contact_line_3,
group_number: self.group_number,
claim_to_1: self.claim_to_1,
claim_to_2: self.claim_to_2,
claim_to_3: self.claim_to_3,
claim_to_4: self.claim_to_4,
claim_to_5: self.claim_to_5,
claim_to_6: self.claim_to_6,
claim_to_7: self.claim_to_7,
claim_to_8: self.claim_to_8,
claim_to_9: self.claim_to_9,
claim_to_10: self.claim_to_10,
claim_to_11: self.claim_to_11,
claim_to_12: self.claim_to_12,
provider_line_6: self.provider_line_6,
provider_line_7: self.provider_line_7,
provider_line_8: self.provider_line_8,
provider_line_9: self.provider_line_9,
provider_line_10: self.provider_line_10,
provider_line_11: self.provider_line_11,
provider_line_12: self.provider_line_12,
rx_group_id: self.rx_group_id,
rx_contact: self.rx_contact,
provider_lookup_1: self.provider_lookup_1,
provider_lookup_2: self.provider_lookup_2,
precert_1: self.precert_1,
precert_2: self.precert_2,
precert_3: self.precert_3,
precert_4: self.precert_4,
precert_5: self.precert_5,
precert_6: self.precert_6,
}
super.merge(rails_like)
end
end
+48
View File
@@ -0,0 +1,48 @@
module Vhcs
class HlidCardProvider < VhcsRecord
self.table_name = 'HLIDCardProvider'
alias_attribute :provider_code, :ProviderCode
alias_attribute :provider_line_1, :ProviderLine1
alias_attribute :provider_line_2, :ProviderLine2
alias_attribute :provider_line_3, :ProviderLine3
alias_attribute :provider_line_4, :ProviderLine4
alias_attribute :provider_line_5, :ProviderLine5
alias_attribute :mail_to, :MailTo
alias_attribute :mail_to_2, :MailTo2
alias_attribute :contact_line_1, :ContactLine1
alias_attribute :contact_line_2, :ContactLine2
alias_attribute :contact_line_3, :ContactLine3
alias_attribute :group_number, :GroupNumber
alias_attribute :claim_to_1, :ClaimTo1
alias_attribute :claim_to_2, :ClaimTo2
alias_attribute :claim_to_3, :ClaimTo3
alias_attribute :claim_to_4, :ClaimTo4
alias_attribute :claim_to_5, :ClaimTo5
alias_attribute :claim_to_6, :ClaimTo6
alias_attribute :claim_to_7, :ClaimTo7
alias_attribute :claim_to_8, :ClaimTo8
alias_attribute :claim_to_9, :ClaimTo9
alias_attribute :claim_to_10, :ClaimTo10
alias_attribute :claim_to_11, :ClaimTo11
alias_attribute :provider_line_6, :ProviderLine6
alias_attribute :provider_line_7, :ProviderLine7
alias_attribute :provider_line_8, :ProviderLine8
alias_attribute :provider_line_9, :ProviderLine9
alias_attribute :provider_line_10, :ProviderLine10
alias_attribute :provider_line_11, :ProviderLine11
alias_attribute :rx_group_id, :RXGroupId
alias_attribute :rx_contact, :RXContact
alias_attribute :provider_lookup_1, :ProviderLookup1
alias_attribute :provider_lookup_2, :ProviderLookup2
alias_attribute :precert1, :Precert1
alias_attribute :precert2, :Precert2
alias_attribute :precert3, :Precert3
alias_attribute :precert4, :Precert4
alias_attribute :precert5, :Precert5
alias_attribute :precert6, :Precert6
end
end
+12
View File
@@ -10,6 +10,18 @@ module Vhcs
alias_attribute :web_url, :WebUrl
alias_attribute :pl_plan_key, :PLPlanKey
def attributes
rails_like = {
group_no: self.group_no,
rx_group_id: self.rx_group_id,
help_desk: self.help_desk,
customer_service: self.customer_service,
web_url: self.web_url,
pl_plan_key: self.pl_plan_key,
}
super.merge(rails_like)
end
end
end
+15
View File
@@ -0,0 +1,15 @@
module Vhcs
class HlrxCrosRef < VhcsRecord
self.table_name = 'HLRXCrosRef'
alias_attribute :group_no, :GroupNo
alias_attribute :rx_group_id, :RXGroupID
alias_attribute :help_desk, :HelpDesk
alias_attribute :customer_service, :CustomerService
alias_attribute :web_url, :WebUrl
alias_attribute :pl_plan_key, :PLPlanKey
end
end
+23
View File
@@ -0,0 +1,23 @@
module Vhcs
class PbCompanyPlans < VhcsRecord
self.table_name = 'PBCompanyPlans'
alias_attribute :pb_company_plan_key, :PBCompanyPlanKey
alias_attribute :company_pb_entity_key, :CompanyPBEntityKey
alias_attribute :pl_plan_key, :PLPlanKey
def attributes
rails_like = {
pb_company_plan_key: self.pb_company_plan_key,
company_pb_entity_key: self.company_pb_entity_key,
pl_plan_key: self.pl_plan_key,
}
super.merge(rails_like)
end
end
end
+47
View File
@@ -0,0 +1,47 @@
module Vhcs
class PbEntity < VhcsRecord
self.table_name = 'PBEntity'
alias_attribute :pb_entity_key, :PBEntityKey
alias_attribute :company_pb_entity_key, :CompanyPBEntityKey
alias_attribute :entity_type_id, :EntityTypeID
alias_attribute :prefix_id, :PrefixID
alias_attribute :first_name, :FirstName
alias_attribute :middle_name, :MiddleName
alias_attribute :last_name, :LastName
alias_attribute :suffix_id, :SuffixID
alias_attribute :title, :Title
alias_attribute :letter_tag_bit_flags, :LetterTagBitFlags
alias_attribute :when_last_changed, :WhenLastChanged
alias_attribute :who_last_changed, :WhoLastChanged
alias_attribute :full_name_last_name_first, :FullNameLastNameFirst
alias_attribute :alternate_key, :AlternateKey
def attributes
rails_like = {
pb_entity_key: self.pb_entity_key,
company_pb_entity_key: self.company_pb_entity_key,
entity_type_id: self.entity_type_id,
prefix_id: self.prefix_id,
first_name: self.first_name,
middle_name: self.middle_name,
last_name: self.last_name,
suffix_id: self.suffix_id,
title: self.title,
letter_tag_bit_flags: self.letter_tag_bit_flags,
when_last_changed: self.when_last_changed,
who_last_changed: self.who_last_changed,
full_name_last_name_first: self.full_name_last_name_first,
alternate_key: self.alternate_key,
}
super.merge(rails_like)
end
def full_name
[self.first_name, self.middle_name, self.last_name].join(" ").squish
end
end
end
+57
View File
@@ -0,0 +1,57 @@
module Vhcs
class PbProduct < VhcsRecord
self.table_name = 'PBProduct'
alias_attribute :pb_product_key, :PBProductKey
alias_attribute :pb_product_line_key, :PBProductLineKey
alias_attribute :target_entity_type_id, :TargetEntityTypeID
alias_attribute :company_pb_entity_key, :CompanyPBEntityKey
alias_attribute :full_description, :FullDescription
alias_attribute :column_description, :ColumnDescription
alias_attribute :short_description, :ShortDescription
alias_attribute :presentation_format_code, :PresentationFormatCode
alias_attribute :is_active, :IsActive
alias_attribute :used_for_hrafsa, :UsedForHRAFSA
alias_attribute :non_network_rx_coverage, :NonNetworkRxCoverage
alias_attribute :web_express_product_group_g_1_0, :WebExpressProductGroup_G10
alias_attribute :web_express_description, :WebExpressDescription
alias_attribute :web_express_oe_processing_order, :WebExpressOEProcessingOrder
alias_attribute :participant_enrollee_type_bitmask, :ParticipantEnrolleeTypeBitmask
alias_attribute :invoice_group_g_1_2_7, :InvoiceGroup_G127
alias_attribute :web_express_must_participate, :WebExpressMustParticipate
alias_attribute :suppress_optional_amount, :SuppressOptionalAmount
alias_attribute :suppress_coverage, :SuppressCoverage
alias_attribute :suppress_description, :SuppressDescription
alias_attribute :pb_product_enrollment_grouping_key, :PBProductEnrollmentGroupingKey
def attributes
rails_like = {
pb_product_key: self.pb_product_key,
pb_product_line_key: self.pb_product_line_key,
target_entity_type_id: self.target_entity_type_id,
company_pb_entity_key: self.company_pb_entity_key,
full_description: self.full_description,
column_description: self.column_description,
short_description: self.short_description,
presentation_format_code: self.presentation_format_code,
is_active: self.is_active,
used_for_hrafsa: self.used_for_hrafsa,
non_network_rx_coverage: self.non_network_rx_coverage,
web_express_product_group_g_1_0: self.web_express_product_group_g_1_0,
web_express_description: self.web_express_description,
web_express_oe_processing_order: self.web_express_oe_processing_order,
participant_enrollee_type_bitmask: self.participant_enrollee_type_bitmask,
invoice_group_g_1_2_7: self.invoice_group_g_1_2_7,
web_express_must_participate: self.web_express_must_participate,
suppress_optional_amount: self.suppress_optional_amount,
suppress_coverage: self.suppress_coverage,
suppress_description: self.suppress_description,
pb_product_enrollment_grouping_key: self.pb_product_enrollment_grouping_key,
}
super.merge(rails_like)
end
end
end
@@ -0,0 +1,55 @@
module Vhcs
class PbProductParticipation < VhcsRecord
self.table_name = 'PBProductParticipation'
alias_attribute :pb_product_participation_key, :PBProductParticipationKey
alias_attribute :pb_affiliation_key, :PBAffiliationKey
alias_attribute :pb_product_availability_key, :PBProductAvailabilityKey
alias_attribute :coverage_type_code, :CoverageTypeCode
alias_attribute :optional_amount, :OptionalAmount
alias_attribute :in_effect, :InEffect
alias_attribute :out_of_effect, :OutOfEffect
alias_attribute :in_effect_reason_code, :InEffectReasonCode
alias_attribute :out_of_effect_reason_code, :OutOfEffectReasonCode
alias_attribute :when_last_changed, :WhenLastChanged
alias_attribute :who_last_changed, :WhoLastChanged
alias_attribute :user_defined_rate_criteria_value_1, :UserDefinedRateCriteriaValue1
alias_attribute :user_defined_rate_criteria_value_2, :UserDefinedRateCriteriaValue2
alias_attribute :user_defined_rate_criteria_value_3, :UserDefinedRateCriteriaValue3
alias_attribute :user_defined_rate_criteria_record_id_1, :UserDefinedRateCriteriaRecordID1
alias_attribute :user_defined_rate_criteria_record_id_2, :UserDefinedRateCriteriaRecordID2
alias_attribute :user_defined_rate_criteria_record_id_3, :UserDefinedRateCriteriaRecordID3
alias_attribute :optional_amount_record_id, :OptionalAmountRecordID
alias_attribute :primary_pb_affiliation_key, :PrimaryPBAffiliationKey
alias_attribute :payment_type_record_id_g_1_7_7, :PaymentTypeRecordID_G177
def attributes
rails_like = {
pb_product_participation_key: self.pb_product_participation_key,
pb_affiliation_key: self.pb_affiliation_key,
pb_product_availability_key: self.pb_product_availability_key,
coverage_type_code: self.coverage_type_code,
optional_amount: self.optional_amount,
in_effect: self.in_effect,
out_of_effect: self.out_of_effect,
in_effect_reason_code: self.in_effect_reason_code,
out_of_effect_reason_code: self.out_of_effect_reason_code,
when_last_changed: self.when_last_changed,
who_last_changed: self.who_last_changed,
user_defined_rate_criteria_value_1: self.user_defined_rate_criteria_value_1,
user_defined_rate_criteria_value_2: self.user_defined_rate_criteria_value_2,
user_defined_rate_criteria_value_3: self.user_defined_rate_criteria_value_3,
user_defined_rate_criteria_record_id_1: self.user_defined_rate_criteria_record_id_1,
user_defined_rate_criteria_record_id_2: self.user_defined_rate_criteria_record_id_2,
user_defined_rate_criteria_record_id_3: self.user_defined_rate_criteria_record_id_3,
optional_amount_record_id: self.optional_amount_record_id,
primary_pb_affiliation_key: self.primary_pb_affiliation_key,
payment_type_record_id_g_1_7_7: self.payment_type_record_id_g_1_7_7,
}
super.merge(rails_like)
end
end
end
+103
View File
@@ -0,0 +1,103 @@
module Vhcs
class VwmbMember < VhcsRecord
self.table_name = 'VWMBMember'
alias_attribute :mb_member_key, :MBMemberKey
alias_attribute :pb_entity_key, :PBEntityKey
alias_attribute :pl_plan_key, :PLPlanKey
alias_attribute :mbr_class, :MbrClass
alias_attribute :mbr_type, :MbrType
alias_attribute :mbr_ap_vendor_key, :MbrAPVendorKey
alias_attribute :alt_ap_vendor_key, :AltAPVendorKey
alias_attribute :use_alt_payee, :UseAltPayee
alias_attribute :send_eob_primary, :SendEOBPrimary
alias_attribute :send_eob_dependent, :SendEOBDependent
alias_attribute :send_eob_third_party, :SendEOBThirdParty
alias_attribute :student_flag, :StudentFlag
alias_attribute :disabled_dependent_flag, :DisabledDependentFlag
alias_attribute :is_restricted, :IsRestricted
alias_attribute :third_party_pb_entity_key, :ThirdPartyPBEntityKey
alias_attribute :user_def_1, :UserDef1
alias_attribute :user_def_2, :UserDef2
alias_attribute :family_id, :FamilyID
alias_attribute :sequence_number, :SequenceNumber
alias_attribute :enrollee_type_key, :EnrolleeTypeKey
alias_attribute :enrollee_type, :EnrolleeType
alias_attribute :enrollee_type_value_id, :EnrolleeTypeValueID
alias_attribute :sex_key, :SexKey
alias_attribute :use_primary_address, :UsePrimaryAddress
alias_attribute :birth_date, :BirthDate
alias_attribute :birth_sequence_number, :BirthSequenceNumber
alias_attribute :death_date, :DeathDate
alias_attribute :date_of_birth, :DateOfBirth
alias_attribute :date_of_death, :DateOfDeath
alias_attribute :social_security_number, :SocialSecurityNumber
alias_attribute :hipaaid, :HIPAAID
alias_attribute :company_pb_entity_key, :CompanyPBEntityKey
alias_attribute :entity_type_id, :EntityTypeID
alias_attribute :prefix_id, :PrefixID
alias_attribute :first_name, :FirstName
alias_attribute :middle_name, :MiddleName
alias_attribute :last_name, :LastName
alias_attribute :suffix_id, :SuffixID
alias_attribute :title, :Title
alias_attribute :letter_tag_bit_flags, :LetterTagBitFlags
alias_attribute :full_name_last_name_first, :FullNameLastNameFirst
alias_attribute :policy_number, :PolicyNumber
alias_attribute :send_eob_alt_payee, :SendEOBAltPayee
alias_attribute :send_eob_alt_payee_only, :SendEOBAltPayeeOnly
def attributes
rails_like = {
mb_member_key: self.mb_member_key,
pb_entity_key: self.pb_entity_key,
pl_plan_key: self.pl_plan_key,
mbr_class: self.mbr_class,
mbr_type: self.mbr_type,
mbr_ap_vendor_key: self.mbr_ap_vendor_key,
alt_ap_vendor_key: self.alt_ap_vendor_key,
use_alt_payee: self.use_alt_payee,
send_eob_primary: self.send_eob_primary,
send_eob_dependent: self.send_eob_dependent,
send_eob_third_party: self.send_eob_third_party,
student_flag: self.student_flag,
disabled_dependent_flag: self.disabled_dependent_flag,
is_restricted: self.is_restricted,
third_party_pb_entity_key: self.third_party_pb_entity_key,
user_def_1: self.user_def_1,
user_def_2: self.user_def_2,
family_id: self.family_id,
sequence_number: self.sequence_number,
enrollee_type_key: self.enrollee_type_key,
enrollee_type: self.enrollee_type,
enrollee_type_value_id: self.enrollee_type_value_id,
sex_key: self.sex_key,
use_primary_address: self.use_primary_address,
birth_date: self.birth_date,
birth_sequence_number: self.birth_sequence_number,
death_date: self.death_date,
date_of_birth: self.date_of_birth,
date_of_death: self.date_of_death,
social_security_number: self.social_security_number,
hipaaid: self.hipaaid,
company_pb_entity_key: self.company_pb_entity_key,
entity_type_id: self.entity_type_id,
prefix_id: self.prefix_id,
first_name: self.first_name,
middle_name: self.middle_name,
last_name: self.last_name,
suffix_id: self.suffix_id,
title: self.title,
letter_tag_bit_flags: self.letter_tag_bit_flags,
full_name_last_name_first: self.full_name_last_name_first,
policy_number: self.policy_number,
send_eob_alt_payee: self.send_eob_alt_payee,
send_eob_alt_payee_only: self.send_eob_alt_payee_only,
}
super.merge(rails_like)
end
end
end
@@ -1,8 +1,8 @@
module BenefitsWordDoc
class MapEmployerInformation
def initialize(process, word_doc_section)
@process = process
def initialize(employer, word_doc_section)
@employer = employer
@word_doc_section = word_doc_section
end
@@ -13,21 +13,21 @@ module BenefitsWordDoc
matching_field = search_fields.detect { |field| line.include?(field) }
if matching_field
field_mapping = mapping_hash[matching_field]
field_regex = field_mapping[:doc_to_process_regex]
field_regex = field_mapping[:doc_to_employer_regex]
field_value = line.match(field_regex)[1].strip
process_field = field_mapping[:process_field]
employer_field = field_mapping[:employer_field]
if field_mapping[:validation].present?
validation_type = field_mapping[:validation]
if send("is_#{validation_type}?".to_sym, field_value)
@process[process_field] = field_value
@employer[employer_field] = field_value
end
else
@process[process_field] = field_value
@employer[employer_field] = field_value
end
end
end
@process.save
@employer
end
private
@@ -35,25 +35,25 @@ module BenefitsWordDoc
def mapping_hash
{
'Employer Name' => {
process_field: :employer_name,
employer_field: :name,
doc_field: 'Employer Name',
doc_field_desc: 'Follows pattern - Employer Name:New Employer',
doc_to_process_regex: /.*:(.*)/,
doc_to_employer_regex: /.*:(.*)/,
regex_desc: 'Grabs everything after colon'
},
'Group Number' => {
process_field: :group_number,
employer_field: :group_number,
doc_field: 'Group Number',
doc_field_desc: 'Follows pattern - Group Number:099999',
doc_to_process_regex: /.*:(.*)/,
doc_to_employer_regex: /.*:(.*)/,
regex_desc: 'Grabs everything after colon',
validation: 'number'
},
'Group Effective Date' => {
process_field: :effective_date,
employer_field: :effective_date,
doc_field: 'Group Effective Date',
doc_field_desc: 'Follows pattern - Group Effective Date:12/1/2025',
doc_to_process_regex: /.*:(.*)/,
doc_to_employer_regex: /.*:(.*)/,
regex_desc: 'Grabs everything after colon',
validation: 'date'
}
@@ -1,28 +1,78 @@
module BenefitsWordDoc
class MapEmployerLogo
def initialize(process, word_doc)
@process = process
def initialize(employer, word_doc)
@employer = employer
@word_doc = word_doc
end
def call
extracted_images = []
Zip::File.open(@word_doc) do |zip_file|
zip_file.each do |entry|
if entry.name.start_with?('word/media/') && !entry.directory?
filename = @process.employer_name.titleize.gsub(/\s+/, '').concat("Logo.png")
image_data = entry.get_input_stream.read
extracted_images << { filename: filename, data: image_data }
media_files = zip_file.select { |entry| entry.name.start_with?('word/media/') && !entry.directory? }
if media_files.length > 1
logo = media_files.last
file_extension = File.extname(logo.name)
meme_type = Marcel::MimeType.for(logo.get_input_stream)
image_binary = logo.get_input_stream.read
# image_binary = File.binread(logo.get_input_stream.read)
filename = @employer.name_to_logo_filename(file_extension)
logo = CardLogoFile.find_or_create_by(filename: filename) do |clf|
clf.image_data = image_binary
clf.content_type = meme_type
clf.logo_type = "employer"
end
# new_logo = CardLogoFile.create!(
# filename: filename,
# image_data: image_binary,
# content_type: meme_type,
# logo_type: "employer"
# )
image_io = StringIO.new(image_binary)
width, height = FastImage.size(image_io)
image_ratio = width.to_f / height
if (0.8..1.2).cover?(image_ratio)
@employer.single_card_template = "FairosRxIDCard-Half"
else
@employer.single_card_template = "FairosRxIDCard"
end
@employer.employer_logo_filename = logo.filename
end
end
if extracted_images.length > 1
employer_logo = extracted_images.last
@process.employer_logo = employer_logo[:filename]
# same file logic
end
@process.save
@employer
end
# def call
# extracted_images = []
# Zip::File.open(@word_doc) do |zip_file|
# zip_file.each do |entry|
# if entry.name.start_with?('word/media/') && !entry.directory?
# file_extension = File.extname(entry.name)
# image_data = entry.get_input_stream.read
# extracted_images << { file_extension: file_extension, data: image_data }
# end
# end
# end
# if extracted_images.length > 1
# logo = extracted_images.last
# filename = @employer.employer_name_to_logo_filename(logo[:file_extension])
# employer_logo_binary = logo[:data]
# new_logo = @employer.card_logo_files.create(
# filename: filename,
# image: employer_logo_binary,
# logo_type: "employer"
# )
# @employer.employer_logo = new_logo.filename
# # same file logic
# end
# @employer.save
# end
end
end
@@ -0,0 +1,33 @@
module BenefitsWordDoc
class MapNetworkInformation
def initialize(employer, word_doc_section)
@employer = employer
@word_doc_section = word_doc_section
end
def call
network_matches = []
@word_doc_section.each do |line|
if network_matches.exclude?("Cigna") && line.match?(/cigna/i)
network_matches.push("Cigna")
elsif network_matches.exclude?("Medcost") && line.match?(/medcost/i)
network_matches.push("Medcost")
end
end
if network_matches.length == 1
network_provider = network_matches.first
@employer.network_provider = network_provider
@employer.default_network_logo = "#{network_provider}Logo.png"
provider_code = network_provider == "Cigna" ? "5" : "2"
@employer.card_provider = CardProvider.find_by(provider_code: provider_code)
@employer.card_rx = CardRx.find_by(web_url: "www.FairosRx.com")
end
@employer
end
end
end
@@ -1,8 +1,8 @@
module BenefitsWordDoc
class MapPlansInformation
def initialize(process, word_doc_section)
@process = process
def initialize(employer, word_doc_section)
@employer = employer
@word_doc_section = word_doc_section
end
@@ -11,132 +11,256 @@ module BenefitsWordDoc
plans_indexes = @word_doc_section.each_index.select { |index| @word_doc_section[index].match?(/\d*\.?\d+k/i) }
plans_indexes.each do |plan_index|
new_plan = @process.plans.create(title: @word_doc_section[plan_index])
new_plan = @employer.build_plan_with_default_benefits(title: @word_doc_section[plan_index])
plan_lines = @word_doc_section.slice(plan_index + 1, 14)
plan_lines.each_with_index do |line, i|
matching_field = search_fields.detect { |field| line.include?(field) }
if matching_field
puts matching_field
field_mapping = mapping_hash[matching_field]
field_regex = field_mapping[:doc_to_process_regex]
field_value = line.match(field_regex)[1].strip
process_benefit_desc_field = field_mapping[:process_benefit_desc_field]
puts process_benefit_desc_field
puts new_plan.plan_benefits.map { |b| b.benefit_desc}
new_benefit = new_plan.plan_benefits.find_by(benefit_desc: process_benefit_desc_field)
new_benefit.benefit = field_value
new_benefit.save
field_mapping = mapping_array[i]
field_regex = field_mapping[:doc_to_employer_regex]
if line.match(field_regex)
field_value = line.match(field_regex)[0].strip
elsif line.match(default_benefit_regex(field_mapping[:employer_benefit_desc_field]))
field_value = line.match(default_benefit_regex(field_mapping[:employer_benefit_desc_field]))[0].strip
else
field_value = line
end
employer_benefit_desc_field = field_mapping[:employer_benefit_desc_field]
new_benefit = new_plan.plan_benefits[i]
new_benefit.benefit = field_value
# matching_field = search_fields.detect { |field| line.include?(field) }
# if matching_field
# field_mapping = mapping_hash[matching_field]
# field_regex = field_mapping[:doc_to_employer_regex]
# if line.match(field_regex)
# field_value = line.match(field_regex)[0].strip
# elsif line.match(default_benefit_regex(field_mapping[:employer_benefit_desc_field]))
# field_value = line.match(default_benefit_regex(field_mapping[:employer_benefit_desc_field]))[0].strip
# else
# field_value = ""
# end
# employer_benefit_desc_field = field_mapping[:employer_benefit_desc_field]
# new_benefit = new_plan.plan_benefits.find_by(benefit_desc: employer_benefit_desc_field)
# new_benefit.benefit = field_value
# new_benefit.save
# end
end
end
@employer
end
private
def mapping_array
[
{
employer_benefit_sequence: 1,
employer_benefit_desc_field: 'Primary Visit',
doc_field_desc: 'Follows pattern - Physician Visit$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 2,
employer_benefit_desc_field: 'Specialist Visit',
doc_field_desc: 'Follows pattern - Specialist Visit$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 3,
employer_benefit_desc_field: 'Urgent Care',
doc_field_desc: 'Follows pattern - Urgent Care$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 4,
employer_benefit_desc_field: 'INNInd Ded',
doc_field_desc: 'Follows pattern - Individual Deductible (in network )$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 5,
employer_benefit_desc_field: 'INNFamily Ded',
doc_field_desc: 'Follows pattern - Family Deductible(in network )$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 6,
employer_benefit_desc_field: 'OONInd Ded',
doc_field_desc: 'Follows pattern - Individual Deductible (out of network)$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 7,
employer_benefit_desc_field: 'OONFamily Ded',
doc_field_desc: 'Follows pattern - Family Deductible (out of network)$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 8,
employer_benefit_desc_field: 'Co-Insurance',
doc_field_desc: 'Follows pattern - Co-Insurance70%/30%',
doc_to_employer_regex: /(?<=Co-Insurance).*/,
regex_desc: 'Grabs everything after field name'
},
{
employer_benefit_sequence: 9,
employer_benefit_desc_field: 'INNInd OOP',
doc_field_desc: 'Follows pattern - Out-of-Pocket(in network)$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 10,
employer_benefit_desc_field: 'INNFamily OOP',
doc_field_desc: 'Follows pattern - Out-of-Pocket Family(in network)$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 11,
employer_benefit_desc_field: 'OONInd OOP',
doc_field_desc: 'Follows pattern - Out-of-Pocket(out of network)$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 12,
employer_benefit_desc_field: 'OONFamily OOP',
doc_field_desc: 'Follows pattern - Out-of-Pocket Family (out of network)$x,xxx',
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
{
employer_benefit_sequence: 13,
employer_benefit_desc_field: 'Emergency Room',
doc_field_desc: 'Follows pattern - Emergency RoomXxxxx',
doc_to_employer_regex: /(?<=Emergency Room).*/,
regex_desc: 'Grabs everything after field name'
},
{
employer_benefit_sequence: 14,
employer_benefit_desc_field: 'Preventive Care',
doc_field_desc: 'Follows pattern - Preventive Care100%',
doc_to_employer_regex: /(?<=Preventive Care).*/,
regex_desc: 'Grabs everything after field name'
}
]
end
def mapping_hash
{
'Physician Visit' => {
process_field: :benefit,
process_benefit_desc_field: 'Primary Visit',
employer_benefit_sequence: 1,
employer_benefit_desc_field: 'Primary Visit',
doc_field_desc: 'Follows pattern - Physician Visit$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Specialist Visit' => {
process_field: :benefit,
process_benefit_desc_field: 'Specialist Visit',
employer_benefit_sequence: 2,
employer_benefit_desc_field: 'Specialist Visit',
doc_field_desc: 'Follows pattern - Specialist Visit$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Urgent Care' => {
process_field: :benefit,
process_benefit_desc_field: 'Urgent Care',
employer_benefit_sequence: 3,
employer_benefit_desc_field: 'Urgent Care',
doc_field_desc: 'Follows pattern - Urgent Care$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Individual Deductible (in network )' => {
process_field: :benefit,
process_benefit_desc_field: 'INNInd Ded',
'Individual Deductible' => {
employer_benefit_sequence: 4,
employer_benefit_desc_field: 'INNInd Ded',
doc_field_desc: 'Follows pattern - Individual Deductible (in network )$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Family Deductible(in network )' => {
process_field: :benefit,
process_benefit_desc_field: 'INNFamily Ded',
'Family Deductible' => {
employer_benefit_sequence: 5,
employer_benefit_desc_field: 'INNFamily Ded',
doc_field_desc: 'Follows pattern - Family Deductible(in network )$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Individual Deductible (out of network)' => {
process_field: :benefit,
process_benefit_desc_field: 'OONInd Ded',
'Individual Deductible' => {
employer_benefit_sequence: 6,
employer_benefit_desc_field: 'OONInd Ded',
doc_field_desc: 'Follows pattern - Individual Deductible (out of network)$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Family Deductible (out of network)' => {
process_field: :benefit,
process_benefit_desc_field: 'OONFamily Ded',
'Family Deductible' => {
employer_benefit_sequence: 7,
employer_benefit_desc_field: 'OONFamily Ded',
doc_field_desc: 'Follows pattern - Family Deductible (out of network)$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Co-Insurance' => {
process_field: :benefit,
process_benefit_desc_field: 'Co-Insurance',
employer_benefit_sequence: 8,
employer_benefit_desc_field: 'Co-Insurance',
doc_field_desc: 'Follows pattern - Co-Insurance70%/30%',
doc_to_process_regex: /Co-Insurance(.*)/,
doc_to_employer_regex: /(?<=Co-Insurance).*/,
regex_desc: 'Grabs everything after field name'
},
'Out-of-Pocket(in network)' => {
process_field: :benefit,
process_benefit_desc_field: 'INNInd OOP',
'Out-of-Pocket' => {
employer_benefit_sequence: 9,
employer_benefit_desc_field: 'INNInd OOP',
doc_field_desc: 'Follows pattern - Out-of-Pocket(in network)$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Out-of-Pocket Family(in network)' => {
process_field: :benefit,
process_benefit_desc_field: 'INNFamily OOP',
'Out-of-Pocket Family' => {
employer_benefit_sequence: 10,
employer_benefit_desc_field: 'INNFamily OOP',
doc_field_desc: 'Follows pattern - Out-of-Pocket Family(in network)$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Out-of-Pocket(out of network)' => {
process_field: :benefit,
process_benefit_desc_field: 'OONInd OOP',
'Out-of-Pocket' => {
employer_benefit_sequence: 11,
employer_benefit_desc_field: 'OONInd OOP',
doc_field_desc: 'Follows pattern - Out-of-Pocket(out of network)$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Out-of-Pocket Family (out of network)' => {
process_field: :benefit,
process_benefit_desc_field: 'OONFamily OOP',
'Out-of-Pocket Family' => {
employer_benefit_sequence: 12,
employer_benefit_desc_field: 'OONFamily OOP',
doc_field_desc: 'Follows pattern - Out-of-Pocket Family (out of network)$x,xxx',
doc_to_process_regex: /\$(.*)/,
regex_desc: 'Grabs everything after dollar sign'
doc_to_employer_regex: /\$.*/,
regex_desc: 'Grabs dollar sign and everything after'
},
'Emergency Room' => {
process_field: :benefit,
process_benefit_desc_field: 'Emergency Room',
employer_benefit_sequence: 13,
employer_benefit_desc_field: 'Emergency Room',
doc_field_desc: 'Follows pattern - Emergency RoomXxxxx',
doc_to_process_regex: /Emergency Room(.*)/,
doc_to_employer_regex: /(?<=Emergency Room).*/,
regex_desc: 'Grabs everything after field name'
},
'Preventive Care' => {
process_field: :benefit,
process_benefit_desc_field: 'Preventive Care',
employer_benefit_sequence: 14,
employer_benefit_desc_field: 'Preventive Care',
doc_field_desc: 'Follows pattern - Preventive Care100%',
doc_to_process_regex: /Preventive Care(.*)/,
doc_to_employer_regex: /(?<=Preventive Care).*/,
regex_desc: 'Grabs everything after field name'
},
}
end
def default_benefit_regex(field)
/(?<=#{field}).*/
end
def is_number?(string)
true if Float(string) rescue false
end
+14 -12
View File
@@ -1,11 +1,11 @@
class BenefitsWordDocProcessor
def initialize(word_doc, process=nil)
def initialize(word_doc, employer=nil)
@word_doc = word_doc
if process
@process = process
if employer
@employer = employer
else
@process = EmployerSetupProcess.new
@employer = Employer.new
end
end
@@ -13,17 +13,19 @@ class BenefitsWordDocProcessor
doc = Docx::Document.open(@word_doc)
data_lines = doc.paragraphs.map { |p| p.to_s.squish }.reject!(&:empty?)
start_of_plans_index = data_lines.index { |s| s == 'Medical Plan'}
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..)
# 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..)
BenefitsWordDoc::MapEmployerInformation.new(@process, employer_information).call
BenefitsWordDoc::MapEmployerLogo.new(@process, @word_doc).call
BenefitsWordDoc::MapPlansInformation.new(@process, plan_information).call
@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
@process
@employer
end
@@ -39,7 +39,7 @@ class BenefitsWordDocProcessorOld
end
elsif field_string.include?('Employer Name:')
value = field_string.delete_prefix('Employer Name:').strip
@process.employer_name = value
@process.name = value
elsif field_string.include?('Group Effective Date:')
value = field_string.delete_prefix('Group Effective Date:').strip
@process.effective_date = value
@@ -59,7 +59,7 @@ class BenefitsWordDocProcessorOld
end
end
if extracted_images.length > 1
@process.employer_logo = @process.employer_name.titleize.gsub(/\s+/, '').concat("Logo.png")
@process.employer_logo = @process.name.titleize.gsub(/\s+/, '').concat("Logo.png")
# same file logic
end
end
@@ -0,0 +1,121 @@
module EmployerCards
class DataFormatter
def initialize(employer)
@employer = employer
end
def call
@members = @employer.members
@employer_cards = []
init_cards_and_set_member_fields
set_plan_fields
set_common_fields
@employer_cards.each(&:save!)
end
private
def set_common_fields
employer_attributes = {
employer_name: @employer.id_card_display_name,
group_number: @employer.group_number,
rx_group: @employer.rx_group_number
}
rx_attributes = @employer.card_rx.attributes.with_indifferent_access.slice(
:customer_service,
:web_url
)
provider_attributes = @employer.card_provider.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_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
@employer.plans.each do |plan|
selected_attributes = {}
plan.plan_benefits.each do |bene|
selected_attributes["benefit_desc_#{bene.sequence}".to_sym] = bene.benefit_desc
selected_attributes["benefit_#{bene.sequence}".to_sym] = bene.benefit
end
@employer_cards.find_all { |card| card.plan_id == plan.id.to_s }.each do |card|
card.assign_attributes(selected_attributes)
end
end
end
def init_cards_and_set_member_fields
@members.each do |me|
effect_date = determine_eff_date(me)
if effect_date
member_card = SampleIdCard.new()
selected_attributes = {
full_name: me.id_card_display_name,
primary_mb_member_key: me.mb_member_key,
family_id: me.family_id,
plan_id: me.plan_id,
medical_eff_date: effect_date.strftime("%m/%d/%Y")
}
member_card.assign_attributes(selected_attributes)
@employer_cards.push(member_card)
end
end
end
# def set_network_fields
# selected_attributes = @employer.card_provider.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_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
# )
# @employer_cards.all do |card|
# card.assign_attributes(selected_attributes)
# end
# end
# def set_rx_fields
# # fairos_information = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first
# selected_attributes = @employer.card_rx.attributes.with_indifferent_access.slice(
# :customer_service,
# :web_url
# )
# @employer_cards.all do |card|
# card.assign_attributes(selected_attributes)
# end
# end
def determine_eff_date(member)
participation = Vhcs::PbProductParticipation.joins('INNER JOIN "PBCoveredEntities" ON "PBProductParticipation"."PBProductParticipationKey" = "PBCoveredEntities"."PBProductParticipationKey"').where('"PBCoveredEntities"."PBEntityKey" = ?', member.pb_entity_key).first
in_effect = participation.in_effect
out_of_effect = participation.out_of_effect
if in_effect <= (Date.today + 90.days) && (out_of_effect - 1.day) > Date.today && out_of_effect > in_effect
in_effect
else
false
end
end
def set_dependent_fields
# Not needed for sample card
end
end
end
@@ -0,0 +1,48 @@
module EmployerCards
class JasperUrlGenerator
def initialize(employer, family_id)
@family_id = family_id
@employer = employer
end
def call
# @net_logo = determine_network_logo
card_front_url = URI::HTTP.build(url_components("Front"))
card_back_url = URI::HTTP.build(url_components("Back"))
[card_front_url, card_back_url]
end
private
def determine_network_logo
# if @network_logos.length > 1
# member_geographic_info = Vhcs::PbEntityAddress.joins("INNER JOIN vwMBMember ON PBEntityAddress.PBEntityKey = vwMBMember.PBEntityKey AND PBEntityAddress.AddressTypeID = 1137").where("vwMBMember.FamilyID = ?", @family_id).first
# @network_logos.where.not(default: true).each do |pnl|
# if member_geographic_info[pnl.exception_type] == pnl.exception_value
# return pnl.net_logo
# end
# end
# end
# @network_logos.find_by(default: true).net_logo
@employer.default_network_logo
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
def url_components(card_side)
if card_side == "Back" && @employer.single_card_template.include?("-Half")
template = @employer.single_card_template.gsub("-Half", "")
else
template = @employer.single_card_template
end
{
host: '10.41.1.115',
port: 8080,
path: '/trunk/PdfServlet',
query: "reportConn=BrittonConnect&id=&reportName=#{template}-#{card_side}-Print&family_id=#{@family_id}&employer_logo=#{@employer.employer_logo_filename}&network_logo=#{determine_network_logo}&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF"
}
end
end
end
+28
View File
@@ -0,0 +1,28 @@
class EmployerCardsGenerator
def initialize(employer)
@employer = employer
end
def call
SampleIdCard.where(employer_name: @employer.id_card_display_name).destroy_all
EmployerCards::DataFormatter.new(@employer).call
group_cards_pdf = CombinePDF.new
SampleIdCard.where(employer_name: @employer.id_card_display_name).each do |card|
urls = EmployerCards::JasperUrlGenerator.new(@employer, card.family_id).call
puts urls
card_front_pdf = SampleCard::JasperPdfGenerator.new(urls.first).call
card_back_pdf = SampleCard::JasperPdfGenerator.new(urls.last).call
group_cards_pdf << card_front_pdf
group_cards_pdf << card_back_pdf
end
# todays_date = DateTime.current.strftime('%Y%m%d%H%M%S')
# group_cards_pdf.save("tmp/#{@employer.name}_print_cards_#{todays_date}.pdf")
group_cards_pdf
end
end
+27
View File
@@ -0,0 +1,27 @@
class ImageProcessor
def initialize(image_path, new_filename = nil)
@image_path = image_path
@new_filename = new_filename
end
def call
if @new_filename
filename = @new_filename
else
filename = File.basename(@image_path)
end
binary_data = File.binread(@image_path)
# binary_data = File.open(@image_path, 'rb').read
meme_type = Marcel::MimeType.for Pathname.new(@image_path)
CardLogoFile.create(
filename: filename,
image_data: binary_data,
content_type: meme_type,
logo_type: "network"
)
end
end
+25 -25
View File
@@ -1,15 +1,16 @@
module SampleCard
class DataFormatter
def initialize(process)
@process = process
def initialize(employer)
@employer = employer
end
def call
@sample_card = BrittonWeb::SampleIdCard.new()
@sample_card = SampleIdCard.new()
set_process_fields()
set_employer_fields()
set_generic_fields()
set_rx_fields()
set_network_fields()
sample_cards = set_plan_fields()
sample_cards.each(&:save!)
@@ -18,13 +19,11 @@ module SampleCard
private
def set_process_fields
def set_employer_fields
selected_attributes = {
employer_name: @process.employer_name,
group_number: @process.group_number,
medical_eff_date: @process.effective_date,
network_image: @process.logo_filename,
status: "imported"
employer_name: @employer.name,
group_number: @employer.group_number || "999999",
medical_eff_date: @employer.effective_date
}
@sample_card.assign_attributes(selected_attributes)
@@ -32,7 +31,7 @@ module SampleCard
def set_plan_fields
plans_sample_cards = []
@process.plans.each do |plan|
@employer.plans.each do |plan|
plan_sample_card = @sample_card.dup
plan_sample_card.family_id = plan.title
plan.plan_benefits.each do |bene|
@@ -47,28 +46,29 @@ module SampleCard
def set_generic_fields
selected_attributes = {
full_name: "JANE DOE",
primary_mb_member_key: "99999",
rx_group: "99999"
primary_mb_member_key: "888888",
rx_group: @employer.group_number || "999999"
}
@sample_card.assign_attributes(selected_attributes)
end
def set_network_fields
provider_code = @process.network_provider.includes?("Cigna") ? "5" : "2"
# if @process.network_provider.includes?("Cigna")
# provider_code = "5"
# network_image = "CignaLogo.png"
# else
# provider_code = "2"
# network_image = "Logo_MC_PMS.png"
# end
provider_information = Vhcs::HLIDCardProvider.find_by(provider_code: provider_code)
selected_attributes = provider_information.attributes.slice(
selected_attributes = @employer.card_provider.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_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11,
: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_7, :claim_to_8, :claim_to_9, :claim_to_10, :claim_to_11, :claim_to_12
)
@sample_card.assign_attributes(selected_attributes)
end
def set_rx_fields
# fairos_information = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first
selected_attributes = @employer.card_rx.attributes.with_indifferent_access.slice(
:customer_service,
:web_url
)
@sample_card.assign_attributes(selected_attributes)
@@ -5,15 +5,11 @@ module SampleCard
@jasper_url = jasper_url
end
def call
response = HTTParty.get(@jasper_url)
card_pdf = CombinePDF.parse(response.body)
# todays_date = Date.today.strftime("%m-%d-%Y")
# card_pdf.save("tmp/service_test_member_id_card_#{todays_date}.pdf")
card_pdf
CombinePDF.parse(response.body)
end
@@ -1,19 +1,36 @@
module SampleCard
class JasperUrlGenerator
def initialize(process, family_id)
@family_id = family_id
@process = process
def initialize(employer, plan_name)
@plan_name = plan_name
@employer = employer
end
def call
@net_logo = determine_network_logo
# @net_logo = determine_network_logo
URI::HTTPS.build(url_components)
URI::HTTP.build(url_components)
end
private
def determine_card_template
# if @network_logos.length > 1
# member_geographic_info = Vhcs::PbEntityAddress.joins("INNER JOIN vwMBMember ON PBEntityAddress.PBEntityKey = vwMBMember.PBEntityKey AND PBEntityAddress.AddressTypeID = 1137").where("vwMBMember.FamilyID = ?", @family_id).first
# @network_logos.where.not(default: true).each do |pnl|
# if member_geographic_info[pnl.exception_type] == pnl.exception_value
# return pnl.net_logo
# end
# end
# end
# @network_logos.find_by(default: true).net_logo
if @employer.single_card_template.include?("Half")
"FairosRxSampleIDCard-Half-Display"
else
"FairosRxSampleIDCard-Display"
end
end
def determine_network_logo
# if @network_logos.length > 1
# member_geographic_info = Vhcs::PbEntityAddress.joins("INNER JOIN vwMBMember ON PBEntityAddress.PBEntityKey = vwMBMember.PBEntityKey AND PBEntityAddress.AddressTypeID = 1137").where("vwMBMember.FamilyID = ?", @family_id).first
@@ -24,14 +41,16 @@ module SampleCard
# end
# end
# @network_logos.find_by(default: true).net_logo
@process.network_logo
@employer.default_network_logo
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
def url_components
{
host: 'www.dicins.com',
path: '/ReportServerDEV/PdfServlet',
query: "reportConn=BrittonWeb&id=&reportName=#{@process.card_template}&FamilyId=#{@family_id}&BackImage=c:/images/#{@net_logo}&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF"
host: '10.41.1.115',
port: 8080,
path: '/trunk/PdfServlet',
query: "reportConn=BrittonConnect&id=&reportName=#{determine_card_template}&family_id=#{@plan_name}&employer_logo=#{@employer.employer_logo_filename}&network_logo=#{determine_network_logo}&reportDir=secure/Documents&SUBREPORT_DIR=/&ImageDir=secure/Documents&netToken=3a4a8b03f4dfb0e6e3fc82dd369f70ef&FileType=PDF"
}
end
+23
View File
@@ -0,0 +1,23 @@
class SampleCardGenerator
def initialize(employer)
@employer = employer
end
def call
SampleIdCard.where(employer_name: @employer.name).destroy_all
SampleCard::DataFormatter.new(@employer).call
group_sample_cards_pdf = CombinePDF.new
SampleIdCard.where(employer_name: @employer.name).each do |card|
url = SampleCard::JasperUrlGenerator.new(@employer, card.family_id).call
puts url
card_pdf = SampleCard::JasperPdfGenerator.new(url).call
group_sample_cards_pdf << card_pdf
end
group_sample_cards_pdf
end
end
@@ -0,0 +1,26 @@
class SampleCardGeneratorLocal
def initialize(process)
@process = process
end
def call
# SampleCard::DataFormatter.new(@process).call
group_sample_cards_pdf = CombinePDF.new
SampleIdCard.where(employer_name: @process.employer_name).each do |card|
url = SampleCard::JasperUrlGenerator.new(@process, card.family_id).call
puts url
card_pdf = SampleCard::JasperPdfGenerator.new(url).call
group_sample_cards_pdf << card_pdf
end
todays_date = DateTime.current.strftime('%Y%m%d%H%M%S')
group_sample_cards_pdf.save("tmp/#{@process.employer_name}_sample_cards_#{todays_date}.pdf")
group_sample_cards_pdf
end
end
@@ -0,0 +1,166 @@
<div id="<%= dom_id card_provider %>" class="w-full sm:w-auto my-5 space-y-5">
<div>
<strong class="block font-medium mb-1">Provider code:</strong>
<%= card_provider.provider_code %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 1:</strong>
<%= card_provider.provider_line_1 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 2:</strong>
<%= card_provider.provider_line_2 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 3:</strong>
<%= card_provider.provider_line_3 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 4:</strong>
<%= card_provider.provider_line_4 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 5:</strong>
<%= card_provider.provider_line_5 %>
</div>
<div>
<strong class="block font-medium mb-1">Mail to:</strong>
<%= card_provider.mail_to %>
</div>
<div>
<strong class="block font-medium mb-1">Mail to 2:</strong>
<%= card_provider.mail_to_2 %>
</div>
<div>
<strong class="block font-medium mb-1">Contact line 1:</strong>
<%= card_provider.contact_line_1 %>
</div>
<div>
<strong class="block font-medium mb-1">Contact line 2:</strong>
<%= card_provider.contact_line_2 %>
</div>
<div>
<strong class="block font-medium mb-1">Contact line 3:</strong>
<%= card_provider.contact_line_3 %>
</div>
<div>
<strong class="block font-medium mb-1">Group number:</strong>
<%= card_provider.group_number %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 1:</strong>
<%= card_provider.claim_to_1 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 2:</strong>
<%= card_provider.claim_to_2 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 3:</strong>
<%= card_provider.claim_to_3 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 4:</strong>
<%= card_provider.claim_to_4 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 5:</strong>
<%= card_provider.claim_to_5 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 6:</strong>
<%= card_provider.claim_to_6 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 7:</strong>
<%= card_provider.claim_to_7 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 8:</strong>
<%= card_provider.claim_to_8 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 9:</strong>
<%= card_provider.claim_to_9 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 10:</strong>
<%= card_provider.claim_to_10 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 11:</strong>
<%= card_provider.claim_to_11 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 6:</strong>
<%= card_provider.provider_line_6 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 7:</strong>
<%= card_provider.provider_line_7 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 8:</strong>
<%= card_provider.provider_line_8 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 9:</strong>
<%= card_provider.provider_line_9 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 10:</strong>
<%= card_provider.provider_line_10 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 11:</strong>
<%= card_provider.provider_line_11 %>
</div>
<div>
<strong class="block font-medium mb-1">Rx group:</strong>
<%= card_provider.rx_group_id %>
</div>
<div>
<strong class="block font-medium mb-1">Rx contact:</strong>
<%= card_provider.rx_contact %>
</div>
<div>
<strong class="block font-medium mb-1">Provider lookup 1:</strong>
<%= card_provider.provider_lookup_1 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider lookup 2:</strong>
<%= card_provider.provider_lookup_2 %>
</div>
<div>
<strong class="block font-medium mb-1">Precert 1:</strong>
<%= card_provider.precert_1 %>
</div>
<div>
<strong class="block font-medium mb-1">Precert 2:</strong>
<%= card_provider.precert_2 %>
</div>
<div>
<strong class="block font-medium mb-1">Precert 3:</strong>
<%= card_provider.precert_3 %>
</div>
<div>
<strong class="block font-medium mb-1">Precert 4:</strong>
<%= card_provider.precert_4 %>
</div>
<div>
<strong class="block font-medium mb-1">Precert 5:</strong>
<%= card_provider.precert_5 %>
</div>
<div>
<strong class="block font-medium mb-1">Precert 6:</strong>
<%= card_provider.precert_6 %>
</div>
<div>
<strong class="block font-medium mb-1">Provider line 12:</strong>
<%= card_provider.provider_line_12 %>
</div>
<div>
<strong class="block font-medium mb-1">Claim to 12:</strong>
<%= card_provider.claim_to_12 %>
</div>
</div>
@@ -0,0 +1,2 @@
json.extract! card_provider, :id, :provider_code, :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :mail_to, :mail_to_2, :contact_line_1, :contact_line_2, :contact_line_3, :group_number, :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, :provider_line_6, :provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :rx_group_id, :rx_contact, :provider_lookup_1, :provider_lookup_2, :precert_1, :precert_2, :precert_3, :precert_4, :precert_5, :precert_6, :provider_line_12, :claim_to_12, :created_at, :updated_at
json.url card_provider_url(card_provider, format: :json)
+222
View File
@@ -0,0 +1,222 @@
<%= form_with(model: card_provider, class: "contents") do |form| %>
<% if card_provider.errors.any? %>
<div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-md mt-3">
<h2><%= pluralize(card_provider.errors.count, "error") %> prohibited this card_provider from being saved:</h2>
<ul class="list-disc ml-6">
<% card_provider.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="my-5">
<%= form.label :provider_code %>
<%= form.text_field :provider_code, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_code].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_code].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_1 %>
<%= form.text_field :provider_line_1, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_1].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_1].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_2 %>
<%= form.text_field :provider_line_2, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_2].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_2].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_3 %>
<%= form.text_field :provider_line_3, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_3].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_3].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_4 %>
<%= form.text_field :provider_line_4, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_4].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_4].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_5 %>
<%= form.text_field :provider_line_5, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_5].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_5].any?}] %>
</div>
<div class="my-5">
<%= form.label :mail_to %>
<%= form.text_field :mail_to, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:mail_to].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:mail_to].any?}] %>
</div>
<div class="my-5">
<%= form.label :mail_to_2 %>
<%= form.text_field :mail_to_2, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:mail_to_2].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:mail_to_2].any?}] %>
</div>
<div class="my-5">
<%= form.label :contact_line_1 %>
<%= form.text_field :contact_line_1, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:contact_line_1].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:contact_line_1].any?}] %>
</div>
<div class="my-5">
<%= form.label :contact_line_2 %>
<%= form.text_field :contact_line_2, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:contact_line_2].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:contact_line_2].any?}] %>
</div>
<div class="my-5">
<%= form.label :contact_line_3 %>
<%= form.text_field :contact_line_3, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:contact_line_3].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:contact_line_3].any?}] %>
</div>
<div class="my-5">
<%= form.label :group_number %>
<%= form.text_field :group_number, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:group_number].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:group_number].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_1 %>
<%= form.text_field :claim_to_1, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_1].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_1].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_2 %>
<%= form.text_field :claim_to_2, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_2].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_2].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_3 %>
<%= form.text_field :claim_to_3, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_3].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_3].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_4 %>
<%= form.text_field :claim_to_4, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_4].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_4].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_5 %>
<%= form.text_field :claim_to_5, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_5].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_5].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_6 %>
<%= form.text_field :claim_to_6, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_6].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_6].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_7 %>
<%= form.text_field :claim_to_7, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_7].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_7].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_8 %>
<%= form.text_field :claim_to_8, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_8].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_8].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_9 %>
<%= form.text_field :claim_to_9, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_9].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_9].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_10 %>
<%= form.text_field :claim_to_10, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_10].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_10].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_11 %>
<%= form.text_field :claim_to_11, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_11].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_11].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_6 %>
<%= form.text_field :provider_line_6, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_6].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_6].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_7 %>
<%= form.text_field :provider_line_7, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_7].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_7].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_8 %>
<%= form.text_field :provider_line_8, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_8].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_8].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_9 %>
<%= form.text_field :provider_line_9, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_9].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_9].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_10 %>
<%= form.text_field :provider_line_10, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_10].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_10].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_11 %>
<%= form.text_field :provider_line_11, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_11].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_11].any?}] %>
</div>
<div class="my-5">
<%= form.label :rx_group_id %>
<%= form.text_field :rx_group_id, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:rx_group_id].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:rx_group_id].any?}] %>
</div>
<div class="my-5">
<%= form.label :rx_contact %>
<%= form.text_field :rx_contact, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:rx_contact].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:rx_contact].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_lookup_1 %>
<%= form.text_field :provider_lookup_1, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_lookup_1].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_lookup_1].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_lookup_2 %>
<%= form.text_field :provider_lookup_2, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_lookup_2].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_lookup_2].any?}] %>
</div>
<div class="my-5">
<%= form.label :precert_1 %>
<%= form.text_field :precert_1, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:precert_1].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:precert_1].any?}] %>
</div>
<div class="my-5">
<%= form.label :precert_2 %>
<%= form.text_field :precert_2, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:precert_2].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:precert_2].any?}] %>
</div>
<div class="my-5">
<%= form.label :precert_3 %>
<%= form.text_field :precert_3, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:precert_3].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:precert_3].any?}] %>
</div>
<div class="my-5">
<%= form.label :precert_4 %>
<%= form.text_field :precert_4, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:precert_4].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:precert_4].any?}] %>
</div>
<div class="my-5">
<%= form.label :precert_5 %>
<%= form.text_field :precert_5, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:precert_5].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:precert_5].any?}] %>
</div>
<div class="my-5">
<%= form.label :precert_6 %>
<%= form.text_field :precert_6, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:precert_6].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:precert_6].any?}] %>
</div>
<div class="my-5">
<%= form.label :provider_line_12 %>
<%= form.text_field :provider_line_12, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:provider_line_12].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:provider_line_12].any?}] %>
</div>
<div class="my-5">
<%= form.label :claim_to_12 %>
<%= form.text_field :claim_to_12, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_provider.errors[:claim_to_12].none?, "border-red-400 focus:outline-red-600": card_provider.errors[:claim_to_12].any?}] %>
</div>
<div class="inline">
<%= form.submit class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
</div>
<% end %>
+10
View File
@@ -0,0 +1,10 @@
<% content_for :title, "Editing card provider" %>
<div class="md:w-2/3 w-full">
<h1 class="font-bold text-4xl">Editing card provider</h1>
<%= render "form", card_provider: @card_provider %>
<%= link_to "Show this card provider", @card_provider, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= link_to "Back to card providers", card_providers_path, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
</div>
+29
View File
@@ -0,0 +1,29 @@
<% content_for :title, "Card providers" %>
<div class="w-full">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block" id="notice"><%= notice %></p>
<% end %>
<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Card providers</h1>
<%= link_to "New card provider", new_card_provider_path, class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium" %>
</div>
<div id="card_providers" class="min-w-full divide-y divide-gray-200 space-y-5">
<% if @card_providers.any? %>
<% @card_providers.each do |card_provider| %>
<div class="flex flex-col sm:flex-row justify-between items-center pb-5 sm:pb-0">
<%= render card_provider %>
<div class="w-full sm:w-auto flex flex-col sm:flex-row space-x-2 space-y-2">
<%= link_to "Show", card_provider, class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= link_to "Edit", edit_card_provider_path(card_provider), class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= button_to "Destroy", card_provider, method: :delete, class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
</div>
</div>
<% end %>
<% else %>
<p class="text-center my-10">No card providers found.</p>
<% end %>
</div>
</div>
@@ -0,0 +1 @@
json.array! @card_providers, partial: "card_providers/card_provider", as: :card_provider
+9
View File
@@ -0,0 +1,9 @@
<% content_for :title, "New card provider" %>
<div class="md:w-2/3 w-full">
<h1 class="font-bold text-4xl">New card provider</h1>
<%= render "form", card_provider: @card_provider %>
<%= link_to "Back to card providers", card_providers_path, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
</div>
+15
View File
@@ -0,0 +1,15 @@
<% content_for :title, "Showing card provider" %>
<div class="md:w-2/3 w-full">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block" id="notice"><%= notice %></p>
<% end %>
<h1 class="font-bold text-4xl">Showing card provider</h1>
<%= render @card_provider %>
<%= link_to "Edit this card provider", edit_card_provider_path(@card_provider), class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= link_to "Back to card providers", card_providers_path, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= button_to "Destroy this card provider", @card_provider, method: :delete, form_class: "sm:inline-block mt-2 sm:mt-0 sm:ml-2", class: "w-full rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
</div>
@@ -0,0 +1 @@
json.partial! "card_providers/card_provider", card_provider: @card_provider
+14
View File
@@ -0,0 +1,14 @@
<div id="<%= dom_id card_rx %>" class="w-full sm:w-auto my-5 space-y-5">
<div>
<strong class="block font-medium mb-1">Help desk:</strong>
<%= card_rx.help_desk %>
</div>
<div>
<strong class="block font-medium mb-1">Customer service:</strong>
<%= card_rx.customer_service %>
</div>
<div>
<strong class="block font-medium mb-1">Web url:</strong>
<%= card_rx.web_url %>
</div>
</div>
@@ -0,0 +1,2 @@
json.extract! card_rx, :id, :help_desk, :customer_service, :web_url, :created_at, :updated_at
json.url card_rx_url(card_rx, format: :json)
+32
View File
@@ -0,0 +1,32 @@
<%= form_with(model: card_rx, class: "contents") do |form| %>
<% if card_rx.errors.any? %>
<div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-md mt-3">
<h2><%= pluralize(card_rx.errors.count, "error") %> prohibited this card_rx from being saved:</h2>
<ul class="list-disc ml-6">
<% card_rx.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="my-5">
<%= form.label :help_desk %>
<%= form.text_field :help_desk, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_rx.errors[:help_desk].none?, "border-red-400 focus:outline-red-600": card_rx.errors[:help_desk].any?}] %>
</div>
<div class="my-5">
<%= form.label :customer_service %>
<%= form.text_field :customer_service, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_rx.errors[:customer_service].none?, "border-red-400 focus:outline-red-600": card_rx.errors[:customer_service].any?}] %>
</div>
<div class="my-5">
<%= form.label :web_url %>
<%= form.text_field :web_url, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": card_rx.errors[:web_url].none?, "border-red-400 focus:outline-red-600": card_rx.errors[:web_url].any?}] %>
</div>
<div class="inline">
<%= form.submit class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
</div>
<% end %>
+10
View File
@@ -0,0 +1,10 @@
<% content_for :title, "Editing card rx" %>
<div class="md:w-2/3 w-full">
<h1 class="font-bold text-4xl">Editing card rx</h1>
<%= render "form", card_rx: @card_rx %>
<%= link_to "Show this card rx", @card_rx, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= link_to "Back to card rxes", card_rxes_path, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
</div>
+29
View File
@@ -0,0 +1,29 @@
<% content_for :title, "Card rxes" %>
<div class="w-full">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block" id="notice"><%= notice %></p>
<% end %>
<div class="flex justify-between items-center">
<h1 class="font-bold text-4xl">Card rxes</h1>
<%= link_to "New card rx", new_card_rx_path, class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium" %>
</div>
<div id="card_rxes" class="min-w-full divide-y divide-gray-200 space-y-5">
<% if @card_rxes.any? %>
<% @card_rxes.each do |card_rx| %>
<div class="flex flex-col sm:flex-row justify-between items-center pb-5 sm:pb-0">
<%= render card_rx %>
<div class="w-full sm:w-auto flex flex-col sm:flex-row space-x-2 space-y-2">
<%= link_to "Show", card_rx, class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= link_to "Edit", edit_card_rx_path(card_rx), class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= button_to "Destroy", card_rx, method: :delete, class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
</div>
</div>
<% end %>
<% else %>
<p class="text-center my-10">No card rxes found.</p>
<% end %>
</div>
</div>
+1
View File
@@ -0,0 +1 @@
json.array! @card_rxes, partial: "card_rxes/card_rx", as: :card_rx
+9
View File
@@ -0,0 +1,9 @@
<% content_for :title, "New card rx" %>
<div class="md:w-2/3 w-full">
<h1 class="font-bold text-4xl">New card rx</h1>
<%= render "form", card_rx: @card_rx %>
<%= link_to "Back to card rxes", card_rxes_path, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
</div>
+15
View File
@@ -0,0 +1,15 @@
<% content_for :title, "Showing card rx" %>
<div class="md:w-2/3 w-full">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block" id="notice"><%= notice %></p>
<% end %>
<h1 class="font-bold text-4xl">Showing card rx</h1>
<%= render @card_rx %>
<%= link_to "Edit this card rx", edit_card_rx_path(@card_rx), class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= link_to "Back to card rxes", card_rxes_path, class: "w-full sm:w-auto text-center mt-2 sm:mt-0 sm:ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
<%= button_to "Destroy this card rx", @card_rx, method: :delete, form_class: "sm:inline-block mt-2 sm:mt-0 sm:ml-2", class: "w-full rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
</div>
+1
View File
@@ -0,0 +1 @@
json.partial! "card_rxes/card_rx", card_rx: @card_rx
@@ -1,9 +1,20 @@
<div class="flex space-x-5 items-center mt-4">
<label for="file_upload_input_NEW_RECORD" class="cursor-pointer bg-NEXT_COLOR hover:bg-NEXT_COLOR-tinted text-platinum font-bold py-2 px-4 rounded border border-platinum">
Choose Network Logo File
</label>
<span id="file_name_display_NEW_RECORD" class="ml-2 text-NEXT_COLOR font-semibold">No file chosen</span>
<%= network_fields.file_field :network_logo, class: "hidden", id: "file_upload_input_NEW_RECORD", data: { add_alt_network_logo_target: "networkLogo" } %>
<div class="flex flex-col items-start w-full">
<div class="flex items-end w-full">
<div class="flex flex-col">
<%= f.select :network_logo, options_for_select(CardLogoFile.where(logo_type: 'network').pluck(:filename).map { |fn| [fn, fn]}), { include_blank: "Select or Add Network Logo", class: "rounded-r-none" }, { data: { logo_upload_target: "logoSelect" }} %>
</div>
<div class="flex items-center justify-center cursor-pointer bg-NEXT_COLOR hover:bg-deepcove border-2 border-NEXT_COLOR text-platinum font-bold px-3 rounded-r h-10 transition duration-100">
<label for="file_upload_input_NEW_RECORD" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
<div class="hidden flex justify-center ml-4 rounded-lg border-4 border-NEXT_COLOR" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Network Logo preview" class="max-h-[100px] max-w-[133px] m-1 bg-platinum"/>
</div>
</div>
</div>
<%= network_fields.file_field :network_logo_file, class: "hidden", id: "file_upload_input_NEW_RECORD", data: { add_alt_network_logo_target: "networkLogo", logo_upload_type_param: "network", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
<div class="flex items-end space-x-6 w-full">
<div class="w-full">
@@ -12,26 +23,10 @@
<div class="w-full">
<%= network_fields.text_field :exception_value, label: { text: "Exception Value" }, class: "w-full" %>
</div>
<div class="w-1/5">
</div>
<div class="flex justify-center items-end w-full">
<div class="w-1/2">
<%= network_fields.hidden_field :_destroy %>
<%= button_tag "Remove", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-NEXT_SECONDARY_COLOR hover:text-platinum py-1 px-2 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-alt-network-logo#remove" } %>
</div>
</div>
<div class="flex flex-col w-full space-y-6" data-add-network-exception-target="container"></div>
<%= button_tag "Add an exception rule", class: "cursor-pointer bg-NEXT_COLOR hover:bg-NEXT_COLOR-tinted text-platinum text-lg font-bold py-2 px-4 rounded border border-platinum w-full", data: { action: "add-network-exception#add" } %>
<template data-add-network-exception-target="template">
<%= network_fields.fields_for :alternative_network_logos, AlternativeNetworkLogo.new(network_logo: network_fields.object.network_logo), child_index: 'NEW_EXC_RECORD' do |network_fields| %>
<div class="flex items-end space-x-6 w-full">
<div class="w-full">
<%= network_fields.select :exception_type, options_for_select(["Zip","State"]), label: { text: "Exception Type" }, prompt: "Select Type", class: "w-full" %>
</div>
<div class="w-full">
<%= network_fields.text_field :exception_value, label: { text: "Exception Value" }, class: "w-full" %>
</div>
<div class="w-1/5">
<%= network_fields.hidden_field :_destroy %>
<%= button_tag "Remove", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-PARENT_SECONDARY_COLOR hover:text-platinum py-1 px-2 font-semibold leading-tight rounded-lg border-3 border-PARENT_SECONDARY_COLOR w-full", data: { action: "add-alt-network-logo#remove" } %>
</div>
</div>
<% end %>
</template>
@@ -1,4 +1,4 @@
<div class="pl-1 w-full">
<%= plan_benefits_fields.text_field :benefit, label: { text: "Benefit Value #{plan_benefits_fields.object.sequence}" }, data: { benefits_template_picker_target: "benefit", sequence: plan_benefits_fields.object.sequence}, class: "w-full" %>
<%= plan_benefits_fields.text_field :benefit, label: { text: "#{plan_benefits_fields.object.benefit_desc}" }, data: { benefits_template_picker_target: "benefit", sequence: plan_benefits_fields.object.sequence}, class: "w-full" %>
<%= plan_benefits_fields.hidden_field :sequence %>
</div>
@@ -1,5 +1,5 @@
<div class="pl-1 w-full">
<%= plan_benefits_fields.text_field :benefit, label: { text: "Benefit Value #{plan_benefits_fields.object.sequence}" }, data: { benefits_template_picker_target: "benefit", sequence: plan_benefits_fields.object.sequence}, class: "w-full" %>
<div class="pl-1 pt-2 w-full">
<%= plan_benefits_fields.text_field :benefit, label: { text: "#{plan_benefits_fields.object.benefit_desc}" }, data: { benefits_template_picker_target: "benefit", sequence: plan_benefits_fields.object.sequence}, class: "w-full" %>
<%= plan_benefits_fields.hidden_field :benefit_desc %>
<%= plan_benefits_fields.hidden_field :sequence %>
</div>
@@ -1,11 +1,13 @@
<div class="pl-1 w-full">
<%= plan_fields.text_field :title, label: { text: "Plan Title" }, class: "w-full", data: { add_plan_target: "plan" } %>
</div>
<div class="pl-1 w-full">
<%= plan_fields.text_field :plan_id, label: { text: "Plan Id" }, class: "w-full" %>
</div>
<div class="pl-1">
<%= f.select :template_id, options_from_collection_for_select(@plan_templates, :id, :title), { prompt: "Select Plan Template" }, { data: { action: "benefits-template-picker#fetchData" }} %>
<% if f.object.persisted? %>
<div class="pl-1 w-full">
<%= plan_fields.text_field :plan_id, label: { text: "Plan Id" }, class: "w-full" %>
</div>
<% 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>
@@ -1,38 +1,50 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum my-5">New Employer Setup</h1>
<%= form_with model: @employer_setup, url: employer_setup_index_path, local: true do |f| %>
<h1 class="font-bold text-4xl text-platinum my-5">Edit Employer</h1>
<%= 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="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">General Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex space-x-10">
<div class="w-1/5">
<%= f.text_field :employer_name, label: { text: "Employer Name" }, class: "w-full" %>
<div class="flex w-full items-end" data-controller="logo-upload">
<div class="flex flex-col space-y-6 w-3/5">
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :employer_name, label: { text: "Employer Name" }, data: { logo_upload_target: "initialLogoFile" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :slug, label: { text: "Slug" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :pl_plan_key, label: { text: "Pl Plan Key" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost"]), label: { text: "Provider Network" }, class: "w-full" %>
</div>
</div>
<div class="flex items-end">
<div class="flex flex-col">
<%= f.text_field :employer_logo, data: { logo_upload_target: "logofield" }, class: "w-full rounded-r-none", readonly: true %>
</div>
<div class="flex items-center justify-center 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="file_upload_input_employer" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
<%= f.file_field :add_or_update_logo, class: "hidden", id: "file_upload_input_employer", data: { logo_upload_target: "input", logo_upload_type_param: "employer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
<div class="ml-15">
<img data-logo-upload-target="preview" src="#" alt="Employer Logo preview" class="hidden max-h-[150px] max-w-[200px] bg-platinum"/>
</div>
</div>
</div>
<div class="w-1/5">
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-1/5">
<%= f.text_field :pl_plan_key, label: { text: "Pl Plan Key" }, class: "w-full" %>
</div>
<div class="w-1/5">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-1/5">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost"]), label: { text: "Provider Network" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-5 items-center mt-4">
<label for="file_upload_input" class="cursor-pointer bg-atmosphere hover:bg-bluetang text-platinum font-bold py-2 px-4 rounded border border-platinum">
Choose Employer Logo File
</label>
<span id="file_name_display" class="ml-2 text-bluemana font-semibold">No file chosen</span>
<%= f.file_field :employer_logo, class: "hidden", id: "file_upload_input" %>
</div>
<div class="w-full flex items-center">
@@ -43,50 +55,24 @@
<div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer_setup.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<% if index == 0 %>
<div class="flex flex-col w-1/2 relative items-end" data-controller="benefits-template-picker">
<div class="absolute left-[50%] top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> "></div>
<div class="inline-flex flex-col pl-1 pr-6 w-1/2">
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan 1" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
</div>
<div class="flex flex-col items-end w-full">
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<div class="flex w-full">
<div class="flex flex-col items-stretch justify-end pr-6 w-1/2">
<%= render 'plan_benefits_desc_fields', plan_benefits_fields: plan_benefits_fields %>
</div>
<div class="flex flex-col items-stretch justify-end pl-1 pr-6 w-1/2">
<%= render 'plan_benefit_only_fields', plan_benefits_fields: plan_benefits_fields %>
</div>
</div>
<% end %>
<div class="mt-4 pl-2 pr-6 w-1/2">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan 1", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-copper hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-copper w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
</div>
<% else %>
<div class="inline-flex flex-col justify-end pr-6 mt-10 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-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %>
</div>
<%= 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-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan #{index + 1}", class: "cursor-pointer bg-deepcove text-brightlava py-2 px-4 font-semibold leading-tight rounded border-3 border-#{EmployerSetupPlansForm::PLAN_COLORS[index]} w-full", data: { action: "add-plan#remove" } %>
<%= button_tag "Remove Plan #{index + 1}", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-#{index % 2 == 1 ? 'bronze' : 'copper'} hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
<% end %>
<% end %>
@@ -99,6 +85,10 @@
<%= "Plan NEW_PLAN" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: "NEW_RECORD".to_i %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 text-NEXT_COLOR">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r bg-NEXT_SECONDARY_COLOR ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
@@ -121,9 +111,9 @@
<%= 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>
<template data-add-alt-network-logo-target="template">
<%= f.fields_for :alternative_network_logos, AlternativeNetworkLogo.new, child_index: 'NEW_RECORD' do |network_fields| %>
<%= f.fields_for :alternate_network_logos, AlternateNetworkLogo.new, child_index: 'NEW_RECORD' do |network_fields| %>
<div class="flex flex-col my-8 mr-3 space-y-6 px-3" data-controller="add-network-exception" data-add-network-exception-parent-color-value="NEXT_SECONDARY_COLOR">
<%= render 'alt_network_logo_fields', network_fields: network_fields %>
<%= render 'alt_network_logo_fields', network_fields: network_fields, f: f %>
</div>
<% end %>
</template>
+10
View File
@@ -0,0 +1,10 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum my-5">Employer Setups</h1>
<% plan_colors = EmployerSetupPlansForm::PLAN_COLORS.push('copper', 'bronze').shuffle %>
<% @employer_setups.each_with_index do |es, index| %>
<% 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]}" %>">
<%= es.employer_name %>
</div>
<% end %>
</div>
+130
View File
@@ -0,0 +1,130 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<div class="flex justify-between">
<h1 class="font-bold text-4xl text-platinum my-5">New Employer</h1>
<%= form_with model: @employer_setup, url: import_employer_setup_index_path, data: { turbo: false }, local: true, multipart: true do |form| %>
<div class="flex space-x-4">
<div class="flex flex-col">
<%= form.label :import_from_word, 'ID Card Setup Word Doc', class: "block text-platinum font-bold mb-1 md:mb-0 pr-4" %>
<%= form.file_field :import_from_word %>
</div>
<%= form.submit "Import" %>
</div>
<% end %>
</div>
<%= form_with model: @employer_setup, url: employer_setup_index_path, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10">
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">General Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full items-end" data-controller="logo-upload">
<div class="flex flex-col space-y-6 w-2/5">
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :employer_name, label: { text: "Employer Name" }, data: { logo_upload_target: "employer" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost"]), label: { text: "Provider Network" }, data: { logo_upload_target: "network" }, class: "w-full" %>
</div>
</div>
<div class="flex items-start">
<div class="flex">
<div class="flex flex-col">
<%= f.text_field :employer_logo, value: "No logo added", data: { logo_upload_target: "logofield" }, class: "w-full rounded-r-none", readonly: true %>
</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">
<label for="file_upload_input_employer" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
</div>
<div class="hidden flex justify-center ml-15 rounded-lg border-4 border-atmosphere" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Employer Logo preview" class="max-h-[100px] max-w-[133px] bg-platinum m-1"/>
</div>
<%= f.file_field :add_or_update_logo, class: "hidden", id: "file_upload_input_employer", data: { logo_upload_target: "previewContainer", logo_upload_type_param: "employer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" >
<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| %>
<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-#{EmployerSetupPlansForm::PLAN_COLORS[0]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[0]}" %> -ml-[6px] z-2 w-full">
<%= "Plan 1" %>
</div>
<%= 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-#{EmployerSetupPlansForm::PLAN_COLORS[0]}" %>">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r bg-bronze ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan 1", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-copper hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-copper w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
<%= 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>
<template data-add-plan-target="template">
<%= f.fields_for :plans, Plan.new, child_index: 'NEW_RECORD' 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="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">
<%= "Plan NEW_PLAN" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: "NEW_RECORD".to_i %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 text-NEXT_COLOR">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r bg-NEXT_SECONDARY_COLOR ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan NEW_PLAN", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-NEXT_SECONDARY_COLOR hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
</template>
</div>
</div>
<div class="w-full flex items-center">
<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>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>">
<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" } %>
</div>
<template data-add-alt-network-logo-target="template">
<%= f.fields_for :alternate_network_logos, AlternateNetworkLogo.new, child_index: 'NEW_RECORD' do |network_fields| %>
<div class="flex flex-col my-8 mr-3 space-y-6 px-3 min-w-1/3" data-controller="logo-upload" data-add-network-exception-parent-color-value="NEXT_SECONDARY_COLOR">
<%= render 'alt_network_logo_fields', network_fields: network_fields, f: f %>
</div>
<% end %>
</template>
</div>
<div class="pt-8">
<%= f.submit "Submit" %>
</div>
</div>
<% end %>
</div>
@@ -0,0 +1,32 @@
<div class="flex space-x-5 items-center mt-4">
<div class="flex flex-col items-start w-full">
<div class="flex items-end w-full">
<div class="flex flex-col">
<%= f.select :network_logo, options_for_select(CardLogoFile.where(logo_type: 'network').pluck(:filename).map { |fn| [fn, fn]}), { include_blank: "Select or Add Network Logo", class: "rounded-r-none" }, { data: { logo_upload_target: "logoSelect" }} %>
</div>
<div class="flex items-center justify-center cursor-pointer bg-NEXT_COLOR hover:bg-deepcove border-2 border-NEXT_COLOR text-platinum font-bold px-3 rounded-r h-10 transition duration-100">
<label for="file_upload_input_NEW_RECORD" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
<div class="hidden flex justify-center ml-4 rounded-lg border-4 border-NEXT_COLOR" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Network Logo preview" class="max-h-[100px] max-w-[133px] m-1 bg-platinum"/>
</div>
</div>
</div>
<%= network_fields.file_field :network_logo_file, class: "hidden", id: "file_upload_input_NEW_RECORD", data: { add_alt_network_logo_target: "networkLogo", logo_upload_type_param: "network", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
<div class="flex items-end space-x-6 w-full">
<div class="w-full">
<%= network_fields.select :exception_type, options_for_select(["Zip","State"]), label: { text: "Exception Type" }, prompt: "Select Type", class: "w-full" %>
</div>
<div class="w-full">
<%= network_fields.text_field :exception_value, label: { text: "Exception Value" }, class: "w-full" %>
</div>
</div>
<div class="flex justify-center items-end w-full">
<div class="w-1/2">
<%= network_fields.hidden_field :_destroy %>
<%= button_tag "Remove", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-NEXT_SECONDARY_COLOR hover:text-platinum py-1 px-2 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-alt-network-logo#remove" } %>
</div>
</div>
@@ -0,0 +1,23 @@
<div class="flex flex-col items-stretch justify-end pr-6 pl-1 w-1/4">
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_desc_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
</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="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> rounded-bl-lg"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %>
</div>
<div class="pl-1 w-full">
<%= plan_fields.text_field :title, label: { text: "Plan Title" }, class: "w-full", data: { add_plan_target: "plan" } %>
</div>
<div class="pl-1 w-full">
<%= plan_fields.text_field :plan_id, label: { text: "Plan Id" }, class: "w-full" %>
</div>
<div class="pl-1">
<%= f.select :template_id, options_from_collection_for_select(@form.plan_templates, :id, :title), { prompt: "Select Plan Template" }, { data: { action: "benefits-template-picker#fetchData" }} %>
</div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
</div>
@@ -0,0 +1,4 @@
<div class="pl-1 w-full">
<%= plan_benefits_fields.text_field :benefit, label: { text: "#{plan_benefits_fields.object.benefit_desc}" }, data: { benefits_template_picker_target: "benefit", sequence: plan_benefits_fields.object.sequence}, class: "w-full" %>
<%= plan_benefits_fields.hidden_field :sequence %>
</div>
@@ -0,0 +1,3 @@
<div class="pl-1 w-full">
<%= plan_benefits_fields.text_field :benefit_desc, label: { text: "Benefit Description #{plan_benefits_fields.object.sequence}" }, class: "w-full" %>
</div>
@@ -0,0 +1,5 @@
<div class="pl-1 pt-2 w-full">
<%= plan_benefits_fields.text_field :benefit, label: { text: "#{plan_benefits_fields.object.benefit_desc}" }, data: { benefits_template_picker_target: "benefit", sequence: plan_benefits_fields.object.sequence}, class: "w-full" %>
<%= plan_benefits_fields.hidden_field :benefit_desc %>
<%= plan_benefits_fields.hidden_field :sequence %>
</div>
+13
View File
@@ -0,0 +1,13 @@
<div class="pl-1 w-full">
<%= plan_fields.text_field :title, label: { text: "Plan Title" }, class: "w-full", data: { add_plan_target: "plan" } %>
</div>
<% if f.object.persisted? %>
<div class="pl-1 w-full">
<%= plan_fields.text_field :pb_product_key, label: { text: "Plan Product Key" }, class: "w-full" %>
</div>
<% 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>
+126
View File
@@ -0,0 +1,126 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum my-5">Edit Employer</h1>
<%= form_with model: @employer, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6">
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">General Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full items-end" data-controller="logo-upload">
<div class="flex flex-col space-y-6 w-3/5">
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :name, label: { text: "Employer Name" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :slug, label: { text: "Slug" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :pl_plan_key, label: { text: "Pl Plan Key" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost"]), label: { text: "Provider Network" }, class: "w-full" %>
</div>
</div>
<div class="flex items-end">
<div class="flex flex-col">
<%= f.text_field :employer_logo_filename, data: { logo_upload_target: "logofield" }, class: "w-full rounded-r-none", readonly: true %>
</div>
<div class="flex items-center justify-center 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="file_upload_input_employer" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
<div class="hidden flex justify-center ml-15 rounded-lg border-4 border-atmosphere" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Employer Logo preview" class="max-h-[100px] max-w-[133px] bg-platinum m-1"/>
</div>
<%= f.file_field :add_or_update_logo, class: "hidden", id: "file_upload_input_employer", data: { logo_upload_target: "previewContainer", logo_upload_type_param: "employer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %>
<%= 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="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %>
</div>
<%= 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-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan #{index + 1}", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-#{index % 2 == 1 ? 'bronze' : 'copper'} hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
<% end %>
<%= 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" } %>
<template data-add-plan-target="template">
<%= f.fields_for :plans, @employer.build_plan_with_default_benefits, child_index: 'NEW_RECORD' 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="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">
<%= "Plan NEW_PLAN" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: "NEW_RECORD".to_i %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 text-NEXT_COLOR">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r bg-NEXT_SECONDARY_COLOR ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan NEW_PLAN", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-NEXT_SECONDARY_COLOR hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
</template>
</div>
</div>
<div class="w-full flex items-center">
<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>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>">
<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" } %>
</div>
<template data-add-alt-network-logo-target="template">
<%= f.fields_for :alternate_network_logos, AlternateNetworkLogo.new, child_index: 'NEW_RECORD' do |network_fields| %>
<div class="flex flex-col my-8 mr-3 space-y-6 px-3" data-controller="add-network-exception" data-add-network-exception-parent-color-value="NEXT_SECONDARY_COLOR">
<%= render 'alt_network_logo_fields', network_fields: network_fields, f: f %>
</div>
<% end %>
</template>
</div>
<div class="py-8">
<%= f.submit "Submit" %>
</div>
</div>
<% end %>
</div>
@@ -0,0 +1,47 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">General Information</h3>
<%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %>
<div class="flex flex-col space-y-6">
<div class="flex space-x-10">
<div class="w-1/5">
<%= f.text_field :name, label: { text: "Employer Name" }, class: "w-full" %>
</div>
<div class="w-1/5">
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-1/5">
<%= f.text_field :pl_plan_key, label: { text: "Pl Plan Key" }, class: "w-full" %>
</div>
<div class="w-1/5">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-1/5">
<%= f.select :network, options_for_select(["Cigna", "Cigna+Regional", "Medcost"]), label: { text: "Provider Network" }, data: { controller: "form-toggle", action: "change->form-toggle#toggleDivs" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-5 items-center mt-4">
<label for="file_upload_input" class="cursor-pointer bg-atmosphere hover:bg-bluetang text-platinum font-bold py-2 px-4 rounded border border-platinum">
Choose Employer Logo File
</label>
<span id="file_name_display" class="ml-2 text-bluemana font-semibold">No file chosen</span>
<%= f.file_field :employer_logo, class: "hidden", id: "file_upload_input" %>
</div>
<div class="pt-8">
<%= f.submit "Continue to Plans" %>
</div>
</div>
<% end %>
</div>
<script>
document.getElementById('file_upload_input').addEventListener('change', function(e) {
var fileName = e.target.files[0] ? e.target.files[0].name : 'No file chosen';
document.getElementById('file_name_display').textContent = fileName;
});
</script>
+21
View File
@@ -0,0 +1,21 @@
<div class="bg-deepcove h-full w-full flex flex-col justify-start">
<h1 class="font-bold text-4xl text-platinum my-5">Employers</h1>
<% plan_colors = EmployerSetupPlansForm::PLAN_COLORS.push('copper', 'bronze').shuffle %>
<h2 class="font-bold text-3xl text-platinum my-5">In Process:</h2>
<% @employers.inactive.each_with_index do |es, index| %>
<% item_color_index = index == 0 ? 0 : index % plan_colors.length %>
<div class="w-1/2 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]}" %>">
<%= link_to es.name, employer_path(es.slug), class: "hover:text-atmosphere" %>
</div>
<% end %>
<div class="w-1/2 flex text-2xl text-limegreen font-bold px-4 py-4 ml-10 rounded-lg border-l-5 border-b-2 border-platinum">
<%= link_to "New Employer", new_employer_path, class: "hover:text-verdigris" %>
</div>
<h2 class="font-bold text-3xl text-platinum my-5">Live:</h2>
<% @employers.active.each_with_index do |es, index| %>
<% item_color_index = index == 0 ? 0 : index % plan_colors.length %>
<div class="w-1/2 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]}" %>">
<%= link_to es.name, employer_path(es.slug), class: "hover:text-atmosphere" %>
</div>
<% end %>
</div>
@@ -0,0 +1,68 @@
<div class="min-h-screen w-full flex flex-col" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Provider Network</h3>
<%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %>
<div class="flex w-full justify-start">
<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" } %>
</div>
</div>
<div class="py-10">
<%= f.hidden_field :pl_plan_key, value: "fake" %>
<%= f.submit "Continue to Summary" %>
</div>
<template data-add-alt-network-logo-target="template">
<%= f.fields_for :network_exceptions, index: 'NEW_RECORD' do |network_fields| %>
<div class="flex flex-col my-8 mr-3 space-y-6 px-3" data-controller="add-network-exception">
<div class="flex space-x-5 items-center mt-4">
<label for="file_upload_input_NEW_RECORD" class="cursor-pointer bg-NEXT_COLOR hover:bg-NEXT_COLOR-tinted text-platinum font-bold py-2 px-4 rounded border border-platinum">
Choose Network Logo File
</label>
<span id="file_name_display_NEW_RECORD" class="ml-2 text-NEXT_COLOR font-semibold">No file chosen</span>
<%= network_fields.file_field :network_logo, class: "hidden", id: "file_upload_input_NEW_RECORD", data: { add_alt_network_logo_target: "networkLogo" } %>
</div>
<%= network_fields.fields_for :exceptions, index: 0 do |exception_fields| %>
<div class="flex space-x-6 w-full">
<div class="w-full">
<%= exception_fields.select :type, options_for_select(["Zip","State"]), label: { text: "Exception Type" }, prompt: "Select Type", class: "w-full" %>
</div>
<div class="w-full">
<%= exception_fields.text_field :value, label: { text: "Exception Value" }, class: "w-full" %>
</div>
</div>
<% end %>
<div class="flex flex-col w-full space-y-6" data-add-network-exception-target="container"></div>
<%= button_tag "Add an exception rule", class: "cursor-pointer bg-NEXT_COLOR hover:bg-NEXT_COLOR-tinted text-platinum text-lg font-bold py-2 px-4 rounded border border-platinum w-full", data: { action: "add-network-exception#add" } %>
<template data-add-network-exception-target="template">
<%= network_fields.fields_for :exceptions, index: 'NEW_EXC_RECORD' do |exception_fields| %>
<div class="flex space-x-6 w-full">
<div class="w-full">
<%= exception_fields.select :type, options_for_select(["Zip","State"]), label: { text: "Exception Type" }, prompt: "Select Type", class: "w-full" %>
</div>
<div class="w-full">
<%= exception_fields.text_field :value, label: { text: "Exception Value" }, class: "w-full" %>
</div>
</div>
<% end %>
</template>
</div>
<% end %>
</template>
<% end %>
</div>
<script>
const logoButtons = document.querySelectorAll('[id^="file_upload_input_"]');
logoButtons.forEach(button => {
button.addEventListener('change', function(e) {
var fileName = e.target.files[0] ? e.target.files[0].name : 'No file chosen';
var targetIndex = e.target.id.slice(-1);
document.getElementById(`file_name_display_${targetIndex}`).textContent = fileName;
});
})
</script>
+136
View File
@@ -0,0 +1,136 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<div class="flex justify-between">
<h1 class="font-bold text-4xl text-platinum my-5">New Employer</h1>
<%= form_with model: @employer, url: import_employers_path, data: { turbo: false }, local: true, multipart: true do |form| %>
<div class="flex items-end space-x-4">
<div class="flex flex-col">
<%= form.label :import_from_word, 'ID Card Setup Word Doc', class: "block text-platinum font-bold mb-1 md:mb-0 pr-4" %>
<%= form.file_field :import_from_word %>
</div>
<%= form.submit "Import", class: "h-[40px]" %>
</div>
<% end %>
</div>
<%= form_with model: @employer, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10">
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">General Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="flex w-full items-end" data-controller="logo-upload">
<div class="flex flex-col space-y-6 w-2/5">
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :name, label: { text: "Employer Name" }, data: { logo_upload_target: "employer" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :group_number, label: { text: "Group/Medical Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :effective_date, label: { text: "Effective Date" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost"]), label: { text: "Provider Network" }, data: { logo_upload_target: "network" }, class: "w-full" %>
<%= f.hidden_field :single_card_template, value: @employer.single_card_template %>
<%= f.hidden_field :default_network_logo, value: @employer.default_network_logo %>
<%= f.hidden_field :card_provider_id, value: @employer.card_provider_id %>
<%= f.hidden_field :card_rx_id, value: @employer.card_rx_id %>
</div>
</div>
<div class="flex items-end">
<div class="flex">
<div class="flex flex-col">
<%= f.text_field :employer_logo_filename, label: { text: "Employer Logo" }, default: "No logo added", data: { logo_upload_target: "logofield" }, class: "w-full rounded-r-none", readonly: true %>
</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">
<label for="file_upload_input_employer" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
</div>
<div class="hidden flex justify-center ml-15 rounded-lg border-4 border-atmosphere" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Employer Logo preview" class="max-h-[100px] max-w-[133px] bg-platinum m-1"/>
</div>
<%= f.file_field :add_or_update_logo, class: "hidden", id: "file_upload_input_employer", data: { logo_upload_target: "previewContainer", logo_upload_type_param: "employer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
</div>
</div>
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %>
<%= 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="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %>
</div>
<%= 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-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan #{index + 1}", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-copper hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-copper w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
<% end %>
<%= 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>
<template data-add-plan-target="template">
<%= f.fields_for :plans, @employer.build_plan_with_default_benefits, 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="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">
<%= "Plan NEW_PLAN" %>
</div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: "NEW_RECORD".to_i %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 text-NEXT_COLOR">
Benefit Values
</div>
<div class="w-full h-[3px] rounded-r bg-NEXT_SECONDARY_COLOR ml-[3px]"></div>
<%= plan_fields.fields_for :plan_benefits do |plan_benefits_fields| %>
<%= render 'plan_benefits_fields', plan_benefits_fields: plan_benefits_fields %>
<% end %>
<div class="mt-4 pl-1">
<%= plan_fields.hidden_field :_destroy %>
<%= button_tag "Remove Plan NEW_PLAN", class: "cursor-pointer bg-deepcove hover:bg-brightlava text-xl font-bold text-NEXT_SECONDARY_COLOR hover:text-platinum py-2 px-4 font-semibold leading-tight rounded-lg border-3 border-NEXT_SECONDARY_COLOR w-full", data: { action: "add-plan#remove" } %>
</div>
</div>
<% end %>
</template>
</div>
</div>
<div class="w-full flex items-center">
<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>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>">
<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" } %>
</div>
<template data-add-alt-network-logo-target="template">
<%= f.fields_for :alternate_network_logos, AlternateNetworkLogo.new, child_index: 'NEW_RECORD' do |network_fields| %>
<div class="flex flex-col my-8 mr-3 space-y-6 px-3 min-w-1/3 network-item" data-controller="logo-upload" data-add-network-exception-parent-color-value="NEXT_SECONDARY_COLOR">
<%= render 'alt_network_logo_fields', network_fields: network_fields, f: f %>
</div>
<% end %>
</template>
</div>
<div class="py-8">
<%= f.submit "Submit" %>
</div>
</div>
<% end %>
</div>
+72
View File
@@ -0,0 +1,72 @@
<div class="min-h-screen w-full flex flex-col" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Medical Plans</h3>
<div class="flex flex-col pl-6">
<%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %>
<div class="w-full flex my-8">
<div class="flex flex-wrap w-full" data-add-plan-target="container">
<div class="flex flex-col items-stretch justify-end pr-6 pl-1 w-1/4">
<%= f.fields_for :benefit_descs do |plan_benefit_fields| %>
<%= plan_benefit_fields.hidden_field :plan_id, value: "descriptions" %>
<% @form.benefits_template.each do |bene| %>
<div>
<%= plan_benefit_fields.text_field "benefit_#{bene.sequence}", label: { text: "Benefit Description #{bene.sequence}" }, value: "#{bene.benefit_desc}", class: "w-full" %>
</div>
<% end %>
<% end %>
</div>
<% @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="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> rounded-bl-lg"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %>
</div>
<%= f.fields_for :plans, index: i do |plan_fields| %>
<div class="pl-1 w-full">
<%= plan_fields.text_field :plan_id, label: { text: "Plan Id" }, class: "w-full", data: { add_plan_target: "plan" } %>
</div>
<div class="pl-1">
<%= f.select :template_id, options_from_collection_for_select(@form.plan_templates, :id, :title), { prompt: "Select Plan Template" }, { data: { action: "benefits-template-picker#fetchData" }} %>
</div>
<% @form.benefits_template.each do |bene| %>
<div>
<div class="pl-1 w-full">
<%= plan_fields.text_field "benefit_#{bene.sequence}", label: { text: "Benefit Value #{bene.sequence}" }, data: { benefits_template_picker_target: "benefit", sequence: "#{bene.sequence}"}, class: "w-full" %>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
<%= 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" } %>
<template data-add-plan-target="template">
<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-NEXT_COLOR rounded-bl-lg"></div>
<div class="font-bold text-2xl text-NEXT_COLOR -ml-[6px] z-2 w-full">
<%= "Plan NEW_PLAN" %>
</div>
<%= f.fields_for :plans, index: 'NEW_RECORD' do |plan_fields| %>
<div class="pl-1 w-full">
<%= plan_fields.text_field :plan_id, label: { text: "Plan Id" }, class: "w-full", data: { add_plan_target: "plan" } %>
</div>
<div class="pl-1">
<%= f.select :template_id, options_from_collection_for_select(@form.plan_templates, :id, :title), { prompt: "Select Plan Template" }, { data: { action: "benefits-template-picker#fetchData" }} %>
</div>
<% @form.benefits_template.each do |bene| %>
<div>
<div class="pl-1 w-full">
<%= plan_fields.text_field "benefit_#{bene.sequence}", label: { text: "Benefit Value #{bene.sequence}" }, data: { benefits_template_picker_target: "benefit", sequence: "#{bene.sequence}"}, class: "w-full" %>
</div>
</div>
<% end %>
<% end %>
</div>
</template>
</div>
</div>
<div class="py-10">
<%= f.submit "Continue to Provider Network" %>
</div>
<% end %>
</div>
</div>
+58
View File
@@ -0,0 +1,58 @@
<div class="bg-deepcove text-platinum h-full w-full flex flex-col">
<div class="flex w-full items-center space-x-4">
<h1 class="font-bold text-4xl text-platinum my-5"><%= @employer.name %></h1>
<div class="h-[50px] max-w-[200px]">
<%= image_tag image_card_logo_file_path(@employer.employer_logo_filename), class: "max-h-[50px] object-contain shadow-[0_0_10px_3px_#93c5fd]" %>
</div>
</div>
<div class="flex space-x-6">
<div class="flex flex-col space-y-1 w-1/3">
<div class="w-full flex items-center">
<h3 class="grow-0 font-bold text-2xl text-bluemana">Employer Information</h3>
<div class="h-[1px] grow mt-2 bg-bluemana"></div>
</div>
<div class="flex flex-col space-y-1 ml-4">
<p class="text-<%="#{@employer.active == false ? "brightlava" : "limegreen"}" %>">
<strong class="text-platinum mr-2">└── Status:</strong>
<%= @employer.active == false ? "inactive" : "active" %>
</p>
<p class="ml-9 text-bluemana">
<strong class="text-platinum mr-2">├── Effective Date:</strong>
<%= @employer.effective_date %>
</p>
<div>
<strong class="text-atmosphere mr-2">└── Key Chain</strong>
</div>
<% @employer.attributes.with_indifferent_access.slice(:pl_plan_key, :company_pb_entity_key, :group_number).each do |attribute_name, attribute_value| %>
<p class="ml-9 text-<%="#{attribute_value.present? ? "limegreen" : "brightlava"}" %>">
<strong class="text-platinum mr-2">├── <%= attribute_name.humanize %>:</strong>
<%= attribute_value.present? ? attribute_value.to_s : "waiting" %>
</p>
<% end %>
<div>
<strong class="text-atmosphere mr-2">└── Plans</strong>
</div>
<% @employer.plans.pluck(:title).each do |plan_title| %>
<div class="ml-9">
├── <%= plan_title %>
</div>
<% end %>
</div>
<div class="w-full flex items-center space-x-2 mt-10 ml-14">
<%= link_to 'Edit', edit_employer_path(@employer.slug), class: "hover:text-atmosphere" %>
<p>|</p>
<%= link_to 'Back', employers_path, class: "hover:text-atmosphere" %>
</div>
</div>
<div class="flex flex-col space-y-6 w-1/3">
<div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">Actions</h3>
<div class="h-[1px] w-2/3 mt-2 bg-bluemana"></div>
</div>
<%= link_to 'Generate Sample Cards', generate_sample_sample_id_cards_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for print)', generate_print_sample_id_cards_path(employer_slug: @employer.slug ),data: { turbo: false }, class: "flex justify-center items-center w-2/3 #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for display)', generate_sample_sample_id_cards_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 pointer-events-none opacity-50 cursor-not-allowed bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for download)', generate_sample_sample_id_cards_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-2/3 pointer-events-none opacity-50 cursor-not-allowed bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
</div>
</div>
</div>
+9
View File
@@ -0,0 +1,9 @@
<div class="bg-deepcove min-h-screen w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Summary</h3>
<%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %>
<div class="py-10">
<%= f.submit "Submit" %>
</div>
<% end %>
</div>
+3 -2
View File
@@ -9,13 +9,14 @@
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>
<script src="https://cdn.jsdelivr.net/gh/benkaiser/fileinput-image-resize@1.0.0/dist/bundle.js"></script>
</head>
<body>
<main>
<div class="w-full min-h-screen flex flex-col bg-black justify-center items-center">
<div class="min-h-full w-[calc(100%-1rem)] mt-1 mb-2 flex flex-grow justify-center items-center shadow-[0_0_10px_3px_#93c5fd] rounded-xl bg-[#04153E]">
<div class="min-h-full w-11/12 mt-8 px-5 flex flex-grow justify-center items-center">
<div class="min-h-full w-[calc(100%-1rem)] mt-1 mb-2 flex grow justify-center shadow-[0_0_10px_3px_#93c5fd] rounded-xl bg-[#04153E]">
<div class="h-full w-11/12 mt-8 px-5 flex grow justify-center">
<%= yield %>
</div>
</div>
@@ -14,4 +14,5 @@
<div class="text-verdigris bg-verdigris border border-verdigris">co</div>
<div class="text-verdigris-tinted bg-verdigris-tinted border border-verdigris-tinted">co</div>
<div class="text-brightlava bg-brightlava border border-brightlava">co</div>
<div class="text-limegreen bg-brightlava border border-brightlava">co</div>
+11 -6
View File
@@ -19,14 +19,19 @@ default: &default
# https://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
dev_tools:
baclight:
<<: *default
host: db
database: dev_tools_dev
username: sa
password: Br1tt0nPassw0rd
# host: db
# database: dev_tools_dev
# username: sa
# password: Br1tt0nPassw0rd
host: 10.41.82.73 #Dev
port: 1433
database: BrittonConnect
username: BSTI
password: BSTIBOY
tds_version: 7.3
vhcs:
<<: *default
# host: 10.41.82.72 #Prod
+25
View File
@@ -0,0 +1,25 @@
RailsIcons.configure do |config|
config.default_library = "boxicons"
# config.default_variant = "" # Set a default variant for all libraries
# Override Boxicons defaults
# config.libraries.boxicons.default_variant = "" # Set a default variant for Boxicons
# config.libraries.boxicons.exclude_variants = [] # Exclude specific variants
# config.libraries.boxicons.solid.css = "size-6"
# config.libraries.boxicons.solid.data = {}
# config.libraries.boxicons.regular.css = "size-6"
# config.libraries.boxicons.regular.data = {}
# config.libraries.boxicons.logos.css = "size-6"
# config.libraries.boxicons.logos.data = {}
# Override Lucide defaults
# config.libraries.lucide.default_variant = "" # Set a default variant for Lucide
# config.libraries.lucide.exclude_variants = [] # Exclude specific variants
# config.libraries.lucide.outline.default.css = "size-6"
# config.libraries.lucide.outline.default.stroke_width = "1.5"
# config.libraries.lucide.outline.default.data = {}
end
+19 -1
View File
@@ -1,7 +1,25 @@
# frozen_string_literal: true
Rails.application.routes.draw do
resources :employer_setup, only: [:new, :create, :edit, :update]
resources :card_rxes
resources :card_providers
resources :card_logo_files do
get 'image', on: :member, constraints: { id: /.*/ }
end
# resources :employer_setup
resources :employers do
collection do
post 'import'
end
end
resources :sample_id_cards do
collection do
get 'generate_sample'
get 'generate_print'
end
end
get 'id_card_benefits_templates/get_template_benefits/:id', to: 'id_card_benefits_templates#get_template_benefits'
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
@@ -1,16 +0,0 @@
class CreateEmployerSetupProcesses < ActiveRecord::Migration[7.2]
def change
create_table :employer_setup_processes do |t|
t.string :employer_name
t.string :group_number
t.string :effect_date
t.string :logo_filename
t.string :form_method
t.string :status
t.string :current_step
t.timestamps
end
end
end
@@ -0,0 +1,26 @@
class CreateEmployers < ActiveRecord::Migration[7.2]
def change
create_table :employers do |t|
t.string :name
t.string :id_card_display_name
t.string :slug
t.string :pl_plan_key
t.integer :company_pb_entity_key
t.integer :plan_id
t.string :group_number
t.string :rx_group_number
t.string :effective_date
t.string :employer_logo_filename
t.string :network_provider
t.string :default_network_logo
t.string :single_card_template
t.string :multiple_card_template
t.boolean :active, default: false
t.timestamps
end
end
end
+2 -2
View File
@@ -2,8 +2,8 @@ class CreatePlans < ActiveRecord::Migration[7.2]
def change
create_table :plans do |t|
t.string :title
t.references :employer_setup_process, null: false, foreign_key: true
t.integer :pb_product_key
t.references :employer, null: false, foreign_key: true
t.timestamps
end
@@ -1,10 +1,10 @@
class CreateNetworkLogos < ActiveRecord::Migration[7.0]
def change
create_table :alternate_network_logos do |t|
t.string :network_logo
t.string :network_logo_filename
t.string :exception_type
t.string :exception_value
t.belongs_to :employer_setup_process, null: false, foreign_key: true
t.belongs_to :employer, null: false, foreign_key: true
t.timestamps
end
@@ -2,9 +2,10 @@ class CreateCardLogoFiles < ActiveRecord::Migration[7.2]
def change
create_table :card_logo_files do |t|
t.string :filename
t.binary :image_data
t.string :content_type
t.string :logo_type
t.binary :image
t.integer :pl_plan_key
t.boolean :active, default: false
t.timestamps
end
@@ -0,0 +1,79 @@
class CreateSampleIdCards < ActiveRecord::Migration[7.0]
def change
create_table :sample_id_cards do |t|
t.string :full_name
t.string :family_id
t.string :primary_mb_member_key
t.string :employer_name
t.string :group_number
t.string :rx_group
t.string :medical_eff_date
t.string :provider_code
t.string :provider_line_1
t.string :provider_line_2
t.string :provider_line_3
t.string :provider_line_4
t.string :provider_line_5
t.string :provider_line_6
t.string :provider_line_7
t.string :provider_line_8
t.string :provider_line_9
t.string :provider_line_10
t.string :provider_line_11
t.string :provider_line_12
t.string :claim_to_1
t.string :claim_to_2
t.string :claim_to_3
t.string :claim_to_4
t.string :claim_to_5
t.string :claim_to_6
t.string :claim_to_7
t.string :claim_to_8
t.string :claim_to_9
t.string :claim_to_10
t.string :claim_to_11
t.string :claim_to_12
t.string :customer_service
t.string :web_url
t.string :dependent_1
t.string :dependent_2
t.string :dependent_3
t.string :dependent_4
t.string :dependent_5
t.string :dependent_6
t.string :dependent_7
t.string :dependent_8
t.string :plan_id
t.string :benefit_desc_1
t.string :benefit_1
t.string :benefit_desc_2
t.string :benefit_2
t.string :benefit_desc_3
t.string :benefit_3
t.string :benefit_desc_4
t.string :benefit_4
t.string :benefit_desc_5
t.string :benefit_5
t.string :benefit_desc_6
t.string :benefit_6
t.string :benefit_desc_7
t.string :benefit_7
t.string :benefit_desc_8
t.string :benefit_8
t.string :benefit_desc_9
t.string :benefit_9
t.string :benefit_desc_10
t.string :benefit_10
t.string :benefit_desc_11
t.string :benefit_11
t.string :benefit_desc_12
t.string :benefit_12
t.string :benefit_desc_13
t.string :benefit_13
t.string :benefit_desc_14
t.string :benefit_14
t.timestamps
end
end
end

Some files were not shown because too many files have changed in this diff Show More