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,185 @@
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 AdditionalInformation
17
+ attr_accessor :description
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ 'description': :description
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.swagger_types
28
+ {
29
+ 'description': :String
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.transform_keys(&:to_sym)
40
+
41
+ self.description = attributes[:description] if attributes.key?(:description)
42
+ end
43
+
44
+ # Show invalid properties with the reasons. Usually used together with valid?
45
+ # @return Array for valid properties with the reasons
46
+ def list_invalid_properties
47
+ []
48
+ end
49
+
50
+ # Check to see if the all the properties in the model are valid
51
+ # @return true if the model is valid
52
+ def valid?
53
+ true
54
+ end
55
+
56
+ # Checks equality by comparing each attribute.
57
+ # @param [Object] Object to be compared
58
+ def ==(o)
59
+ return true if equal?(o)
60
+
61
+ self.class == o.class &&
62
+ description == o.description
63
+ end
64
+
65
+ # @see the `==` method
66
+ # @param [Object] Object to be compared
67
+ def eql?(o)
68
+ self == o
69
+ end
70
+
71
+ # Calculates hash code according to all attributes.
72
+ # @return [Fixnum] Hash code
73
+ def hash
74
+ [description].hash
75
+ end
76
+
77
+ # Builds the object from hash
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ # @return [Object] Returns the model itself
80
+ def build_from_hash(attributes)
81
+ return nil unless attributes.is_a?(Hash)
82
+
83
+ self.class.swagger_types.each_pair do |key, type|
84
+ if type =~ /\AArray<(.*)>/i
85
+ # check to ensure the input is an array given that the attribute
86
+ # is documented as an array but the input is not
87
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
88
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
89
+ end
90
+ elsif !attributes[self.class.attribute_map[key]].nil?
91
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
92
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
93
+ end
94
+
95
+ self
96
+ end
97
+
98
+ # Deserializes the data based on type
99
+ # @param string type Data type
100
+ # @param string value Value to be deserialized
101
+ # @return [Object] Deserialized data
102
+ def _deserialize(type, value)
103
+ case type.to_sym
104
+ when :DateTime
105
+ DateTime.parse(value)
106
+ when :Date
107
+ Date.parse(value)
108
+ when :String
109
+ value.to_s
110
+ when :Integer
111
+ value.to_i
112
+ when :Float
113
+ value.to_f
114
+ when :BOOLEAN
115
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
116
+ true
117
+ else
118
+ false
119
+ end
120
+ when :Object
121
+ # generic object (usually a Hash), return directly
122
+ value
123
+ when /\AArray<(?<inner_type>.+)>\z/
124
+ inner_type = Regexp.last_match[:inner_type]
125
+ value.map { |v| _deserialize(inner_type, v) }
126
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
127
+ k_type = Regexp.last_match[:k_type]
128
+ v_type = Regexp.last_match[:v_type]
129
+ {}.tap do |hash|
130
+ value.each do |k, v|
131
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
132
+ end
133
+ end
134
+ else # model
135
+ temp_model = SwaggerClient.const_get(type).new
136
+ temp_model.build_from_hash(value)
137
+ end
138
+ end
139
+
140
+ # Returns the string representation of the object
141
+ # @return [String] String presentation of the object
142
+ def to_s
143
+ to_hash.to_s
144
+ end
145
+
146
+ # to_body is an alias to to_hash (backward compatibility)
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_body
149
+ to_hash
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = send(attr)
158
+ next if value.nil?
159
+
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ # Outputs non-array value in the form of hash
166
+ # For object, use to_hash. Otherwise, just return the value
167
+ # @param [Object] value Any valid value
168
+ # @return [Hash] Returns the value in the form of hash
169
+ def _to_hash(value)
170
+ if value.is_a?(Array)
171
+ value.compact.map { |v| _to_hash(v) }
172
+ elsif value.is_a?(Hash)
173
+ {}.tap do |hash|
174
+ value.each { |k, v| hash[k] = _to_hash(v) }
175
+ end
176
+ elsif value.respond_to? :to_hash
177
+ value.to_hash
178
+ else
179
+ value
180
+ end
181
+ end
182
+ end
183
+ end
184
+ end
185
+ end
@@ -0,0 +1,218 @@
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 Address
17
+ # Loop: 270 2100[C|D] 271 2100[B|C|D], Segment: N3, Element: N301, Notes: Required, Address Information
18
+ attr_accessor :address1
19
+
20
+ # Loop: 270 2100[C|D] 271 2100[B|C|D], Segment: N3, Element: N302, Notes: Address Information
21
+ attr_accessor :address2
22
+
23
+ # Loop: 270 2100[C|D] 271 2100[B|C|D], Segment: N4, Element: N401, Notes: Required, city
24
+ attr_accessor :city
25
+
26
+ # Loop: 270 2100[C|D] 271 2100[B|C|D], Segment: N4, Element: N403, Notes: Postal Code
27
+ attr_accessor :postal_code
28
+
29
+ # Loop: 270 2100[C|D] 271 2100[B|C|D], Segment: N4, Element: N402, Notes: state example: TN, WA
30
+ attr_accessor :state
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ 'address1': :address1,
36
+ 'address2': :address2,
37
+ 'city': :city,
38
+ 'postal_code': :postalCode,
39
+ 'state': :state
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+ 'address1': :String,
47
+ 'address2': :String,
48
+ 'city': :String,
49
+ 'postal_code': :String,
50
+ 'state': :String
51
+ }
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ return unless attributes.is_a?(Hash)
58
+
59
+ # convert string to symbol for hash key
60
+ attributes = attributes.transform_keys(&:to_sym)
61
+
62
+ self.address1 = attributes[:address1] if attributes.key?(:address1)
63
+
64
+ self.address2 = attributes[:address2] if attributes.key?(:address2)
65
+
66
+ self.city = attributes[:city] if attributes.key?(:city)
67
+
68
+ self.postal_code = attributes[:postalCode] if attributes.key?(:postalCode)
69
+
70
+ self.state = attributes[:state] if attributes.key?(:state)
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ []
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if equal?(o)
89
+
90
+ self.class == o.class &&
91
+ address1 == o.address1 &&
92
+ address2 == o.address2 &&
93
+ city == o.city &&
94
+ postal_code == o.postal_code &&
95
+ state == o.state
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [address1, address2, city, postal_code, state].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+
116
+ self.class.swagger_types.each_pair do |key, type|
117
+ if type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
121
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
122
+ end
123
+ elsif !attributes[self.class.attribute_map[key]].nil?
124
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
126
+ end
127
+
128
+ self
129
+ end
130
+
131
+ # Deserializes the data based on type
132
+ # @param string type Data type
133
+ # @param string value Value to be deserialized
134
+ # @return [Object] Deserialized data
135
+ def _deserialize(type, value)
136
+ case type.to_sym
137
+ when :DateTime
138
+ DateTime.parse(value)
139
+ when :Date
140
+ Date.parse(value)
141
+ when :String
142
+ value.to_s
143
+ when :Integer
144
+ value.to_i
145
+ when :Float
146
+ value.to_f
147
+ when :BOOLEAN
148
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149
+ true
150
+ else
151
+ false
152
+ end
153
+ when :Object
154
+ # generic object (usually a Hash), return directly
155
+ value
156
+ when /\AArray<(?<inner_type>.+)>\z/
157
+ inner_type = Regexp.last_match[:inner_type]
158
+ value.map { |v| _deserialize(inner_type, v) }
159
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160
+ k_type = Regexp.last_match[:k_type]
161
+ v_type = Regexp.last_match[:v_type]
162
+ {}.tap do |hash|
163
+ value.each do |k, v|
164
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165
+ end
166
+ end
167
+ else # model
168
+ temp_model = SwaggerClient.const_get(type).new
169
+ temp_model.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = send(attr)
191
+ next if value.nil?
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+ end
216
+ end
217
+ end
218
+ end
@@ -0,0 +1,376 @@
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 BenefitsAdditionalInformation
17
+ attr_accessor :agency_claim_number, :alternative_list_id, :case_number, :centers_for_medicare_and_medicaid_services_npi, :class_of_contract_code, :contract_number, :coverage_list_id, :drug_formulary_number, :electronic_device_pin, :eligibility_category, :facility_id_number, :facility_network_identification_number, :family_unit_number, :federal_taxpayers_identification_number, :group_number, :hic_number, :id_card_number, :id_card_serial_number, :insurance_policy_number, :issue_number, :medicaid_provider_number, :medicaid_recepient_id_number, :medical_assistance_category, :medical_record_identification_number, :medicare_provider_number, :member_id, :patient_account_number, :personal_identification_number, :plan_network_id_number, :plan_number, :policy_number, :prior_authorization_number, :prior_id_number, :referral_number, :social_security_number, :state_license_number, :submitter_identification_number, :user_identification
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ 'agency_claim_number': :agencyClaimNumber,
23
+ 'alternative_list_id': :alternativeListId,
24
+ 'case_number': :caseNumber,
25
+ 'centers_for_medicare_and_medicaid_services_npi': :centersForMedicareAndMedicaidServicesNPI,
26
+ 'class_of_contract_code': :classOfContractCode,
27
+ 'contract_number': :contractNumber,
28
+ 'coverage_list_id': :coverageListId,
29
+ 'drug_formulary_number': :drugFormularyNumber,
30
+ 'electronic_device_pin': :electronicDevicePin,
31
+ 'eligibility_category': :eligibilityCategory,
32
+ 'facility_id_number': :facilityIdNumber,
33
+ 'facility_network_identification_number': :facilityNetworkIdentificationNumber,
34
+ 'family_unit_number': :familyUnitNumber,
35
+ 'federal_taxpayers_identification_number': :federalTaxpayersIdentificationNumber,
36
+ 'group_number': :groupNumber,
37
+ 'hic_number': :hicNumber,
38
+ 'id_card_number': :idCardNumber,
39
+ 'id_card_serial_number': :idCardSerialNumber,
40
+ 'insurance_policy_number': :insurancePolicyNumber,
41
+ 'issue_number': :issueNumber,
42
+ 'medicaid_provider_number': :medicaidProviderNumber,
43
+ 'medicaid_recepient_id_number': :medicaidRecepientIdNumber,
44
+ 'medical_assistance_category': :medicalAssistanceCategory,
45
+ 'medical_record_identification_number': :medicalRecordIdentificationNumber,
46
+ 'medicare_provider_number': :medicareProviderNumber,
47
+ 'member_id': :memberId,
48
+ 'patient_account_number': :patientAccountNumber,
49
+ 'personal_identification_number': :personalIdentificationNumber,
50
+ 'plan_network_id_number': :planNetworkIdNumber,
51
+ 'plan_number': :planNumber,
52
+ 'policy_number': :policyNumber,
53
+ 'prior_authorization_number': :priorAuthorizationNumber,
54
+ 'prior_id_number': :priorIdNumber,
55
+ 'referral_number': :referralNumber,
56
+ 'social_security_number': :socialSecurityNumber,
57
+ 'state_license_number': :stateLicenseNumber,
58
+ 'submitter_identification_number': :submitterIdentificationNumber,
59
+ 'user_identification': :userIdentification
60
+ }
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.swagger_types
65
+ {
66
+ 'agency_claim_number': :String,
67
+ 'alternative_list_id': :String,
68
+ 'case_number': :String,
69
+ 'centers_for_medicare_and_medicaid_services_npi': :String,
70
+ 'class_of_contract_code': :String,
71
+ 'contract_number': :String,
72
+ 'coverage_list_id': :String,
73
+ 'drug_formulary_number': :String,
74
+ 'electronic_device_pin': :String,
75
+ 'eligibility_category': :String,
76
+ 'facility_id_number': :String,
77
+ 'facility_network_identification_number': :String,
78
+ 'family_unit_number': :String,
79
+ 'federal_taxpayers_identification_number': :String,
80
+ 'group_number': :String,
81
+ 'hic_number': :String,
82
+ 'id_card_number': :String,
83
+ 'id_card_serial_number': :String,
84
+ 'insurance_policy_number': :String,
85
+ 'issue_number': :String,
86
+ 'medicaid_provider_number': :String,
87
+ 'medicaid_recepient_id_number': :String,
88
+ 'medical_assistance_category': :String,
89
+ 'medical_record_identification_number': :String,
90
+ 'medicare_provider_number': :String,
91
+ 'member_id': :String,
92
+ 'patient_account_number': :String,
93
+ 'personal_identification_number': :String,
94
+ 'plan_network_id_number': :String,
95
+ 'plan_number': :String,
96
+ 'policy_number': :String,
97
+ 'prior_authorization_number': :String,
98
+ 'prior_id_number': :String,
99
+ 'referral_number': :String,
100
+ 'social_security_number': :String,
101
+ 'state_license_number': :String,
102
+ 'submitter_identification_number': :String,
103
+ 'user_identification': :String
104
+ }
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ return unless attributes.is_a?(Hash)
111
+
112
+ # convert string to symbol for hash key
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+
115
+ self.agency_claim_number = attributes[:agencyClaimNumber] if attributes.key?(:agencyClaimNumber)
116
+
117
+ self.alternative_list_id = attributes[:alternativeListId] if attributes.key?(:alternativeListId)
118
+
119
+ self.case_number = attributes[:caseNumber] if attributes.key?(:caseNumber)
120
+
121
+ if attributes.key?(:centersForMedicareAndMedicaidServicesNPI)
122
+ self.centers_for_medicare_and_medicaid_services_npi = attributes[:centersForMedicareAndMedicaidServicesNPI]
123
+ end
124
+
125
+ self.class_of_contract_code = attributes[:classOfContractCode] if attributes.key?(:classOfContractCode)
126
+
127
+ self.contract_number = attributes[:contractNumber] if attributes.key?(:contractNumber)
128
+
129
+ self.coverage_list_id = attributes[:coverageListId] if attributes.key?(:coverageListId)
130
+
131
+ self.drug_formulary_number = attributes[:drugFormularyNumber] if attributes.key?(:drugFormularyNumber)
132
+
133
+ self.electronic_device_pin = attributes[:electronicDevicePin] if attributes.key?(:electronicDevicePin)
134
+
135
+ self.eligibility_category = attributes[:eligibilityCategory] if attributes.key?(:eligibilityCategory)
136
+
137
+ self.facility_id_number = attributes[:facilityIdNumber] if attributes.key?(:facilityIdNumber)
138
+
139
+ if attributes.key?(:facilityNetworkIdentificationNumber)
140
+ self.facility_network_identification_number = attributes[:facilityNetworkIdentificationNumber]
141
+ end
142
+
143
+ self.family_unit_number = attributes[:familyUnitNumber] if attributes.key?(:familyUnitNumber)
144
+
145
+ if attributes.key?(:federalTaxpayersIdentificationNumber)
146
+ self.federal_taxpayers_identification_number = attributes[:federalTaxpayersIdentificationNumber]
147
+ end
148
+
149
+ self.group_number = attributes[:groupNumber] if attributes.key?(:groupNumber)
150
+
151
+ self.hic_number = attributes[:hicNumber] if attributes.key?(:hicNumber)
152
+
153
+ self.id_card_number = attributes[:idCardNumber] if attributes.key?(:idCardNumber)
154
+
155
+ self.id_card_serial_number = attributes[:idCardSerialNumber] if attributes.key?(:idCardSerialNumber)
156
+
157
+ self.insurance_policy_number = attributes[:insurancePolicyNumber] if attributes.key?(:insurancePolicyNumber)
158
+
159
+ self.issue_number = attributes[:issueNumber] if attributes.key?(:issueNumber)
160
+
161
+ self.medicaid_provider_number = attributes[:medicaidProviderNumber] if attributes.key?(:medicaidProviderNumber)
162
+
163
+ self.medicaid_recepient_id_number = attributes[:medicaidRecepientIdNumber] if attributes.key?(:medicaidRecepientIdNumber)
164
+
165
+ self.medical_assistance_category = attributes[:medicalAssistanceCategory] if attributes.key?(:medicalAssistanceCategory)
166
+
167
+ self.medical_record_identification_number = attributes[:medicalRecordIdentificationNumber] if attributes.key?(:medicalRecordIdentificationNumber)
168
+
169
+ self.medicare_provider_number = attributes[:medicareProviderNumber] if attributes.key?(:medicareProviderNumber)
170
+
171
+ self.member_id = attributes[:memberId] if attributes.key?(:memberId)
172
+
173
+ self.patient_account_number = attributes[:patientAccountNumber] if attributes.key?(:patientAccountNumber)
174
+
175
+ self.personal_identification_number = attributes[:personalIdentificationNumber] if attributes.key?(:personalIdentificationNumber)
176
+
177
+ self.plan_network_id_number = attributes[:planNetworkIdNumber] if attributes.key?(:planNetworkIdNumber)
178
+
179
+ self.plan_number = attributes[:planNumber] if attributes.key?(:planNumber)
180
+
181
+ self.policy_number = attributes[:policyNumber] if attributes.key?(:policyNumber)
182
+
183
+ self.prior_authorization_number = attributes[:priorAuthorizationNumber] if attributes.key?(:priorAuthorizationNumber)
184
+
185
+ self.prior_id_number = attributes[:priorIdNumber] if attributes.key?(:priorIdNumber)
186
+
187
+ self.referral_number = attributes[:referralNumber] if attributes.key?(:referralNumber)
188
+
189
+ self.social_security_number = attributes[:socialSecurityNumber] if attributes.key?(:socialSecurityNumber)
190
+
191
+ self.state_license_number = attributes[:stateLicenseNumber] if attributes.key?(:stateLicenseNumber)
192
+
193
+ self.submitter_identification_number = attributes[:submitterIdentificationNumber] if attributes.key?(:submitterIdentificationNumber)
194
+
195
+ self.user_identification = attributes[:userIdentification] if attributes.key?(:userIdentification)
196
+ end
197
+
198
+ # Show invalid properties with the reasons. Usually used together with valid?
199
+ # @return Array for valid properties with the reasons
200
+ def list_invalid_properties
201
+ []
202
+ end
203
+
204
+ # Check to see if the all the properties in the model are valid
205
+ # @return true if the model is valid
206
+ def valid?
207
+ true
208
+ end
209
+
210
+ # Checks equality by comparing each attribute.
211
+ # @param [Object] Object to be compared
212
+ def ==(o)
213
+ return true if equal?(o)
214
+
215
+ self.class == o.class &&
216
+ agency_claim_number == o.agency_claim_number &&
217
+ alternative_list_id == o.alternative_list_id &&
218
+ case_number == o.case_number &&
219
+ centers_for_medicare_and_medicaid_services_npi == o.centers_for_medicare_and_medicaid_services_npi &&
220
+ class_of_contract_code == o.class_of_contract_code &&
221
+ contract_number == o.contract_number &&
222
+ coverage_list_id == o.coverage_list_id &&
223
+ drug_formulary_number == o.drug_formulary_number &&
224
+ electronic_device_pin == o.electronic_device_pin &&
225
+ eligibility_category == o.eligibility_category &&
226
+ facility_id_number == o.facility_id_number &&
227
+ facility_network_identification_number == o.facility_network_identification_number &&
228
+ family_unit_number == o.family_unit_number &&
229
+ federal_taxpayers_identification_number == o.federal_taxpayers_identification_number &&
230
+ group_number == o.group_number &&
231
+ hic_number == o.hic_number &&
232
+ id_card_number == o.id_card_number &&
233
+ id_card_serial_number == o.id_card_serial_number &&
234
+ insurance_policy_number == o.insurance_policy_number &&
235
+ issue_number == o.issue_number &&
236
+ medicaid_provider_number == o.medicaid_provider_number &&
237
+ medicaid_recepient_id_number == o.medicaid_recepient_id_number &&
238
+ medical_assistance_category == o.medical_assistance_category &&
239
+ medical_record_identification_number == o.medical_record_identification_number &&
240
+ medicare_provider_number == o.medicare_provider_number &&
241
+ member_id == o.member_id &&
242
+ patient_account_number == o.patient_account_number &&
243
+ personal_identification_number == o.personal_identification_number &&
244
+ plan_network_id_number == o.plan_network_id_number &&
245
+ plan_number == o.plan_number &&
246
+ policy_number == o.policy_number &&
247
+ prior_authorization_number == o.prior_authorization_number &&
248
+ prior_id_number == o.prior_id_number &&
249
+ referral_number == o.referral_number &&
250
+ social_security_number == o.social_security_number &&
251
+ state_license_number == o.state_license_number &&
252
+ submitter_identification_number == o.submitter_identification_number &&
253
+ user_identification == o.user_identification
254
+ end
255
+
256
+ # @see the `==` method
257
+ # @param [Object] Object to be compared
258
+ def eql?(o)
259
+ self == o
260
+ end
261
+
262
+ # Calculates hash code according to all attributes.
263
+ # @return [Fixnum] Hash code
264
+ def hash
265
+ [agency_claim_number, alternative_list_id, case_number, centers_for_medicare_and_medicaid_services_npi, class_of_contract_code, contract_number, coverage_list_id, drug_formulary_number, electronic_device_pin, eligibility_category, facility_id_number, facility_network_identification_number, family_unit_number, federal_taxpayers_identification_number, group_number, hic_number, id_card_number, id_card_serial_number, insurance_policy_number, issue_number, medicaid_provider_number, medicaid_recepient_id_number, medical_assistance_category, medical_record_identification_number, medicare_provider_number, member_id, patient_account_number, personal_identification_number, plan_network_id_number, plan_number, policy_number, prior_authorization_number, prior_id_number, referral_number, social_security_number, state_license_number, submitter_identification_number, user_identification].hash
266
+ end
267
+
268
+ # Builds the object from hash
269
+ # @param [Hash] attributes Model attributes in the form of hash
270
+ # @return [Object] Returns the model itself
271
+ def build_from_hash(attributes)
272
+ return nil unless attributes.is_a?(Hash)
273
+
274
+ self.class.swagger_types.each_pair do |key, type|
275
+ if type =~ /\AArray<(.*)>/i
276
+ # check to ensure the input is an array given that the attribute
277
+ # is documented as an array but the input is not
278
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
279
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
280
+ end
281
+ elsif !attributes[self.class.attribute_map[key]].nil?
282
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
283
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
284
+ end
285
+
286
+ self
287
+ end
288
+
289
+ # Deserializes the data based on type
290
+ # @param string type Data type
291
+ # @param string value Value to be deserialized
292
+ # @return [Object] Deserialized data
293
+ def _deserialize(type, value)
294
+ case type.to_sym
295
+ when :DateTime
296
+ DateTime.parse(value)
297
+ when :Date
298
+ Date.parse(value)
299
+ when :String
300
+ value.to_s
301
+ when :Integer
302
+ value.to_i
303
+ when :Float
304
+ value.to_f
305
+ when :BOOLEAN
306
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
307
+ true
308
+ else
309
+ false
310
+ end
311
+ when :Object
312
+ # generic object (usually a Hash), return directly
313
+ value
314
+ when /\AArray<(?<inner_type>.+)>\z/
315
+ inner_type = Regexp.last_match[:inner_type]
316
+ value.map { |v| _deserialize(inner_type, v) }
317
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
318
+ k_type = Regexp.last_match[:k_type]
319
+ v_type = Regexp.last_match[:v_type]
320
+ {}.tap do |hash|
321
+ value.each do |k, v|
322
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
323
+ end
324
+ end
325
+ else # model
326
+ temp_model = SwaggerClient.const_get(type).new
327
+ temp_model.build_from_hash(value)
328
+ end
329
+ end
330
+
331
+ # Returns the string representation of the object
332
+ # @return [String] String presentation of the object
333
+ def to_s
334
+ to_hash.to_s
335
+ end
336
+
337
+ # to_body is an alias to to_hash (backward compatibility)
338
+ # @return [Hash] Returns the object in the form of hash
339
+ def to_body
340
+ to_hash
341
+ end
342
+
343
+ # Returns the object in the form of hash
344
+ # @return [Hash] Returns the object in the form of hash
345
+ def to_hash
346
+ hash = {}
347
+ self.class.attribute_map.each_pair do |attr, param|
348
+ value = send(attr)
349
+ next if value.nil?
350
+
351
+ hash[param] = _to_hash(value)
352
+ end
353
+ hash
354
+ end
355
+
356
+ # Outputs non-array value in the form of hash
357
+ # For object, use to_hash. Otherwise, just return the value
358
+ # @param [Object] value Any valid value
359
+ # @return [Hash] Returns the value in the form of hash
360
+ def _to_hash(value)
361
+ if value.is_a?(Array)
362
+ value.compact.map { |v| _to_hash(v) }
363
+ elsif value.is_a?(Hash)
364
+ {}.tap do |hash|
365
+ value.each { |k, v| hash[k] = _to_hash(v) }
366
+ end
367
+ elsif value.respond_to? :to_hash
368
+ value.to_hash
369
+ else
370
+ value
371
+ end
372
+ end
373
+ end
374
+ end
375
+ end
376
+ end