Employers working - onboarding to card print
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
class BenefitsWordDocProcessor
|
||||
|
||||
def initialize(word_doc, process=nil)
|
||||
def initialize(word_doc, employer=nil)
|
||||
@word_doc = word_doc
|
||||
if process
|
||||
@process = process
|
||||
if employer
|
||||
@employer = employer
|
||||
else
|
||||
@process = EmployerSetupProcess.new
|
||||
@employer = Employer.new
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,17 +13,19 @@ class BenefitsWordDocProcessor
|
||||
doc = Docx::Document.open(@word_doc)
|
||||
data_lines = doc.paragraphs.map { |p| p.to_s.squish }.reject!(&:empty?)
|
||||
|
||||
start_of_plans_index = data_lines.index { |s| s == 'Medical Plan'}
|
||||
employer_information, plans_and_network = data_lines.split("Medical Plan")
|
||||
plan_information, network_information = plans_and_network.split("Claims Submission")
|
||||
|
||||
employer_information = data_lines.slice(0, start_of_plans_index)
|
||||
plan_information = data_lines.slice(start_of_plans_index + 1..)
|
||||
# employer_information = data_lines.slice(0, start_of_plans_index)
|
||||
# plan_information = data_lines.slice(start_of_plans_index + 1..)
|
||||
# network_information = data_lines.slice(start_of_network_index + 1..)
|
||||
|
||||
BenefitsWordDoc::MapEmployerInformation.new(@process, employer_information).call
|
||||
BenefitsWordDoc::MapEmployerLogo.new(@process, @word_doc).call
|
||||
BenefitsWordDoc::MapPlansInformation.new(@process, plan_information).call
|
||||
@employer = BenefitsWordDoc::MapEmployerInformation.new(@employer, employer_information).call
|
||||
@employer = BenefitsWordDoc::MapEmployerLogo.new(@employer, @word_doc).call
|
||||
@employer = BenefitsWordDoc::MapPlansInformation.new(@employer, plan_information).call
|
||||
@employer = BenefitsWordDoc::MapNetworkInformation.new(@employer, network_information).call
|
||||
|
||||
|
||||
@process
|
||||
@employer
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user