class Trizetto::Api::Eligibility::WebService::Benefit

A Benefit provided by the insurance.

Example XML

<benefit>
  <info>Out of Pocket (Stop Loss)</info>
  <coveragelevel>Family</coveragelevel>
  <servicetype>Health Benefit Plan Coverage</servicetype>
  <servicetypecode>30</servicetypecode>
  <time_period_qualifier>Remaining</time_period_qualifier>
  <benefitamount>13097.6</benefitamount>
  <plannetworkindicator>In Plan-Network</plannetworkindicator>
  <message>BUT NO MORE THAN INDIVIDUAL AMOUNT PER MEMBER (ACCUMULATES WITH OUT-OF-NETWORK AMOUNTS)</message>
  <message>CALCULATION INCLUDES DEDUCTIBLE, COPAYMENTS AND COINSURANCE FOR MEDICAL AND PRESCRIPTION DRUG BENEFITS.</message>
</benefit>

Example

benefit.info     # => "Out of Pocket (Stop Loss)"
benefit.messages # => ["BUT NO MORE THAN...", "CALCULATION INCLUDES ...."]

Example XML

<benefit>
  <info>Active Coverage</info>
  <coveragelevel>Family</coveragelevel>
  <servicetype>Health Benefit Plan Coverage</servicetype>
  <servicetypecode>30</servicetypecode>
  <insurancetype>Preferred Provider Organization (PPO)</insurancetype>
  <insurancetypecode>PR</insurancetypecode>
  <plancoveragedescription>PPO - PREFERRED BLUE PPO SAVER</plancoveragedescription>
</benefit>

Example

benefit.info                # => "Active Coverage<"
benefit.service_type_codes  # => ["30"]

Constants

KEY_CLEANUP
REQUIRED_KEYS

Public Class Methods

new(raw_hash = {}) click to toggle source
Calls superclass method
# File lib/trizetto/api/eligibility/web_service/benefit.rb, line 67
def initialize(raw_hash = {})
  clean_hash = raw_hash.dup

  # Convert message, which is either a single or multiple entry int
  # the SOAP, which then gets turned into a string or an array by
  # Nori into a messages aaray
  clean_hash[:messages] = Array(clean_hash.delete(:message)) if clean_hash.has_key?(:message)

  # Service type codes indicate the type of benefit.
  # The magic decoder for ID => human meaning is here: http://www.x12.org/codes/health-care-service-type-codes/
  # Multiple service type codes with the same benfit are combined with a ^
  # so we turn a single servicetypecode entry into an array of service types
  clean_hash[:service_type_codes] = (clean_hash.delete(:servicetypecode) || '').split("^")

  super(clean_hash)

  if self.entity.is_a?(Hash)
    self.entity = BenefitEntity.new(self.entity)
  end
end

Public Instance Methods

active_coverage?() click to toggle source

Is this active insurance coverage?

# File lib/trizetto/api/eligibility/web_service/benefit.rb, line 89
def active_coverage?
  info == "Active Coverage"
end
co_insurance?() click to toggle source
# File lib/trizetto/api/eligibility/web_service/benefit.rb, line 97
def co_insurance?
  info == "Co-Insurance"
end
inactive?() click to toggle source
# File lib/trizetto/api/eligibility/web_service/benefit.rb, line 93
def inactive?
  info == "Inactive"
end
limitation?() click to toggle source
# File lib/trizetto/api/eligibility/web_service/benefit.rb, line 101
def limitation?
  info == "Limitations"
end
non_covered?() click to toggle source
# File lib/trizetto/api/eligibility/web_service/benefit.rb, line 105
def non_covered?
  info == "Non-Covered"
end
primary_care_provider?() click to toggle source
# File lib/trizetto/api/eligibility/web_service/benefit.rb, line 109
def primary_care_provider?
  info == "Primary Care Provider"
end