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,190 @@
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 RawX12Request
17
+ attr_accessor :isadate, :x12
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ 'isadate': :isadate,
23
+ 'x12': :x12
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ 'isadate': :String,
31
+ 'x12': :String
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.transform_keys(&:to_sym)
42
+
43
+ self.isadate = attributes[:isadate] if attributes.key?(:isadate)
44
+
45
+ self.x12 = attributes[:x12] if attributes.key?(:x12)
46
+ end
47
+
48
+ # Show invalid properties with the reasons. Usually used together with valid?
49
+ # @return Array for valid properties with the reasons
50
+ def list_invalid_properties
51
+ []
52
+ end
53
+
54
+ # Check to see if the all the properties in the model are valid
55
+ # @return true if the model is valid
56
+ def valid?
57
+ true
58
+ end
59
+
60
+ # Checks equality by comparing each attribute.
61
+ # @param [Object] Object to be compared
62
+ def ==(o)
63
+ return true if equal?(o)
64
+
65
+ self.class == o.class &&
66
+ isadate == o.isadate &&
67
+ x12 == o.x12
68
+ end
69
+
70
+ # @see the `==` method
71
+ # @param [Object] Object to be compared
72
+ def eql?(o)
73
+ self == o
74
+ end
75
+
76
+ # Calculates hash code according to all attributes.
77
+ # @return [Fixnum] Hash code
78
+ def hash
79
+ [isadate, x12].hash
80
+ end
81
+
82
+ # Builds the object from hash
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ # @return [Object] Returns the model itself
85
+ def build_from_hash(attributes)
86
+ return nil unless attributes.is_a?(Hash)
87
+
88
+ self.class.swagger_types.each_pair do |key, type|
89
+ if type =~ /\AArray<(.*)>/i
90
+ # check to ensure the input is an array given that the attribute
91
+ # is documented as an array but the input is not
92
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
93
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
94
+ end
95
+ elsif !attributes[self.class.attribute_map[key]].nil?
96
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
97
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
98
+ end
99
+
100
+ self
101
+ end
102
+
103
+ # Deserializes the data based on type
104
+ # @param string type Data type
105
+ # @param string value Value to be deserialized
106
+ # @return [Object] Deserialized data
107
+ def _deserialize(type, value)
108
+ case type.to_sym
109
+ when :DateTime
110
+ DateTime.parse(value)
111
+ when :Date
112
+ Date.parse(value)
113
+ when :String
114
+ value.to_s
115
+ when :Integer
116
+ value.to_i
117
+ when :Float
118
+ value.to_f
119
+ when :BOOLEAN
120
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
+ true
122
+ else
123
+ false
124
+ end
125
+ when :Object
126
+ # generic object (usually a Hash), return directly
127
+ value
128
+ when /\AArray<(?<inner_type>.+)>\z/
129
+ inner_type = Regexp.last_match[:inner_type]
130
+ value.map { |v| _deserialize(inner_type, v) }
131
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
+ k_type = Regexp.last_match[:k_type]
133
+ v_type = Regexp.last_match[:v_type]
134
+ {}.tap do |hash|
135
+ value.each do |k, v|
136
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
137
+ end
138
+ end
139
+ else # model
140
+ temp_model = SwaggerClient.const_get(type).new
141
+ temp_model.build_from_hash(value)
142
+ end
143
+ end
144
+
145
+ # Returns the string representation of the object
146
+ # @return [String] String presentation of the object
147
+ def to_s
148
+ to_hash.to_s
149
+ end
150
+
151
+ # to_body is an alias to to_hash (backward compatibility)
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_body
154
+ to_hash
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = send(attr)
163
+ next if value.nil?
164
+
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ # Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param [Object] value Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map { |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+ end
188
+ end
189
+ end
190
+ end
@@ -0,0 +1,452 @@
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
+ # Loop: 2000D, Notes: Dependent Detail
17
+ class RequestDependent
18
+ # Loop: 2100[C|D], Segment: REF Notes: Additional Identification
19
+ attr_accessor :additional_identification
20
+
21
+ # Loop: 2100[C|D], Segment: N3 and N4, Notes: Address
22
+ attr_accessor :address
23
+
24
+ # Loop: 2110[C|D], Segment: DTP, Element: DTP03, Notes: DTP01=102, DTP02=RD8 Retired
25
+ attr_accessor :beginning_card_issue_date
26
+
27
+ # Loop: 2110[C|D], Segment: DTP, Element: DTP03, Notes: DTP01=291, DTP02=RD8 Retired
28
+ attr_accessor :beginning_plan_issue_date
29
+
30
+ # Loop: 2100D Segment: INS, Element: INS17, Notes: Birth Sequence Number - must be exactly 9 positive unsigned numeric characters.
31
+ attr_accessor :birth_sequence_number
32
+
33
+ # Loop: 2100[C|D], Segment: DMG, Element: DMG02, Notes: date of birth in CCYYMMDD
34
+ attr_accessor :date_of_birth
35
+
36
+ # Loop: 2100D Segment: REF, Element: REF02, Notes: REF01=MRC Eligibility Category
37
+ attr_accessor :eligibility_category
38
+
39
+ # Loop: 2110[C|D], Segment: DTP, Element: DTP03, Notes: DTP01=102, DTP02=RD8 Retired
40
+ attr_accessor :end_card_issue_date
41
+
42
+ # Loop: 2110[C|D], Segment: DTP, Element: DTP03, Notes: DTP01=291, DTP02=RD8 Retired
43
+ attr_accessor :end_plan_issue_date
44
+
45
+ # Loop: 2100[C|D], Segment: MN1, Element: NM104, Notes: firstName 1-35 alphanumberic characters
46
+ attr_accessor :first_name
47
+
48
+ # Loop: 2100[C|D], Segment: DMG, Element: DMG03, Notes: gender 1 character 'M' or 'F'
49
+ attr_accessor :gender
50
+
51
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=6P Group Number
52
+ attr_accessor :group_number
53
+
54
+ # Loop: 2100[C|D], Segment: HI, Element: HI01-1 HI01-2, Notes: Health Care Diagnosis
55
+ attr_accessor :health_care_code_information
56
+
57
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=HJ Identity Card Number
58
+ attr_accessor :id_card
59
+
60
+ # Loop: 2110[C|D], Segment: DTP, Element: DTP03, Notes: DTP01=102, DTP02=D8 Retired
61
+ attr_accessor :id_card_issue_date
62
+
63
+ # Loop: 2100D Segment: INS, Element: INS02, Notes: Individual Relationship Code 01 - Spouse, 19 - Child, 34 Other Adult
64
+ attr_accessor :individual_relationship_code
65
+
66
+ # Loop: 2100D Segment: REF, Element: REF02, Notes: REF01=IF Issue Number
67
+ attr_accessor :issue_number
68
+
69
+ # Loop: 2100[C|D], Segment: MN1, Element: NM103, Notes: lastName 1-60 alphanumberic characters
70
+ attr_accessor :last_name
71
+
72
+ # Loop: 2100[C|D] Segment: MN1, Element: NM109, Notes: NM108=MI, memberId 2-80 alphanumberic characters
73
+ attr_accessor :member_id
74
+
75
+ # Loop: 2100[C|D], Segment: MN1, Element: NM105, Notes: middleName 1-25 alphanumberic characters
76
+ attr_accessor :middle_name
77
+
78
+ # Loop: 2110[C|D], Segment: DTP, Element: DTP03, Notes: DTP01=291, DTP02=D8 Retired
79
+ attr_accessor :plan_issue_date
80
+
81
+ # Loop: 2100[C|D], Segment: PRV, Element: PRV01, Notes: Provider Code
82
+ attr_accessor :provider_code
83
+
84
+ # Loop: 2100[C|D], Segment: PRV, Element: PRV03, Notes: Provider Identifier
85
+ attr_accessor :provider_identifier
86
+
87
+ # Loop: 2100[C|D], Segment: PRV, Element: PRV02, Notes: Reference Identification Qualifier
88
+ attr_accessor :reference_identification_qualifier
89
+
90
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=SY Social Security Number
91
+ attr_accessor :ssn
92
+
93
+ # Loop: 2100[C|D], Segment: MN1, Element: NM107, Notes: lastName 1-10 alphanumberic characters
94
+ attr_accessor :suffix
95
+
96
+ class EnumAttributeValidator
97
+ attr_reader :datatype, :allowable_values
98
+
99
+ def initialize(datatype, allowable_values)
100
+ @allowable_values = allowable_values.map do |value|
101
+ case datatype.to_s
102
+ when /Integer/i
103
+ value.to_i
104
+ when /Float/i
105
+ value.to_f
106
+ else
107
+ value
108
+ end
109
+ end
110
+ end
111
+
112
+ def valid?(value)
113
+ !value || allowable_values.include?(value)
114
+ end
115
+ end
116
+
117
+ # Attribute mapping from ruby-style variable name to JSON key.
118
+ def self.attribute_map
119
+ {
120
+ 'additional_identification': :additionalIdentification,
121
+ 'address': :address,
122
+ 'beginning_card_issue_date': :beginningCardIssueDate,
123
+ 'beginning_plan_issue_date': :beginningPlanIssueDate,
124
+ 'birth_sequence_number': :birthSequenceNumber,
125
+ 'date_of_birth': :dateOfBirth,
126
+ 'eligibility_category': :eligibilityCategory,
127
+ 'end_card_issue_date': :endCardIssueDate,
128
+ 'end_plan_issue_date': :endPlanIssueDate,
129
+ 'first_name': :firstName,
130
+ 'gender': :gender,
131
+ 'group_number': :groupNumber,
132
+ 'health_care_code_information': :healthCareCodeInformation,
133
+ 'id_card': :idCard,
134
+ 'id_card_issue_date': :idCardIssueDate,
135
+ 'individual_relationship_code': :individualRelationshipCode,
136
+ 'issue_number': :issueNumber,
137
+ 'last_name': :lastName,
138
+ 'member_id': :memberId,
139
+ 'middle_name': :middleName,
140
+ 'plan_issue_date': :planIssueDate,
141
+ 'provider_code': :providerCode,
142
+ 'provider_identifier': :providerIdentifier,
143
+ 'reference_identification_qualifier': :referenceIdentificationQualifier,
144
+ 'ssn': :ssn,
145
+ 'suffix': :suffix
146
+ }
147
+ end
148
+
149
+ # Attribute type mapping.
150
+ def self.swagger_types
151
+ {
152
+ 'additional_identification': :AdditionalIdentification,
153
+ 'address': :Address,
154
+ 'beginning_card_issue_date': :String,
155
+ 'beginning_plan_issue_date': :String,
156
+ 'birth_sequence_number': :String,
157
+ 'date_of_birth': :String,
158
+ 'eligibility_category': :String,
159
+ 'end_card_issue_date': :String,
160
+ 'end_plan_issue_date': :String,
161
+ 'first_name': :String,
162
+ 'gender': :String,
163
+ 'group_number': :String,
164
+ 'health_care_code_information': :'Array<HealthCareInformation>',
165
+ 'id_card': :String,
166
+ 'id_card_issue_date': :String,
167
+ 'individual_relationship_code': :String,
168
+ 'issue_number': :String,
169
+ 'last_name': :String,
170
+ 'member_id': :String,
171
+ 'middle_name': :String,
172
+ 'plan_issue_date': :String,
173
+ 'provider_code': :String,
174
+ 'provider_identifier': :String,
175
+ 'reference_identification_qualifier': :String,
176
+ 'ssn': :String,
177
+ 'suffix': :String
178
+ }
179
+ end
180
+
181
+ # Initializes the object
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ def initialize(attributes = {})
184
+ return unless attributes.is_a?(Hash)
185
+
186
+ # convert string to symbol for hash key
187
+ attributes = attributes.transform_keys(&:to_sym)
188
+
189
+ self.additional_identification = attributes[:additionalIdentification] if attributes.key?(:additionalIdentification)
190
+
191
+ self.address = attributes[:address] if attributes.key?(:address)
192
+
193
+ self.beginning_card_issue_date = attributes[:beginningCardIssueDate] if attributes.key?(:beginningCardIssueDate)
194
+
195
+ self.beginning_plan_issue_date = attributes[:beginningPlanIssueDate] if attributes.key?(:beginningPlanIssueDate)
196
+
197
+ self.birth_sequence_number = attributes[:birthSequenceNumber] if attributes.key?(:birthSequenceNumber)
198
+
199
+ self.date_of_birth = attributes[:dateOfBirth] if attributes.key?(:dateOfBirth)
200
+
201
+ self.eligibility_category = attributes[:eligibilityCategory] if attributes.key?(:eligibilityCategory)
202
+
203
+ self.end_card_issue_date = attributes[:endCardIssueDate] if attributes.key?(:endCardIssueDate)
204
+
205
+ self.end_plan_issue_date = attributes[:endPlanIssueDate] if attributes.key?(:endPlanIssueDate)
206
+
207
+ self.first_name = attributes[:firstName] if attributes.key?(:firstName)
208
+
209
+ self.gender = attributes[:gender] if attributes.key?(:gender)
210
+
211
+ self.group_number = attributes[:groupNumber] if attributes.key?(:groupNumber)
212
+
213
+ if attributes.key?(:healthCareCodeInformation)
214
+ if (value = attributes[:healthCareCodeInformation]).is_a?(Array)
215
+ self.health_care_code_information = value
216
+ end
217
+ end
218
+
219
+ self.id_card = attributes[:idCard] if attributes.key?(:idCard)
220
+
221
+ self.id_card_issue_date = attributes[:idCardIssueDate] if attributes.key?(:idCardIssueDate)
222
+
223
+ self.individual_relationship_code = attributes[:individualRelationshipCode] if attributes.key?(:individualRelationshipCode)
224
+
225
+ self.issue_number = attributes[:issueNumber] if attributes.key?(:issueNumber)
226
+
227
+ self.last_name = attributes[:lastName] if attributes.key?(:lastName)
228
+
229
+ self.member_id = attributes[:memberId] if attributes.key?(:memberId)
230
+
231
+ self.middle_name = attributes[:middleName] if attributes.key?(:middleName)
232
+
233
+ self.plan_issue_date = attributes[:planIssueDate] if attributes.key?(:planIssueDate)
234
+
235
+ self.provider_code = attributes[:providerCode] if attributes.key?(:providerCode)
236
+
237
+ self.provider_identifier = attributes[:providerIdentifier] if attributes.key?(:providerIdentifier)
238
+
239
+ self.reference_identification_qualifier = attributes[:referenceIdentificationQualifier] if attributes.key?(:referenceIdentificationQualifier)
240
+
241
+ self.ssn = attributes[:ssn] if attributes.key?(:ssn)
242
+
243
+ self.suffix = attributes[:suffix] if attributes.key?(:suffix)
244
+ end
245
+
246
+ # Show invalid properties with the reasons. Usually used together with valid?
247
+ # @return Array for valid properties with the reasons
248
+ def list_invalid_properties
249
+ []
250
+ end
251
+
252
+ # Check to see if the all the properties in the model are valid
253
+ # @return true if the model is valid
254
+ def valid?
255
+ individual_relationship_code_validator = EnumAttributeValidator.new('String', %w[01 19 34])
256
+ return false unless individual_relationship_code_validator.valid?(@individual_relationship_code)
257
+
258
+ provider_code_validator = EnumAttributeValidator.new('String', %w[AD AT BI CO CV H HH LA OT P1 P2 PC PE R RF SK SU])
259
+ return false unless provider_code_validator.valid?(@provider_code)
260
+
261
+ reference_identification_qualifier_validator = EnumAttributeValidator.new('String', %w[9K D3 EI HPI PXC SY TJ])
262
+ return false unless reference_identification_qualifier_validator.valid?(@reference_identification_qualifier)
263
+
264
+ true
265
+ end
266
+
267
+ # Custom attribute writer method checking allowed values (enum).
268
+ # @param [Object] individual_relationship_code Object to be assigned
269
+ def individual_relationship_code=(individual_relationship_code)
270
+ validator = EnumAttributeValidator.new('String', %w[01 19 34])
271
+ unless validator.valid?(individual_relationship_code)
272
+ raise ArgumentError, %(invalid value for "individual_relationship_code", must be one of #{validator.allowable_values}.)
273
+ end
274
+
275
+ @individual_relationship_code = individual_relationship_code
276
+ end
277
+
278
+ # Custom attribute writer method checking allowed values (enum).
279
+ # @param [Object] provider_code Object to be assigned
280
+ def provider_code=(provider_code)
281
+ validator = EnumAttributeValidator.new('String', %w[AD AT BI CO CV H HH LA OT P1 P2 PC PE R RF SK SU])
282
+ raise ArgumentError, %(invalid value for "provider_code", must be one of #{validator.allowable_values}.) unless validator.valid?(provider_code)
283
+
284
+ @provider_code = provider_code
285
+ end
286
+
287
+ # Custom attribute writer method checking allowed values (enum).
288
+ # @param [Object] reference_identification_qualifier Object to be assigned
289
+ def reference_identification_qualifier=(reference_identification_qualifier)
290
+ validator = EnumAttributeValidator.new('String', %w[9K D3 EI HPI PXC SY TJ])
291
+ unless validator.valid?(reference_identification_qualifier)
292
+ raise ArgumentError, %(invalid value for "reference_identification_qualifier", must be one of #{validator.allowable_values}.)
293
+ end
294
+
295
+ @reference_identification_qualifier = reference_identification_qualifier
296
+ end
297
+
298
+ # Checks equality by comparing each attribute.
299
+ # @param [Object] Object to be compared
300
+ def ==(o)
301
+ return true if equal?(o)
302
+
303
+ self.class == o.class &&
304
+ additional_identification == o.additional_identification &&
305
+ address == o.address &&
306
+ beginning_card_issue_date == o.beginning_card_issue_date &&
307
+ beginning_plan_issue_date == o.beginning_plan_issue_date &&
308
+ birth_sequence_number == o.birth_sequence_number &&
309
+ date_of_birth == o.date_of_birth &&
310
+ eligibility_category == o.eligibility_category &&
311
+ end_card_issue_date == o.end_card_issue_date &&
312
+ end_plan_issue_date == o.end_plan_issue_date &&
313
+ first_name == o.first_name &&
314
+ gender == o.gender &&
315
+ group_number == o.group_number &&
316
+ health_care_code_information == o.health_care_code_information &&
317
+ id_card == o.id_card &&
318
+ id_card_issue_date == o.id_card_issue_date &&
319
+ individual_relationship_code == o.individual_relationship_code &&
320
+ issue_number == o.issue_number &&
321
+ last_name == o.last_name &&
322
+ member_id == o.member_id &&
323
+ middle_name == o.middle_name &&
324
+ plan_issue_date == o.plan_issue_date &&
325
+ provider_code == o.provider_code &&
326
+ provider_identifier == o.provider_identifier &&
327
+ reference_identification_qualifier == o.reference_identification_qualifier &&
328
+ ssn == o.ssn &&
329
+ suffix == o.suffix
330
+ end
331
+
332
+ # @see the `==` method
333
+ # @param [Object] Object to be compared
334
+ def eql?(o)
335
+ self == o
336
+ end
337
+
338
+ # Calculates hash code according to all attributes.
339
+ # @return [Fixnum] Hash code
340
+ def hash
341
+ [additional_identification, address, beginning_card_issue_date, beginning_plan_issue_date, birth_sequence_number, date_of_birth, eligibility_category, end_card_issue_date, end_plan_issue_date, first_name, gender, group_number, health_care_code_information, id_card, id_card_issue_date, individual_relationship_code, issue_number, last_name, member_id, middle_name, plan_issue_date, provider_code, provider_identifier, reference_identification_qualifier, ssn, suffix].hash
342
+ end
343
+
344
+ # Builds the object from hash
345
+ # @param [Hash] attributes Model attributes in the form of hash
346
+ # @return [Object] Returns the model itself
347
+ def build_from_hash(attributes)
348
+ return nil unless attributes.is_a?(Hash)
349
+
350
+ self.class.swagger_types.each_pair do |key, type|
351
+ if type =~ /\AArray<(.*)>/i
352
+ # check to ensure the input is an array given that the attribute
353
+ # is documented as an array but the input is not
354
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
355
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
356
+ end
357
+ elsif !attributes[self.class.attribute_map[key]].nil?
358
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
359
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
360
+ end
361
+
362
+ self
363
+ end
364
+
365
+ # Deserializes the data based on type
366
+ # @param string type Data type
367
+ # @param string value Value to be deserialized
368
+ # @return [Object] Deserialized data
369
+ def _deserialize(type, value)
370
+ case type.to_sym
371
+ when :DateTime
372
+ DateTime.parse(value)
373
+ when :Date
374
+ Date.parse(value)
375
+ when :String
376
+ value.to_s
377
+ when :Integer
378
+ value.to_i
379
+ when :Float
380
+ value.to_f
381
+ when :BOOLEAN
382
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
383
+ true
384
+ else
385
+ false
386
+ end
387
+ when :Object
388
+ # generic object (usually a Hash), return directly
389
+ value
390
+ when /\AArray<(?<inner_type>.+)>\z/
391
+ inner_type = Regexp.last_match[:inner_type]
392
+ value.map { |v| _deserialize(inner_type, v) }
393
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
394
+ k_type = Regexp.last_match[:k_type]
395
+ v_type = Regexp.last_match[:v_type]
396
+ {}.tap do |hash|
397
+ value.each do |k, v|
398
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
399
+ end
400
+ end
401
+ else # model
402
+ temp_model = SwaggerClient.const_get(type).new
403
+ temp_model.build_from_hash(value)
404
+ end
405
+ end
406
+
407
+ # Returns the string representation of the object
408
+ # @return [String] String presentation of the object
409
+ def to_s
410
+ to_hash.to_s
411
+ end
412
+
413
+ # to_body is an alias to to_hash (backward compatibility)
414
+ # @return [Hash] Returns the object in the form of hash
415
+ def to_body
416
+ to_hash
417
+ end
418
+
419
+ # Returns the object in the form of hash
420
+ # @return [Hash] Returns the object in the form of hash
421
+ def to_hash
422
+ hash = {}
423
+ self.class.attribute_map.each_pair do |attr, param|
424
+ value = send(attr)
425
+ next if value.nil?
426
+
427
+ hash[param] = _to_hash(value)
428
+ end
429
+ hash
430
+ end
431
+
432
+ # Outputs non-array value in the form of hash
433
+ # For object, use to_hash. Otherwise, just return the value
434
+ # @param [Object] value Any valid value
435
+ # @return [Hash] Returns the value in the form of hash
436
+ def _to_hash(value)
437
+ if value.is_a?(Array)
438
+ value.compact.map { |v| _to_hash(v) }
439
+ elsif value.is_a?(Hash)
440
+ {}.tap do |hash|
441
+ value.each { |k, v| hash[k] = _to_hash(v) }
442
+ end
443
+ elsif value.respond_to? :to_hash
444
+ value.to_hash
445
+ else
446
+ value
447
+ end
448
+ end
449
+ end
450
+ end
451
+ end
452
+ end