class ChangeHealthcare::Eligibility::SwaggerClient::BenefitsInformation

Attributes

additional_information[RW]
auth_or_cert_indicator[RW]
benefit_amount[RW]
benefit_percent[RW]
benefit_quantity[RW]
benefits_additional_information[RW]
benefits_date_information[RW]
benefits_service_delivery[RW]
code[RW]
composite_medical_procedure_identifier[RW]
coverage_level[RW]
coverage_level_code[RW]
eligibility_additional_information[RW]
header_loop_identifier_code[RW]
in_plan_network_indicator[RW]
in_plan_network_indicator_code[RW]
insurance_type[RW]
insurance_type_code[RW]
name[RW]
plan_coverage[RW]
quantity_qualifier[RW]
quantity_qualifier_code[RW]
service_type_codes[RW]
service_types[RW]
time_qualifier[RW]
time_qualifier_code[RW]
trailer_loop_identifier_code[RW]

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 20
def self.attribute_map
  {
    'additional_information': :additionalInformation,
    'auth_or_cert_indicator': :authOrCertIndicator,
    'benefit_amount': :benefitAmount,
    'benefit_percent': :benefitPercent,
    'benefit_quantity': :benefitQuantity,
    'benefits_additional_information': :benefitsAdditionalInformation,
    'benefits_date_information': :benefitsDateInformation,
    'benefits_related_entity': :benefitsRelatedEntity,
    'benefits_service_delivery': :benefitsServiceDelivery,
    'code': :code,
    'composite_medical_procedure_identifier': :compositeMedicalProcedureIdentifier,
    'coverage_level': :coverageLevel,
    'coverage_level_code': :coverageLevelCode,
    'eligibility_additional_information': :eligibilityAdditionalInformation,
    'header_loop_identifier_code': :headerLoopIdentifierCode,
    'in_plan_network_indicator': :inPlanNetworkIndicator,
    'in_plan_network_indicator_code': :inPlanNetworkIndicatorCode,
    'insurance_type': :insuranceType,
    'insurance_type_code': :insuranceTypeCode,
    'name': :name,
    'plan_coverage': :planCoverage,
    'quantity_qualifier': :quantityQualifier,
    'quantity_qualifier_code': :quantityQualifierCode,
    'service_type_codes': :serviceTypeCodes,
    'service_types': :serviceTypes,
    'time_qualifier': :timeQualifier,
    'time_qualifier_code': :timeQualifierCode,
    'trailer_loop_identifier_code': :trailerLoopIdentifierCode
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 89
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.transform_keys(&:to_sym)

  if attributes.key?(:additionalInformation)
    if (value = attributes[:additionalInformation]).is_a?(Array)
      self.additional_information = value
    end
  end

  self.auth_or_cert_indicator = attributes[:authOrCertIndicator] if attributes.key?(:authOrCertIndicator)

  self.benefit_amount = attributes[:benefitAmount] if attributes.key?(:benefitAmount)

  self.benefit_percent = attributes[:benefitPercent] if attributes.key?(:benefitPercent)

  self.benefit_quantity = attributes[:benefitQuantity] if attributes.key?(:benefitQuantity)

  self.benefits_additional_information = attributes[:benefitsAdditionalInformation] if attributes.key?(:benefitsAdditionalInformation)

  self.benefits_date_information = attributes[:benefitsDateInformation] if attributes.key?(:benefitsDateInformation)

  self.benefits_related_entity = attributes[:benefitsRelatedEntity] if attributes.key?(:benefitsRelatedEntity)

  if attributes.key?(:benefitsServiceDelivery)
    if (value = attributes[:benefitsServiceDelivery]).is_a?(Array)
      self.benefits_service_delivery = value
    end
  end

  self.code = attributes[:code] if attributes.key?(:code)

  if attributes.key?(:compositeMedicalProcedureIdentifier)
    self.composite_medical_procedure_identifier = attributes[:compositeMedicalProcedureIdentifier]
  end

  self.coverage_level = attributes[:coverageLevel] if attributes.key?(:coverageLevel)

  self.coverage_level_code = attributes[:coverageLevelCode] if attributes.key?(:coverageLevelCode)

  self.eligibility_additional_information = attributes[:eligibilityAdditionalInformation] if attributes.key?(:eligibilityAdditionalInformation)

  self.header_loop_identifier_code = attributes[:headerLoopIdentifierCode] if attributes.key?(:headerLoopIdentifierCode)

  self.in_plan_network_indicator = attributes[:inPlanNetworkIndicator] if attributes.key?(:inPlanNetworkIndicator)

  self.in_plan_network_indicator_code = attributes[:inPlanNetworkIndicatorCode] if attributes.key?(:inPlanNetworkIndicatorCode)

  self.insurance_type = attributes[:insuranceType] if attributes.key?(:insuranceType)

  self.insurance_type_code = attributes[:insuranceTypeCode] if attributes.key?(:insuranceTypeCode)

  self.name = attributes[:name] if attributes.key?(:name)

  self.plan_coverage = attributes[:planCoverage] if attributes.key?(:planCoverage)

  self.quantity_qualifier = attributes[:quantityQualifier] if attributes.key?(:quantityQualifier)

  self.quantity_qualifier_code = attributes[:quantityQualifierCode] if attributes.key?(:quantityQualifierCode)

  if attributes.key?(:serviceTypeCodes)
    if (value = attributes[:serviceTypeCodes]).is_a?(Array)
      self.service_type_codes = value
    end
  end

  if attributes.key?(:serviceTypes)
    if (value = attributes[:serviceTypes]).is_a?(Array)
      self.service_types = value
    end
  end

  self.time_qualifier = attributes[:timeQualifier] if attributes.key?(:timeQualifier)

  self.time_qualifier_code = attributes[:timeQualifierCode] if attributes.key?(:timeQualifierCode)

  self.trailer_loop_identifier_code = attributes[:trailerLoopIdentifierCode] if attributes.key?(:trailerLoopIdentifierCode)
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 54
def self.swagger_types
  {
    'additional_information': :'Array<AdditionalInformation>',
    'auth_or_cert_indicator': :String,
    'benefit_amount': :String,
    'benefit_percent': :String,
    'benefit_quantity': :String,
    'benefits_additional_information': :BenefitsAdditionalInformation,
    'benefits_date_information': :BenefitsDateInformation,
    'benefits_related_entity': :BenefitsRelatedEntity,
    'benefits_service_delivery': :'Array<BenefitsServiceDelivery>',
    'code': :String,
    'composite_medical_procedure_identifier': :CompositeMedicalProcedureIdentifier,
    'coverage_level': :String,
    'coverage_level_code': :String,
    'eligibility_additional_information': :EligibilityAdditionalInformation,
    'header_loop_identifier_code': :String,
    'in_plan_network_indicator': :String,
    'in_plan_network_indicator_code': :String,
    'insurance_type': :String,
    'insurance_type_code': :String,
    'name': :String,
    'plan_coverage': :String,
    'quantity_qualifier': :String,
    'quantity_qualifier_code': :String,
    'service_type_codes': :'Array<String>',
    'service_types': :'Array<String>',
    'time_qualifier': :String,
    'time_qualifier_code': :String,
    'trailer_loop_identifier_code': :String
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 184
def ==(o)
  return true if equal?(o)

  self.class == o.class &&
    additional_information == o.additional_information &&
    auth_or_cert_indicator == o.auth_or_cert_indicator &&
    benefit_amount == o.benefit_amount &&
    benefit_percent == o.benefit_percent &&
    benefit_quantity == o.benefit_quantity &&
    benefits_additional_information == o.benefits_additional_information &&
    benefits_date_information == o.benefits_date_information &&
    benefits_related_entity == o.benefits_related_entity &&
    benefits_service_delivery == o.benefits_service_delivery &&
    code == o.code &&
    composite_medical_procedure_identifier == o.composite_medical_procedure_identifier &&
    coverage_level == o.coverage_level &&
    coverage_level_code == o.coverage_level_code &&
    eligibility_additional_information == o.eligibility_additional_information &&
    header_loop_identifier_code == o.header_loop_identifier_code &&
    in_plan_network_indicator == o.in_plan_network_indicator &&
    in_plan_network_indicator_code == o.in_plan_network_indicator_code &&
    insurance_type == o.insurance_type &&
    insurance_type_code == o.insurance_type_code &&
    name == o.name &&
    plan_coverage == o.plan_coverage &&
    quantity_qualifier == o.quantity_qualifier &&
    quantity_qualifier_code == o.quantity_qualifier_code &&
    service_type_codes == o.service_type_codes &&
    service_types == o.service_types &&
    time_qualifier == o.time_qualifier &&
    time_qualifier_code == o.time_qualifier_code &&
    trailer_loop_identifier_code == o.trailer_loop_identifier_code
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 255
def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = SwaggerClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 322
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 233
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 220
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 226
def hash
  [additional_information, auth_or_cert_indicator, benefit_amount, benefit_percent, benefit_quantity, benefits_additional_information, benefits_date_information, benefits_related_entity, benefits_service_delivery, code, composite_medical_procedure_identifier, coverage_level, coverage_level_code, eligibility_additional_information, header_loop_identifier_code, in_plan_network_indicator, in_plan_network_indicator_code, insurance_type, insurance_type_code, name, plan_coverage, quantity_qualifier, quantity_qualifier_code, service_type_codes, service_types, time_qualifier, time_qualifier_code, trailer_loop_identifier_code].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 172
def list_invalid_properties
  []
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 301
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 307
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = send(attr)
    next if value.nil?

    hash[param] = _to_hash(value)
  end
  hash
end
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 295
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb, line 178
def valid?
  true
end