change_healthcare-eligibility 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +130 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +7 -0
  7. data/Gemfile +4 -0
  8. data/Gemfile.lock +59 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +64 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +11 -0
  13. data/bin/rspec +29 -0
  14. data/bin/setup +8 -0
  15. data/change_healthcare-eligibility.gemspec +44 -0
  16. data/lib/change_healthcare/eligibility.rb +13 -0
  17. data/lib/change_healthcare/eligibility/inspector.rb +82 -0
  18. data/lib/change_healthcare/eligibility/swagger_client.rb +81 -0
  19. data/lib/change_healthcare/eligibility/swagger_client/api_client.rb +388 -0
  20. data/lib/change_healthcare/eligibility/swagger_client/api_error.rb +40 -0
  21. data/lib/change_healthcare/eligibility/swagger_client/configuration.rb +202 -0
  22. data/lib/change_healthcare/eligibility/swagger_client/eligibility_api.rb +198 -0
  23. data/lib/change_healthcare/eligibility/swagger_client/models/additional_identification.rb +266 -0
  24. data/lib/change_healthcare/eligibility/swagger_client/models/additional_information.rb +185 -0
  25. data/lib/change_healthcare/eligibility/swagger_client/models/address.rb +218 -0
  26. data/lib/change_healthcare/eligibility/swagger_client/models/benefits_additional_information.rb +376 -0
  27. data/lib/change_healthcare/eligibility/swagger_client/models/benefits_date_information.rb +340 -0
  28. data/lib/change_healthcare/eligibility/swagger_client/models/benefits_information.rb +338 -0
  29. data/lib/change_healthcare/eligibility/swagger_client/models/benefits_related_entity.rb +240 -0
  30. data/lib/change_healthcare/eligibility/swagger_client/models/benefits_service_delivery.rb +220 -0
  31. data/lib/change_healthcare/eligibility/swagger_client/models/composite_medical_procedure_identifier.rb +218 -0
  32. data/lib/change_healthcare/eligibility/swagger_client/models/eligibility_additional_information.rb +200 -0
  33. data/lib/change_healthcare/eligibility/swagger_client/models/encounter.rb +359 -0
  34. data/lib/change_healthcare/eligibility/swagger_client/models/error.rb +205 -0
  35. data/lib/change_healthcare/eligibility/swagger_client/models/health_care_diagnosis_code.rb +190 -0
  36. data/lib/change_healthcare/eligibility/swagger_client/models/health_care_information.rb +229 -0
  37. data/lib/change_healthcare/eligibility/swagger_client/models/health_check.rb +190 -0
  38. data/lib/change_healthcare/eligibility/swagger_client/models/information_receiver_name.rb +303 -0
  39. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2000_cd2100_cd_segment_nm1_ref_dmg_ins_mpi_prv_notes_response_member.rb +429 -0
  40. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_a_segments_nm1_and_per_notes_information_source_name.rb +293 -0
  41. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_a_segments_per_element_per03_8_notes_communication.rb +194 -0
  42. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_a_segments_per_notes_information_source_contact_information.rb +198 -0
  43. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_bcd_segment_nm1_prv_notes_provider.rb +322 -0
  44. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2100_cd_segment_trn_notes_subscriber_trace_numbers.rb +218 -0
  45. data/lib/change_healthcare/eligibility/swagger_client/models/loop_2110_cd_segments_ref_notes_subscriber_dependent_additional_identification.rb +488 -0
  46. data/lib/change_healthcare/eligibility/swagger_client/models/medical_eligibility.rb +272 -0
  47. data/lib/change_healthcare/eligibility/swagger_client/models/medical_procedure.rb +254 -0
  48. data/lib/change_healthcare/eligibility/swagger_client/models/plan_date_information.rb +340 -0
  49. data/lib/change_healthcare/eligibility/swagger_client/models/plan_status.rb +204 -0
  50. data/lib/change_healthcare/eligibility/swagger_client/models/provider.rb +304 -0
  51. data/lib/change_healthcare/eligibility/swagger_client/models/provider_information.rb +190 -0
  52. data/lib/change_healthcare/eligibility/swagger_client/models/raw_x12_request.rb +190 -0
  53. data/lib/change_healthcare/eligibility/swagger_client/models/request_dependent.rb +452 -0
  54. data/lib/change_healthcare/eligibility/swagger_client/models/request_subscriber.rb +456 -0
  55. data/lib/change_healthcare/eligibility/swagger_client/models/response.rb +322 -0
  56. data/lib/change_healthcare/eligibility/swagger_client/version.rb +17 -0
  57. data/lib/change_healthcare/eligibility/version.rb +5 -0
  58. data/lib/change_healthcare/eligibility/wrapper.rb +124 -0
  59. metadata +214 -0
@@ -0,0 +1,429 @@
1
+ # #Eligibility
2
+ #
3
+ # Reference for developers
4
+ #
5
+ # OpenAPI spec version: v3
6
+ #
7
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
8
+ # Swagger Codegen version: 2.4.17
9
+ #
10
+
11
+ require 'date'
12
+
13
+ module ChangeHealthcare
14
+ module Eligibility
15
+ module SwaggerClient
16
+ class Loop2000CD2100CDSegmentNM1REFDMGINSMPIPRVNotesResponseMember
17
+ # Loop: 2000[C|D]/2100[C|D], Segment: N3 and N4 Element: INS04, Notes: Maintenance Reason Code
18
+ attr_accessor :address
19
+
20
+ # Loop: 2000[C|D]/2100[C|D], Segment: INS, Element: INS17, Notes: Birth Sequence Number Use to indicate the birth order in the event of multiple births in association with the birth date supplied in DMG02
21
+ attr_accessor :birth_sequence_number
22
+
23
+ # Loop: 2000[C|D]/2100[C|D], Segment: DMG, Element: DMG02, Notes: Date of Birth
24
+ attr_accessor :date_of_birth
25
+
26
+ # Loop: 2000[C|D]/2100[C|D], Segment: MPI, Element: MPI07, Notes: MPI106=D8 Date Time Period
27
+ attr_accessor :date_time_period
28
+
29
+ # Loop: 2000[C|D]/2100[C|D], Segment: MPI, Element: MPI06, Notes: Date Time Period Format Qualifier
30
+ attr_accessor :date_time_period_format_qualifier
31
+
32
+ # Loop: 2000[C|D]/2100[C|D], Segment: MPI, Element: MPI04, Notes: Description
33
+ attr_accessor :description
34
+
35
+ # Loop: 2000[C|D]/2100[C|D], Segment: MPI, Element: MPI02, Notes: Employment Status Code
36
+ attr_accessor :employment_status_code
37
+
38
+ # Loop: 2000[C|D]/2100[C|D], Segment: MPI, Element: MPI08, Notes: MPI106=RD8 Date Time Period
39
+ attr_accessor :end_date_time_period
40
+
41
+ # Loop: 2000[C|D]/2100[C|D], Segment: NM1, Element: NM101, Notes: entityIdentifier
42
+ attr_accessor :entity_identifier
43
+
44
+ # Loop: 2000[C|D]/2100[C|D], Segment: NM1, Element: NM102, Notes: entityType
45
+ attr_accessor :entity_type
46
+
47
+ # Loop: 2000[C|D]/2100[C|D], Segment: NM1, Element: NM104, Notes: First Name
48
+ attr_accessor :first_name
49
+
50
+ # Loop: 2000[C|D]/2100[C|D], Segment: DMG, Element: DMG03, Notes: gender
51
+ attr_accessor :gender
52
+
53
+ # Loop: 2000[C|D]/2100[C|D], Segment: MPI, Element: MPI03, Notes: Government Service Affiliation Code
54
+ attr_accessor :government_service_affiliation_code
55
+
56
+ # Loop: 2000[C|D]/2100[C|D], Segment: REF, Element: REF02, Notes: REF01=6P Group Number
57
+ attr_accessor :group_number
58
+
59
+ attr_accessor :health_care_diagnosis_codes
60
+
61
+ # Loop: 2000[C|D]/2100[C|D], Segment: MPI, Element: MPI01, Notes: Information Status Code
62
+ attr_accessor :information_status_code
63
+
64
+ # Loop: 2000[C|D]/2100[C|D], Segment: INS, Element: INS01, Notes: Insured Indicator
65
+ attr_accessor :insured_indicator
66
+
67
+ # Loop: 2000[C|D]/2100[C|D], Segment: NM1, Element: NM103, Notes: Last Name
68
+ attr_accessor :last_name
69
+
70
+ # Loop: 2000[C|D]/2100[C|D], Segment: INS, Element: INS04, Notes: Maintenance Reason Code
71
+ attr_accessor :maintenance_reason_code
72
+
73
+ # Loop: 2000[C|D]/2100[C|D], Segment: INS, Element: INS03, Notes: Maintenance Type Code
74
+ attr_accessor :maintenance_type_code
75
+
76
+ # Loop: 2000[C|D]/2100[C|D], Segment: NM1, Element: NM109, Notes: NM108=MI Member Identification Number
77
+ attr_accessor :member_id
78
+
79
+ # Loop: 2000[C|D]/2100[C|D], Segment: NM1 Element: NM105, Notes: Middle Name
80
+ attr_accessor :middle_name
81
+
82
+ # Loop: 2000[C|D]/2100[C|D], Segment: MPI, Element: MPI05, Notes: Military Service Rank Code
83
+ attr_accessor :military_service_rank_code
84
+
85
+ # Loop: 2000[C|D]/2100[C|D], Segment: REF, Element: REF02, Notes: REF01=18 Plan Number
86
+ attr_accessor :plan_number
87
+
88
+ # Loop: 2000[C|D]/2100[C|D], Segment: PRV, Notes: Provider Information
89
+ attr_accessor :provider
90
+
91
+ # Loop: 2000[C|D]/2100[C|D], Segment: INS, Element: INS02, Notes: Individual Relationship Code
92
+ attr_accessor :relation_to_subscriber
93
+
94
+ # Loop: 2000[C|D]/2100[C|D], Segment: INS, Element: INS02, Notes: Individual Relationship Code
95
+ attr_accessor :relation_to_subscriber_code
96
+
97
+ # Loop: 2000[C|D]/2100[C|D], Segment: REF, Element: REF02, Notes: REF01=SY Social Security Number
98
+ attr_accessor :ssn
99
+
100
+ # Loop: 2000[C|D]/2100[C|D], Segment: MPI, Element: MPI08, Notes: MPI106=RD8 Date Time Period
101
+ attr_accessor :start_date_time_period
102
+
103
+ # Loop: 2000[C|D]/2100[C|D], Segment: NM1, Element: NM107, Notes: suffix
104
+ attr_accessor :suffix
105
+
106
+ # Loop: 2000[C|D]/2100[C|D], Segment: NM1, Element: NM109, Notes: NM108=II uniqueHealthIdentifier
107
+ attr_accessor :unique_health_identifier
108
+
109
+ # Attribute mapping from ruby-style variable name to JSON key.
110
+ def self.attribute_map
111
+ {
112
+ 'address': :address,
113
+ 'birth_sequence_number': :birthSequenceNumber,
114
+ 'date_of_birth': :dateOfBirth,
115
+ 'date_time_period': :dateTimePeriod,
116
+ 'date_time_period_format_qualifier': :dateTimePeriodFormatQualifier,
117
+ 'description': :description,
118
+ 'employment_status_code': :employmentStatusCode,
119
+ 'end_date_time_period': :endDateTimePeriod,
120
+ 'entity_identifier': :entityIdentifier,
121
+ 'entity_type': :entityType,
122
+ 'first_name': :firstName,
123
+ 'gender': :gender,
124
+ 'government_service_affiliation_code': :governmentServiceAffiliationCode,
125
+ 'group_number': :groupNumber,
126
+ 'health_care_diagnosis_codes': :healthCareDiagnosisCodes,
127
+ 'information_status_code': :informationStatusCode,
128
+ 'insured_indicator': :insuredIndicator,
129
+ 'last_name': :lastName,
130
+ 'maintenance_reason_code': :maintenanceReasonCode,
131
+ 'maintenance_type_code': :maintenanceTypeCode,
132
+ 'member_id': :memberId,
133
+ 'middle_name': :middleName,
134
+ 'military_service_rank_code': :militaryServiceRankCode,
135
+ 'plan_number': :planNumber,
136
+ 'provider': :provider,
137
+ 'relation_to_subscriber': :relationToSubscriber,
138
+ 'relation_to_subscriber_code': :relationToSubscriberCode,
139
+ 'ssn': :ssn,
140
+ 'start_date_time_period': :startDateTimePeriod,
141
+ 'suffix': :suffix,
142
+ 'unique_health_identifier': :uniqueHealthIdentifier
143
+ }
144
+ end
145
+
146
+ # Attribute type mapping.
147
+ def self.swagger_types
148
+ {
149
+ 'address': :Address,
150
+ 'birth_sequence_number': :String,
151
+ 'date_of_birth': :Date,
152
+ 'date_time_period': :String,
153
+ 'date_time_period_format_qualifier': :String,
154
+ 'description': :String,
155
+ 'employment_status_code': :String,
156
+ 'end_date_time_period': :String,
157
+ 'entity_identifier': :String,
158
+ 'entity_type': :String,
159
+ 'first_name': :String,
160
+ 'gender': :String,
161
+ 'government_service_affiliation_code': :String,
162
+ 'group_number': :String,
163
+ 'health_care_diagnosis_codes': :'Array<HealthCareDiagnosisCode>',
164
+ 'information_status_code': :String,
165
+ 'insured_indicator': :String,
166
+ 'last_name': :String,
167
+ 'maintenance_reason_code': :String,
168
+ 'maintenance_type_code': :String,
169
+ 'member_id': :String,
170
+ 'middle_name': :String,
171
+ 'military_service_rank_code': :String,
172
+ 'plan_number': :String,
173
+ 'provider': :Loop2100BCDSegmentNM1PRVNotesProvider,
174
+ 'relation_to_subscriber': :String,
175
+ 'relation_to_subscriber_code': :String,
176
+ 'ssn': :String,
177
+ 'start_date_time_period': :String,
178
+ 'suffix': :String,
179
+ 'unique_health_identifier': :String
180
+ }
181
+ end
182
+
183
+ # Initializes the object
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ def initialize(attributes = {})
186
+ return unless attributes.is_a?(Hash)
187
+
188
+ # convert string to symbol for hash key
189
+ attributes = attributes.transform_keys(&:to_sym)
190
+
191
+ self.address = attributes[:address] if attributes.key?(:address)
192
+
193
+ self.birth_sequence_number = attributes[:birthSequenceNumber] if attributes.key?(:birthSequenceNumber)
194
+
195
+ self.date_of_birth = attributes[:dateOfBirth] if attributes.key?(:dateOfBirth)
196
+
197
+ self.date_time_period = attributes[:dateTimePeriod] if attributes.key?(:dateTimePeriod)
198
+
199
+ self.date_time_period_format_qualifier = attributes[:dateTimePeriodFormatQualifier] if attributes.key?(:dateTimePeriodFormatQualifier)
200
+
201
+ self.description = attributes[:description] if attributes.key?(:description)
202
+
203
+ self.employment_status_code = attributes[:employmentStatusCode] if attributes.key?(:employmentStatusCode)
204
+
205
+ self.end_date_time_period = attributes[:endDateTimePeriod] if attributes.key?(:endDateTimePeriod)
206
+
207
+ self.entity_identifier = attributes[:entityIdentifier] if attributes.key?(:entityIdentifier)
208
+
209
+ self.entity_type = attributes[:entityType] if attributes.key?(:entityType)
210
+
211
+ self.first_name = attributes[:firstName] if attributes.key?(:firstName)
212
+
213
+ self.gender = attributes[:gender] if attributes.key?(:gender)
214
+
215
+ self.government_service_affiliation_code = attributes[:governmentServiceAffiliationCode] if attributes.key?(:governmentServiceAffiliationCode)
216
+
217
+ self.group_number = attributes[:groupNumber] if attributes.key?(:groupNumber)
218
+
219
+ if attributes.key?(:healthCareDiagnosisCodes)
220
+ if (value = attributes[:healthCareDiagnosisCodes]).is_a?(Array)
221
+ self.health_care_diagnosis_codes = value
222
+ end
223
+ end
224
+
225
+ self.information_status_code = attributes[:informationStatusCode] if attributes.key?(:informationStatusCode)
226
+
227
+ self.insured_indicator = attributes[:insuredIndicator] if attributes.key?(:insuredIndicator)
228
+
229
+ self.last_name = attributes[:lastName] if attributes.key?(:lastName)
230
+
231
+ self.maintenance_reason_code = attributes[:maintenanceReasonCode] if attributes.key?(:maintenanceReasonCode)
232
+
233
+ self.maintenance_type_code = attributes[:maintenanceTypeCode] if attributes.key?(:maintenanceTypeCode)
234
+
235
+ self.member_id = attributes[:memberId] if attributes.key?(:memberId)
236
+
237
+ self.middle_name = attributes[:middleName] if attributes.key?(:middleName)
238
+
239
+ self.military_service_rank_code = attributes[:militaryServiceRankCode] if attributes.key?(:militaryServiceRankCode)
240
+
241
+ self.plan_number = attributes[:planNumber] if attributes.key?(:planNumber)
242
+
243
+ self.provider = attributes[:provider] if attributes.key?(:provider)
244
+
245
+ self.relation_to_subscriber = attributes[:relationToSubscriber] if attributes.key?(:relationToSubscriber)
246
+
247
+ self.relation_to_subscriber_code = attributes[:relationToSubscriberCode] if attributes.key?(:relationToSubscriberCode)
248
+
249
+ self.ssn = attributes[:ssn] if attributes.key?(:ssn)
250
+
251
+ self.start_date_time_period = attributes[:startDateTimePeriod] if attributes.key?(:startDateTimePeriod)
252
+
253
+ self.suffix = attributes[:suffix] if attributes.key?(:suffix)
254
+
255
+ self.unique_health_identifier = attributes[:uniqueHealthIdentifier] if attributes.key?(:uniqueHealthIdentifier)
256
+ end
257
+
258
+ # Show invalid properties with the reasons. Usually used together with valid?
259
+ # @return Array for valid properties with the reasons
260
+ def list_invalid_properties
261
+ []
262
+ end
263
+
264
+ # Check to see if the all the properties in the model are valid
265
+ # @return true if the model is valid
266
+ def valid?
267
+ true
268
+ end
269
+
270
+ # Checks equality by comparing each attribute.
271
+ # @param [Object] Object to be compared
272
+ def ==(o)
273
+ return true if equal?(o)
274
+
275
+ self.class == o.class &&
276
+ address == o.address &&
277
+ birth_sequence_number == o.birth_sequence_number &&
278
+ date_of_birth == o.date_of_birth &&
279
+ date_time_period == o.date_time_period &&
280
+ date_time_period_format_qualifier == o.date_time_period_format_qualifier &&
281
+ description == o.description &&
282
+ employment_status_code == o.employment_status_code &&
283
+ end_date_time_period == o.end_date_time_period &&
284
+ entity_identifier == o.entity_identifier &&
285
+ entity_type == o.entity_type &&
286
+ first_name == o.first_name &&
287
+ gender == o.gender &&
288
+ government_service_affiliation_code == o.government_service_affiliation_code &&
289
+ group_number == o.group_number &&
290
+ health_care_diagnosis_codes == o.health_care_diagnosis_codes &&
291
+ information_status_code == o.information_status_code &&
292
+ insured_indicator == o.insured_indicator &&
293
+ last_name == o.last_name &&
294
+ maintenance_reason_code == o.maintenance_reason_code &&
295
+ maintenance_type_code == o.maintenance_type_code &&
296
+ member_id == o.member_id &&
297
+ middle_name == o.middle_name &&
298
+ military_service_rank_code == o.military_service_rank_code &&
299
+ plan_number == o.plan_number &&
300
+ provider == o.provider &&
301
+ relation_to_subscriber == o.relation_to_subscriber &&
302
+ relation_to_subscriber_code == o.relation_to_subscriber_code &&
303
+ ssn == o.ssn &&
304
+ start_date_time_period == o.start_date_time_period &&
305
+ suffix == o.suffix &&
306
+ unique_health_identifier == o.unique_health_identifier
307
+ end
308
+
309
+ # @see the `==` method
310
+ # @param [Object] Object to be compared
311
+ def eql?(o)
312
+ self == o
313
+ end
314
+
315
+ # Calculates hash code according to all attributes.
316
+ # @return [Fixnum] Hash code
317
+ def hash
318
+ [address, birth_sequence_number, date_of_birth, date_time_period, date_time_period_format_qualifier, description, employment_status_code, end_date_time_period, entity_identifier, entity_type, first_name, gender, government_service_affiliation_code, group_number, health_care_diagnosis_codes, information_status_code, insured_indicator, last_name, maintenance_reason_code, maintenance_type_code, member_id, middle_name, military_service_rank_code, plan_number, provider, relation_to_subscriber, relation_to_subscriber_code, ssn, start_date_time_period, suffix, unique_health_identifier].hash
319
+ end
320
+
321
+ # Builds the object from hash
322
+ # @param [Hash] attributes Model attributes in the form of hash
323
+ # @return [Object] Returns the model itself
324
+ def build_from_hash(attributes)
325
+ return nil unless attributes.is_a?(Hash)
326
+
327
+ self.class.swagger_types.each_pair do |key, type|
328
+ if type =~ /\AArray<(.*)>/i
329
+ # check to ensure the input is an array given that the attribute
330
+ # is documented as an array but the input is not
331
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
332
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
333
+ end
334
+ elsif !attributes[self.class.attribute_map[key]].nil?
335
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
336
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
337
+ end
338
+
339
+ self
340
+ end
341
+
342
+ # Deserializes the data based on type
343
+ # @param string type Data type
344
+ # @param string value Value to be deserialized
345
+ # @return [Object] Deserialized data
346
+ def _deserialize(type, value)
347
+ case type.to_sym
348
+ when :DateTime
349
+ DateTime.parse(value)
350
+ when :Date
351
+ Date.parse(value)
352
+ when :String
353
+ value.to_s
354
+ when :Integer
355
+ value.to_i
356
+ when :Float
357
+ value.to_f
358
+ when :BOOLEAN
359
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
360
+ true
361
+ else
362
+ false
363
+ end
364
+ when :Object
365
+ # generic object (usually a Hash), return directly
366
+ value
367
+ when /\AArray<(?<inner_type>.+)>\z/
368
+ inner_type = Regexp.last_match[:inner_type]
369
+ value.map { |v| _deserialize(inner_type, v) }
370
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
371
+ k_type = Regexp.last_match[:k_type]
372
+ v_type = Regexp.last_match[:v_type]
373
+ {}.tap do |hash|
374
+ value.each do |k, v|
375
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
376
+ end
377
+ end
378
+ else # model
379
+ temp_model = SwaggerClient.const_get(type).new
380
+ temp_model.build_from_hash(value)
381
+ end
382
+ end
383
+
384
+ # Returns the string representation of the object
385
+ # @return [String] String presentation of the object
386
+ def to_s
387
+ to_hash.to_s
388
+ end
389
+
390
+ # to_body is an alias to to_hash (backward compatibility)
391
+ # @return [Hash] Returns the object in the form of hash
392
+ def to_body
393
+ to_hash
394
+ end
395
+
396
+ # Returns the object in the form of hash
397
+ # @return [Hash] Returns the object in the form of hash
398
+ def to_hash
399
+ hash = {}
400
+ self.class.attribute_map.each_pair do |attr, param|
401
+ value = send(attr)
402
+ next if value.nil?
403
+
404
+ hash[param] = _to_hash(value)
405
+ end
406
+ hash
407
+ end
408
+
409
+ # Outputs non-array value in the form of hash
410
+ # For object, use to_hash. Otherwise, just return the value
411
+ # @param [Object] value Any valid value
412
+ # @return [Hash] Returns the value in the form of hash
413
+ def _to_hash(value)
414
+ if value.is_a?(Array)
415
+ value.compact.map { |v| _to_hash(v) }
416
+ elsif value.is_a?(Hash)
417
+ {}.tap do |hash|
418
+ value.each { |k, v| hash[k] = _to_hash(v) }
419
+ end
420
+ elsif value.respond_to? :to_hash
421
+ value.to_hash
422
+ else
423
+ value
424
+ end
425
+ end
426
+ end
427
+ end
428
+ end
429
+ end
@@ -0,0 +1,293 @@
1
+ # #Eligibility
2
+ #
3
+ # Reference for developers
4
+ #
5
+ # OpenAPI spec version: v3
6
+ #
7
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
8
+ # Swagger Codegen version: 2.4.17
9
+ #
10
+
11
+ require 'date'
12
+
13
+ module ChangeHealthcare
14
+ module Eligibility
15
+ module SwaggerClient
16
+ class Loop2100ASegmentsNM1AndPERNotesInformationSourceName
17
+ # Loop: 2100A, Segments: NM1, Element: NM109 Notes: NM108=XV Centers for Medicare and Medicaid Services PlanID
18
+ attr_accessor :centers_for_medicare_and_medicaid_plan_id
19
+
20
+ # Loop: 2100A, Segments: PER, Notes: Information Source Contact Information
21
+ attr_accessor :contact_information
22
+
23
+ # Loop: 2100A, Segments: NM1, Element: NM109 Notes: NM108=24 Employer’s Identification Number
24
+ attr_accessor :employers_id
25
+
26
+ # Loop: 2100A, Segments: NM1, Element: NM101 Notes: Entity Identifier Code
27
+ attr_accessor :entity_identifier
28
+
29
+ # Loop: 2100A, Segments: NM1, Element: NM102 Notes: Entity Type Qualifier
30
+ attr_accessor :entity_type
31
+
32
+ attr_accessor :etin, :naic, :npi
33
+
34
+ # Loop: 2100A, Segments: NM1, Element: NM109 Notes: NM108=FI Federal Taxpayer’s Identification Number
35
+ attr_accessor :federal_taxpayers_id_number
36
+
37
+ # Loop: 2100A, Segments: NM1, Element: NM104 Notes: Name First
38
+ attr_accessor :first_name
39
+
40
+ # Loop: 2100A, Segments: NM1, Element: NM103 Notes: Name Last
41
+ attr_accessor :last_name
42
+
43
+ # Loop: 2100A, Segments: NM1, Element: NM105 Notes: Name Middle
44
+ attr_accessor :middle_name
45
+
46
+ # Loop: 2100A, Segments: NM1, Element: NM103 Notes: Organization Name
47
+ attr_accessor :name
48
+
49
+ # Loop: 2100A, Segments: NM1, Element: NM109 Notes: NM108=PI Payor Identification
50
+ attr_accessor :payor_identification
51
+
52
+ # Loop: 2100A, Segments: NM1, Element: NM107 Notes: Name Suffix
53
+ attr_accessor :suffix
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ 'centers_for_medicare_and_medicaid_plan_id': :centersForMedicareAndMedicaidPlanId,
59
+ 'contact_information': :contactInformation,
60
+ 'employers_id': :employersId,
61
+ 'entity_identifier': :entityIdentifier,
62
+ 'entity_type': :entityType,
63
+ 'etin': :etin,
64
+ 'federal_taxpayers_id_number': :federalTaxpayersIdNumber,
65
+ 'first_name': :firstName,
66
+ 'last_name': :lastName,
67
+ 'middle_name': :middleName,
68
+ 'naic': :naic,
69
+ 'name': :name,
70
+ 'npi': :npi,
71
+ 'payor_identification': :payorIdentification,
72
+ 'suffix': :suffix
73
+ }
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.swagger_types
78
+ {
79
+ 'centers_for_medicare_and_medicaid_plan_id': :String,
80
+ 'contact_information': :Loop2100ASegmentsPERNotesInformationSourceContactInformation,
81
+ 'employers_id': :String,
82
+ 'entity_identifier': :String,
83
+ 'entity_type': :String,
84
+ 'etin': :String,
85
+ 'federal_taxpayers_id_number': :String,
86
+ 'first_name': :String,
87
+ 'last_name': :String,
88
+ 'middle_name': :String,
89
+ 'naic': :String,
90
+ 'name': :String,
91
+ 'npi': :String,
92
+ 'payor_identification': :String,
93
+ 'suffix': :String
94
+ }
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ return unless attributes.is_a?(Hash)
101
+
102
+ # convert string to symbol for hash key
103
+ attributes = attributes.transform_keys(&:to_sym)
104
+
105
+ if attributes.key?(:centersForMedicareAndMedicaidPlanId)
106
+ self.centers_for_medicare_and_medicaid_plan_id = attributes[:centersForMedicareAndMedicaidPlanId]
107
+ end
108
+
109
+ self.contact_information = attributes[:contactInformation] if attributes.key?(:contactInformation)
110
+
111
+ self.employers_id = attributes[:employersId] if attributes.key?(:employersId)
112
+
113
+ self.entity_identifier = attributes[:entityIdentifier] if attributes.key?(:entityIdentifier)
114
+
115
+ self.entity_type = attributes[:entityType] if attributes.key?(:entityType)
116
+
117
+ self.etin = attributes[:etin] if attributes.key?(:etin)
118
+
119
+ self.federal_taxpayers_id_number = attributes[:federalTaxpayersIdNumber] if attributes.key?(:federalTaxpayersIdNumber)
120
+
121
+ self.first_name = attributes[:firstName] if attributes.key?(:firstName)
122
+
123
+ self.last_name = attributes[:lastName] if attributes.key?(:lastName)
124
+
125
+ self.middle_name = attributes[:middleName] if attributes.key?(:middleName)
126
+
127
+ self.naic = attributes[:naic] if attributes.key?(:naic)
128
+
129
+ self.name = attributes[:name] if attributes.key?(:name)
130
+
131
+ self.npi = attributes[:npi] if attributes.key?(:npi)
132
+
133
+ self.payor_identification = attributes[:payorIdentification] if attributes.key?(:payorIdentification)
134
+
135
+ self.suffix = attributes[:suffix] if attributes.key?(:suffix)
136
+ end
137
+
138
+ # Show invalid properties with the reasons. Usually used together with valid?
139
+ # @return Array for valid properties with the reasons
140
+ def list_invalid_properties
141
+ []
142
+ end
143
+
144
+ # Check to see if the all the properties in the model are valid
145
+ # @return true if the model is valid
146
+ def valid?
147
+ true
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if equal?(o)
154
+
155
+ self.class == o.class &&
156
+ centers_for_medicare_and_medicaid_plan_id == o.centers_for_medicare_and_medicaid_plan_id &&
157
+ contact_information == o.contact_information &&
158
+ employers_id == o.employers_id &&
159
+ entity_identifier == o.entity_identifier &&
160
+ entity_type == o.entity_type &&
161
+ etin == o.etin &&
162
+ federal_taxpayers_id_number == o.federal_taxpayers_id_number &&
163
+ first_name == o.first_name &&
164
+ last_name == o.last_name &&
165
+ middle_name == o.middle_name &&
166
+ naic == o.naic &&
167
+ name == o.name &&
168
+ npi == o.npi &&
169
+ payor_identification == o.payor_identification &&
170
+ suffix == o.suffix
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Fixnum] Hash code
181
+ def hash
182
+ [centers_for_medicare_and_medicaid_plan_id, contact_information, employers_id, entity_identifier, entity_type, etin, federal_taxpayers_id_number, first_name, last_name, middle_name, naic, name, npi, payor_identification, suffix].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+
191
+ self.class.swagger_types.each_pair do |key, type|
192
+ if type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
196
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
197
+ end
198
+ elsif !attributes[self.class.attribute_map[key]].nil?
199
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
200
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
201
+ end
202
+
203
+ self
204
+ end
205
+
206
+ # Deserializes the data based on type
207
+ # @param string type Data type
208
+ # @param string value Value to be deserialized
209
+ # @return [Object] Deserialized data
210
+ def _deserialize(type, value)
211
+ case type.to_sym
212
+ when :DateTime
213
+ DateTime.parse(value)
214
+ when :Date
215
+ Date.parse(value)
216
+ when :String
217
+ value.to_s
218
+ when :Integer
219
+ value.to_i
220
+ when :Float
221
+ value.to_f
222
+ when :BOOLEAN
223
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
224
+ true
225
+ else
226
+ false
227
+ end
228
+ when :Object
229
+ # generic object (usually a Hash), return directly
230
+ value
231
+ when /\AArray<(?<inner_type>.+)>\z/
232
+ inner_type = Regexp.last_match[:inner_type]
233
+ value.map { |v| _deserialize(inner_type, v) }
234
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
235
+ k_type = Regexp.last_match[:k_type]
236
+ v_type = Regexp.last_match[:v_type]
237
+ {}.tap do |hash|
238
+ value.each do |k, v|
239
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
240
+ end
241
+ end
242
+ else # model
243
+ temp_model = SwaggerClient.const_get(type).new
244
+ temp_model.build_from_hash(value)
245
+ end
246
+ end
247
+
248
+ # Returns the string representation of the object
249
+ # @return [String] String presentation of the object
250
+ def to_s
251
+ to_hash.to_s
252
+ end
253
+
254
+ # to_body is an alias to to_hash (backward compatibility)
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_body
257
+ to_hash
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = send(attr)
266
+ next if value.nil?
267
+
268
+ hash[param] = _to_hash(value)
269
+ end
270
+ hash
271
+ end
272
+
273
+ # Outputs non-array value in the form of hash
274
+ # For object, use to_hash. Otherwise, just return the value
275
+ # @param [Object] value Any valid value
276
+ # @return [Hash] Returns the value in the form of hash
277
+ def _to_hash(value)
278
+ if value.is_a?(Array)
279
+ value.compact.map { |v| _to_hash(v) }
280
+ elsif value.is_a?(Hash)
281
+ {}.tap do |hash|
282
+ value.each { |k, v| hash[k] = _to_hash(v) }
283
+ end
284
+ elsif value.respond_to? :to_hash
285
+ value.to_hash
286
+ else
287
+ value
288
+ end
289
+ end
290
+ end
291
+ end
292
+ end
293
+ end