automation and view updates
This commit is contained in:
+15
-16
@@ -6,26 +6,25 @@ module IdCard
|
||||
|
||||
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
|
||||
FARIOS_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
|
||||
TANDEMLOC_BENEFIT_FIELDS = ["Physician Visit", "Specialist Visit", "Urgent Care", "Deductible", "Co-Insurance", "Out-of-Pocket", "Emergency Room", "Preventive Care"].freeze
|
||||
SMART_BENEFIT_FIELDS = [].freeze
|
||||
|
||||
after_initialize :build_plan_benefits, if: :new_record?
|
||||
|
||||
def build_plan_benefits
|
||||
BENEFIT_FIELDS.each_with_index do |bene, i|
|
||||
self.plan_benefits.build(benefit_desc: bene, sequence: (i + 1))
|
||||
if plan_benefits.empty?
|
||||
plan_benefit_fields = case setup&.card_template
|
||||
when "TandemlocIDCard"
|
||||
TANDEMLOC_BENEFIT_FIELDS
|
||||
when "SmartIDCard"
|
||||
SMART_BENEFIT_FIELDS
|
||||
else
|
||||
FARIOS_BENEFIT_FIELDS
|
||||
end
|
||||
plan_benefit_fields.each_with_index do |bene, i|
|
||||
self.plan_benefits.build(benefit_desc: bene, sequence: (i + 1))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user