Employers working - onboarding to card print
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
class CreateEmployerSetupProcesses < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :employer_setup_processes do |t|
|
||||
t.string :employer_name
|
||||
t.string :group_number
|
||||
t.string :effect_date
|
||||
t.string :logo_filename
|
||||
t.string :form_method
|
||||
t.string :status
|
||||
t.string :current_step
|
||||
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,26 @@
|
||||
class CreateEmployers < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :employers do |t|
|
||||
t.string :name
|
||||
t.string :id_card_display_name
|
||||
t.string :slug
|
||||
t.string :pl_plan_key
|
||||
t.integer :company_pb_entity_key
|
||||
t.integer :plan_id
|
||||
t.string :group_number
|
||||
t.string :rx_group_number
|
||||
t.string :effective_date
|
||||
t.string :employer_logo_filename
|
||||
t.string :network_provider
|
||||
t.string :default_network_logo
|
||||
t.string :single_card_template
|
||||
t.string :multiple_card_template
|
||||
t.boolean :active, default: false
|
||||
|
||||
|
||||
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2,8 +2,8 @@ class CreatePlans < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :plans do |t|
|
||||
t.string :title
|
||||
|
||||
t.references :employer_setup_process, null: false, foreign_key: true
|
||||
t.integer :pb_product_key
|
||||
t.references :employer, null: false, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
class CreateNetworkLogos < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :alternate_network_logos do |t|
|
||||
t.string :network_logo
|
||||
t.string :network_logo_filename
|
||||
t.string :exception_type
|
||||
t.string :exception_value
|
||||
t.belongs_to :employer_setup_process, null: false, foreign_key: true
|
||||
t.belongs_to :employer, null: false, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
@@ -2,9 +2,10 @@ class CreateCardLogoFiles < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :card_logo_files do |t|
|
||||
t.string :filename
|
||||
t.binary :image_data
|
||||
t.string :content_type
|
||||
t.string :logo_type
|
||||
t.binary :image
|
||||
t.integer :pl_plan_key
|
||||
t.boolean :active, default: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
class CreateSampleIdCards < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :sample_id_cards do |t|
|
||||
t.string :full_name
|
||||
t.string :family_id
|
||||
t.string :primary_mb_member_key
|
||||
t.string :employer_name
|
||||
t.string :group_number
|
||||
t.string :rx_group
|
||||
t.string :medical_eff_date
|
||||
t.string :provider_code
|
||||
t.string :provider_line_1
|
||||
t.string :provider_line_2
|
||||
t.string :provider_line_3
|
||||
t.string :provider_line_4
|
||||
t.string :provider_line_5
|
||||
t.string :provider_line_6
|
||||
t.string :provider_line_7
|
||||
t.string :provider_line_8
|
||||
t.string :provider_line_9
|
||||
t.string :provider_line_10
|
||||
t.string :provider_line_11
|
||||
t.string :provider_line_12
|
||||
t.string :claim_to_1
|
||||
t.string :claim_to_2
|
||||
t.string :claim_to_3
|
||||
t.string :claim_to_4
|
||||
t.string :claim_to_5
|
||||
t.string :claim_to_6
|
||||
t.string :claim_to_7
|
||||
t.string :claim_to_8
|
||||
t.string :claim_to_9
|
||||
t.string :claim_to_10
|
||||
t.string :claim_to_11
|
||||
t.string :claim_to_12
|
||||
t.string :customer_service
|
||||
t.string :web_url
|
||||
t.string :dependent_1
|
||||
t.string :dependent_2
|
||||
t.string :dependent_3
|
||||
t.string :dependent_4
|
||||
t.string :dependent_5
|
||||
t.string :dependent_6
|
||||
t.string :dependent_7
|
||||
t.string :dependent_8
|
||||
t.string :plan_id
|
||||
t.string :benefit_desc_1
|
||||
t.string :benefit_1
|
||||
t.string :benefit_desc_2
|
||||
t.string :benefit_2
|
||||
t.string :benefit_desc_3
|
||||
t.string :benefit_3
|
||||
t.string :benefit_desc_4
|
||||
t.string :benefit_4
|
||||
t.string :benefit_desc_5
|
||||
t.string :benefit_5
|
||||
t.string :benefit_desc_6
|
||||
t.string :benefit_6
|
||||
t.string :benefit_desc_7
|
||||
t.string :benefit_7
|
||||
t.string :benefit_desc_8
|
||||
t.string :benefit_8
|
||||
t.string :benefit_desc_9
|
||||
t.string :benefit_9
|
||||
t.string :benefit_desc_10
|
||||
t.string :benefit_10
|
||||
t.string :benefit_desc_11
|
||||
t.string :benefit_11
|
||||
t.string :benefit_desc_12
|
||||
t.string :benefit_12
|
||||
t.string :benefit_desc_13
|
||||
t.string :benefit_13
|
||||
t.string :benefit_desc_14
|
||||
t.string :benefit_14
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
class CreateEmployerCardLogos < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :employer_card_logos do |t|
|
||||
t.references :employer, null: false, foreign_key: true
|
||||
t.references :card_logo_file, null: false, foreign_key: true
|
||||
t.string :logo_type
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,49 @@
|
||||
class CreateCardProviders < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :card_providers do |t|
|
||||
t.string :provider_code
|
||||
t.string :provider_line_1
|
||||
t.string :provider_line_2
|
||||
t.string :provider_line_3
|
||||
t.string :provider_line_4
|
||||
t.string :provider_line_5
|
||||
t.string :provider_line_6
|
||||
t.string :provider_line_7
|
||||
t.string :provider_line_8
|
||||
t.string :provider_line_9
|
||||
t.string :provider_line_10
|
||||
t.string :provider_line_11
|
||||
t.string :provider_line_12
|
||||
t.string :claim_to_1
|
||||
t.string :claim_to_2
|
||||
t.string :claim_to_3
|
||||
t.string :claim_to_4
|
||||
t.string :claim_to_5
|
||||
t.string :claim_to_6
|
||||
t.string :claim_to_7
|
||||
t.string :claim_to_8
|
||||
t.string :claim_to_9
|
||||
t.string :claim_to_10
|
||||
t.string :claim_to_11
|
||||
t.string :claim_to_12
|
||||
t.string :mail_to
|
||||
t.string :mail_to_2
|
||||
t.string :contact_line_1
|
||||
t.string :contact_line_2
|
||||
t.string :contact_line_3
|
||||
t.string :group_number
|
||||
t.string :rx_group_id
|
||||
t.string :rx_contact
|
||||
t.string :provider_lookup_1
|
||||
t.string :provider_lookup_2
|
||||
t.string :precert_1
|
||||
t.string :precert_2
|
||||
t.string :precert_3
|
||||
t.string :precert_4
|
||||
t.string :precert_5
|
||||
t.string :precert_6
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
class CreateCardRxes < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :card_rxes do |t|
|
||||
t.string :help_desk
|
||||
t.string :customer_service
|
||||
t.string :web_url
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class AddCardRxToEmployers < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_reference :employers, :card_provider, null: true, foreign_key: true
|
||||
add_reference :employers, :card_rx, null: true, foreign_key: true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
class CreateMembers < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :members do |t|
|
||||
t.string :name
|
||||
t.string :id_card_display_name
|
||||
t.string :family_id
|
||||
t.integer :mb_member_key
|
||||
t.integer :pb_entity_key
|
||||
t.integer :pl_plan_key
|
||||
t.belongs_to :employer, foreign_key: true
|
||||
t.belongs_to :plan, null: true, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
+122
-31
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 2025_12_09_182135) do
|
||||
ActiveRecord::Schema[7.2].define(version: 2026_01_14_183848) do
|
||||
create_table "action_text_rich_texts", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.text "body"
|
||||
@@ -49,41 +49,112 @@ ActiveRecord::Schema[7.2].define(version: 2025_12_09_182135) do
|
||||
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
||||
end
|
||||
|
||||
create_table "alternative_network_logos", force: :cascade do |t|
|
||||
t.string "network_logo"
|
||||
create_table "alternate_network_logos", force: :cascade do |t|
|
||||
t.string "network_logo_filename"
|
||||
t.string "exception_type"
|
||||
t.string "exception_value"
|
||||
t.bigint "employer_setup_process_id", null: false
|
||||
t.bigint "employer_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["employer_setup_process_id"], name: "index_alternative_network_logos_on_employer_setup_process_id"
|
||||
t.index ["employer_id"], name: "index_alternate_network_logos_on_employer_id"
|
||||
end
|
||||
|
||||
create_table "card_logo_files", force: :cascade do |t|
|
||||
t.string "filename"
|
||||
t.binary "image_data"
|
||||
t.string "content_type"
|
||||
t.string "logo_type"
|
||||
t.binary "image"
|
||||
t.integer "pl_plan_key"
|
||||
t.boolean "active", default: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "employer_setup_process_id", null: false
|
||||
t.index ["employer_setup_process_id"], name: "index_card_logo_files_on_employer_setup_process_id"
|
||||
end
|
||||
|
||||
create_table "employer_setup_processes", force: :cascade do |t|
|
||||
t.string "employer_name"
|
||||
create_table "card_providers", force: :cascade do |t|
|
||||
t.string "provider_code"
|
||||
t.string "provider_line_1"
|
||||
t.string "provider_line_2"
|
||||
t.string "provider_line_3"
|
||||
t.string "provider_line_4"
|
||||
t.string "provider_line_5"
|
||||
t.string "provider_line_6"
|
||||
t.string "provider_line_7"
|
||||
t.string "provider_line_8"
|
||||
t.string "provider_line_9"
|
||||
t.string "provider_line_10"
|
||||
t.string "provider_line_11"
|
||||
t.string "provider_line_12"
|
||||
t.string "claim_to_1"
|
||||
t.string "claim_to_2"
|
||||
t.string "claim_to_3"
|
||||
t.string "claim_to_4"
|
||||
t.string "claim_to_5"
|
||||
t.string "claim_to_6"
|
||||
t.string "claim_to_7"
|
||||
t.string "claim_to_8"
|
||||
t.string "claim_to_9"
|
||||
t.string "claim_to_10"
|
||||
t.string "claim_to_11"
|
||||
t.string "claim_to_12"
|
||||
t.string "mail_to"
|
||||
t.string "mail_to_2"
|
||||
t.string "contact_line_1"
|
||||
t.string "contact_line_2"
|
||||
t.string "contact_line_3"
|
||||
t.string "group_number"
|
||||
t.string "effective_date"
|
||||
t.string "employer_logo"
|
||||
t.string "form_method"
|
||||
t.string "status"
|
||||
t.string "current_step"
|
||||
t.string "rx_group_id"
|
||||
t.string "rx_contact"
|
||||
t.string "provider_lookup_1"
|
||||
t.string "provider_lookup_2"
|
||||
t.string "precert_1"
|
||||
t.string "precert_2"
|
||||
t.string "precert_3"
|
||||
t.string "precert_4"
|
||||
t.string "precert_5"
|
||||
t.string "precert_6"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "network_provider"
|
||||
t.string "network_logo"
|
||||
t.string "card_template"
|
||||
end
|
||||
|
||||
create_table "card_rxes", force: :cascade do |t|
|
||||
t.string "help_desk"
|
||||
t.string "customer_service"
|
||||
t.string "web_url"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "employer_card_logos", force: :cascade do |t|
|
||||
t.bigint "employer_id", null: false
|
||||
t.bigint "card_logo_file_id", null: false
|
||||
t.string "logo_type"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["card_logo_file_id"], name: "index_employer_card_logos_on_card_logo_file_id"
|
||||
t.index ["employer_id"], name: "index_employer_card_logos_on_employer_id"
|
||||
end
|
||||
|
||||
create_table "employers", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "id_card_display_name"
|
||||
t.string "slug"
|
||||
t.string "pl_plan_key"
|
||||
t.integer "company_pb_entity_key"
|
||||
t.integer "plan_id"
|
||||
t.string "group_number"
|
||||
t.string "rx_group_number"
|
||||
t.string "effective_date"
|
||||
t.string "employer_logo_filename"
|
||||
t.string "network_provider"
|
||||
t.string "default_network_logo"
|
||||
t.string "single_card_template"
|
||||
t.string "multiple_card_template"
|
||||
t.boolean "active", default: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "card_provider_id"
|
||||
t.bigint "card_rx_id"
|
||||
t.index ["card_provider_id"], name: "index_employers_on_card_provider_id"
|
||||
t.index ["card_rx_id"], name: "index_employers_on_card_rx_id"
|
||||
end
|
||||
|
||||
create_table "id_card_benefits", force: :cascade do |t|
|
||||
@@ -102,6 +173,21 @@ ActiveRecord::Schema[7.2].define(version: 2025_12_09_182135) do
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "members", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "id_card_display_name"
|
||||
t.string "family_id"
|
||||
t.integer "mb_member_key"
|
||||
t.integer "pb_entity_key"
|
||||
t.integer "pl_plan_key"
|
||||
t.bigint "employer_id"
|
||||
t.bigint "plan_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["employer_id"], name: "index_members_on_employer_id"
|
||||
t.index ["plan_id"], name: "index_members_on_plan_id"
|
||||
end
|
||||
|
||||
create_table "plan_benefits", force: :cascade do |t|
|
||||
t.string "benefit_desc"
|
||||
t.string "benefit"
|
||||
@@ -114,22 +200,20 @@ ActiveRecord::Schema[7.2].define(version: 2025_12_09_182135) do
|
||||
|
||||
create_table "plans", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.bigint "employer_setup_process_id", null: false
|
||||
t.integer "pb_product_key"
|
||||
t.bigint "employer_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "plan_id"
|
||||
t.index ["employer_setup_process_id"], name: "index_plans_on_employer_setup_process_id"
|
||||
t.index ["employer_id"], name: "index_plans_on_employer_id"
|
||||
end
|
||||
|
||||
create_table "sample_id_cards", force: :cascade do |t|
|
||||
t.string "full_name"
|
||||
t.string "family_id"
|
||||
t.string "network_image"
|
||||
t.integer "pl_plan_key"
|
||||
t.integer "primary_mb_member_key"
|
||||
t.string "primary_mb_member_key"
|
||||
t.string "employer_name"
|
||||
t.string "group_number"
|
||||
t.string "rx_group"
|
||||
t.string "employer_name"
|
||||
t.string "full_name"
|
||||
t.string "medical_eff_date"
|
||||
t.string "provider_code"
|
||||
t.string "provider_line_1"
|
||||
@@ -143,7 +227,7 @@ ActiveRecord::Schema[7.2].define(version: 2025_12_09_182135) do
|
||||
t.string "provider_line_9"
|
||||
t.string "provider_line_10"
|
||||
t.string "provider_line_11"
|
||||
t.string "mail_to"
|
||||
t.string "provider_line_12"
|
||||
t.string "claim_to_1"
|
||||
t.string "claim_to_2"
|
||||
t.string "claim_to_3"
|
||||
@@ -155,6 +239,7 @@ ActiveRecord::Schema[7.2].define(version: 2025_12_09_182135) do
|
||||
t.string "claim_to_9"
|
||||
t.string "claim_to_10"
|
||||
t.string "claim_to_11"
|
||||
t.string "claim_to_12"
|
||||
t.string "customer_service"
|
||||
t.string "web_url"
|
||||
t.string "dependent_1"
|
||||
@@ -165,6 +250,7 @@ ActiveRecord::Schema[7.2].define(version: 2025_12_09_182135) do
|
||||
t.string "dependent_6"
|
||||
t.string "dependent_7"
|
||||
t.string "dependent_8"
|
||||
t.string "plan_id"
|
||||
t.string "benefit_desc_1"
|
||||
t.string "benefit_1"
|
||||
t.string "benefit_desc_2"
|
||||
@@ -199,9 +285,14 @@ ActiveRecord::Schema[7.2].define(version: 2025_12_09_182135) do
|
||||
|
||||
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "alternative_network_logos", "employer_setup_processes"
|
||||
add_foreign_key "card_logo_files", "employer_setup_processes"
|
||||
add_foreign_key "alternate_network_logos", "employers"
|
||||
add_foreign_key "employer_card_logos", "card_logo_files"
|
||||
add_foreign_key "employer_card_logos", "employers"
|
||||
add_foreign_key "employers", "card_providers"
|
||||
add_foreign_key "employers", "card_rxes"
|
||||
add_foreign_key "id_card_benefits", "id_card_benefits_templates"
|
||||
add_foreign_key "members", "employers"
|
||||
add_foreign_key "members", "plans"
|
||||
add_foreign_key "plan_benefits", "plans"
|
||||
add_foreign_key "plans", "employer_setup_processes"
|
||||
add_foreign_key "plans", "employers"
|
||||
end
|
||||
|
||||
+244
-5
@@ -1,3 +1,88 @@
|
||||
def determine_id_card_templates(pl_plan_key)
|
||||
pl_plan_key = pl_plan_key.to_i
|
||||
if [13, 19, 20, 48, 49, 50, 51, 52, 53, 54, 58, 59, 61].include?(pl_plan_key)
|
||||
single_card_template = 'CignaFairosIDCard'
|
||||
elsif [39].include?(pl_plan_key)
|
||||
single_card_template = 'CignaFairosIDCard-HALF'
|
||||
elsif [4, 5, 16, 23, 33, 55, 57, 63].include?(pl_plan_key)
|
||||
single_card_template = 'MedCostFairosIDCard'
|
||||
elsif [1, 2].include?(pl_plan_key)
|
||||
single_card_template = 'SmartIDCard'
|
||||
elsif [10, 17].include?(pl_plan_key)
|
||||
single_card_template = 'FirstCallTPAIDCard'
|
||||
elsif [15, 18].include?(pl_plan_key)
|
||||
single_card_template = 'SRIIDCARD'
|
||||
elsif [21].include?(pl_plan_key)
|
||||
single_card_template = 'SRIIDCARDFairosRx'
|
||||
elsif [3].include?(pl_plan_key)
|
||||
single_card_template = 'TPAIDCardTan'
|
||||
elsif [56].include?(pl_plan_key)
|
||||
single_card_template = 'CignaHealthBusIDCard'
|
||||
else
|
||||
single_card_template = 'TPAIDCard'
|
||||
end
|
||||
|
||||
if [4, 5, 16, 21, 33, 55, 57, 58, 59, 61].include?(pl_plan_key)
|
||||
multiple_card_template = 'AllTPAIDCardFairosRx'
|
||||
elsif [13, 19, 20, 39, 48, 49, 50, 52, 53, 54].include?(pl_plan_key)
|
||||
multiple_card_template = 'AllHerritageIdCards'
|
||||
elsif [15, 18].include?(pl_plan_key)
|
||||
multiple_card_template = 'ALLSRIIDCARD'
|
||||
elsif [10, 17].include?(pl_plan_key)
|
||||
multiple_card_template = 'AllFirstCallTPAIDCard'
|
||||
elsif [3].include?(pl_plan_key)
|
||||
multiple_card_template = 'AllTPAIDCardTan'
|
||||
elsif [56].include?(pl_plan_key)
|
||||
multiple_card_template = 'AllCignaHealthBusIDCard'
|
||||
else
|
||||
multiple_card_template = 'AllTPAIDCard'
|
||||
end
|
||||
|
||||
{
|
||||
single_card_template: single_card_template,
|
||||
multiple_card_template: multiple_card_template
|
||||
}
|
||||
end
|
||||
|
||||
def determine_network_logos(pl_plan_key)
|
||||
pl_plan_key = pl_plan_key.to_i
|
||||
exception_logos = []
|
||||
if [4, 5, 16, 23, 33, 55, 57, 63].include?(pl_plan_key)
|
||||
default_net_logo_image = 'Logo_MC_PMS.png'
|
||||
elsif [15, 18, 19, 20, 13, 21].include?(pl_plan_key)
|
||||
default_net_logo_image = 'CignaLogo.png'
|
||||
elsif [62].include?(pl_plan_key)
|
||||
default_net_logo_image = 'CignaLogo.png'
|
||||
else
|
||||
default_net_logo_image = 'CignaLogo.png'
|
||||
|
||||
|
||||
# exception_logos << ProviderNetworkLogo.new(
|
||||
# exception_type: 'zip',
|
||||
# exception_value: '49420',
|
||||
# net_logo: 'CignaPHLogo.jpg'
|
||||
# )
|
||||
|
||||
# exception_logos << ProviderNetworkLogo.new(
|
||||
# exception_type: 'zip',
|
||||
# exception_value: '48167',
|
||||
# net_logo: 'CignaPHLogo.jpg'
|
||||
# )
|
||||
|
||||
# exception_logos << ProviderNetworkLogo.new(
|
||||
# exception_type: 'zip',
|
||||
# exception_value: '55419',
|
||||
# net_logo: 'CignaHPLogo.jpg'
|
||||
# )
|
||||
|
||||
# exception_logos << ProviderNetworkLogo.new(
|
||||
# exception_type: 'zip',
|
||||
# exception_value: '55379',
|
||||
# net_logo: 'CignaHPLogo.jpg'
|
||||
# )
|
||||
end
|
||||
end
|
||||
|
||||
benefit_descriptions = ["Primary Visit",
|
||||
"Specialist Visit",
|
||||
"Urgent Care",
|
||||
@@ -18,15 +103,169 @@ benefit_descriptions.each_with_index do |bene, i|
|
||||
IdCardBenefit.create(sequence: i + 1, benefit_desc: bene, id_card_benefits_template: default)
|
||||
end
|
||||
|
||||
temp_1 = IdCardBenefitsTemplate.create(title: "Rebekah's Template")
|
||||
(1..14).each do |seq|
|
||||
IdCardBenefit.create(sequence: seq, benefit: "greatest hits vol #{seq}", id_card_benefits_template: temp_1)
|
||||
end
|
||||
|
||||
temp_2 = IdCardBenefitsTemplate.create(title: "Jason's Template")
|
||||
(1..14).each do |seq|
|
||||
IdCardBenefit.create(sequence: seq, benefit: "#{seq} hit wonder", id_card_benefits_template: temp_2)
|
||||
end
|
||||
|
||||
# temp_1 = IdCardBenefitsTemplate.create(title: "Rebekah's Template")
|
||||
# (1..14).each do |seq|
|
||||
# IdCardBenefit.create(sequence: seq, benefit: "greatest hits vol #{seq}", id_card_benefits_template: temp_1)
|
||||
# end
|
||||
|
||||
|
||||
# historical_id_card_docs = Dir['tmp/*.docx']
|
||||
# historical_id_card_docs.each do |card_doc|
|
||||
# puts card_doc
|
||||
# BenefitsWordDocProcessor.new(card_doc).call
|
||||
# end
|
||||
|
||||
# acentria = Carrier.find_or_create_by!(name: 'Acentria')
|
||||
|
||||
# mcswain_broker = Broker.find_or_create_by!(name: 'Tom McSwain') do |mc|
|
||||
# mc.carrier = acentria
|
||||
# end
|
||||
|
||||
# mcswain_employers = HebWeb::BrokerXRef.where(pl_plan_key: 99).pluck(:employer_pl_plan_key)
|
||||
|
||||
|
||||
# Imports employers and members from VHCS
|
||||
sql_query = "SELECT PLPlanKey, PlanId, ShortDesc FROM PLPlanHeader WHERE ActiveInactive = 'Active' AND PLPlanKey = 61"
|
||||
plan_headers = VhcsRecord.connection.select_all(sql_query)
|
||||
|
||||
plan_headers.each do |ph|
|
||||
import_employer = Employer.find_or_create_by!(pl_plan_key: ph['PLPlanKey']) do |em|
|
||||
puts "Importing #{ph['ShortDesc'].strip}"
|
||||
em.name = ph['ShortDesc'].strip
|
||||
em.plan_id = ph['PlanId'].strip.to_i
|
||||
|
||||
|
||||
id_card_templates = determine_id_card_templates(em.pl_plan_key)
|
||||
em.single_card_template = id_card_templates[:single_card_template]
|
||||
em.multiple_card_template = id_card_templates[:multiple_card_template]
|
||||
|
||||
plan_code = Vhcs::HlPlanCode.find_by(plan_key: em.pl_plan_key)
|
||||
em.group_number = plan_code.group_number
|
||||
em.rx_group_number = plan_code.medical_number
|
||||
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)
|
||||
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
|
||||
em.id_card_display_name = em.employer_trim_name(card_display_name)
|
||||
|
||||
em.default_network_logo = determine_network_logos(em.pl_plan_key)
|
||||
end
|
||||
|
||||
vhcs_plans = Vhcs::PbProduct.where(company_pb_entity_key: import_employer.company_pb_entity_key)
|
||||
vhcs_plans.each do |vp|
|
||||
puts "~~ Importing #{vp.short_description}"
|
||||
import_plan = import_employer.plans.find_or_create_by!(pb_product_key: vp.pb_product_key) do |pl|
|
||||
pl.title = vp.short_description
|
||||
end
|
||||
vhcs_plan_benefits = Vhcs::HlEgglestonCardBenefit.where(plan_id: import_plan.pb_product_key)
|
||||
vhcs_plan_benefits.each do |vb|
|
||||
import_plan.plan_benefits.find_or_create_by!(benefit_desc: vb.benefit_desc) do |pb|
|
||||
pb.sequence = vb.sequence
|
||||
pb.benefit = vb.benefit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
# if mcswain_employers.include?(ph['PLPlanKey'])
|
||||
# em.broker = mcswain_broker
|
||||
# end
|
||||
|
||||
vw_mb_members = Vhcs::VwmbMember.where(enrollee_type_value_id: 1, pl_plan_key: ph['PLPlanKey']).select(:mb_member_key, :pb_entity_key, :pl_plan_key, :family_id, :full_name_last_name_first)
|
||||
vw_mb_members_count = vw_mb_members.length
|
||||
|
||||
vw_mb_members.each_with_index do |vwm, i|
|
||||
import_member = Member.find_or_create_by!(mb_member_key: vwm.mb_member_key) do |me|
|
||||
me.name = vwm.full_name_last_name_first.titleize
|
||||
me.pb_entity_key = vwm.pb_entity_key
|
||||
me.family_id = vwm.family_id
|
||||
me.pl_plan_key = vwm.pl_plan_key
|
||||
me.employer = import_employer
|
||||
|
||||
card_display_name = Vhcs::PbEntity.find_by(pb_entity_key: me.pb_entity_key).full_name
|
||||
me.id_card_display_name = card_display_name
|
||||
|
||||
plan_pb_product_key = Vhcs::PbProduct.joins('INNER JOIN "PBProductAvailability" ON "PBProductAvailability"."PBProductKey" = "PBProduct"."PBProductKey" INNER JOIN "PBProductParticipation" ON "PBProductParticipation"."PBProductAvailabilityKey" = "PBProductAvailability"."PBProductAvailabilityKey" INNER JOIN "PBCoveredEntities" ON "PBProductParticipation"."PBProductParticipationKey" = "PBCoveredEntities"."PBProductParticipationKey"').where('"PBCoveredEntities"."PBEntityKey" = ?', me.pb_entity_key).first.pb_product_key
|
||||
if plan = Plan.find_by(pb_product_key: plan_pb_product_key)
|
||||
me.plan = plan
|
||||
end
|
||||
end
|
||||
puts "Employer #{import_employer.name} (#{i}/#{vw_mb_members_count}) members imported"
|
||||
end
|
||||
end
|
||||
|
||||
Vhcs::HlidCardProvider.all.each do |vhcs|
|
||||
CardProvider.find_or_create_by(provider_code: vhcs.provider_code) do |cp|
|
||||
cp.provider_line_1 = vhcs.provider_line_1
|
||||
cp.provider_line_2 = vhcs.provider_line_2
|
||||
cp.provider_line_3 = vhcs.provider_line_3
|
||||
cp.provider_line_4 = vhcs.provider_line_4
|
||||
cp.provider_line_5 = vhcs.provider_line_5
|
||||
cp.provider_line_6 = vhcs.provider_line_6
|
||||
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
|
||||
cp.claim_to_2 = vhcs.claim_to_2
|
||||
cp.claim_to_3 = vhcs.claim_to_3
|
||||
cp.claim_to_4 = vhcs.claim_to_4
|
||||
cp.claim_to_5 = vhcs.claim_to_5
|
||||
cp.claim_to_6 = vhcs.claim_to_6
|
||||
cp.claim_to_7 = vhcs.claim_to_7
|
||||
cp.claim_to_8 = vhcs.claim_to_8
|
||||
cp.claim_to_9 = vhcs.claim_to_9
|
||||
cp.claim_to_10 = vhcs.claim_to_10
|
||||
cp.claim_to_11 = vhcs.claim_to_11
|
||||
cp.claim_to_12 = vhcs.claim_to_12
|
||||
|
||||
cp.mail_to = vhcs.mail_to
|
||||
cp.mail_to_2 = vhcs.mail_to_2
|
||||
|
||||
cp.contact_line_1 = vhcs.contact_line_1
|
||||
cp.contact_line_2 = vhcs.contact_line_2
|
||||
cp.contact_line_3 = vhcs.contact_line_3
|
||||
|
||||
cp.group_number = vhcs.group_number
|
||||
cp.rx_group_id = vhcs.rx_group_id
|
||||
cp.rx_contact = vhcs.rx_contact
|
||||
|
||||
cp.provider_lookup_1 = vhcs.provider_lookup_1
|
||||
cp.provider_lookup_2 = vhcs.provider_lookup_2
|
||||
|
||||
cp.precert_1 = vhcs.precert_1
|
||||
cp.precert_2 = vhcs.precert_2
|
||||
cp.precert_3 = vhcs.precert_3
|
||||
cp.precert_4 = vhcs.precert_4
|
||||
cp.precert_5 = vhcs.precert_5
|
||||
cp.precert_6 = vhcs.precert_6
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
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)
|
||||
emp = Employer.find_by(pl_plan_key: vhcs.pl_plan_key)
|
||||
if emp.present?
|
||||
emp.card_rx = rx
|
||||
emp.save
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# 15, 18, 19, 20, 13, 21
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user