DB restructure, print page

This commit is contained in:
Jason Jordan
2026-03-13 08:47:13 -04:00
parent 6a068243f4
commit 8c885b3e76
73 changed files with 1362 additions and 325 deletions
+4
View File
@@ -19,6 +19,8 @@
--color-cobalt: #0047AB; --color-cobalt: #0047AB;
/* cobalt blue */ /* cobalt blue */
--color-cobalt-tinted: #003B8F; --color-cobalt-tinted: #003B8F;
/* cobalt blue */
--color-cobalt-vivid: #005DE0;
/* platinum */ /* platinum */
--color-platinum: #E0E0E0; --color-platinum: #E0E0E0;
/* copper */ /* copper */
@@ -33,6 +35,8 @@
--color-verdigris: #588288; --color-verdigris: #588288;
/* oxidized copper/bronze green-blue */ /* oxidized copper/bronze green-blue */
--color-verdigris-tinted: #496A6F; --color-verdigris-tinted: #496A6F;
/* oxidized copper/bronze green-blue */
--color-verdigris-vivid: #618D94;
/* alert red */ /* alert red */
--color-brightlava: #f80800; --color-brightlava: #f80800;
/* alert green */ /* alert green */
@@ -0,0 +1,61 @@
module IdCard
class NetworkLogosController < ApplicationController
# View Methods
def index
end
def show
end
def new
end
def create
file = logo_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)
networklogo = IdCard::NetworkLogo.create(
filename: filename,
image_data: binary_data,
content_type: meme_type
)
render json: networklogo, only: [:id], status: :ok
end
end
def edit
end
def update
end
def destroy
end
# API Methods
def image
logo_file = IdCard::NetworkLogo.find(params[:id])
puts params[:id]
logo_binary = logo_file.image_data
logo_filename = logo_file.filename
send_data logo_binary,
filename: logo_filename,
disposition: 'inline'
end
private
def logo_params
params.require(:id_card_network_logo).permit(:logo_file)
end
end
end
@@ -0,0 +1,35 @@
module IdCard
class PlansController < ApplicationController
# View Methods
def new
end
def create
end
def edit
end
def update
end
def destroy
end
# API Methods
def get_plan_benefits
@plan_benefits = IdCard::Plan.find(params[:id]).plan_benefits
render json: @plan_benefits.as_json
end
private
end
end
@@ -0,0 +1,27 @@
module IdCard
class PrinterController < ApplicationController
# View Methods
def index
@employer_configurations = IdCard::Configuration.active.to_a.sort_by { |config| config.pl_plan_key.to_i }
add_queued_count_to_card_configuration
render :index
end
# API Methods
private
def add_queued_count_to_card_configuration
@queue_counts = EmployerCards::QueueCounter.new().call
@queue_counts.each do |qc|
match = @employer_configurations.find { |configuration| configuration.pl_plan_key == qc["PLPlanKey"] }
if match.present?
match.queued_card_count = qc["QueuedCardsCount"]
end
end
end
end
end
@@ -0,0 +1,40 @@
module IdCard
class ProviderSectionsController < ApplicationController
# View Methods
def index
end
def show
end
def new
end
def create
end
def edit
end
def update
end
def destroy
end
# API Methods
def get_section_data
@provider_section = IdCard::ProviderSection.find(params[:id])
render json: @provider_section.as_json
end
private
def logo_params
params.require(:id_card_network_logo).permit(:logo_file)
end
end
end
+89 -36
View File
@@ -1,41 +1,25 @@
module IdCard module IdCard
class SetupController < ApplicationController class ConfigurationController < ApplicationController
before_action :set_employer_and_setup
# View Methods # View Methods
def new
@employer = Employer.find_by(slug: params[:employer])
@setup = @employer.create_id_card_setup
render :new
end
def create
xyz
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
render :new
end
end
def edit def edit
@employer = Employer.find_by(slug: params[:id]) @employer = Employer.find_by(slug: params[:employer_id])
if @employer.id_card_enabled?
@setup = @employer.id_card_setup
else
@setup = @employer.create_id_card_setup
end
render :edit render :edit
end end
def update def update
puts "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" setup_params = IdCard::Configuration.permitted_params(params)
employer_params = Employer.permitted_params(params) @setup = IdCard::Configuration.find(params[:id])
@employer = Employer.find(params[:id])
if @employer.update(employer_params) if @setup.update(setup_params)
puts "sucess" puts "sucess"
redirect_to employer_path(@employer.slug), notice: 'Employer was successfully updated.' redirect_to employer_path(@setup.employer.slug), notice: 'ID Card Configuration was successfully updated.'
else else
puts "fail" puts "fail"
render :edit, status: :unprocessable_entity render :edit, status: :unprocessable_entity
@@ -43,6 +27,66 @@ module IdCard
end end
def general
provider_defaults = IdCard::ProviderSection.defaults
@provider_options = provider_defaults.map { |p| ["Default #{p.title}", p.id] }.concat(provider_defaults.map { |p| ["New #{p.title}", "new|#{p.id}"] })
if @setup.provider_section_id.present? && provider_defaults.map(&:id).exclude?(@setup.provider_section_id)
@provider_options.insert(0, ["#{@employer.name} Custom", @setup.provider_section_id])
end
@rx_options = IdCard::RxSection.all
@fairos_rx_id = IdCard::RxSection.find_by(title: "FairosRx").id
render :general
end
def update_general
if params[:id_card_setup]["provider_section_id"].include?("new|")
new_provider_section_params = IdCard::ProviderSection.permitted_params(params)
new_provider_section = IdCard::ProviderSection.create(new_provider_section_params)
params[:id_card_setup]["provider_section_id"] = new_provider_section.id
end
general_params = IdCard::Configuration.permitted_params(params)
if @setup.update(general_params)
puts "sucess"
redirect_to employer_path(@employer.slug), notice: 'ID Card Configuration was successfully updated.'
else
puts "fail"
render :general, status: :unprocessable_entity
end
end
def plans
@plan_templates = IdCard::Plan.templates
render :plans
end
def update_plans
plans_params = IdCard::Plan.permitted_params(params)
if @setup.update(plans_params)
puts "sucess"
redirect_to employer_path(@setup.employer.slug), notice: 'ID Card Plans successfully updated.'
else
puts "fail"
render :plans, status: :unprocessable_entity
end
end
def field_exceptions
render :field_exceptions
end
def update_field_exceptions
field_exceptions_params = IdCard::FieldException.permitted_params(params)
if @setup.update(field_exceptions_params)
puts "sucess"
redirect_to employer_path(@setup.employer.slug), notice: 'ID Card Exceptions successfully updated.'
else
puts "fail"
render :field_exceptions, status: :unprocessable_entity
end
end
def destroy def destroy
# @resource = Resource.find(params[:id]) # @resource = Resource.find(params[:id])
# @resource.destroy # @resource.destroy
@@ -53,6 +97,15 @@ module IdCard
private private
def set_employer_and_setup
@employer = Employer.find_by(slug: params[:employer_id])
if @employer.id_card_setup.present?
@setup = @employer.id_card_setup
else
@setup = @employer.create_id_card_setup
end
end
# def process_logos(employer_setup_process_params) # def process_logos(employer_setup_process_params)
# @uploaded_logos = [] # @uploaded_logos = []
# employer_logo = employer_setup_process_params["employer_logo"] # employer_logo = employer_setup_process_params["employer_logo"]
@@ -129,15 +182,15 @@ module IdCard
# ) # )
# end # end
# def network_exceptions_params # def network_field_exceptions_params
# params.require(:employer_setup_network_exceptions_form).permit( # params.require(:employer_setup_network_field_exceptions_form).permit(
# network_exceptions: [:network_logo, exceptions: [:type, :value]], # network_field_exceptions: [:network_logo, field_exceptions: [:type, :value]],
# ) # )
# end # end
# def form_for_step # def form_for_step
# step_name = @top_form.current_step # step_name = @top_form.current_step
# form_method = "EmployerSetup#{step_name.camelize}Form".constantize # form_method = "EmployerConfiguration#{step_name.camelize}Form".constantize
# # puts "/////\\\\\\||||||" # # puts "/////\\\\\\||||||"
# # puts session[:employer_setup_data] # # puts session[:employer_setup_data]
# # puts session[:employer_setup_data]['employer_setup_process_id'] # # puts session[:employer_setup_data]['employer_setup_process_id']
@@ -146,7 +199,7 @@ module IdCard
# end # end
# def process_step(step_name) # def process_step(step_name)
# @form_method = "EmployerSetup#{step_name.camelize}Form".constantize # @form_method = "EmployerConfiguration#{step_name.camelize}Form".constantize
# session_data_name = "#{step_name}_data" # session_data_name = "#{step_name}_data"
# # puts "1--------------params----" # # puts "1--------------params----"
# # puts params # # puts params
@@ -180,13 +233,13 @@ module IdCard
# def global_params(step_name) # def global_params(step_name)
# form_name_sym = "employer_setup_#{step_name}_form".to_sym # form_name_sym = "employer_setup_#{step_name}_form".to_sym
# params.require(form_name_sym).permit(EmployerSetupForm.permitted_params) # params.require(form_name_sym).permit(EmployerConfigurationForm.permitted_params)
# end # end
# def process_step(step_name) # def process_step(step_name)
# form_name = "employer_setup_#{step_name}_form".camelize.constantize # form_name = "employer_setup_#{step_name}_form".camelize.constantize
# form_params_name = "#{step_name}_params".to_sym # form_params_name = "#{step_name}_params".to_sym
# allowed_params = [:general_information_params, :plans_params, :network_exceptions_params] # allowed_params = [:general_information_params, :plans_params, :network_field_exceptions_params]
# if allowed_params.include?(form_params_name) # if allowed_params.include?(form_params_name)
# form_params = send(form_params_name) # form_params = send(form_params_name)
# @form = form_name.new(form_params) # @form = form_name.new(form_params)
@@ -211,7 +264,7 @@ module IdCard
# :number_of_plans, # :number_of_plans,
# :network, # :network,
# :number_of_additional_network_logos, # :number_of_additional_network_logos,
# network_exceptions: [:network_logo, exceptions: [:type, :value]], # network_field_exceptions: [:network_logo, field_exceptions: [:type, :value]],
# plans: permited_plans_keys, # plans: permited_plans_keys,
# benefit_descs: benefit_sequence_keys # benefit_descs: benefit_sequence_keys
# ) # )
@@ -4,10 +4,11 @@ export default class extends Controller {
static targets = ["exceptionItemTemplate", "exceptionItemContainer", "exceptionItem", "exceptionItemButton"] static targets = ["exceptionItemTemplate", "exceptionItemContainer", "exceptionItem", "exceptionItemButton"]
connect() { connect() {
if (this.exceptionItemTargets.length > 0) {
const content = this.#newExemptionItem() const content = this.#newExemptionItem()
this.exceptionItemButtonTarget.insertAdjacentHTML('beforebegin', content); this.exceptionItemButtonTarget.insertAdjacentHTML('beforebegin', content);
} }
}
addExemptionItem(event) { addExemptionItem(event) {
event.preventDefault() event.preventDefault()
@@ -36,6 +37,7 @@ export default class extends Controller {
#newExemptionItem() { #newExemptionItem() {
const nextIndex = this.exceptionItemTargets.length const nextIndex = this.exceptionItemTargets.length
console.log(nextIndex)
const buttonElement = this.exceptionItemButtonTarget; const buttonElement = this.exceptionItemButtonTarget;
// Get the computed style (returns rgb/rgba value) // Get the computed style (returns rgb/rgba value)
@@ -33,6 +33,7 @@ export default class extends Controller {
#updateTemplatePlan() { #updateTemplatePlan() {
const nextIndex = this.planTargets.length const nextIndex = this.planTargets.length
console.log(nextIndex)
const num_of_colors = this.formColorValue.length const num_of_colors = this.formColorValue.length
let colorIndex = 0 let colorIndex = 0
let newSecondaryColor = "copper" let newSecondaryColor = "copper"
@@ -14,7 +14,7 @@ export default class extends Controller {
return; return;
} }
const url = `/id_card_benefits_templates/get_template_benefits/${templateId}` const url = `/id_card/plans/${templateId}/get_plan_benefits`
const response = await fetch(url); const response = await fetch(url);
const templateBenefitsData = await response.json(); const templateBenefitsData = await response.json();
@@ -0,0 +1,57 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["dependentField", "providerField", "selectField"]
connect() {
console.log("--- in toggle connect --- ")
const selector = this.selectFieldTarget;
if (selector.value) {
const selectedValue = selector.value
this.dependentFieldTargets.forEach((field) => {
if (field.value) {
if (selectedValue == "network_logo") {
field.parentElement.parentElement.parentElement.classList.remove("hidden");
} else {
field.parentElement.classList.remove("hidden");
}
}
})
}
}
toggleFields() {
console.log("--- in toggle --- ")
const selector = this.selectFieldTarget;
if (selector.value) {
const selectedValue = selector.value
this.field_match = false;
this.dependentFieldTargets.forEach((field) => {
// console.log("- ", selectedValue)
// console.log("-- ", this.field_match)
// Check a data attribute on the field to see if it matches the selected value
if (field.dataset.parentValue === selectedValue) {
if (selectedValue == "network_logo") {
field.parentElement.parentElement.parentElement.classList.remove("hidden");
} else {
field.parentElement.classList.remove("hidden");
}
this.field_match = true;
} else {
if (field.dataset.parentValue == "network_logo") {
field.parentElement.parentElement.parentElement.classList.add("hidden");
} else {
field.parentElement.classList.add("hidden");
}
}
});
if (!this.field_match) {
console.log("--- ", this.field_match)
const defaultOption = this.dependentFieldTargets.find(target => {
return target.dataset.parentValue === 'default';
});
defaultOption.parentElement.classList.remove("hidden");
}
}
}
}
@@ -1,9 +1,78 @@
import { Controller } from "@hotwired/stimulus" import { Controller } from "@hotwired/stimulus"
export default class extends Controller { export default class extends Controller {
static targets = ["dependentField"] static targets = ["dependentField", "providerField", "selectField"]
connect() { connect() {
if (this.selectFieldTarget.value) {
this.toggleNewFieldSection();
}
}
async initNewFieldSection() {
console.log("--- in init async --- ")
const selector = this.selectFieldTarget
console.log(selector.textContent)
console.log(selector.value)
if (selector && selector.value && !selector.textContent.includes("Default")) {
const sectionId = selector.value
const response = await fetch(`/id_card/provider_sections/${sectionId}/get_section_data`);
const templateSectionData = await response.json();
this.#updateFields(templateSectionData)
this.dependentFieldTarget.classList.remove("hidden");
}
}
async toggleNewFieldSection() {
console.log("--- in new field toggle --- ")
const selector = this.selectFieldTarget
const selectedOption = selector.options[selector.selectedIndex]
const selectedValue = selectedOption.value
const selectedLabel = selectedOption.textContent
if (selectedValue && selectedLabel.includes("Default")) {
this.dependentFieldTarget.classList.add("hidden");
} else if (selectedValue) {
let sectionId = selectedValue
if (selectedValue.includes("new")) {
sectionId = selectedValue.split('|')[1]
}
const response = await fetch(`/id_card/provider_sections/${sectionId}/get_section_data`);
const sectionData = await response.json();
this.#updateFields(sectionData)
this.dependentFieldTarget.classList.remove("hidden");
}
}
async #updateFields(templateSectionData) {
const providerFieldTargetsList = this.providerFieldTargets
console.log(templateSectionData)
providerFieldTargetsList.forEach(function(formField) {
const dbField = formField.id.replace('id_card_configuration_provider_section_', '')
const dbValue = templateSectionData[dbField]
formField.value = dbValue;
})
// templateSectionData.forEach(function(data) {
// const targetElement = providerFieldTargetsList.find(
// (element) => element.dataset.sequence == data.sequence
// );
// if (targetElement) {
// targetElement.value = data.benefit;
// } else {
// console.error(`Target not found for sequence: ${data.sequence}`);
// }
// });
} }
toggleFields() { toggleFields() {
@@ -5,21 +5,38 @@ export default class extends Controller {
logoType: String, logoType: String,
employerName: String employerName: String
} }
static targets = ["preview", "previewContainer", "logoSelect", "logoField", "initialLogoFile"]; static targets = ["preview", "previewContainer", "logoSelect", "logoIdField", "logoNameField", "initialLogoFile"];
async connect() { async connect() {
console.log('in connect'); console.log('in connect');
const initValue = this.logoFieldTarget.value this.setPreviewImage()
// Remember to revoke the URL when the controller is disconnected if necessary
// this.disconnect = () => URL.revokeObjectURL(objectUrl);
}
async setPreviewImage() {
const initValue = this.logoIdFieldTarget.value
console.log(initValue) console.log(initValue)
console.log(this.logoTypeValue)
if (initValue) { if (initValue) {
const response = await fetch(`/id_card/${this.logoTypeValue}_logos/${initValue}/image`); // Fetch the binary data const response = await fetch(`/id_card/${this.logoTypeValue}_logos/${initValue}/image`); // Fetch the binary data
const logoType = this.logoTypeValue
if (logoType == "employer") {
const contentDisposition = response.headers.get('Content-Disposition');
const filename = contentDisposition.match(/filename="?([^"]+)"?/)[1];
this.logoNameFieldTarget.value = filename;
}
const blob = await response.blob(); const blob = await response.blob();
const objectUrl = URL.createObjectURL(blob); const objectUrl = URL.createObjectURL(blob);
this.previewTarget.src = objectUrl; this.previewTarget.src = objectUrl;
this.previewContainerTarget.classList.remove("hidden"); this.previewContainerTarget.classList.remove("hidden");
} else {
this.previewContainerTarget.classList.add("hidden");
} }
// Remember to revoke the URL when the controller is disconnected if necessary }
// this.disconnect = () => URL.revokeObjectURL(objectUrl);
setSelectPreview(event) {
this.setPreviewImage()
} }
uploadLogo(event) { uploadLogo(event) {
@@ -34,19 +51,25 @@ export default class extends Controller {
if (logoType == "network") { if (logoType == "network") {
console.log("n " + newFileName); console.log("n " + newFileName);
newFileName = this.determineNetworkFilename(logoFile) newFileName = this.determineNetworkFilename(logoFile)
this.addOptionToSelect(newFileName)
logoFile = new File([logoFile], newFileName)
} else if (logoType == "employer") { } else if (logoType == "employer") {
newFileName = this.determineEmployerFilename(logoFile) newFileName = this.determineEmployerFilename(logoFile)
logoFile = new File([logoFile], newFileName)
} }
logoFile = new File([logoFile], newFileName)
this.uploadLogoToServer(logoFile) this.uploadLogoToServer(logoFile)
.then((result) => { .then((result) => {
console.log(result); console.log(result);
const logoId = result.id const logoId = result.id
this.previewFile(logoFile); this.previewFile(logoFile);
this.logoFieldTarget.value = logoId; if (logoType == "network") {
this.addOptionToSelect(newFileName, logoId)
} else {
this.logoNameFieldTarget.value = newFileName;
}
this.logoIdFieldTarget.value = logoId;
}) })
.catch((error) => { .catch((error) => {
// Handle any errors that occurred // Handle any errors that occurred
@@ -93,23 +116,22 @@ export default class extends Controller {
} }
} }
addOptionToSelect(name) { addOptionToSelect(name, id) {
const blankOptionIndex = 0; const blankOptionIndex = 0;
const newOption = new Option(name, name, true, true) const newOption = new Option(name, id, true, true)
if (this.logoFieldTarget.options.length > blankOptionIndex + 1) { if (this.logoIdFieldTarget.options.length > blankOptionIndex + 1) {
this.logoFieldTarget.insertBefore(newOption, this.logoFieldTarget.options[blankOptionIndex + 1]); this.logoIdFieldTarget.insertBefore(newOption, this.logoIdFieldTarget.options[blankOptionIndex + 1]);
} else { } else {
this.logoFieldTarget.appendChild(newOption); this.logoIdFieldTarget.appendChild(newOption);
} }
this.logoFieldTarget.value = name;
} }
determineNetworkFilename(logoFile) { determineNetworkFilename(logoFile) {
const fileExtension = logoFile.name.split('.').pop(); const fileExtension = logoFile.name.split('.').pop();
const primaryNetworkName = prompt("Enter the name for the primary network (Usually 'Cigna' or 'MedCost':"); 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 secondaryNetworkName = prompt("Enter the name for the partner network (ex: Health Partners):");
const logoFilename = this.titleizeText(primaryNetworkName).concat(this.titleizeText(secondaryNetworkName)).concat("Logo.").concat(fileExtension).replaceAll(' ', ''); const logoFilename = this.titleizeText(primaryNetworkName).concat(this.titleizeText(secondaryNetworkName)).concat("Logo.").concat(fileExtension).replaceAll(' ', '');
return logoFilename return logoFilename
@@ -0,0 +1,25 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["providerNetworkField", "networkLogoField", "providerSectionField"]
connect() {
console.log("---provider update---")
}
syncDefaults() {
const pnValue = this.providerNetworkFieldTarget.value
if (pnValue == "Cigna") {
this.networkLogoFieldTarget.value = 1
this.providerSectionFieldTarget.value = 30
} else if (pnValue == "Medcost") {
this.networkLogoFieldTarget.value = 2
this.providerSectionFieldTarget.value = 26
} else {
this.networkLogoFieldTarget.value = ""
this.providerSectionFieldTarget.value = ""
}
const event = new Event('change', { bubbles: true });
this.networkLogoFieldTarget.dispatchEvent(event);
}
}
+9 -1
View File
@@ -1,6 +1,6 @@
class Employer < ApplicationRecord class Employer < ApplicationRecord
has_many :members has_many :members
has_one :id_card_setup, class_name: 'IdCard::Setup', dependent: :destroy has_one :id_card_configuration, class_name: 'IdCard::Configuration', dependent: :destroy
scope :active, -> { where(active: true) } scope :active, -> { where(active: true) }
scope :inactive, -> { where(active: false) } scope :inactive, -> { where(active: false) }
@@ -38,6 +38,14 @@ class Employer < ApplicationRecord
self.slug = employer_trim_name(self.name).parameterize self.slug = employer_trim_name(self.name).parameterize
end end
def id_card_enabled?
self.id_card_configuration.present?
end
def claims_check_enabled?
false
end
# def name_to_logo_filename(extension) # def name_to_logo_filename(extension)
# self.employer_trim_name(self.name).titleize.gsub(/\s+/, '').concat('Logo').concat(extension.downcase) # self.employer_trim_name(self.name).titleize.gsub(/\s+/, '').concat('Logo').concat(extension.downcase)
# end # end
+2 -2
View File
@@ -5,11 +5,11 @@ module IdCard
private private
def calculate_aspect_ratio def calculate_aspect_ratio
image_io = StringIO.new(self.image_data) image_io = StringIO.new(image_data)
width, height = FastImage.size(image_io) width, height = FastImage.size(image_io)
image_ratio = width.to_f / height image_ratio = width.to_f / height
if image_ratio if image_ratio
self.aspect_ratio = image_ratio.round(2) aspect_ratio = image_ratio.round(2)
end end
end end
end end
-12
View File
@@ -1,12 +0,0 @@
module IdCard
class Exception < ApplicationRecord
belongs_to :setup
has_many :exception_items
accepts_nested_attributes_for :exception_items, allow_destroy: true, reject_if: :all_blank
VALID_TYPES = ['zipcode', 'state', 'family_id']
validates :type, inclusion: { in: VALID_TYPES,
message: "%{value} is not a valid exception type" }
end
end
+35
View File
@@ -0,0 +1,35 @@
module IdCard
class FieldException < ApplicationRecord
belongs_to :configuration
has_many :field_exception_items, dependent: :destroy
accepts_nested_attributes_for :field_exception_items, allow_destroy: true, reject_if: :all_blank
VALID_TYPES = ['zipcode', 'state', 'family_id']
validates :exception_type, inclusion: { in: VALID_TYPES,
message: "%{value} is not a valid exception type" }
class << self
def permitted_params(params)
params.require(:id_card_configuration).permit(
field_exceptions_attributes: [
:exception_type,
:exception_value,
:_destroy,
field_exception_items_attributes: [
:field_name,
:field_value,
:network_logo_id,
:provider_section_id,
:_destroy
]
]
)
end
end
end
end
+22 -4
View File
@@ -1,13 +1,31 @@
module IdCard module IdCard
class NetworkLogo < ApplicationRecord class NetworkLogo < ApplicationRecord
before_save :round_aspect_ratio before_validation :calculate_aspect_ratio, if: :image_data_changed?
scope :defaults, -> { where(default: true) }
class << self
def medcost
defaults.where("filename LIKE ?", "%Medcost%")
end
def cigna
defaults.where("filename LIKE ?", "%Cigna%")
end
end
private private
def round_aspect_ratio def calculate_aspect_ratio
if self.aspect_ratio.present? image_io = StringIO.new(image_data)
self.aspect_ratio = self.aspect_ratio.round(2) width, height = FastImage.size(image_io)
image_ratio = width.to_f / height
if image_ratio
self.aspect_ratio = image_ratio.round(2)
end end
end end
end end
end end
+46 -5
View File
@@ -1,28 +1,69 @@
module IdCard module IdCard
class Plan < ApplicationRecord class Plan < ApplicationRecord
belongs_to :setup belongs_to :configuration, optional: true
has_many :plan_benefits, dependent: :destroy has_many :plan_benefits, dependent: :destroy
accepts_nested_attributes_for :plan_benefits, allow_destroy: true, reject_if: :all_blank accepts_nested_attributes_for :plan_benefits, allow_destroy: true, reject_if: :all_blank
# after_initialize :create_default_benefits, if: :new_record? scope :templates, -> { where(template: true) }
BENEFIT_FIELDS = ["Primary Visit",
"Specialist Visit",
"Urgent Care",
"INN-Ind Ded",
"INN-Family Ded",
"OON-Ind Ded",
"OON-Family Ded",
"Co-Insurance",
"INN-Ind OOP",
"INN-Family OOP",
"OON-Ind OOP",
"OON-Family OOP",
"Emergency Room",
"Preventive Care"].freeze
def self.permitted_params(params) after_initialize :build_plan_benefits, if: :new_record?
params.require(:id_card_plan).permit(
def build_plan_benefits
BENEFIT_FIELDS.each_with_index do |bene, i|
self.plan_benefits.build(benefit_desc: bene, sequence: (i + 1))
end
end
def format_template
formatted_title = title
if pl_plan_key.present?
employer_name = Employer.find_by(pl_plan_key: pl_plan_key).pluck(:name)
formatted_title.concat( " (#{employer_name})" )
end
{ id: id, title: formatted_title }
end
class << self
# def templates
# active_templates.map(&:format_template)
# end
def permitted_params(params)
params.require(:id_card_configuration).permit(
plans_attributes: [
:title, :title,
:pb_product_key, :pb_product_key,
:pl_plan_key, :pl_plan_key,
:_destroy, :_destroy,
id_card_plan_benefits_attributes: [ plan_benefits_attributes: [
:id, :id,
:benefit_desc, :benefit_desc,
:benefit, :benefit,
:sequence, :sequence,
:_destroy, :_destroy,
] ]
]
) )
end end
end
private private
def build_and_create_default_benefits def build_and_create_default_benefits
+31
View File
@@ -1,5 +1,36 @@
module IdCard module IdCard
class ProviderSection < ApplicationRecord class ProviderSection < ApplicationRecord
scope :defaults, -> { where(default: true) }
def self.permitted_params(params)
params.require(:id_card_configuration).require(:provider_section).permit(
: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
)
end
end end
end end
+25 -4
View File
@@ -1,5 +1,5 @@
module IdCard module IdCard
class Setup < ApplicationRecord class Configuration < ApplicationRecord
belongs_to :employer, class_name: 'Employer' belongs_to :employer, class_name: 'Employer'
belongs_to :employer_logo, optional: true belongs_to :employer_logo, optional: true
belongs_to :network_logo, optional: true belongs_to :network_logo, optional: true
@@ -7,8 +7,17 @@ module IdCard
belongs_to :rx_section, optional: true belongs_to :rx_section, optional: true
has_many :plans, dependent: :destroy has_many :plans, dependent: :destroy
has_many :field_exceptions, dependent: :destroy
has_many :exceptions, dependent: :destroy accepts_nested_attributes_for :plans, allow_destroy: true, reject_if: :all_blank
accepts_nested_attributes_for :field_exceptions, allow_destroy: true, reject_if: :all_blank
attribute :queued_card_count, :integer, default: 0
scope :active, -> { where(active: true) }
FORM_COLORS = ['atmosphere', 'verdigris', 'bluemana', 'cobalt']
MODULE_COLOR = 'atmosphere'
# def employer_logo_filename # def employer_logo_filename
# self.employer_logo.filename # self.employer_logo.filename
@@ -18,13 +27,25 @@ module IdCard
# self.network_logo.filename # self.network_logo.filename
# 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
def self.permitted_params(params) def self.permitted_params(params)
params.require(:id_card_setup).permit( params.require(:id_card_configuration).permit(
:print_name, :print_name,
:network_provider, :network_provider,
:card_template, :card_template,
:rx_group_number, :rx_group_number,
:id_card_employer_logo_id :employer_logo_id,
:network_logo_id,
:rx_section_id,
:provider_section_id
) )
end end
end end
@@ -19,10 +19,9 @@ module BenefitsWordDoc
filename = @employer.name_to_logo_filename(file_extension) filename = @employer.name_to_logo_filename(file_extension)
logo = CardLogoFile.find_or_create_by(filename: filename) do |clf| logo = IdCard::EmployerLogo.find_or_create_by(filename: filename) do |clf|
clf.image_data = image_binary clf.image_data = image_binary
clf.content_type = meme_type clf.content_type = meme_type
clf.logo_type = "employer"
end end
# new_logo = CardLogoFile.create!( # new_logo = CardLogoFile.create!(
@@ -32,16 +31,16 @@ module BenefitsWordDoc
# logo_type: "employer" # logo_type: "employer"
# ) # )
image_io = StringIO.new(image_binary) # image_io = StringIO.new(image_binary)
width, height = FastImage.size(image_io) # width, height = FastImage.size(image_io)
image_ratio = width.to_f / height # image_ratio = width.to_f / height
if (0.8..1.2).cover?(image_ratio) # if (0.8..1.2).cover?(image_ratio)
@employer.single_card_template = "FairosRxIDCard-Half" # @employer.single_card_template = "FairosRxIDCard-Half"
else # else
@employer.single_card_template = "FairosRxIDCard" # @employer.single_card_template = "FairosRxIDCard"
end # end
@employer.employer_logo_filename = logo.filename @employer.id_card_configuration.employer_logo = logo
end end
end end
@employer @employer
@@ -7,19 +7,29 @@ module BenefitsWordDoc
end end
def call def call
network_matches = [] # network = @word_doc_section.each do |line|
@word_doc_section.each do |line| # if line.match?(/cigna/i)
if network_matches.exclude?("Cigna") && line.match?(/cigna/i) # return "Cigna"
network_matches.push("Cigna") # elsif line.match?(/medcost/i)
elsif network_matches.exclude?("Medcost") && line.match?(/medcost/i) # return "Medcost"
network_matches.push("Medcost") # end
# end
network = @word_doc_section.find do |line|
if line.match?(/cigna/i)
break "Cigna"
elsif line.match?(/medcost/i)
break "Medcost"
end end
end end
if network_matches.length == 1 # yellow_fruit_names_filtered = @word_doc_section.filter_map do |line|
network_provider = network_matches.first # item[:name] if item[:color] == 'yellow'
@employer.network_provider = network_provider # end
@employer.default_network_logo = "#{network_provider}Logo.png"
if network
@employer.id_card_configuration.network_provider = network
@employer.id_card_configuration.network_logo = IdCard::NetworkLogo
provider_code = network_provider == "Cigna" ? "5" : "2" provider_code = network_provider == "Cigna" ? "5" : "2"
@employer.card_provider = CardProvider.find_by(provider_code: provider_code) @employer.card_provider = CardProvider.find_by(provider_code: provider_code)
@employer.card_rx = CardRx.find_by(web_url: "www.FairosRx.com") @employer.card_rx = CardRx.find_by(web_url: "www.FairosRx.com")
@@ -0,0 +1,13 @@
module EmployerCards
class QueueCounter
def initialize()
@employer_pl_plan_keys = IdCard::Configuration.active.pluck(:pl_plan_key).join(',')
end
def call
CallStoredProc.new('HLGetQueuedIdCardsTPANewCount', { PLPlanKeys: @employer_pl_plan_keys }).call.to_ary
end
end
end
+13 -7
View File
@@ -1,8 +1,14 @@
class ImageProcessor class ImageProcessor
ALLOWED_LOGO_TYPES = ['Network', 'Employer'].freeze
def initialize(image_path, new_filename = nil) def initialize(image_path, logo_type, new_filename = nil)
@image_path = image_path @image_path = image_path
@logo_type = logo_type.capitalize
@new_filename = new_filename @new_filename = new_filename
unless ALLOWED_LOGO_TYPES.include?(@logo_type)
raise ArgumentError, "Invalid logo type: #{@logo_type}. Must be one of: #{ALLOWED_LOGO_TYPES.join(', ')}"
end
end end
def call def call
@@ -17,11 +23,11 @@ class ImageProcessor
# binary_data = File.open(@image_path, 'rb').read # binary_data = File.open(@image_path, 'rb').read
meme_type = Marcel::MimeType.for Pathname.new(@image_path) meme_type = Marcel::MimeType.for Pathname.new(@image_path)
CardLogoFile.create( logo_model = "IdCard::#{@logo_type}Logo".constantize
filename: filename,
image_data: binary_data, logo_model.find_or_create_by(filename: filename) do |logo|
content_type: meme_type, logo.image_data = binary_data
logo_type: "employer" logo.content_type = meme_type
) end
end end
end end
+3 -3
View File
@@ -32,7 +32,7 @@ module SampleCard
def set_plan_fields def set_plan_fields
plans_sample_cards = [] plans_sample_cards = []
@employer.plans.each do |plan| @employer.id_card_configuration.plans.each do |plan|
plan_sample_card = @sample_card.dup plan_sample_card = @sample_card.dup
plan_name = plan.title.split(/(?<=\d[kK])/).first plan_name = plan.title.split(/(?<=\d[kK])/).first
plan_sample_card.family_id = plan_name plan_sample_card.family_id = plan_name
@@ -56,7 +56,7 @@ module SampleCard
end end
def set_network_fields def set_network_fields
selected_attributes = @employer.card_provider.attributes.with_indifferent_access.slice( selected_attributes = @employer.id_card_configuration.provider_section.attributes.with_indifferent_access.slice(
:provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6, :provider_line_1, :provider_line_2, :provider_line_3, :provider_line_4, :provider_line_5, :provider_line_6,
:provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12, :provider_line_7, :provider_line_8, :provider_line_9, :provider_line_10, :provider_line_11, :provider_line_12,
:claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6, :claim_to_1, :claim_to_2, :claim_to_3, :claim_to_4, :claim_to_5, :claim_to_6,
@@ -71,7 +71,7 @@ module SampleCard
def set_rx_fields def set_rx_fields
# fairos_information = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first # fairos_information = Vhcs::HlrxCrosRef.where(pl_plan_key: 52).first
selected_attributes = @employer.card_rx.attributes.with_indifferent_access.slice( selected_attributes = @employer.id_card_configuration.rx_section.attributes.with_indifferent_access.slice(
:customer_service, :customer_service,
:web_url :web_url
) )
@@ -4,8 +4,8 @@
<% end %> <% end %>
</div> </div>
<div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> rounded-bl-lg"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[i]}" %> rounded-bl-lg"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %> <%= "Plan #{i + 1}" %>
</div> </div>
<div class="pl-1 w-full"> <div class="pl-1 w-full">
+7 -7
View File
@@ -1,6 +1,6 @@
<div class="bg-deepcove h-full w-full flex flex-col"> <div class="bg-deepcove h-full w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum my-5">Edit Employer</h1> <h1 class="font-bold text-4xl text-platinum my-5">Edit Employer</h1>
<%= form_with model: @employer_setup, url: employer_setup_index_path, local: true, multipart: true do |f| %> <%= form_with model: @employer_configuration, url: employer_configuration_index_path, local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6"> <div class="flex flex-col space-y-6">
<div class="w-full flex items-center"> <div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">General Information</h3> <h3 class="font-bold text-2xl text-bluemana">General Information</h3>
@@ -51,17 +51,17 @@
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3> <h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer_setup.plans.each_with_index do |plan, index| %> <% @employer_configuration.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker"> <div class="inline-flex flex-col pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[index]}" %>"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %> <%= "Plan #{index + 1}" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div> <div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
@@ -106,7 +106,7 @@
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3> <h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>"> <div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container"> <div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %> <%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div> </div>
+1 -1
View File
@@ -1,6 +1,6 @@
<div class="bg-deepcove h-full w-full flex flex-col"> <div class="bg-deepcove h-full w-full flex flex-col">
<h1 class="font-bold text-4xl text-platinum my-5">Employer Setups</h1> <h1 class="font-bold text-4xl text-platinum my-5">Employer Setups</h1>
<% plan_colors = EmployerSetupPlansForm::PLAN_COLORS.push('copper', 'bronze').shuffle %> <% plan_colors = IdCard::Configuration::FORM_COLORS.push('copper', 'bronze').shuffle %>
<% @employer_setups.each_with_index do |es, index| %> <% @employer_setups.each_with_index do |es, index| %>
<% item_color_index = index == 0 ? 0 : index % plan_colors.length %> <% item_color_index = index == 0 ? 0 : index % plan_colors.length %>
<div class="w-full flex text-2xl text-platinum font-bold px-4 py-4 ml-10 rounded-lg border-l-5 border-b-2 <%= "border-#{plan_colors[item_color_index]}" %>"> <div class="w-full flex text-2xl text-platinum font-bold px-4 py-4 ml-10 rounded-lg border-l-5 border-b-2 <%= "border-#{plan_colors[item_color_index]}" %>">
@@ -1,4 +1,4 @@
<div class="min-h-screen w-full flex flex-col" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>"> <div class="min-h-screen w-full flex flex-col" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1> <h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Provider Network</h3> <h3 class="font-bold text-2xl text-bluemana">Provider Network</h3>
<%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %> <%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %>
+5 -5
View File
@@ -57,16 +57,16 @@
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3> <h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<%= f.fields_for :plans, @employer_setup.plans.first, child_index: 0 do |plan_fields| %> <%= f.fields_for :plans, @employer_setup.plans.first, child_index: 0 do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[0]}" %> "></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[0]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[0]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[0]}" %> -ml-[6px] z-2 w-full">
<%= "Plan 1" %> <%= "Plan 1" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: 0 %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: 0 %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[0]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[0]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r bg-bronze ml-[3px]"></div> <div class="w-full h-[3px] rounded-r bg-bronze ml-[3px]"></div>
@@ -110,7 +110,7 @@
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3> <h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>"> <div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container"> <div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %> <%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div> </div>
+3 -3
View File
@@ -1,4 +1,4 @@
<div class="min-h-screen w-full flex flex-col" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>"> <div class="min-h-screen w-full flex flex-col" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1> <h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Medical Plans</h3> <h3 class="font-bold text-2xl text-bluemana">Medical Plans</h3>
<div class="flex flex-col pl-6"> <div class="flex flex-col pl-6">
@@ -17,8 +17,8 @@
</div> </div>
<% @form.plans.each_with_index do |plan, i| %> <% @form.plans.each_with_index do |plan, i| %>
<div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> rounded-bl-lg"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[i]}" %> rounded-bl-lg"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %> <%= "Plan #{i + 1}" %>
</div> </div>
<%= f.fields_for :plans, index: i do |plan_fields| %> <%= f.fields_for :plans, index: i do |plan_fields| %>
+1 -1
View File
@@ -6,7 +6,7 @@
<% end %> <% end %>
</div> </div>
<% plan_colors = EmployerSetupPlansForm::PLAN_COLORS.push('copper', 'bronze').shuffle %> <% plan_colors = IdCard::Configuration::FORM_COLORS.push('copper', 'bronze').shuffle %>
<% @color_index = 0 %> <% @color_index = 0 %>
<h2 class="font-bold text-3xl text-brightlava my-5">In Process:</h2> <h2 class="font-bold text-3xl text-brightlava my-5">In Process:</h2>
<% @employers.inactive.each_with_index do |emp, index| %> <% @employers.inactive.each_with_index do |emp, index| %>
+76 -21
View File
@@ -1,17 +1,20 @@
<div class="bg-deepcove text-platinum h-full w-full flex flex-col"> <div class="bg-deepcove text-platinum h-full w-full flex flex-col">
<%= link_to employers_path, class: "flex h-10 w-10 text-xl transition duration-100" do %>
<%= icon "arrow-big-left-dash", library: "lucide", class: "h-full w-full text-center text-bluemana hover:text-bronze" %>
<% end %>
<div class="flex w-full items-center space-x-4"> <div class="flex w-full items-center space-x-4">
<h1 class="font-bold text-4xl text-platinum my-5"><%= @employer.name %></h1> <h1 class="font-bold text-4xl text-platinum my-5"><%= @employer.name %></h1>
<div class="h-[50px] max-w-[200px]"> <div class="h-[50px] max-w-[200px]">
<% if @employer&.id_card_setup&.id_card_employer_logo&.filename %> <% if @employer&.id_card_configuration&.employer_logo&.filename %>
<%= image_tag image_id_card_employer_logo_path(@employer.id_card_setup.id_card_employer_logo.filename), class: "max-h-[50px] object-contain shadow-[0_0_10px_3px_#93c5fd]" %> <%= image_tag image_id_card_employer_logo_path(@employer.id_card_configuration.employer_logo.id), class: "max-h-[50px] object-contain shadow-[0_0_10px_3px_#93c5fd]" %>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="flex space-x-6"> <div class="flex space-x-6">
<div class="flex flex-col space-y-1 w-1/3"> <div class="flex flex-col space-y-1 w-1/4">
<div class="w-full flex items-center"> <div class="w-full flex items-center">
<h3 class="grow-0 font-bold text-2xl text-bluemana">Employer Information</h3> <h3 class="flex-none font-bold text-2xl text-bluemana">Employer Information</h3>
<div class="h-[1px] grow mt-2 bg-bluemana"></div> <div class="grow h-[1px] mt-2 ml-1 bg-bronze"></div>
</div> </div>
<div class="flex flex-col space-y-1 ml-4"> <div class="flex flex-col space-y-1 ml-4">
<p class="text-<%="#{@employer.active == false ? "brightlava" : "limegreen"}" %>"> <p class="text-<%="#{@employer.active == false ? "brightlava" : "limegreen"}" %>">
@@ -23,7 +26,7 @@
<%= @employer.effective_date %> <%= @employer.effective_date %>
</p> </p>
<div> <div>
<strong class="text-atmosphere mr-2">└── Key Chain</strong> <strong class="text-bluemana mr-2">└── Key Chain</strong>
</div> </div>
<% @employer.attributes.with_indifferent_access.slice(:pl_plan_key, :company_pb_entity_key, :group_number).each do |attribute_name, attribute_value| %> <% @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"}" %>"> <p class="ml-9 text-<%="#{attribute_value.present? ? "limegreen" : "brightlava"}" %>">
@@ -31,11 +34,11 @@
<%= attribute_value.present? ? attribute_value.to_s : "waiting" %> <%= attribute_value.present? ? attribute_value.to_s : "waiting" %>
</p> </p>
<% end %> <% end %>
<% if @employer&.id_card_setup&.id_card_plans %> <% if @employer&.id_card_configuration&.plans.present? %>
<div> <div>
<strong class="text-atmosphere mr-2">└── Plans</strong> <strong class="text-atmosphere mr-2">└── Plans</strong>
</div> </div>
<% @employer.id_card_setup.id_card_plans.pluck(:title, :pb_product_key).each do |plan| %> <% @employer.id_card_configuration.plans.pluck(:title, :pb_product_key).each do |plan| %>
<div class="ml-9"> <div class="ml-9">
├── <%= plan.first %> ├── <%= plan.first %>
</div> </div>
@@ -45,24 +48,76 @@
</p> </p>
<% end %> <% end %>
<% end %> <% end %>
</div> <div class="w-full flex items-end mt-10">
<div class="w-full flex items-center space-x-2 mt-10 ml-14"> <%= link_to 'Edit Employer', edit_employer_path(@employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-brightlava hover:bg-deepcove border-2 border-brightlava text-platinum text-lg font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= 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> </div>
<div class="flex flex-col space-y-6 w-1/3"> </div>
<div class="flex flex-col space-y w-[23%]">
<% module_color = IdCard::Configuration::MODULE_COLOR %>
<div class="w-full flex flex-none items-center justify-between">
<h3 class="flex-none font-bold text-2xl text-<%= module_color %>">ID Card Module</h3>
<div class="grow h-[1px] mt-2 ml-1 bg-bronze"></div>
</div>
<div class="grow flex flex-col w-full border-l-4 border-b-4 border-<%= module_color %> rounded-xl pl-2 pb-2">
<% if @employer.id_card_enabled? %>
<div class="grow-1 flex flex-col items-center w-full">
<div class="w-full flex flex-col items-center my-3">
<div class="font-bold text-lg text-bronze">
Setup
</div>
<span class="block w-full h-0.5 bg-copper mt-[-4]"></span>
</div>
<div class="flex flex-col items-center space-y-6 w-full">
<%= link_to "General", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to "Plans", plans_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Exceptions (Optional)', field_exceptions_employer_id_card_configuration_index_path(employer_id: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
</div>
</div>
<div class="grow-1 flex flex-col items-center w-full">
<div class="w-full flex flex-col items-center my-3">
<div class="font-bold text-lg text-bronze">
Actions
</div>
<span class="block w-full h-0.5 bg-copper mt-[-4]"></span>
</div>
<div class="flex flex-col items-center space-y-6 w-full">
<%= link_to 'Generate Sample Cards', generate_sample_id_card_print_data_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for print)', generate_print_id_card_print_data_path(employer_slug: @employer.slug ),data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for display)', generate_mobile_display_id_card_print_data_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
<%= link_to 'Generate Group Cards (for download)', generate_full_page_id_card_print_data_path(employer_slug: @employer.slug ), data: { turbo: false }, class: "flex justify-center items-center w-full #{@employer.active ? "" : "pointer-events-none opacity-50 cursor-not-allowed"} bg-#{module_color} hover:bg-deepcove border-2 border-#{module_color} text-platinum font-bold px-3 rounded-lg h-10 transition duration-100" %>
</div>
</div>
<% else %>
<%= link_to "Enable ID Card", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-#{module_color} hover:bg-deepcove border-4 border-atmosphere text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %>
<% end %>
</div>
</div>
<div class="flex flex-col space-y w-[23%]">
<div class="w-full flex items-center"> <div class="w-full flex items-center">
<h3 class="font-bold text-2xl text-bluemana">ID Card Actions</h3> <h3 class="flex-none font-bold text-2xl text-cobalt-vivid">Claims Check Module</h3>
<div class="h-[1px] w-2/3 mt-2 bg-bluemana"></div> <div class="grow h-[1px] mt-2 ml-1 bg-bronze"></div>
</div> </div>
<%= link_to "Setup", new_id_card_setup_path(employer: @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" %> <div class="grow flex flex-col w-full border-l-4 border-b-4 border-cobalt-vivid rounded-xl pl-2 pb-2">
<% if @employer.claims_check_enabled? %>
<%= link_to 'Generate Sample Cards', generate_sample_id_card_print_data_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" %> <% else %>
<%= link_to 'Generate Group Cards (for print)', generate_print_id_card_print_data_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 "Enable Claims Check", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-cobalt-vivid hover:bg-deepcove border-4 border-cobalt-vivid text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %>
<%= link_to 'Generate Group Cards (for display)', generate_mobile_display_id_card_print_data_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" %> <% end %>
<%= link_to 'Generate Group Cards (for download)', generate_full_page_id_card_print_data_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" %> </div>
</div>
<div class="flex flex-col space-y w-[23%]">
<div class="w-full flex items-center">
<h3 class="flex-none font-bold text-2xl text-verdigris-vivid">FairosRx Eligibility Module</h3>
<div class="grow h-[1px] mt-2 ml-1 bg-bronze"></div>
</div>
<div class="grow flex flex-col w-full border-l-4 border-b-4 border-verdigris-vivid rounded-xl pl-2 pb-2">
<% if @employer.claims_check_enabled? %>
<% else %>
<%= link_to "Enable FairosRx Eligibility", general_employer_id_card_configuration_index_path(employer_id: @employer.slug), data: { turbo: false }, class: "flex justify-center items-center w-full h-full cursor-pointer bg-verdigris-vivid hover:bg-deepcove border-4 border-verdigris-vivid text-platinum text-xl font-bold px-3 rounded-md mt-3 transition duration-100" %>
<% end %>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -4,8 +4,8 @@
<% end %> <% end %>
</div> </div>
<div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> rounded-bl-lg"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[i]}" %> rounded-bl-lg"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %> <%= "Plan #{i + 1}" %>
</div> </div>
<div class="pl-1 w-full"> <div class="pl-1 w-full">
+5 -5
View File
@@ -51,17 +51,17 @@
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3> <h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %> <% @employer.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker"> <div class="inline-flex flex-col pr-6 w-1/4 relative pl-1" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[index]}" %>"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %> <%= "Plan #{index + 1}" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div> <div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
@@ -106,7 +106,7 @@
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3> <h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>"> <div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container"> <div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %> <%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-75 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div> </div>
+1 -1
View File
@@ -6,7 +6,7 @@
<% end %> <% end %>
</div> </div>
<% plan_colors = EmployerSetupPlansForm::PLAN_COLORS.push('copper', 'bronze').shuffle %> <% plan_colors = IdCard::Configuration::FORM_COLORS.push('copper', 'bronze').shuffle %>
<% @color_index = 0 %> <% @color_index = 0 %>
<h2 class="font-bold text-3xl text-brightlava my-5">In Process:</h2> <h2 class="font-bold text-3xl text-brightlava my-5">In Process:</h2>
<% @employers.inactive.each_with_index do |emp, index| %> <% @employers.inactive.each_with_index do |emp, index| %>
@@ -1,4 +1,4 @@
<div class="min-h-screen w-full flex flex-col" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>"> <div class="min-h-screen w-full flex flex-col" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1> <h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Provider Network</h3> <h3 class="font-bold text-2xl text-bluemana">Provider Network</h3>
<%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %> <%= form_with model: @form, url: employer_setup_index_path, local: true do |f| %>
+5 -5
View File
@@ -61,17 +61,17 @@
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3> <h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %> <% @employer.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> "></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[index]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %> <%= "Plan #{index + 1}" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div> <div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
@@ -116,7 +116,7 @@
<h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3> <h3 class="font-bold text-2xl text-bluemana">Alternative Network Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>"> <div class="flex w-full justify-start" data-controller="add-alt-network-logo" data-add-alt-network-logo-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>">
<div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container"> <div class="flex flex-wrap w-full" data-add-alt-network-logo-target="container">
<%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %> <%= button_tag "Add a Regional Logo", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-55 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-alt-network-logo#add", add_alt_network_logo_target: "button" } %>
</div> </div>
+5 -5
View File
@@ -61,17 +61,17 @@
<h3 class="font-bold text-2xl text-bluemana">Plans Information</h3> <h3 class="font-bold text-2xl text-bluemana">Plans Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>" > <div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container"> <div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @employer.plans.each_with_index do |plan, index| %> <% @employer.plans.each_with_index do |plan, index| %>
<%= f.fields_for :plans, plan, child_index: index do |plan_fields| %> <%= f.fields_for :plans, plan, child_index: index do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> "></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[index]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{index + 1}" %> <%= "Plan #{index + 1}" %>
</div> </div>
<%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %> <%= render 'plan_fields', plan_fields: plan_fields, f: f, index: index %>
<div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[index]}" %>"> <div class="text-xl text-left font-bold pl-[2px] mb-[-4px] z-1 <%= "text-#{IdCard::Configuration::FORM_COLORS[index]}" %>">
Benefit Values Benefit Values
</div> </div>
<div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div> <div class="w-full h-[3px] rounded-r <%= "bg-#{index % 2 == 1 ? 'bronze' : 'copper'}" %> ml-[3px]"></div>
@@ -116,7 +116,7 @@
<h3 class="font-bold text-2xl text-bluemana">ID Card Exceptions Information</h3> <h3 class="font-bold text-2xl text-bluemana">ID Card Exceptions Information</h3>
<div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div> <div class="h-[1px] w-1/2 mt-2 bg-bluemana"></div>
</div> </div>
<div class="flex flex-wrap w-full justify-start my-8" data-controller="add-exception" data-add-exception-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>"> <div class="flex flex-wrap w-full justify-start my-8" data-controller="add-exception" data-add-exception-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>">
<%= button_tag "Add an Exception", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-35 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-exception#addExemption", add_exception_target: "exceptionButton" } %> <%= button_tag "Add an Exception", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/7 h-35 my-8 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-exception#addExemption", add_exception_target: "exceptionButton" } %>
<template data-add-exception-target="exceptionTemplate"> <template data-add-exception-target="exceptionTemplate">
<%= f.fields_for :card_exceptions, CardException.new, child_index: 'NEW_RECORD' do |exception_fields| %> <%= f.fields_for :card_exceptions, CardException.new, child_index: 'NEW_RECORD' do |exception_fields| %>
+3 -3
View File
@@ -1,4 +1,4 @@
<div class="min-h-screen w-full flex flex-col" data-controller="add-plan" data-add-plan-form-color-value="<%= EmployerSetupPlansForm::PLAN_COLORS.to_json %>"> <div class="min-h-screen w-full flex flex-col" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>">
<h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1> <h1 class="font-bold text-4xl text-platinum">New Employer Setup</h1>
<h3 class="font-bold text-2xl text-bluemana">Medical Plans</h3> <h3 class="font-bold text-2xl text-bluemana">Medical Plans</h3>
<div class="flex flex-col pl-6"> <div class="flex flex-col pl-6">
@@ -17,8 +17,8 @@
</div> </div>
<% @form.plans.each_with_index do |plan, i| %> <% @form.plans.each_with_index do |plan, i| %>
<div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker"> <div class="inline-flex flex-col justify-end pr-6 pl-1 mt-10 relative w-1/4" data-controller="benefits-template-picker">
<div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> rounded-bl-lg"></div> <div class="absolute left-0 top-[2%] h-[98%] border-l-4 <%= "border-#{IdCard::Configuration::FORM_COLORS[i]}" %> rounded-bl-lg"></div>
<div class="font-bold text-2xl <%= "text-#{EmployerSetupPlansForm::PLAN_COLORS[i]}" %> -ml-[6px] z-2 w-full"> <div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_COLORS[i]}" %> -ml-[6px] z-2 w-full">
<%= "Plan #{i + 1}" %> <%= "Plan #{i + 1}" %>
</div> </div>
<%= f.fields_for :plans, index: i do |plan_fields| %> <%= f.fields_for :plans, index: i do |plan_fields| %>
+34
View File
@@ -0,0 +1,34 @@
<div class="bg-deepcove h-full w-full flex flex-col justify-start font-bold">
<div class="w-full flex flex-col items-center mb-3">
<div class="text-5xl text-platinum">
ID Card Printer
</div>
<span class="block w-full h-0.5 bg-copper"></span>
</div>
<div class="w-full items-start flex">
<div class="w-1/2 flex flex-col">
<% @employer_configurations.each do |es| %>
<div class="w-full flex items-center justify-between text-lg text-platinum my-1">
<div class="flex flex-none">
<%= es.pl_plan_key %> -
<%= es.employer.name %>
(
<div class="mx-1 text-<%= es.queued_card_count > 0 ? "brightlava" : "limegreen" %>">
<%= es.queued_card_count %>
</div>
)
</div>
<div class="grow h-[1px] mx-1 bg-cobalt-vivid"></div>
<div class="flex flex-none items-center text-xs">
<%= link_to general_employer_id_card_configuration_index_path(employer_id: es.employer.slug), class: "flex h-7 w-14 transition duration-100 #{es.queued_card_count > 0 ? "" : "pointer-events-none opacity-50 cursor-not-allowed" }" do %>
<%= icon "printer", library: "lucide", class: "h-full w-full text-center text-platinum bg-atmosphere hover:bg-deepcove border-2 border-atmosphere rounded-md p-0.5" %>
<% end %>
</div>
</div>
<% end %>
</div>
<div class="w-1/2 flex justify-center items-center text-center text-2xl">
<%= link_to "Print All Queued", id_card_printer_index_path, class: "flex justify-center items-center w-1/2 h-15 text-platinum bg-cobalt-vivid hover:bg-deepcove border-2 border-cobalt-vivid rounded-lg p-2" %>
</div>
</div>
</div>
@@ -0,0 +1,16 @@
<div class="flex flex-col items-start space-y-3 w-[42%] hidden exception-item" data-controller="logo-upload" data-logo-upload-logo-type-value="network">
<div class="flex w-full">
<div class="flex flex-col w-full">
<%= exception_item_fields.select :network_logo_id, options_for_select(IdCard::NetworkLogo.pluck(:filename, :id)), { include_blank: "Select/Add Network Logo", class: "rounded-r-none flex flex-col" }, data: { exceptions_toggle_target: "dependentField", parent_value: "network_logo", logo_upload_target: "logoIdField", action: "change->logo-upload#setSelectPreview" } %>
</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="network_logo_file" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
</div>
<div class="hidden flex ml-10 justify-center rounded-lg border-4 border-atmosphere" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Netwoek Logo preview" class="max-h-[100px] max-w-[133px] bg-platinum m-1"/>
</div>
<%= exception_item_fields.file_field :network_logo_file, class: "hidden", id: "network_logo_file", data: { logo_upload_target: "previewContainer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
@@ -0,0 +1,5 @@
<% (1..12).each do |n| %>
<div class="pl-1 pt-2 w-full">
<%= provider_fields.text_field "claim_to_#{n}".to_sym, label: { text: "Claim To Line #{n}" }, data: { general_form_target: "providerField"}, class: "w-full" %>
</div>
<% end %>
@@ -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>
@@ -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 plan_fields.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>
@@ -0,0 +1,5 @@
<% (1..12).each do |n| %>
<div class="pl-1 pt-2 w-full">
<%= provider_fields.text_field "provider_line_#{n}".to_sym, label: { text: "Provider Line #{n}" }, data: { general_form_target: "providerField"}, class: "w-full" %>
</div>
<% end %>
-34
View File
@@ -1,34 +0,0 @@
<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="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>
</div>
</div>
<div class="flex py-8 space-x-4">
<%= f.submit "Save Employer" %>
<%= link_to "Back", employer_path(@employer.slug), class: "flex justify-center items-center cursor-pointer bg-atmosphere hover:bg-deepcove border-2 border-atmosphere text-platinum font-bold px-3 rounded-sm h-10 transition duration-100" %>
</div>
</div>
<% end %>
</div>
@@ -0,0 +1,119 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<div class="flex space-x-6 my-5 font-bold text-4xl">
<h1 class="text-platinum">ID Card Exceptions:</h1>
<h1 class="text-atmosphere">(<%= @employer.name %>)</h1>
</div>
<%= form_with model: @configuration, url: update_field_exceptions_employer_id_card_configuration_index_path(@employer.slug), local: true, multipart: true do |f| %>
<div class="flex flex-col">
<div class="w-full flex pb-10">
<div class="flex flex-wrap w-full justify-start space-y-12 my-8" data-controller="add-exception" data-add-exception-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>">
<% @configuration.field_exceptions.each_with_index do |exc, index| %>
<%= f.fields_for :field_exceptions, exc, child_index: index do |exception_fields| %>
<div class="flex flex-col pr-6 w-1/2">
<div class="flex justify-between items-end w-full pb-2">
<div class="w-[48%]">
<%= exception_fields.select :exception_type, options_for_select(IdCard::FieldException::VALID_TYPES.map { |type| [type.titleize(keep_id_suffix: true), type] }), { label: { text: "Exception Based On" }, prompt: "Select Type", class: "w-full" }, data: { add_exception_target: "exception" } %>
</div>
<div class="w-[48%]">
<%= exception_fields.text_field :exception_value, label: { text: "Exception Value" }, class: "w-full" %>
</div>
</div>
<div class="text-xl text-left font-bold mb-[-4px] z-1 text-platinum">
Field Exception Items
</div>
<div class="w-full h-[3px] rounded-r bg-NEXT_COLOR ml-[1px] mb-1"></div>
<div class="flex flex-col w-full justify-start" data-controller="add-exception-item">
<%= exception_fields.fields_for :field_exception_items do |exception_item_fields| %>
<div class="flex justify-between items-start w-full" data-controller="exceptions-toggle">
<div class="w-[42%]">
<%= exception_item_fields.select :field_name, options_for_select(IdCard::FieldExceptionItem::VALID_FIELD_NAMES.map { |field_name| [field_name.titleize, field_name] }, exception_item_fields.object.field_name ), { label: { text: "Card Field" }, prompt: "Select Card Field", class: "w-full" }, { data: { action: "change->exceptions-toggle#toggleFields", add_exception_item_target: "exceptionItem", exceptions_toggle_target: "selectField" } } %>
</div>
<div class="w-[42%] hidden">
<%= exception_item_fields.text_field :field_value, value: exception_item_fields.object.field_value, label: { text: "New Value" }, data: { exceptions_toggle_target: "dependentField", parent_value: "default" }, class: "w-full" %>
</div>
<%= render 'alt_network_logo_fields', exception_item_fields: exception_item_fields %>
<div class="w-[42%] hidden">
<%= exception_item_fields.select :provider_section_id, options_for_select(IdCard::ProviderSection.where.not(title: nil).map { |provider| [provider.title, provider.id] }, exception_item_fields.object.provider_section_id), { prompt: "Select Provider Template", class: "w-full" }, { data: { exceptions_toggle_target: "dependentField", parent_value: "provider_section" } } %>
</div>
<div class="mt-6 ml-1">
<%= exception_item_fields.hidden_field :_destroy %>
<%= button_tag "Remove", class: "cursor-pointer flex items-center justify-center bg-brightlava font-bold text-lg text-platinum py-[6px] px-1 font-semibold leading-tight rounded-lg border-3 border-brightlava w-full", data: { action: "add-exception-item#removeExemptionItem" } %>
</div>
</div>
<% end %>
<%= button_tag "Add Another Item To Exception", class: "cursor-pointer bg-NEXT_COLOR hover:bg-deepcove text-xl font-bold text-platinum my-3 py-1 font-semibold leading-tight rounded border-3 border-NEXT_COLOR w-full", data: { action: "add-exception-item#addExemptionItem", add_exception_item_target: "exceptionItemButton" } %>
<template data-add-exception-item-target="exceptionItemTemplate">
<%= exception_fields.fields_for :field_exception_items, IdCard::FieldExceptionItem.new, child_index: 'NEW_ITEM_RECORD' do |exception_item_fields| %>
<div class="flex justify-between items-start w-full" data-controller="exceptions-toggle">
<div class="w-[42%]">
<%= exception_item_fields.select :field_name, options_for_select(IdCard::FieldExceptionItem::VALID_FIELD_NAMES.map { |field_name| [field_name.titleize, field_name] }), { label: { text: "Card Field" }, prompt: "Select Card Field", class: "w-full" }, { data: { action: "change->exceptions-toggle#toggleFields", add_exception_item_target: "exceptionItem", exceptions_toggle_target: "selectField" } } %>
</div>
<div class="w-[42%] hidden">
<%= exception_item_fields.text_field :field_value, label: { text: "New Value" }, data: { exceptions_toggle_target: "dependentField", parent_value: "default" }, class: "w-full" %>
</div>
<%= render 'alt_network_logo_fields', exception_item_fields: exception_item_fields %>
<div class="w-[42%] hidden">
<%= exception_item_fields.select :provider_section_id, options_for_select(IdCard::ProviderSection.where.not(title: nil).map { |provider| [provider.title, provider.id] }), { prompt: "Select Provider Template", class: "w-full" }, { data: { exceptions_toggle_target: "dependentField", parent_value: "provider_section" } } %>
</div>
<div class="mt-6 ml-1">
<%= exception_item_fields.hidden_field :_destroy %>
<%= button_tag "Remove", class: "cursor-pointer flex items-center justify-center bg-brightlava font-bold text-lg text-platinum py-[6px] px-1 font-semibold leading-tight rounded-lg border-3 border-brightlava w-full", data: { action: "add-exception-item#removeExemptionItem" } %>
</div>
</div>
<% end %>
</template>
</div>
</div>
<% end %>
<% end %>
<%= button_tag "Add an Exception", class: "cursor-pointer text-lg font-medium py-2 px-4 rounded w-1/2 h-4/5 mt-3 text-[#E0E0E0] rounded-lg border border-[#C2C2C2] hover:shadow-[0_0_10px_3px_#93c5fd]", data: { action: "add-exception#addExemption", add_exception_target: "exceptionButton" } %>
<template data-add-exception-target="exceptionTemplate">
<%= f.fields_for :field_exceptions, @configuration.field_exceptions.build, child_index: 'NEW_RECORD' do |exception_fields| %>
<div class="flex flex-col pr-6 w-1/2 pl-1">
<div class="flex justify-between items-end w-full pb-2">
<div class="w-[48%]">
<%= exception_fields.select :exception_type, options_for_select(IdCard::FieldException::VALID_TYPES.map { |type| [type.titleize(keep_id_suffix: true), type] }), { label: { text: "Exception Based On" }, prompt: "Select Type", class: "w-full" }, data: { add_exception_target: "exception" } %>
</div>
<div class="w-[48%]">
<%= exception_fields.text_field :exception_value, label: { text: "Exception Value" }, class: "w-full" %>
</div>
</div>
<div class="text-xl text-left font-bold mb-[-4px] z-1 text-platinum">
Field Exception Items
</div>
<div class="w-full h-[3px] rounded-r bg-NEXT_COLOR ml-[1px] mb-1"></div>
<div class="flex flex-col w-full justify-start" data-controller="add-exception-item">
<%= button_tag "Add Another Item To Exception", class: "cursor-pointer bg-NEXT_COLOR hover:bg-deepcove text-xl font-bold text-platinum my-3 py-1 font-semibold leading-tight rounded border-3 border-NEXT_COLOR w-full", data: { action: "add-exception-item#addExemptionItem", add_exception_item_target: "exceptionItemButton" } %>
<template data-add-exception-item-target="exceptionItemTemplate">
<%= exception_fields.fields_for :field_exception_items, IdCard::FieldExceptionItem.new, child_index: 'NEW_ITEM_RECORD' do |exception_item_fields| %>
<div class="flex justify-between items-start w-full" data-controller="exceptions-toggle">
<div class="w-[42%]">
<%= exception_item_fields.select :field_name, options_for_select(IdCard::FieldExceptionItem::VALID_FIELD_NAMES.map { |field_name| [field_name.titleize, field_name] }), { label: { text: "Card Field" }, prompt: "Select Card Field", class: "w-full" }, { data: { action: "change->exceptions-toggle#toggleFields", add_exception_item_target: "exceptionItem", exceptions_toggle_target: "selectField" } } %>
</div>
<div class="w-[42%] hidden">
<%= exception_item_fields.text_field :field_value, label: { text: "New Value" }, data: { exceptions_toggle_target: "dependentField", parent_value: "default" }, class: "w-full" %>
</div>
<%= render 'alt_network_logo_fields', exception_item_fields: exception_item_fields %>
<div class="w-[42%] hidden">
<%= exception_item_fields.select :provider_section_id, options_for_select(IdCard::ProviderSection.where.not(title: nil).map { |provider| [provider.title, provider.id] }), { prompt: "Select Provider Template", class: "w-full" }, { data: { exceptions_toggle_target: "dependentField", parent_value: "provider_section" } } %>
</div>
<div class="mt-6 ml-1">
<%= exception_item_fields.hidden_field :_destroy %>
<%= button_tag "Remove", class: "cursor-pointer flex items-center justify-center bg-brightlava font-bold text-lg text-platinum py-[6px] px-1 font-semibold leading-tight rounded-lg border-3 border-brightlava w-full", data: { action: "add-exception-item#removeExemptionItem" } %>
</div>
</div>
<% end %>
</template>
</div>
</div>
<% end %>
</template>
</div>
</div>
<div class="py-8">
<%= f.submit "Submit Network" %>
</div>
</div>
<% end %>
</div>
+93
View File
@@ -0,0 +1,93 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<div class="flex space-x-6 my-5 font-bold text-4xl">
<h1 class="text-platinum">ID Card Setup:</h1>
<h1 class="text-atmosphere">(<%= @employer.name %>)</h1>
</div>
<%= form_with model: @configuration, url: update_general_employer_id_card_configuration_index_path(@employer.slug), local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10">
<div class="flex w-full items-end">
<div class="flex flex-col space-y-6 w-3/5" data-controller="general-form provider-update">
<div class="flex space-x-10">
<div class="w-full">
<%= f.text_field :print_name, label: { text: "Print Name" }, class: "w-full" %>
</div>
<div class="w-full">
<%= f.text_field :rx_group_number, label: { text: "Rx Group Number" }, class: "w-full" %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.select :network_provider, options_for_select(["Cigna", "Medcost", "Other"], @configuration.network_provider), { label: { text: "Provider Network" }, include_blank: "Select", class: "w-full" }, data: { provider_update_target: "providerNetworkField", action: "change->provider-update#syncDefaults" } %>
</div>
<div class="w-full">
<%= f.select :card_template, options_for_select([["FairosRx", "FairosRxIDCard"], ["Tandemloc", "TandemlocIDCard"], ["smART", "SmartIDCard"], ["QRCode (Healthbus)", "QRCodeIDCard"]], @configuration.card_template || "FairosRxIDCard" ), { label: { text: "Card Template" }, include_blank: "Select", class: "w-full" } %>
</div>
</div>
<div class="flex space-x-10">
<div class="flex flex-col items-start space-y-3 w-full" data-controller="logo-upload" data-logo-upload-logo-type-value="employer" data-logo-upload-employer-name-value=<%= @employer.name %>>
<div class="flex w-full">
<div class="flex flex-col w-full">
<%= f.text_field :employer_logo_filename, label: { text: "Employer Logo" }, default: "No logo added", data: { logo_upload_target: "logoNameField" }, 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="employer_logo_file" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
</div>
<div class="hidden flex ml-10 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.hidden_field :employer_logo_id, label: { text: "Employer Logo" }, data: { logo_upload_target: "logoIdField" } %>
<%= f.file_field :employer_logo_file, class: "hidden", id: "employer_logo_file", data: { logo_upload_target: "previewContainer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
<div class="flex flex-col items-start space-y-3 w-full" data-controller="logo-upload" data-logo-upload-logo-type-value="network">
<div class="flex w-full">
<div class="flex flex-col w-full">
<%= f.select :network_logo_id, options_for_select(IdCard::NetworkLogo.pluck(:filename, :id), @configuration.network_logo_id), { include_blank: "Select/Add Network Logo", class: "rounded-r-none flex flex-col" }, data: { provider_update_target: "networkLogoField", logo_upload_target: "logoIdField", action: "change->logo-upload#setSelectPreview" } %>
</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="network_logo_file" class="text-center cursor-pointer">
<%= icon "image-plus", library: "lucide" %>
</label>
</div>
</div>
<div class="hidden flex ml-10 justify-center rounded-lg border-4 border-atmosphere" data-logo-upload-target="previewContainer">
<img data-logo-upload-target="preview" src="#" alt="Netwoek Logo preview" class="max-h-[100px] max-w-[133px] bg-platinum m-1"/>
</div>
<%= f.file_field :network_logo_file, class: "hidden", id: "network_logo_file", data: { logo_upload_target: "previewContainer", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
</div>
<div class="flex space-x-10">
<div class="w-full">
<%= f.select :rx_section_id, options_from_collection_for_select(@rx_options, :id, :title, @configuration.rx_section_id || @fairos_rx_id), { include_blank: "Select Rx", class: "flex-col w-full" } %>
</div>
<div class="w-full">
<%= f.select :provider_section_id, options_for_select(@provider_options, @configuration.provider_section_id), { label: { text: "Claims Submission Section" }, include_blank: "Select/Add Claims Submission", class: "flex flex-col w-full" }, data: { provider_update_target: "providerSectionField", general_form_target: "selectField", action: "change->general-form#toggleNewFieldSection" } %>
</div>
</div>
<div class="w-full hidden" data-general-form-target="dependentField">
<div class="text-xl text-left font-bold text-platinum pt-8">
New Claims Submission Section
</div>
<%= f.fields_for :provider_section do |provider_fields| %>
<div class="flex w-full space-x-3">
<div class="flex flex-col w-1/2">
<%= render 'claim_fields', provider_fields: provider_fields %>
</div>
<div class="flex flex-col w-1/2">
<%= render 'provider_fields', provider_fields: provider_fields %>
</div>
</div>
<% end %>
</div>
</div>
</div>
<div class="py-8">
<%= f.submit "Create ID Card Setup" %>
</div>
</div>
<% end %>
</div>
+57
View File
@@ -0,0 +1,57 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<div class="flex space-x-6 my-5 font-bold text-4xl">
<h1 class="text-platinum">ID Card Network:</h1>
<h1 class="text-atmosphere">(<%= @employer.name %>)</h1>
</div>
<%= form_with model: @configuration, url: update_network_employer_id_card_configuration_index_path(@employer.slug), local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10">
<div class="flex flex-col space-y-6 w-full" data-controller="logo-upload" data-logo-upload-logo-type-value="network">
<div class="flex w-2/5">
<div class="flex items-end">
<div class="flex">
<div class="flex flex-col w-full">
<%= f.select :network_logo_id, options_for_select(IdCard::NetworkLogo.pluck(:filename)), { include_blank: "Select/Add Network Logo", class: "rounded-r-none flex flex-col" }, data: { logo_upload_target: "logoField" } %>
</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="employer_logo_file" 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 :logo_file, class: "hidden", id: "employer_logo_file", data: { logo_upload_target: "previewContainer", parent_value: "network_logo", action: "change->logo-upload#uploadLogo" }, direct_upload: true %>
</div>
</div>
<div class="flex">
<div class="flex flex-col w-full">
<div class="flex flex-col w-1/3">
<%= f.select :provider_section_id, options_from_collection_for_select(@provider_sections, :id, :title), { include_blank: "Select/Add Network Provider Info", class: "rounded-r-none flex flex-col" }, data: { logo_upload_target: "logoField" } %>
</div>
<div class="flex flex-col w-1/3">
<%= f.select :rx_section_id, options_from_collection_for_select(@rx_sections, :id, :title), { include_blank: "Select Rx Info", class: "rounded-r-none flex flex-col" } %>
</div>
<div class="text-xl text-left font-bold text-platinum pt-4">
Claims Submission Section
</div>
<div class="flex w-full space-x-3">
<div class="flex flex-col w-1/3">
<%= render 'provider_fields', f: f %>
</div>
<div class="flex flex-col w-1/3">
<%= render 'claim_fields', f: f %>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="py-8">
<%= f.submit "Submit Network" %>
</div>
</div>
<% end %>
</div>
+1 -2
View File
@@ -1,10 +1,9 @@
<div class="bg-deepcove h-full w-full flex flex-col"> <div class="bg-deepcove h-full w-full flex flex-col">
<div class="flex space-x-6 my-5 font-bold text-4xl"> <div class="flex space-x-6 my-5 font-bold text-4xl">
<h1 class="text-platinum">New ID Card Setup:</h1> <h1 class="text-platinum">New ID Card Setup:</h1>
<h1 class="text-verdigris">(<%= @employer.name %>)</h1> <h1 class="text-atmosphere">(<%= @employer.name %>)</h1>
</div> </div>
<%= form_with model: @setup, local: true, multipart: true do |f| %> <%= form_with model: @setup, local: true, multipart: true do |f| %>
<%= form_with model: @employer, url: import_employers_path, data: { turbo: false }, local: true, multipart: true do |form| %>
<div class="flex flex-col space-y-6 pb-10"> <div class="flex flex-col space-y-6 pb-10">
<div class="flex w-full items-end" data-controller="logo-upload" data-logo-upload-logo-type-value="employer" data-logo-upload-employer-name-value=<%= @employer.name %>> <div class="flex w-full items-end" data-controller="logo-upload" data-logo-upload-logo-type-value="employer" data-logo-upload-employer-name-value=<%= @employer.name %>>
<div class="flex flex-col space-y-6 w-2/5"> <div class="flex flex-col space-y-6 w-2/5">
+63
View File
@@ -0,0 +1,63 @@
<div class="bg-deepcove h-full w-full flex flex-col">
<div class="flex space-x-6 my-5 font-bold text-4xl">
<h1 class="text-platinum">ID Card Plans:</h1>
<h1 class="text-atmosphere">(<%= @employer.name %>)</h1>
</div>
<%= form_with model: @configuration, url: update_plans_employer_id_card_configuration_index_path(@employer.slug), local: true, multipart: true do |f| %>
<div class="flex flex-col space-y-6 pb-10">
<div class="w-full flex my-8" data-controller="add-plan" data-add-plan-form-color-value="<%= IdCard::Configuration::FORM_COLORS.to_json %>" >
<div class="flex flex-wrap w-full" data-add-plan-target="container">
<% @configuration.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-#{IdCard::Configuration::FORM_COLORS[index]}" %> "></div>
<div class="font-bold text-2xl <%= "text-#{IdCard::Configuration::FORM_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-#{IdCard::Configuration::FORM_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, @configuration.plans.build, child_index: 'NEW_RECORD' do |plan_fields| %>
<div class="inline-flex flex-col justify-end pr-6 w-1/4 relative pl-1 plan-item" data-controller="benefits-template-picker">
<div class="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="py-8">
<%= f.submit "Submit Plans" %>
</div>
</div>
<% end %>
</div>
+3 -1
View File
@@ -14,5 +14,7 @@
<div class="text-verdigris bg-verdigris border border-verdigris">co</div> <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-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-brightlava bg-brightlava border border-brightlava">co</div>
<div class="text-limegreen bg-brightlava border border-brightlava">co</div> <div class="text-limegreen bg-limegreen border border-limegreen">co</div>
<div class="text-cobalt-vivid bg-cobalt-vivid border border-cobalt-vivid">co</div>
<div class="text-verdigris-vivid bg-verdigris-vivid border border-verdigris-vivid">co</div>
+2 -2
View File
@@ -34,8 +34,8 @@ development:
# tds_version: 7.3 # tds_version: 7.3
vhcs: vhcs:
<<: *default <<: *default
host: 10.41.82.72 #Prod # host: 10.41.82.72 #Prod
# host: 10.41.82.73 #Dev host: 10.41.82.73 #Dev
port: 1433 port: 1433
database: VHCS_HIPAA database: VHCS_HIPAA
username: BSTI username: BSTI
+18 -4
View File
@@ -2,15 +2,17 @@
Rails.application.routes.draw do Rails.application.routes.draw do
namespace :id_card do namespace :id_card do
resources :setup
resources :rx_sections resources :rx_sections
resources :provider_sections resources :provider_sections do
get 'get_section_data', on: :member
end
resources :employer_logos do resources :employer_logos do
get 'image', on: :member get 'image', on: :member
end end
resources :network_logos do resources :network_logos do
get 'image', on: :member, constraints: { id: /.*/ } get 'image', on: :member
end end
resources :printer, only: [:index]
resources :print_data do resources :print_data do
collection do collection do
get 'generate_sample' get 'generate_sample'
@@ -19,15 +21,27 @@ Rails.application.routes.draw do
get 'generate_full_page' get 'generate_full_page'
end end
end end
get 'plans/:id/get_plan_benefits', to: 'plans#get_plan_benefits'
end end
# resources :employer_setup # resources :employer_setup
resources :employers do resources :employers do
collection do collection do
post 'import' post 'import'
end end
namespace :id_card do
resources :setup, only: [:destroy] do
collection do
get 'general'
patch 'update_general'
get 'plans'
patch 'update_plans'
get 'field_exceptions'
patch 'update_field_exceptions'
end
end
end
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. # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
# Can be used by load balancers and uptime monitors to verify that the app is live. # Can be used by load balancers and uptime monitors to verify that the app is live.
@@ -43,6 +43,7 @@ class CreateIdCardProviderSections < ActiveRecord::Migration[7.2]
t.string :precert_4 t.string :precert_4
t.string :precert_5 t.string :precert_5
t.string :precert_6 t.string :precert_6
t.boolean :default, default: false
t.timestamps t.timestamps
end end
@@ -1,6 +1,7 @@
class CreateIdCardRxSections < ActiveRecord::Migration[7.2] class CreateIdCardRxSections < ActiveRecord::Migration[7.2]
def change def change
create_table :id_card_rx_sections do |t| create_table :id_card_rx_sections do |t|
t.string :title
t.string :help_desk t.string :help_desk
t.string :customer_service t.string :customer_service
t.string :web_url t.string :web_url
@@ -5,6 +5,7 @@ class CreateIdCardNetworkLogos < ActiveRecord::Migration[7.2]
t.binary :image_data t.binary :image_data
t.string :content_type t.string :content_type
t.float :aspect_ratio t.float :aspect_ratio
t.boolean :default, default: false
t.boolean :active, default: false t.boolean :active, default: false
t.timestamps t.timestamps
@@ -1,10 +1,11 @@
class CreateIdCardSetups < ActiveRecord::Migration[7.2] class CreateIdCardConfigurations < ActiveRecord::Migration[7.2]
def change def change
create_table :id_card_setups do |t| create_table :id_card_configurations do |t|
t.string :print_name t.string :print_name
t.string :network_provider t.string :network_provider
t.string :card_template t.string :card_template
t.string :rx_group_number t.string :rx_group_number
t.string :pl_plan_key
t.boolean :active, default: false t.boolean :active, default: false
t.belongs_to :employer, null: false, foreign_key: true t.belongs_to :employer, null: false, foreign_key: true
t.belongs_to :employer_logo, null: true, foreign_key: { to_table: :id_card_employer_logos } t.belongs_to :employer_logo, null: true, foreign_key: { to_table: :id_card_employer_logos }
@@ -5,7 +5,7 @@ class CreateIdCardPlans < ActiveRecord::Migration[7.2]
t.integer :pb_product_key t.integer :pb_product_key
t.string :pl_plan_key t.string :pl_plan_key
t.boolean :template t.boolean :template
t.belongs_to :setup, null: true, foreign_key: { to_table: :id_card_setups } t.belongs_to :configuration, null: true, foreign_key: { to_table: :id_card_configurations }
t.timestamps t.timestamps
end end
@@ -1,11 +0,0 @@
class CreateIdCardExceptions < ActiveRecord::Migration[7.2]
def change
create_table :id_card_exceptions do |t|
t.string :type
t.string :value
t.belongs_to :setup, null: false, foreign_key: { to_table: :id_card_setups }
t.timestamps
end
end
end
@@ -0,0 +1,11 @@
class CreateIdCardFieldExceptions < ActiveRecord::Migration[7.2]
def change
create_table :id_card_field_exceptions do |t|
t.string :exception_type
t.string :exception_value
t.belongs_to :configuration, null: false, foreign_key: { to_table: :id_card_configurations }
t.timestamps
end
end
end
@@ -1,9 +1,9 @@
class CreateIdCardExceptionItems < ActiveRecord::Migration[7.2] class CreateIdCardFieldExceptionItems < ActiveRecord::Migration[7.2]
def change def change
create_table :id_card_exception_items do |t| create_table :id_card_field_exception_items do |t|
t.string :field_name t.string :field_name
t.string :field_value t.string :field_value
t.belongs_to :exception, null: false, foreign_key: { to_table: :id_card_exceptions } t.belongs_to :field_exception, null: false, foreign_key: { to_table: :id_card_field_exceptions }
t.belongs_to :network_logo, null: true, foreign_key: { to_table: :id_card_network_logos } t.belongs_to :network_logo, null: true, foreign_key: { to_table: :id_card_network_logos }
t.belongs_to :provider_section, null: true, foreign_key: { to_table: :id_card_provider_sections } t.belongs_to :provider_section, null: true, foreign_key: { to_table: :id_card_provider_sections }
+17 -13
View File
@@ -34,26 +34,26 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
end end
create_table "id_card_exception_items", force: :cascade do |t| create_table "id_card_field_exception_items", force: :cascade do |t|
t.string "field_name" t.string "field_name"
t.string "field_value" t.string "field_value"
t.bigint "exception_id", null: false t.bigint "field_exception_id", null: false
t.bigint "network_logo_id" t.bigint "network_logo_id"
t.bigint "provider_section_id" t.bigint "provider_section_id"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["exception_id"], name: "index_id_card_exception_items_on_exception_id" t.index ["field_exception_id"], name: "index_id_card_field_exception_items_on_field_exception_id"
t.index ["network_logo_id"], name: "index_id_card_exception_items_on_network_logo_id" t.index ["network_logo_id"], name: "index_id_card_field_exception_items_on_network_logo_id"
t.index ["provider_section_id"], name: "index_id_card_exception_items_on_provider_section_id" t.index ["provider_section_id"], name: "index_id_card_field_exception_items_on_provider_section_id"
end end
create_table "id_card_exceptions", force: :cascade do |t| create_table "id_card_field_exceptions", force: :cascade do |t|
t.string "type" t.string "exception_type"
t.string "value" t.string "exception_value"
t.bigint "setup_id", null: false t.bigint "setup_id", null: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.index ["setup_id"], name: "index_id_card_exceptions_on_setup_id" t.index ["setup_id"], name: "index_id_card_field_exceptions_on_setup_id"
end end
create_table "id_card_network_logos", force: :cascade do |t| create_table "id_card_network_logos", force: :cascade do |t|
@@ -61,6 +61,7 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.binary "image_data" t.binary "image_data"
t.string "content_type" t.string "content_type"
t.float "aspect_ratio" t.float "aspect_ratio"
t.boolean "default", default: false
t.boolean "active", default: false t.boolean "active", default: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
@@ -208,11 +209,13 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.string "precert_4" t.string "precert_4"
t.string "precert_5" t.string "precert_5"
t.string "precert_6" t.string "precert_6"
t.boolean "default", default: false
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
end end
create_table "id_card_rx_sections", force: :cascade do |t| create_table "id_card_rx_sections", force: :cascade do |t|
t.string "title"
t.string "help_desk" t.string "help_desk"
t.string "customer_service" t.string "customer_service"
t.string "web_url" t.string "web_url"
@@ -225,6 +228,7 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.string "network_provider" t.string "network_provider"
t.string "card_template" t.string "card_template"
t.string "rx_group_number" t.string "rx_group_number"
t.string "pl_plan_key"
t.boolean "active", default: false t.boolean "active", default: false
t.bigint "employer_id", null: false t.bigint "employer_id", null: false
t.bigint "employer_logo_id" t.bigint "employer_logo_id"
@@ -255,10 +259,10 @@ ActiveRecord::Schema[7.2].define(version: 2026_01_16_182836) do
t.index ["id_card_plan_id"], name: "index_members_on_id_card_plan_id" t.index ["id_card_plan_id"], name: "index_members_on_id_card_plan_id"
end end
add_foreign_key "id_card_exception_items", "id_card_exceptions", column: "exception_id" add_foreign_key "id_card_field_exception_items", "id_card_field_exceptions", column: "field_exception_id"
add_foreign_key "id_card_exception_items", "id_card_network_logos", column: "network_logo_id" add_foreign_key "id_card_field_exception_items", "id_card_network_logos", column: "network_logo_id"
add_foreign_key "id_card_exception_items", "id_card_provider_sections", column: "provider_section_id" add_foreign_key "id_card_field_exception_items", "id_card_provider_sections", column: "provider_section_id"
add_foreign_key "id_card_exceptions", "id_card_setups", column: "setup_id" add_foreign_key "id_card_field_exceptions", "id_card_setups", column: "setup_id"
add_foreign_key "id_card_plan_benefits", "id_card_plans", column: "plan_id" add_foreign_key "id_card_plan_benefits", "id_card_plans", column: "plan_id"
add_foreign_key "id_card_plans", "id_card_setups", column: "setup_id" add_foreign_key "id_card_plans", "id_card_setups", column: "setup_id"
add_foreign_key "id_card_setups", "employers" add_foreign_key "id_card_setups", "employers"
+65 -52
View File
@@ -103,9 +103,10 @@ end
# IdCardBenefit.create(sequence: i + 1, benefit_desc: bene, id_card_benefits_template: default) # IdCardBenefit.create(sequence: i + 1, benefit_desc: bene, id_card_benefits_template: default)
# end # end
# temp_2 = IdCardBenefitsTemplate.create(title: "Jason's Template") # temp_2 = IdCard::Plan.create(title: "Jason's Template", template: true)
# (1..14).each do |seq| # temp_2.plan_benefits.each do |bene|
# IdCardBenefit.create(sequence: seq, benefit: "#{seq} hit wonder", id_card_benefits_template: temp_2) # bene.benefit = "#{bene.sequence} hit wonder"
# bene.save
# end # end
# temp_1 = IdCardBenefitsTemplate.create(title: "Rebekah's Template") # temp_1 = IdCardBenefitsTemplate.create(title: "Rebekah's Template")
@@ -202,65 +203,77 @@ plan_headers.each do |ph|
end end
end end
# Vhcs::HlidCardProvider.all.each do |vhcs| base_cp_provider_codes = ["5", "2"]
# CardProvider.find_or_create_by(provider_code: vhcs.provider_code) do |cp| needed_codes = %w(M T A I 8 7 1 6 3 P C V Y Z)
# cp.provider_line_1 = vhcs.provider_line_1 # provider_code_map = {}
# cp.provider_line_2 = vhcs.provider_line_2 vhcs_cp = Vhcs::HlidCardProvider.where(provider_code: base_cp_provider_codes).to_a + Vhcs::HlidCardProvider.where(provider_code: needed_codes).order(:provider_code).to_a
# cp.provider_line_3 = vhcs.provider_line_3 vhcs_cp.each do |vhcs|
# cp.provider_line_4 = vhcs.provider_line_4 attributes_hash = vhcs.attributes.except(:provider_code, :group_number)
# cp.provider_line_5 = vhcs.provider_line_5 attributes_hash.delete_if { |key, value| !key.to_s.include?("_") }
# cp.provider_line_6 = vhcs.provider_line_6 existing_cp = IdCard::ProviderSection.find_by(attributes_hash)
# cp.provider_line_7 = vhcs.provider_line_7
# cp.provider_line_8 = vhcs.provider_line_8
# cp.provider_line_9 = vhcs.provider_line_9
# cp.provider_line_10 = vhcs.provider_line_10
# cp.provider_line_11 = vhcs.provider_line_11
# cp.provider_line_12 = vhcs.provider_line_12
# cp.claim_to_1 = vhcs.claim_to_1 if existing_cp
# cp.claim_to_2 = vhcs.claim_to_2 existing_cp.title = existing_cp.title.concat(vhcs.provider_code)
# cp.claim_to_3 = vhcs.claim_to_3 existing_cp.save
# cp.claim_to_4 = vhcs.claim_to_4 else
# cp.claim_to_5 = vhcs.claim_to_5 title = case
# cp.claim_to_6 = vhcs.claim_to_6 when vhcs.provider_line_1 == "PO Box 188061"
# cp.claim_to_7 = vhcs.claim_to_7 "Cigna #{vhcs.provider_code}"
# cp.claim_to_8 = vhcs.claim_to_8 when vhcs.provider_line_1.present?
# cp.claim_to_9 = vhcs.claim_to_9 "#{vhcs.provider_line_1} #{vhcs.provider_code}"
# cp.claim_to_10 = vhcs.claim_to_10 else
# cp.claim_to_11 = vhcs.claim_to_11 "Medcost #{vhcs.provider_code}"
# cp.claim_to_12 = vhcs.claim_to_12 end
# cp.mail_to = vhcs.mail_to if base_cp_provider_codes.include?(vhcs.provider_code)
# cp.mail_to_2 = vhcs.mail_to_2 attributes_hash[:default] = true
end
attributes_hash[:title] = title
attributes_hash[:provider_code] = vhcs.provider_code
# cp.contact_line_1 = vhcs.contact_line_1 IdCard::ProviderSection.find_or_create_by(attributes_hash)
# cp.contact_line_2 = vhcs.contact_line_2 end
# cp.contact_line_3 = vhcs.contact_line_3
# cp.group_number = vhcs.group_number end
# cp.rx_group_id = vhcs.rx_group_id
# cp.rx_contact = vhcs.rx_contact
# cp.provider_lookup_1 = vhcs.provider_lookup_1 base_cp_provider_codes = ["5", "2"]
# cp.provider_lookup_2 = vhcs.provider_lookup_2 needed_codes = %w(M T A I 8 7 1 6 3 P C V Y Z)
# provider_code_map = {}
# cp.precert_1 = vhcs.precert_1 vhcs_cp = Vhcs::HlidCardProvider.where(provider_code: base_cp_provider_codes).to_a + Vhcs::HlidCardProvider.where(provider_code: needed_codes).order(:provider_code).to_a
# cp.precert_2 = vhcs.precert_2 vhcs_cp.each do |vhcs|
# cp.precert_3 = vhcs.precert_3 attributes_hash = vhcs.attributes.except(:provider_code)
# cp.precert_4 = vhcs.precert_4 attributes_hash.delete_if { |key, value| !key.to_s.include?("_") }
# cp.precert_5 = vhcs.precert_5 existing_cp = IdCard::ProviderSection.find_by(attributes_hash)
# cp.precert_6 = vhcs.precert_6
if existing_cp
existing_cp
# if provider_code_map[existing_cp.provider_code]
# provider_code_map[existing_cp.provider_code].push(vhcs.provider_code)
# else
# provider_code_map[existing_cp.provider_code] = [vhcs.provider_code]
# end # end
# end else
attributes_hash[:provider_code] = vhcs.provider_code
IdCard::ProviderSection.find_or_create_by(attributes_hash)
end
end
Vhcs::HlrxCrosRef.all.each do |vhcs| Vhcs::HlrxCrosRef.all.each do |vhcs|
rx = CardRx.find_or_create_by(help_desk: vhcs.help_desk, customer_service: vhcs.customer_service, web_url: vhcs.web_url) rx = IdCard::RxSection.find_or_create_by(help_desk: vhcs.help_desk, customer_service: vhcs.customer_service, web_url: vhcs.web_url)
emp = Employer.find_by(pl_plan_key: vhcs.pl_plan_key) title = rx.web_url.gsub(/^www\./, '').gsub(/\.com\Z/, '')
if emp.present? unless title.match?(/\A[A-Z]/)
emp.card_rx = rx title = title.capitalize
emp.save
end end
rx.title = title
rx.save
end
["CignaLogo.png", "MedCostLogo.png"].each do |logo_upload|
new_logo = ImageProcessor.new("logo_files/network/#{logo_upload}", "Network").call
new_logo.default = true
new_logo.active = true
new_logo.save
end end
+13 -9
View File
@@ -3,7 +3,7 @@ namespace :employer do
desc "TODO" desc "TODO"
# rake employer:vhcs_sync_all # rake employer:vhcs_sync_all
task vhcs_sync_all: :environment do task vhcs_sync_all: :environment do
sql_query = "SELECT PLPlanKey, PlanId, ShortDesc FROM PLPlanHeader WHERE ActiveInactive = 'Active' AND PLPlanKey = 65" sql_query = "SELECT PLPlanKey, PlanId, ShortDesc FROM PLPlanHeader WHERE ActiveInactive = 'Active'"
plan_headers = VhcsRecord.connection.select_all(sql_query) plan_headers = VhcsRecord.connection.select_all(sql_query)
plan_headers.each do |ph| plan_headers.each do |ph|
@@ -13,28 +13,32 @@ namespace :employer do
em.plan_id = ph['PlanId'].strip.to_i em.plan_id = ph['PlanId'].strip.to_i
id_card_templates = determine_id_card_templates(em.pl_plan_key) # id_card_templates = determine_id_card_templates(em.pl_plan_key)
em.single_card_template = id_card_templates[:single_card_template] # em.single_card_template = id_card_templates[:single_card_template]
em.multiple_card_template = id_card_templates[:multiple_card_template] # em.multiple_card_template = id_card_templates[:multiple_card_template]
id_card_setup = em.build_id_card_setup(pl_plan_key: em.pl_plan_key)
plan_code = Vhcs::HlPlanCode.find_by(plan_key: em.pl_plan_key) plan_code = Vhcs::HlPlanCode.find_by(plan_key: em.pl_plan_key)
em.group_number = plan_code.group_number em.group_number = plan_code.group_number
em.rx_group_number = plan_code.medical_number id_card_setup.rx_group_number = plan_code.medical_number
em.effective_date = plan_code.effect_date.strftime("%m/%d/%Y") em.effective_date = plan_code.effect_date.strftime("%m/%d/%Y")
pb_company_plan = Vhcs::PbCompanyPlans.find_by(pl_plan_key: em.pl_plan_key) pb_company_plan = Vhcs::PbCompanyPlans.find_by(pl_plan_key: em.pl_plan_key)
em.company_pb_entity_key = pb_company_plan.company_pb_entity_key em.company_pb_entity_key = pb_company_plan.company_pb_entity_key
card_display_name = Vhcs::PbEntity.find_by(company_pb_entity_key: em.company_pb_entity_key).last_name card_print_name = Vhcs::PbEntity.find_by(company_pb_entity_key: em.company_pb_entity_key).last_name
em.id_card_display_name = em.employer_trim_name(card_display_name) id_card_setup.print_name = em.employer_trim_name(card_print_name)
em.default_network_logo = determine_network_logos(em.pl_plan_key) id_card_setup.active = true
# em.default_network_logo = determine_network_logos(em.pl_plan_key)
end end
vhcs_plans = Vhcs::PbProduct.where(company_pb_entity_key: import_employer.company_pb_entity_key) vhcs_plans = Vhcs::PbProduct.where(company_pb_entity_key: import_employer.company_pb_entity_key)
vhcs_plans.each do |vp| vhcs_plans.each do |vp|
puts "~~ Importing #{vp.short_description}" puts "~~ Importing #{vp.short_description}"
import_plan = import_employer.plans.find_or_create_by!(pb_product_key: vp.pb_product_key) do |pl| import_plan = import_employer.id_card_setup.plans.find_or_create_by!(pb_product_key: vp.pb_product_key) do |pl|
pl.title = vp.short_description pl.title = vp.short_description
end end
vhcs_plan_benefits = Vhcs::HlEgglestonCardBenefit.where(plan_id: import_plan.pb_product_key) vhcs_plan_benefits = Vhcs::HlEgglestonCardBenefit.where(plan_id: import_plan.pb_product_key)
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB