Sha256: 84cecf96b971c61ca70b8fe5ce889bb7646ca22dcdbe3826dfb15b19e13245ff

Contents?: true

Size: 1.86 KB

Versions: 1

Compression:

Stored size: 1.86 KB

Contents

unless defined? SampleUser
  SampleUser = OpenStruct.new(
          :member_id => 1,
          :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}/uhc_requisition_cover_letter.pdf"
    faq_path =  "#{FIXTURE_PATH}/result_faq.pdf"

    @pdf_requisition = Medivo::PdfGroup.create do
      variable_fields(cover_letter_file_path, cover_letter_fields)
      lab_requisition(requisition_id)
      static_pdf(faq_path)
    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}/uhc_result_cover_letter.pdf"

    Medivo::PdfGroup.create do
      variable_fields(cover_letter_file_path, cover_letter_fields)
      lab_result(requisition_id)
    end
  end
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
medivo-0.1.18 spec/support/sample_data.rb