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,340 @@
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 BenefitsDateInformation
17
+ attr_accessor :added, :admission, :benefit, :benefit_begin, :benefit_end, :certification, :cobra_begin, :cobra_end, :completion, :coordination_of_benefits, :date_of_death, :date_of_last_update, :discharge, :effective_date_of_change, :eligibility, :eligibility_begin, :eligibility_end, :enrollment, :issue, :latest_visit_or_consultation, :period_end, :period_start, :plan, :plan_begin, :plan_end, :policy_effective, :policy_expiration, :premium_paid_to_date_end, :premium_paidto_date_begin, :primary_care_provider, :service, :status
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ 'added': :added,
23
+ 'admission': :admission,
24
+ 'benefit': :benefit,
25
+ 'benefit_begin': :benefitBegin,
26
+ 'benefit_end': :benefitEnd,
27
+ 'certification': :certification,
28
+ 'cobra_begin': :cobraBegin,
29
+ 'cobra_end': :cobraEnd,
30
+ 'completion': :completion,
31
+ 'coordination_of_benefits': :coordinationOfBenefits,
32
+ 'date_of_death': :dateOfDeath,
33
+ 'date_of_last_update': :dateOfLastUpdate,
34
+ 'discharge': :discharge,
35
+ 'effective_date_of_change': :effectiveDateOfChange,
36
+ 'eligibility': :eligibility,
37
+ 'eligibility_begin': :eligibilityBegin,
38
+ 'eligibility_end': :eligibilityEnd,
39
+ 'enrollment': :enrollment,
40
+ 'issue': :issue,
41
+ 'latest_visit_or_consultation': :latestVisitOrConsultation,
42
+ 'period_end': :periodEnd,
43
+ 'period_start': :periodStart,
44
+ 'plan': :plan,
45
+ 'plan_begin': :planBegin,
46
+ 'plan_end': :planEnd,
47
+ 'policy_effective': :policyEffective,
48
+ 'policy_expiration': :policyExpiration,
49
+ 'premium_paid_to_date_end': :premiumPaidToDateEnd,
50
+ 'premium_paidto_date_begin': :premiumPaidtoDateBegin,
51
+ 'primary_care_provider': :primaryCareProvider,
52
+ 'service': :service,
53
+ 'status': :status
54
+ }
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.swagger_types
59
+ {
60
+ 'added': :String,
61
+ 'admission': :String,
62
+ 'benefit': :String,
63
+ 'benefit_begin': :String,
64
+ 'benefit_end': :String,
65
+ 'certification': :String,
66
+ 'cobra_begin': :String,
67
+ 'cobra_end': :String,
68
+ 'completion': :String,
69
+ 'coordination_of_benefits': :String,
70
+ 'date_of_death': :String,
71
+ 'date_of_last_update': :String,
72
+ 'discharge': :String,
73
+ 'effective_date_of_change': :String,
74
+ 'eligibility': :String,
75
+ 'eligibility_begin': :String,
76
+ 'eligibility_end': :String,
77
+ 'enrollment': :String,
78
+ 'issue': :String,
79
+ 'latest_visit_or_consultation': :String,
80
+ 'period_end': :String,
81
+ 'period_start': :String,
82
+ 'plan': :String,
83
+ 'plan_begin': :String,
84
+ 'plan_end': :String,
85
+ 'policy_effective': :String,
86
+ 'policy_expiration': :String,
87
+ 'premium_paid_to_date_end': :String,
88
+ 'premium_paidto_date_begin': :String,
89
+ 'primary_care_provider': :String,
90
+ 'service': :String,
91
+ 'status': :String
92
+ }
93
+ end
94
+
95
+ # Initializes the object
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ def initialize(attributes = {})
98
+ return unless attributes.is_a?(Hash)
99
+
100
+ # convert string to symbol for hash key
101
+ attributes = attributes.transform_keys(&:to_sym)
102
+
103
+ self.added = attributes[:added] if attributes.key?(:added)
104
+
105
+ self.admission = attributes[:admission] if attributes.key?(:admission)
106
+
107
+ self.benefit = attributes[:benefit] if attributes.key?(:benefit)
108
+
109
+ self.benefit_begin = attributes[:benefitBegin] if attributes.key?(:benefitBegin)
110
+
111
+ self.benefit_end = attributes[:benefitEnd] if attributes.key?(:benefitEnd)
112
+
113
+ self.certification = attributes[:certification] if attributes.key?(:certification)
114
+
115
+ self.cobra_begin = attributes[:cobraBegin] if attributes.key?(:cobraBegin)
116
+
117
+ self.cobra_end = attributes[:cobraEnd] if attributes.key?(:cobraEnd)
118
+
119
+ self.completion = attributes[:completion] if attributes.key?(:completion)
120
+
121
+ self.coordination_of_benefits = attributes[:coordinationOfBenefits] if attributes.key?(:coordinationOfBenefits)
122
+
123
+ self.date_of_death = attributes[:dateOfDeath] if attributes.key?(:dateOfDeath)
124
+
125
+ self.date_of_last_update = attributes[:dateOfLastUpdate] if attributes.key?(:dateOfLastUpdate)
126
+
127
+ self.discharge = attributes[:discharge] if attributes.key?(:discharge)
128
+
129
+ self.effective_date_of_change = attributes[:effectiveDateOfChange] if attributes.key?(:effectiveDateOfChange)
130
+
131
+ self.eligibility = attributes[:eligibility] if attributes.key?(:eligibility)
132
+
133
+ self.eligibility_begin = attributes[:eligibilityBegin] if attributes.key?(:eligibilityBegin)
134
+
135
+ self.eligibility_end = attributes[:eligibilityEnd] if attributes.key?(:eligibilityEnd)
136
+
137
+ self.enrollment = attributes[:enrollment] if attributes.key?(:enrollment)
138
+
139
+ self.issue = attributes[:issue] if attributes.key?(:issue)
140
+
141
+ self.latest_visit_or_consultation = attributes[:latestVisitOrConsultation] if attributes.key?(:latestVisitOrConsultation)
142
+
143
+ self.period_end = attributes[:periodEnd] if attributes.key?(:periodEnd)
144
+
145
+ self.period_start = attributes[:periodStart] if attributes.key?(:periodStart)
146
+
147
+ self.plan = attributes[:plan] if attributes.key?(:plan)
148
+
149
+ self.plan_begin = attributes[:planBegin] if attributes.key?(:planBegin)
150
+
151
+ self.plan_end = attributes[:planEnd] if attributes.key?(:planEnd)
152
+
153
+ self.policy_effective = attributes[:policyEffective] if attributes.key?(:policyEffective)
154
+
155
+ self.policy_expiration = attributes[:policyExpiration] if attributes.key?(:policyExpiration)
156
+
157
+ self.premium_paid_to_date_end = attributes[:premiumPaidToDateEnd] if attributes.key?(:premiumPaidToDateEnd)
158
+
159
+ self.premium_paidto_date_begin = attributes[:premiumPaidtoDateBegin] if attributes.key?(:premiumPaidtoDateBegin)
160
+
161
+ self.primary_care_provider = attributes[:primaryCareProvider] if attributes.key?(:primaryCareProvider)
162
+
163
+ self.service = attributes[:service] if attributes.key?(:service)
164
+
165
+ self.status = attributes[:status] if attributes.key?(:status)
166
+ end
167
+
168
+ # Show invalid properties with the reasons. Usually used together with valid?
169
+ # @return Array for valid properties with the reasons
170
+ def list_invalid_properties
171
+ []
172
+ end
173
+
174
+ # Check to see if the all the properties in the model are valid
175
+ # @return true if the model is valid
176
+ def valid?
177
+ true
178
+ end
179
+
180
+ # Checks equality by comparing each attribute.
181
+ # @param [Object] Object to be compared
182
+ def ==(o)
183
+ return true if equal?(o)
184
+
185
+ self.class == o.class &&
186
+ added == o.added &&
187
+ admission == o.admission &&
188
+ benefit == o.benefit &&
189
+ benefit_begin == o.benefit_begin &&
190
+ benefit_end == o.benefit_end &&
191
+ certification == o.certification &&
192
+ cobra_begin == o.cobra_begin &&
193
+ cobra_end == o.cobra_end &&
194
+ completion == o.completion &&
195
+ coordination_of_benefits == o.coordination_of_benefits &&
196
+ date_of_death == o.date_of_death &&
197
+ date_of_last_update == o.date_of_last_update &&
198
+ discharge == o.discharge &&
199
+ effective_date_of_change == o.effective_date_of_change &&
200
+ eligibility == o.eligibility &&
201
+ eligibility_begin == o.eligibility_begin &&
202
+ eligibility_end == o.eligibility_end &&
203
+ enrollment == o.enrollment &&
204
+ issue == o.issue &&
205
+ latest_visit_or_consultation == o.latest_visit_or_consultation &&
206
+ period_end == o.period_end &&
207
+ period_start == o.period_start &&
208
+ plan == o.plan &&
209
+ plan_begin == o.plan_begin &&
210
+ plan_end == o.plan_end &&
211
+ policy_effective == o.policy_effective &&
212
+ policy_expiration == o.policy_expiration &&
213
+ premium_paid_to_date_end == o.premium_paid_to_date_end &&
214
+ premium_paidto_date_begin == o.premium_paidto_date_begin &&
215
+ primary_care_provider == o.primary_care_provider &&
216
+ service == o.service &&
217
+ status == o.status
218
+ end
219
+
220
+ # @see the `==` method
221
+ # @param [Object] Object to be compared
222
+ def eql?(o)
223
+ self == o
224
+ end
225
+
226
+ # Calculates hash code according to all attributes.
227
+ # @return [Fixnum] Hash code
228
+ def hash
229
+ [added, admission, benefit, benefit_begin, benefit_end, certification, cobra_begin, cobra_end, completion, coordination_of_benefits, date_of_death, date_of_last_update, discharge, effective_date_of_change, eligibility, eligibility_begin, eligibility_end, enrollment, issue, latest_visit_or_consultation, period_end, period_start, plan, plan_begin, plan_end, policy_effective, policy_expiration, premium_paid_to_date_end, premium_paidto_date_begin, primary_care_provider, service, status].hash
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+
238
+ self.class.swagger_types.each_pair do |key, type|
239
+ if type =~ /\AArray<(.*)>/i
240
+ # check to ensure the input is an array given that the attribute
241
+ # is documented as an array but the input is not
242
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
243
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
244
+ end
245
+ elsif !attributes[self.class.attribute_map[key]].nil?
246
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
247
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
248
+ end
249
+
250
+ self
251
+ end
252
+
253
+ # Deserializes the data based on type
254
+ # @param string type Data type
255
+ # @param string value Value to be deserialized
256
+ # @return [Object] Deserialized data
257
+ def _deserialize(type, value)
258
+ case type.to_sym
259
+ when :DateTime
260
+ DateTime.parse(value)
261
+ when :Date
262
+ Date.parse(value)
263
+ when :String
264
+ value.to_s
265
+ when :Integer
266
+ value.to_i
267
+ when :Float
268
+ value.to_f
269
+ when :BOOLEAN
270
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
271
+ true
272
+ else
273
+ false
274
+ end
275
+ when :Object
276
+ # generic object (usually a Hash), return directly
277
+ value
278
+ when /\AArray<(?<inner_type>.+)>\z/
279
+ inner_type = Regexp.last_match[:inner_type]
280
+ value.map { |v| _deserialize(inner_type, v) }
281
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
282
+ k_type = Regexp.last_match[:k_type]
283
+ v_type = Regexp.last_match[:v_type]
284
+ {}.tap do |hash|
285
+ value.each do |k, v|
286
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
287
+ end
288
+ end
289
+ else # model
290
+ temp_model = SwaggerClient.const_get(type).new
291
+ temp_model.build_from_hash(value)
292
+ end
293
+ end
294
+
295
+ # Returns the string representation of the object
296
+ # @return [String] String presentation of the object
297
+ def to_s
298
+ to_hash.to_s
299
+ end
300
+
301
+ # to_body is an alias to to_hash (backward compatibility)
302
+ # @return [Hash] Returns the object in the form of hash
303
+ def to_body
304
+ to_hash
305
+ end
306
+
307
+ # Returns the object in the form of hash
308
+ # @return [Hash] Returns the object in the form of hash
309
+ def to_hash
310
+ hash = {}
311
+ self.class.attribute_map.each_pair do |attr, param|
312
+ value = send(attr)
313
+ next if value.nil?
314
+
315
+ hash[param] = _to_hash(value)
316
+ end
317
+ hash
318
+ end
319
+
320
+ # Outputs non-array value in the form of hash
321
+ # For object, use to_hash. Otherwise, just return the value
322
+ # @param [Object] value Any valid value
323
+ # @return [Hash] Returns the value in the form of hash
324
+ def _to_hash(value)
325
+ if value.is_a?(Array)
326
+ value.compact.map { |v| _to_hash(v) }
327
+ elsif value.is_a?(Hash)
328
+ {}.tap do |hash|
329
+ value.each { |k, v| hash[k] = _to_hash(v) }
330
+ end
331
+ elsif value.respond_to? :to_hash
332
+ value.to_hash
333
+ else
334
+ value
335
+ end
336
+ end
337
+ end
338
+ end
339
+ end
340
+ end
@@ -0,0 +1,338 @@
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 BenefitsInformation
17
+ attr_accessor :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
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ 'additional_information': :additionalInformation,
23
+ 'auth_or_cert_indicator': :authOrCertIndicator,
24
+ 'benefit_amount': :benefitAmount,
25
+ 'benefit_percent': :benefitPercent,
26
+ 'benefit_quantity': :benefitQuantity,
27
+ 'benefits_additional_information': :benefitsAdditionalInformation,
28
+ 'benefits_date_information': :benefitsDateInformation,
29
+ 'benefits_related_entity': :benefitsRelatedEntity,
30
+ 'benefits_service_delivery': :benefitsServiceDelivery,
31
+ 'code': :code,
32
+ 'composite_medical_procedure_identifier': :compositeMedicalProcedureIdentifier,
33
+ 'coverage_level': :coverageLevel,
34
+ 'coverage_level_code': :coverageLevelCode,
35
+ 'eligibility_additional_information': :eligibilityAdditionalInformation,
36
+ 'header_loop_identifier_code': :headerLoopIdentifierCode,
37
+ 'in_plan_network_indicator': :inPlanNetworkIndicator,
38
+ 'in_plan_network_indicator_code': :inPlanNetworkIndicatorCode,
39
+ 'insurance_type': :insuranceType,
40
+ 'insurance_type_code': :insuranceTypeCode,
41
+ 'name': :name,
42
+ 'plan_coverage': :planCoverage,
43
+ 'quantity_qualifier': :quantityQualifier,
44
+ 'quantity_qualifier_code': :quantityQualifierCode,
45
+ 'service_type_codes': :serviceTypeCodes,
46
+ 'service_types': :serviceTypes,
47
+ 'time_qualifier': :timeQualifier,
48
+ 'time_qualifier_code': :timeQualifierCode,
49
+ 'trailer_loop_identifier_code': :trailerLoopIdentifierCode
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ 'additional_information': :'Array<AdditionalInformation>',
57
+ 'auth_or_cert_indicator': :String,
58
+ 'benefit_amount': :String,
59
+ 'benefit_percent': :String,
60
+ 'benefit_quantity': :String,
61
+ 'benefits_additional_information': :BenefitsAdditionalInformation,
62
+ 'benefits_date_information': :BenefitsDateInformation,
63
+ 'benefits_related_entity': :BenefitsRelatedEntity,
64
+ 'benefits_service_delivery': :'Array<BenefitsServiceDelivery>',
65
+ 'code': :String,
66
+ 'composite_medical_procedure_identifier': :CompositeMedicalProcedureIdentifier,
67
+ 'coverage_level': :String,
68
+ 'coverage_level_code': :String,
69
+ 'eligibility_additional_information': :EligibilityAdditionalInformation,
70
+ 'header_loop_identifier_code': :String,
71
+ 'in_plan_network_indicator': :String,
72
+ 'in_plan_network_indicator_code': :String,
73
+ 'insurance_type': :String,
74
+ 'insurance_type_code': :String,
75
+ 'name': :String,
76
+ 'plan_coverage': :String,
77
+ 'quantity_qualifier': :String,
78
+ 'quantity_qualifier_code': :String,
79
+ 'service_type_codes': :'Array<String>',
80
+ 'service_types': :'Array<String>',
81
+ 'time_qualifier': :String,
82
+ 'time_qualifier_code': :String,
83
+ 'trailer_loop_identifier_code': :String
84
+ }
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ return unless attributes.is_a?(Hash)
91
+
92
+ # convert string to symbol for hash key
93
+ attributes = attributes.transform_keys(&:to_sym)
94
+
95
+ if attributes.key?(:additionalInformation)
96
+ if (value = attributes[:additionalInformation]).is_a?(Array)
97
+ self.additional_information = value
98
+ end
99
+ end
100
+
101
+ self.auth_or_cert_indicator = attributes[:authOrCertIndicator] if attributes.key?(:authOrCertIndicator)
102
+
103
+ self.benefit_amount = attributes[:benefitAmount] if attributes.key?(:benefitAmount)
104
+
105
+ self.benefit_percent = attributes[:benefitPercent] if attributes.key?(:benefitPercent)
106
+
107
+ self.benefit_quantity = attributes[:benefitQuantity] if attributes.key?(:benefitQuantity)
108
+
109
+ self.benefits_additional_information = attributes[:benefitsAdditionalInformation] if attributes.key?(:benefitsAdditionalInformation)
110
+
111
+ self.benefits_date_information = attributes[:benefitsDateInformation] if attributes.key?(:benefitsDateInformation)
112
+
113
+ self.benefits_related_entity = attributes[:benefitsRelatedEntity] if attributes.key?(:benefitsRelatedEntity)
114
+
115
+ if attributes.key?(:benefitsServiceDelivery)
116
+ if (value = attributes[:benefitsServiceDelivery]).is_a?(Array)
117
+ self.benefits_service_delivery = value
118
+ end
119
+ end
120
+
121
+ self.code = attributes[:code] if attributes.key?(:code)
122
+
123
+ if attributes.key?(:compositeMedicalProcedureIdentifier)
124
+ self.composite_medical_procedure_identifier = attributes[:compositeMedicalProcedureIdentifier]
125
+ end
126
+
127
+ self.coverage_level = attributes[:coverageLevel] if attributes.key?(:coverageLevel)
128
+
129
+ self.coverage_level_code = attributes[:coverageLevelCode] if attributes.key?(:coverageLevelCode)
130
+
131
+ self.eligibility_additional_information = attributes[:eligibilityAdditionalInformation] if attributes.key?(:eligibilityAdditionalInformation)
132
+
133
+ self.header_loop_identifier_code = attributes[:headerLoopIdentifierCode] if attributes.key?(:headerLoopIdentifierCode)
134
+
135
+ self.in_plan_network_indicator = attributes[:inPlanNetworkIndicator] if attributes.key?(:inPlanNetworkIndicator)
136
+
137
+ self.in_plan_network_indicator_code = attributes[:inPlanNetworkIndicatorCode] if attributes.key?(:inPlanNetworkIndicatorCode)
138
+
139
+ self.insurance_type = attributes[:insuranceType] if attributes.key?(:insuranceType)
140
+
141
+ self.insurance_type_code = attributes[:insuranceTypeCode] if attributes.key?(:insuranceTypeCode)
142
+
143
+ self.name = attributes[:name] if attributes.key?(:name)
144
+
145
+ self.plan_coverage = attributes[:planCoverage] if attributes.key?(:planCoverage)
146
+
147
+ self.quantity_qualifier = attributes[:quantityQualifier] if attributes.key?(:quantityQualifier)
148
+
149
+ self.quantity_qualifier_code = attributes[:quantityQualifierCode] if attributes.key?(:quantityQualifierCode)
150
+
151
+ if attributes.key?(:serviceTypeCodes)
152
+ if (value = attributes[:serviceTypeCodes]).is_a?(Array)
153
+ self.service_type_codes = value
154
+ end
155
+ end
156
+
157
+ if attributes.key?(:serviceTypes)
158
+ if (value = attributes[:serviceTypes]).is_a?(Array)
159
+ self.service_types = value
160
+ end
161
+ end
162
+
163
+ self.time_qualifier = attributes[:timeQualifier] if attributes.key?(:timeQualifier)
164
+
165
+ self.time_qualifier_code = attributes[:timeQualifierCode] if attributes.key?(:timeQualifierCode)
166
+
167
+ self.trailer_loop_identifier_code = attributes[:trailerLoopIdentifierCode] if attributes.key?(:trailerLoopIdentifierCode)
168
+ end
169
+
170
+ # Show invalid properties with the reasons. Usually used together with valid?
171
+ # @return Array for valid properties with the reasons
172
+ def list_invalid_properties
173
+ []
174
+ end
175
+
176
+ # Check to see if the all the properties in the model are valid
177
+ # @return true if the model is valid
178
+ def valid?
179
+ true
180
+ end
181
+
182
+ # Checks equality by comparing each attribute.
183
+ # @param [Object] Object to be compared
184
+ def ==(o)
185
+ return true if equal?(o)
186
+
187
+ self.class == o.class &&
188
+ additional_information == o.additional_information &&
189
+ auth_or_cert_indicator == o.auth_or_cert_indicator &&
190
+ benefit_amount == o.benefit_amount &&
191
+ benefit_percent == o.benefit_percent &&
192
+ benefit_quantity == o.benefit_quantity &&
193
+ benefits_additional_information == o.benefits_additional_information &&
194
+ benefits_date_information == o.benefits_date_information &&
195
+ benefits_related_entity == o.benefits_related_entity &&
196
+ benefits_service_delivery == o.benefits_service_delivery &&
197
+ code == o.code &&
198
+ composite_medical_procedure_identifier == o.composite_medical_procedure_identifier &&
199
+ coverage_level == o.coverage_level &&
200
+ coverage_level_code == o.coverage_level_code &&
201
+ eligibility_additional_information == o.eligibility_additional_information &&
202
+ header_loop_identifier_code == o.header_loop_identifier_code &&
203
+ in_plan_network_indicator == o.in_plan_network_indicator &&
204
+ in_plan_network_indicator_code == o.in_plan_network_indicator_code &&
205
+ insurance_type == o.insurance_type &&
206
+ insurance_type_code == o.insurance_type_code &&
207
+ name == o.name &&
208
+ plan_coverage == o.plan_coverage &&
209
+ quantity_qualifier == o.quantity_qualifier &&
210
+ quantity_qualifier_code == o.quantity_qualifier_code &&
211
+ service_type_codes == o.service_type_codes &&
212
+ service_types == o.service_types &&
213
+ time_qualifier == o.time_qualifier &&
214
+ time_qualifier_code == o.time_qualifier_code &&
215
+ trailer_loop_identifier_code == o.trailer_loop_identifier_code
216
+ end
217
+
218
+ # @see the `==` method
219
+ # @param [Object] Object to be compared
220
+ def eql?(o)
221
+ self == o
222
+ end
223
+
224
+ # Calculates hash code according to all attributes.
225
+ # @return [Fixnum] Hash code
226
+ def hash
227
+ [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
228
+ end
229
+
230
+ # Builds the object from hash
231
+ # @param [Hash] attributes Model attributes in the form of hash
232
+ # @return [Object] Returns the model itself
233
+ def build_from_hash(attributes)
234
+ return nil unless attributes.is_a?(Hash)
235
+
236
+ self.class.swagger_types.each_pair do |key, type|
237
+ if type =~ /\AArray<(.*)>/i
238
+ # check to ensure the input is an array given that the attribute
239
+ # is documented as an array but the input is not
240
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
241
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
242
+ end
243
+ elsif !attributes[self.class.attribute_map[key]].nil?
244
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
245
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
246
+ end
247
+
248
+ self
249
+ end
250
+
251
+ # Deserializes the data based on type
252
+ # @param string type Data type
253
+ # @param string value Value to be deserialized
254
+ # @return [Object] Deserialized data
255
+ def _deserialize(type, value)
256
+ case type.to_sym
257
+ when :DateTime
258
+ DateTime.parse(value)
259
+ when :Date
260
+ Date.parse(value)
261
+ when :String
262
+ value.to_s
263
+ when :Integer
264
+ value.to_i
265
+ when :Float
266
+ value.to_f
267
+ when :BOOLEAN
268
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
269
+ true
270
+ else
271
+ false
272
+ end
273
+ when :Object
274
+ # generic object (usually a Hash), return directly
275
+ value
276
+ when /\AArray<(?<inner_type>.+)>\z/
277
+ inner_type = Regexp.last_match[:inner_type]
278
+ value.map { |v| _deserialize(inner_type, v) }
279
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
280
+ k_type = Regexp.last_match[:k_type]
281
+ v_type = Regexp.last_match[:v_type]
282
+ {}.tap do |hash|
283
+ value.each do |k, v|
284
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
285
+ end
286
+ end
287
+ else # model
288
+ temp_model = SwaggerClient.const_get(type).new
289
+ temp_model.build_from_hash(value)
290
+ end
291
+ end
292
+
293
+ # Returns the string representation of the object
294
+ # @return [String] String presentation of the object
295
+ def to_s
296
+ to_hash.to_s
297
+ end
298
+
299
+ # to_body is an alias to to_hash (backward compatibility)
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_body
302
+ to_hash
303
+ end
304
+
305
+ # Returns the object in the form of hash
306
+ # @return [Hash] Returns the object in the form of hash
307
+ def to_hash
308
+ hash = {}
309
+ self.class.attribute_map.each_pair do |attr, param|
310
+ value = send(attr)
311
+ next if value.nil?
312
+
313
+ hash[param] = _to_hash(value)
314
+ end
315
+ hash
316
+ end
317
+
318
+ # Outputs non-array value in the form of hash
319
+ # For object, use to_hash. Otherwise, just return the value
320
+ # @param [Object] value Any valid value
321
+ # @return [Hash] Returns the value in the form of hash
322
+ def _to_hash(value)
323
+ if value.is_a?(Array)
324
+ value.compact.map { |v| _to_hash(v) }
325
+ elsif value.is_a?(Hash)
326
+ {}.tap do |hash|
327
+ value.each { |k, v| hash[k] = _to_hash(v) }
328
+ end
329
+ elsif value.respond_to? :to_hash
330
+ value.to_hash
331
+ else
332
+ value
333
+ end
334
+ end
335
+ end
336
+ end
337
+ end
338
+ end