Class: ChangeHealthcare::Eligibility::SwaggerClient::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/change_healthcare/eligibility/swagger_client/models/response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Response

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 99

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?(:benefitsInformation)
    if (value = attributes[:benefitsInformation]).is_a?(Array)
      self.benefits_information = value
    end
  end

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

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

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

  if attributes.key?(:implementationTransactionSetSyntaxError)
    self.implementation_transaction_set_syntax_error = attributes[:implementationTransactionSetSyntaxError]
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#benefits_informationObject

Returns the value of attribute benefits_information.



17
18
19
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 17

def benefits_information
  @benefits_information
end

#control_numberObject

Segment: ISA, Element: ISA13, Notes: Interchange Control Number original request



20
21
22
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 20

def control_number
  @control_number
end

#dependentsObject

Loop: 2100D, Notes: Dependent Details



23
24
25
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 23

def dependents
  @dependents
end

#errorsObject

Returns the value of attribute errors.



17
18
19
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 17

def errors
  @errors
end

#implementation_transaction_set_syntax_errorObject

Returns the value of attribute implementation_transaction_set_syntax_error.



17
18
19
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 17

def implementation_transaction_set_syntax_error
  @implementation_transaction_set_syntax_error
end

#payerObject

Loop: 2100A, Segments: NM1 and PER, Notes: Information Source Name



26
27
28
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 26

def payer
  @payer
end

#plan_date_informationObject

Returns the value of attribute plan_date_information.



17
18
19
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 17

def plan_date_information
  @plan_date_information
end

#plan_informationObject

Loop: 2110, Segments: REF, Notes: Subscriber/Dependent Additional Identification



29
30
31
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 29

def plan_information
  @plan_information
end

#plan_statusObject

Returns the value of attribute plan_status.



17
18
19
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 17

def plan_status
  @plan_status
end

#providerObject

Loop: 2000B/2100B, Segment: NM1 and PRV, Notes: Information Receiver



32
33
34
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 32

def provider
  @provider
end

#reassociation_keyObject

Segment: ISA, Element: ISA13, Notes: Interchange Control Number



35
36
37
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 35

def reassociation_key
  @reassociation_key
end

#statusObject

Returns the value of attribute status.



17
18
19
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 17

def status
  @status
end

#subscriberObject

Loop: 2000C/2100C, Segment: NM1, REF, DMG, INS, MPI, PRV, Notes: Subscriber Details



38
39
40
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 38

def subscriber
  @subscriber
end

#subscriber_trace_numbersObject

Loop: 2100, Segment: TRN, Notes: Subscriber Trace Numbers



41
42
43
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 41

def subscriber_trace_numbers
  @subscriber_trace_numbers
end

#trading_partner_idObject

This property is a feature of Trading Partner API, if you are not using Trading Partner API



44
45
46
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 44

def trading_partner_id
  @trading_partner_id
end

#trading_partner_service_idObject

This is the payorId or Identification Code that was sent in the 270



47
48
49
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 47

def trading_partner_service_id
  @trading_partner_service_id
end

#transaction_set_acknowledgementObject

Returns the value of attribute transaction_set_acknowledgement.



17
18
19
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 17

def transaction_set_acknowledgement
  @transaction_set_acknowledgement
end

#x12Object

Returns the value of attribute x12.



17
18
19
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 17

def x12
  @x12
end

Class Method Details

.attribute_mapObject

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



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 50

def self.attribute_map
  {
    'benefits_information': :benefitsInformation,
    'control_number': :controlNumber,
    'dependents': :dependents,
    'errors': :errors,
    'implementation_transaction_set_syntax_error': :implementationTransactionSetSyntaxError,
    'payer': :payer,
    'plan_date_information': :planDateInformation,
    'plan_information': :planInformation,
    'plan_status': :planStatus,
    'provider': :provider,
    'reassociation_key': :reassociationKey,
    'status': :status,
    'subscriber': :subscriber,
    'subscriber_trace_numbers': :subscriberTraceNumbers,
    'trading_partner_id': :tradingPartnerId,
    'trading_partner_service_id': :tradingPartnerServiceId,
    'transaction_set_acknowledgement': :transactionSetAcknowledgement,
    'x12': :x12
  }
end

.swagger_typesObject

Attribute type mapping.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 74

def self.swagger_types
  {
    'benefits_information': :'Array<BenefitsInformation>',
    'control_number': :String,
    'dependents': :'Array<Loop2000CD2100CDSegmentNM1REFDMGINSMPIPRVNotesResponseMember>',
    'errors': :'Array<Error>',
    'implementation_transaction_set_syntax_error': :String,
    'payer': :Loop2100ASegmentsNM1AndPERNotesInformationSourceName,
    'plan_date_information': :PlanDateInformation,
    'plan_information': :Loop2110CDSegmentsREFNotesSubscriberDependentAdditionalIdentification,
    'plan_status': :'Array<PlanStatus>',
    'provider': :Loop2100BCDSegmentNM1PRVNotesProvider,
    'reassociation_key': :String,
    'status': :String,
    'subscriber': :Loop2000CD2100CDSegmentNM1REFDMGINSMPIPRVNotesResponseMember,
    'subscriber_trace_numbers': :'Array<Loop2100CDSegmentTRNNotesSubscriberTraceNumbers>',
    'trading_partner_id': :String,
    'trading_partner_service_id': :String,
    'transaction_set_acknowledgement': :String,
    'x12': :String
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 178

def ==(o)
  return true if equal?(o)

  self.class == o.class &&
    benefits_information == o.benefits_information &&
    control_number == o.control_number &&
    dependents == o.dependents &&
    errors == o.errors &&
    implementation_transaction_set_syntax_error == o.implementation_transaction_set_syntax_error &&
    payer == o.payer &&
    plan_date_information == o.plan_date_information &&
    plan_information == o.plan_information &&
    plan_status == o.plan_status &&
    provider == o.provider &&
    reassociation_key == o.reassociation_key &&
    status == o.status &&
    subscriber == o.subscriber &&
    subscriber_trace_numbers == o.subscriber_trace_numbers &&
    trading_partner_id == o.trading_partner_id &&
    trading_partner_service_id == o.trading_partner_service_id &&
    transaction_set_acknowledgement == o.transaction_set_acknowledgement &&
    x12 == o.x12
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 239

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) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 306

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) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 217

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) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


204
205
206
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 204

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



210
211
212
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 210

def hash
  [benefits_information, control_number, dependents, errors, implementation_transaction_set_syntax_error, payer, plan_date_information, plan_information, plan_status, provider, reassociation_key, status, subscriber, subscriber_trace_numbers, trading_partner_id, trading_partner_service_id, transaction_set_acknowledgement, x12].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



166
167
168
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 166

def list_invalid_properties
  []
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



285
286
287
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 285

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



291
292
293
294
295
296
297
298
299
300
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 291

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



279
280
281
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 279

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



172
173
174
# File 'lib/change_healthcare/eligibility/swagger_client/models/response.rb', line 172

def valid?
  true
end