Sha256: eb7a0c278a23b2b7819a37bcc3b762b9ba73cafbf4a758f4ca5dc4490a86c5a2

Contents?: true

Size: 901 Bytes

Versions: 1

Compression:

Stored size: 901 Bytes

Contents

module Trizetto
  module Api
    module Eligibility
      module WebService

        # A Patient is either a Subscriber or Depedent.  This is the common
        # attributes between the two
        class Patient < Node

          # @see PatientName
          attr_accessor :name

          # The benefits this patient has.
          #
          attr_accessor :benefits

          KEY_CLEANUP = {
            :patientid => :id
          }

          def initialize(raw_hash = {})
            super(raw_hash)
            self.name = PatientName.new(raw_hash[:patientname]) if raw_hash.has_key?(:patientname)

            benefits_xml = raw_hash[:benefit] || []
            benefits_xml = [benefits_xml] if benefits_xml.is_a?(Hash)

            self.benefits = benefits_xml.map do |benefit_xml|
              Benefit.new(benefit_xml)
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trizetto-api-0.2.1 lib/trizetto/api/eligibility/web_service/patient.rb