Sha256: 23ab2d08a88a444a678b499c93d03e0818984f2b1f032d4089190ff7d16507ce

Contents?: true

Size: 1.91 KB

Versions: 19

Compression:

Stored size: 1.91 KB

Contents

unless defined? SampleUser
  SampleUser = OpenStruct.new(
          :member_id => 1,
          :full_name=>'dude man',
          :first_name=>'dude',
          :last_name=>'man',
          :date_of_birth => Date.new(1938, 3, 3),
          :address1 => "422 Cattelranchy St",
          :city => "Dudeville",
          :state => "NY",
          :zip_code => "10000",
          :phone_number => '6461232334',
          :lab_order => nil
  )
end


class LabTestOrder
  attr_accessor :requisition_id, :user

  def initialize(requisition_id, user=nil)
    @requisition_id = requisition_id
    @user = user
  end

  def pdf_requisition
    return @pdf_requisition if @pdf_requisition

    cover_letter_fields = {
      :full_name => user.full_name,
      :address => "#{user.address1}\n#{user.address2}\n#{user.city}, #{user.state} #{user.zip_code}",
      :first_name => user.first_name,
      :sched_date => Date.today.to_s,
      :lab_name => 'LabCorp',
      :order_number => requisition_id
    }

    cover_letter_file_path = "#{FIXTURE_PATH}/pdfs/uhc_requisition_cover_letter.pdf"

    @pdf_requisition = Medivo::PdfGroup.create do
      variable_fields(cover_letter_file_path, cover_letter_fields)
      lab_requisition(requisition_id)
    end
  end

  def pdf_result
    return @pdf_result if @pdf_result

    cover_letter_fields = {
      :full_name => user.full_name,
      :address => "#{user.address1}\n#{user.address2}\n#{user.city}, #{user.state} #{user.zip_code}",
      :first_name => user.first_name,
      :sched_date => Date.today.to_s,
      :lab_name => 'LabCorp',
      :order_number => requisition_id
    }

    cover_letter_file_path = "#{FIXTURE_PATH}/pdfs/uhc_result_cover_letter.pdf"
    faq_path =  "#{FIXTURE_PATH}/pdfs/hepc_result_faq.pdf"

    @pdf_result = Medivo::PdfGroup.create do
      variable_fields(cover_letter_file_path, cover_letter_fields)
      lab_result(requisition_id)
      static_pdf(faq_path)
    end
  end
end


Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
medivo-0.2.24 spec/support/sample_data.rb
medivo-0.2.21 spec/support/sample_data.rb
medivo-0.2.20 spec/support/sample_data.rb
medivo-0.2.19 spec/support/sample_data.rb
medivo-0.2.18 spec/support/sample_data.rb
medivo-0.2.17 spec/support/sample_data.rb
medivo-0.2.16 spec/support/sample_data.rb
medivo-0.2.15 spec/support/sample_data.rb
medivo-0.2.14 spec/support/sample_data.rb
medivo-0.2.13 spec/support/sample_data.rb
medivo-0.2.12 spec/support/sample_data.rb
medivo-0.2.11 spec/support/sample_data.rb
medivo-0.2.10 spec/support/sample_data.rb
medivo-0.2.9 spec/support/sample_data.rb
medivo-0.2.8 spec/support/sample_data.rb
medivo-0.2.7 spec/support/sample_data.rb
medivo-0.2.6 spec/support/sample_data.rb
medivo-0.2.5 spec/support/sample_data.rb
medivo-0.2.3 spec/support/sample_data.rb