class ChangeHealthcare::Eligibility::SwaggerClient::Encounter

Loop: 2110, Notes: Eligibility or Benefit Information

Attributes

beginning_date_of_service[RW]

Loop: 2100, Segment: DTP, Element: DTP02, Notes: Date Time Period

date_of_service[RW]

Loop: 2100, Segment: DTP, Element: DTP02, Notes: Date Time Period

date_range[RW]
diagnosis_code_pointer[RW]

Loop: 2110, Segment: EQ, Element: EQ05, Notes: Composite Diagnosis Code Pointer

end_date_of_service[RW]

Loop: 2100, Segment: DTP, Element: DTP02, Notes: Date Time Period

industry_code[RW]

Loop: 2110, Segment: III, Element: III02, Notes: III01=ZZ Industry Code, Allowed Values are: '01' Pharmacy,'03' School,'04' Homeless Shelter,'05' Indian Health Service Free-standing Facility,'06' Indian Health Service Provider-based Facility,'07' Tribal 638 Free-standing Facility,'08' Tribal 638 Provider-based Facility,'11' Office,'12' Home,'13' Assisted Living Facility,'14' Group Home,'15' Mobile Unit,'20' Urgent Care Facility,'21' Inpatient Hospital,'22' Outpatient Hospital,'23' Emergency Room - Hospital,'24' Ambulatory Surgical Center,'25' Birthing Center,'26' Military Treatment Facility,'31' Skilled Nursing Facility,'32' Nursing Facility,'33' Custodial Care Facility,'34' Hospice,'41' Ambulance - Land,'42' Ambulance - Air or Water,'49' Independent Clinic,'50' Federally Qualified Health Center,'51' Inpatient Psychiatric Facility,'52' Psychiatric Facility - Partial Hospitalization,'53' Community Mental Health Center,'54' Intermediate Care Facility/Mentally Retarded,'55' Residential Substance Abuse Treatment Facility,'56' Psychiatric Residential Treatment Center,'57' Non-residential Substance Abuse Treatment Facility,'60' Mass Immunization Center,'61'Comprehensive Inpatient Rehabilitation Facility,'62' Comprehensive Outpatient Rehabilitation Facility,'65' End-Stage Renal Disease Treatment Facility,'71' Public Health Clinic,'72' Rural Health Clinic,'81' Independent Laboratory,'99' Other Place of Service

medical_procedures[RW]

Loop: 2110, Segment: EQ, Element: EQ02-1-3, Notes: Composite Medical Procedure Identifier

prior_authorization_or_referral_number[RW]

Loop: 2110, Segment: REF, Element: REF02, Notes: Prior Authorization or Referral Number

procedure_code[RW]

Loop: 2110, Segment: EQ, Element: EQ02-2, Notes: Composite Medical Procedure Identifier - Procedure Code

procedure_modifiers[RW]

Loop: 2110, Segment: EQ, Element: EQ02-3, Notes: Composite Medical Procedure Identifier - Procedure Modifier

product_or_service_id_qualifier[RW]

Loop: 2110, Segment: EQ, Element: EQ02-1, Notes: Composite Medical Procedure Identifier - Product or Service ID Qualifier, Allowed Values are: 'AD' American Dental Association Codes, 'CJ' Current Procedural Terminology (CPT) Codes,'HC' Health Care Financing Administration Common Procedural Coding System (HCPCS) Codes,'ID' International Classification of Diseases, 9th Revision, Clinical Modification (ICD-9-CM) - Procedure, 'IV' Home Infusion EDI Coalition (HIEC) Product/Service Code, 'N4' National Drug Code in 5-4-2 Format, 'ZZ' Mutually Defined

reference_identification_qualifier[RW]

Loop: 2110, Segment: REF, Element: REF01, Notes: Prior Authorization or Referral Number, Allowed Values are: '9F' Referral Number, 'G1' Prior Authorization Number

service_type_codes[RW]

Loop: 2110, Segment: EQ, Element: EQ01, Notes: Service Type Codes

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/encounter.rb, line 78
def self.attribute_map
  {
    'beginning_date_of_service': :beginningDateOfService,
    'date_of_service': :dateOfService,
    'date_range': :dateRange,
    'diagnosis_code_pointer': :diagnosisCodePointer,
    'end_date_of_service': :endDateOfService,
    'industry_code': :industryCode,
    'medical_procedures': :medicalProcedures,
    'prior_authorization_or_referral_number': :priorAuthorizationOrReferralNumber,
    'procedure_code': :procedureCode,
    'procedure_modifiers': :procedureModifiers,
    'product_or_service_id_qualifier': :productOrServiceIDQualifier,
    'reference_identification_qualifier': :referenceIdentificationQualifier,
    'service_type_codes': :serviceTypeCodes
  }
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/encounter.rb, line 117
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:serviceTypeCodes)
    if (value = attributes[:serviceTypeCodes]).is_a?(Array)
      self.service_type_codes = value
    end
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/change_healthcare/eligibility/swagger_client/models/encounter.rb, line 97
def self.swagger_types
  {
    'beginning_date_of_service': :String,
    'date_of_service': :String,
    'date_range': :BOOLEAN,
    'diagnosis_code_pointer': :'Array<String>',
    'end_date_of_service': :String,
    'industry_code': :String,
    'medical_procedures': :'Array<MedicalProcedure>',
    'prior_authorization_or_referral_number': :String,
    'procedure_code': :String,
    'procedure_modifiers': :'Array<String>',
    'product_or_service_id_qualifier': :String,
    'reference_identification_qualifier': :String,
    'service_type_codes': :'Array<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/encounter.rb, line 220
def ==(o)
  return true if equal?(o)

  self.class == o.class &&
    beginning_date_of_service == o.beginning_date_of_service &&
    date_of_service == o.date_of_service &&
    date_range == o.date_range &&
    diagnosis_code_pointer == o.diagnosis_code_pointer &&
    end_date_of_service == o.end_date_of_service &&
    industry_code == o.industry_code &&
    medical_procedures == o.medical_procedures &&
    prior_authorization_or_referral_number == o.prior_authorization_or_referral_number &&
    procedure_code == o.procedure_code &&
    procedure_modifiers == o.procedure_modifiers &&
    product_or_service_id_qualifier == o.product_or_service_id_qualifier &&
    reference_identification_qualifier == o.reference_identification_qualifier &&
    service_type_codes == o.service_type_codes
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/encounter.rb, line 276
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/encounter.rb, line 343
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/encounter.rb, line 254
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/encounter.rb, line 241
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/encounter.rb, line 247
def hash
  [beginning_date_of_service, date_of_service, date_range, diagnosis_code_pointer, end_date_of_service, industry_code, medical_procedures, prior_authorization_or_referral_number, procedure_code, procedure_modifiers, product_or_service_id_qualifier, reference_identification_qualifier, service_type_codes].hash
end
industry_code=(industry_code) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] industry_code Object to be assigned

# File lib/change_healthcare/eligibility/swagger_client/models/encounter.rb, line 189
def industry_code=(industry_code)
  validator = EnumAttributeValidator.new('String', %w[01 03 04 05 06 07 08 11 12 13 14 15 20 21 22 23 24 25 26 31 32 33 34 41 42 49 50 51 52 53 54 55 56 57 60 61 62 65 71 72 81 99])
  raise ArgumentError, %(invalid value for "industry_code", must be one of #{validator.allowable_values}.) unless validator.valid?(industry_code)

  @industry_code = industry_code
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/encounter.rb, line 168
def list_invalid_properties
  []
end
product_or_service_id_qualifier=(product_or_service_id_qualifier) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] product_or_service_id_qualifier Object to be assigned

# File lib/change_healthcare/eligibility/swagger_client/models/encounter.rb, line 198
def product_or_service_id_qualifier=(product_or_service_id_qualifier)
  validator = EnumAttributeValidator.new('String', %w[AD CJ HC ID IV N4 ZZ])
  unless validator.valid?(product_or_service_id_qualifier)
    raise ArgumentError, %(invalid value for "product_or_service_id_qualifier", must be one of #{validator.allowable_values}.)
  end

  @product_or_service_id_qualifier = product_or_service_id_qualifier
end
reference_identification_qualifier=(reference_identification_qualifier) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] reference_identification_qualifier Object to be assigned

# File lib/change_healthcare/eligibility/swagger_client/models/encounter.rb, line 209
def reference_identification_qualifier=(reference_identification_qualifier)
  validator = EnumAttributeValidator.new('String', %w[9F G1])
  unless validator.valid?(reference_identification_qualifier)
    raise ArgumentError, %(invalid value for "reference_identification_qualifier", must be one of #{validator.allowable_values}.)
  end

  @reference_identification_qualifier = reference_identification_qualifier
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/encounter.rb, line 322
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/encounter.rb, line 328
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/encounter.rb, line 316
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/encounter.rb, line 174
def valid?
  industry_code_validator = EnumAttributeValidator.new('String', %w[01 03 04 05 06 07 08 11 12 13 14 15 20 21 22 23 24 25 26 31 32 33 34 41 42 49 50 51 52 53 54 55 56 57 60 61 62 65 71 72 81 99])
  return false unless industry_code_validator.valid?(@industry_code)

  product_or_service_id_qualifier_validator = EnumAttributeValidator.new('String', %w[AD CJ HC ID IV N4 ZZ])
  return false unless product_or_service_id_qualifier_validator.valid?(@product_or_service_id_qualifier)

  reference_identification_qualifier_validator = EnumAttributeValidator.new('String', %w[9F G1])
  return false unless reference_identification_qualifier_validator.valid?(@reference_identification_qualifier)

  true
end