change_healthcare-professional_claims 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +30 -0
  5. data/.travis.yml +6 -0
  6. data/.yardopts +1 -0
  7. data/CHANGELOG.md +0 -0
  8. data/Gemfile +6 -0
  9. data/Gemfile.lock +118 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +39 -0
  12. data/Rakefile +8 -0
  13. data/TODO.md +8 -0
  14. data/bin/console +15 -0
  15. data/bin/rspec +29 -0
  16. data/bin/setup +8 -0
  17. data/change_healthcare-professional_claims.gemspec +43 -0
  18. data/lib/change_healthcare/professional_claims.rb +16 -0
  19. data/lib/change_healthcare/professional_claims/swagger_client.rb +106 -0
  20. data/lib/change_healthcare/professional_claims/swagger_client/api_client.rb +390 -0
  21. data/lib/change_healthcare/professional_claims/swagger_client/api_error.rb +42 -0
  22. data/lib/change_healthcare/professional_claims/swagger_client/configuration.rb +204 -0
  23. data/lib/change_healthcare/professional_claims/swagger_client/models/address.rb +219 -0
  24. data/lib/change_healthcare/professional_claims/swagger_client/models/ambulance_certification.rb +247 -0
  25. data/lib/change_healthcare/professional_claims/swagger_client/models/ambulance_transport_information.rb +259 -0
  26. data/lib/change_healthcare/professional_claims/swagger_client/models/clai_request.rb +283 -0
  27. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_adjustment.rb +244 -0
  28. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_adjustment_details.rb +199 -0
  29. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_contract_information.rb +265 -0
  30. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_date_information.rb +298 -0
  31. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_information.rb +579 -0
  32. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_note.rb +216 -0
  33. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_pricing_repricing_information.rb +363 -0
  34. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_reference.rb +231 -0
  35. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_submission_request.rb +278 -0
  36. data/lib/change_healthcare/professional_claims/swagger_client/models/claim_supplemental_information.rb +315 -0
  37. data/lib/change_healthcare/professional_claims/swagger_client/models/composite_diagnosis_code_pointers.rb +191 -0
  38. data/lib/change_healthcare/professional_claims/swagger_client/models/condition_indicator_durable_medical_equipment.rb +281 -0
  39. data/lib/change_healthcare/professional_claims/swagger_client/models/condition_information.rb +190 -0
  40. data/lib/change_healthcare/professional_claims/swagger_client/models/contact_information.rb +209 -0
  41. data/lib/change_healthcare/professional_claims/swagger_client/models/contract_information.rb +255 -0
  42. data/lib/change_healthcare/professional_claims/swagger_client/models/dependent.rb +294 -0
  43. data/lib/change_healthcare/professional_claims/swagger_client/models/drug_identification.rb +278 -0
  44. data/lib/change_healthcare/professional_claims/swagger_client/models/durable_medical_equipment_certificate_of_medical_necessity.rb +226 -0
  45. data/lib/change_healthcare/professional_claims/swagger_client/models/durable_medical_equipment_certification.rb +233 -0
  46. data/lib/change_healthcare/professional_claims/swagger_client/models/durable_medical_equipment_service.rb +243 -0
  47. data/lib/change_healthcare/professional_claims/swagger_client/models/edit_response.rb +251 -0
  48. data/lib/change_healthcare/professional_claims/swagger_client/models/epsdt_referral.rb +236 -0
  49. data/lib/change_healthcare/professional_claims/swagger_client/models/error.rb +214 -0
  50. data/lib/change_healthcare/professional_claims/swagger_client/models/failure.rb +194 -0
  51. data/lib/change_healthcare/professional_claims/swagger_client/models/form_identification.rb +240 -0
  52. data/lib/change_healthcare/professional_claims/swagger_client/models/health_care_information.rb +233 -0
  53. data/lib/change_healthcare/professional_claims/swagger_client/models/line_adjudication_information.rb +284 -0
  54. data/lib/change_healthcare/professional_claims/swagger_client/models/measurements.rb +256 -0
  55. data/lib/change_healthcare/professional_claims/swagger_client/models/medicare_outpatient_adjudication.rb +213 -0
  56. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_billing_provider.rb +236 -0
  57. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_name.rb +285 -0
  58. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_referring_provider.rb +192 -0
  59. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_rendering_provider.rb +236 -0
  60. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_service_facility_location.rb +192 -0
  61. data/lib/change_healthcare/professional_claims/swagger_client/models/other_payer_supervising_provider.rb +192 -0
  62. data/lib/change_healthcare/professional_claims/swagger_client/models/other_subscriber_information.rb +430 -0
  63. data/lib/change_healthcare/professional_claims/swagger_client/models/other_subscriber_name.rb +288 -0
  64. data/lib/change_healthcare/professional_claims/swagger_client/models/patient_condition_information_vision.rb +259 -0
  65. data/lib/change_healthcare/professional_claims/swagger_client/models/pay_to_plan.rb +278 -0
  66. data/lib/change_healthcare/professional_claims/swagger_client/models/payer.rb +194 -0
  67. data/lib/change_healthcare/professional_claims/swagger_client/models/prior_authorization.rb +194 -0
  68. data/lib/change_healthcare/professional_claims/swagger_client/models/professional_service.rb +290 -0
  69. data/lib/change_healthcare/professional_claims/swagger_client/models/provider.rb +281 -0
  70. data/lib/change_healthcare/professional_claims/swagger_client/models/purchased_service_information.rb +194 -0
  71. data/lib/change_healthcare/professional_claims/swagger_client/models/raw_x12_request.rb +194 -0
  72. data/lib/change_healthcare/professional_claims/swagger_client/models/receiver.rb +189 -0
  73. data/lib/change_healthcare/professional_claims/swagger_client/models/reference_identification.rb +199 -0
  74. data/lib/change_healthcare/professional_claims/swagger_client/models/report_information.rb +261 -0
  75. data/lib/change_healthcare/professional_claims/swagger_client/models/response.rb +240 -0
  76. data/lib/change_healthcare/professional_claims/swagger_client/models/service_facility_location.rb +224 -0
  77. data/lib/change_healthcare/professional_claims/swagger_client/models/service_line.rb +388 -0
  78. data/lib/change_healthcare/professional_claims/swagger_client/models/service_line_date_information.rb +236 -0
  79. data/lib/change_healthcare/professional_claims/swagger_client/models/service_line_provider.rb +293 -0
  80. data/lib/change_healthcare/professional_claims/swagger_client/models/service_line_reference_information.rb +230 -0
  81. data/lib/change_healthcare/professional_claims/swagger_client/models/spinal_manipulation_service_information.rb +238 -0
  82. data/lib/change_healthcare/professional_claims/swagger_client/models/submitter.rb +209 -0
  83. data/lib/change_healthcare/professional_claims/swagger_client/models/subscriber.rb +309 -0
  84. data/lib/change_healthcare/professional_claims/swagger_client/models/supporting_documentation.rb +249 -0
  85. data/lib/change_healthcare/professional_claims/swagger_client/professional_claims_api.rb +361 -0
  86. data/lib/change_healthcare/professional_claims/swagger_client/version.rb +19 -0
  87. data/lib/change_healthcare/professional_claims/version.rb +7 -0
  88. data/lib/change_healthcare/professional_claims/wrapper.rb +141 -0
  89. metadata +274 -0
@@ -0,0 +1,259 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Medical Network Professional Claims v3
4
+ #
5
+ # Reference for developers
6
+ #
7
+ # OpenAPI spec version: v3
8
+ #
9
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
10
+ # Swagger Codegen version: 2.4.19
11
+ #
12
+
13
+ require 'date'
14
+
15
+ module ChangeHealthcare
16
+ module ProfessionalClaims
17
+ module SwaggerClient
18
+ class AmbulanceTransportInformation
19
+ ##
20
+ # Allowed Values are:
21
+ #
22
+ # - 'A' Patient was transported to nearest facility for care of symptoms, complaints, or both,
23
+ # - 'B' Patient was transported for the benefit of a preferred physician,
24
+ # - 'C' Patient was transported for the nearness of family members
25
+ # - 'D' Patient was transported for the care of a specialist or for availability of specialized equipment
26
+ # - 'E' Patient Transferred to Rehabilitation Facility
27
+ #
28
+ # @return ['A', 'B', 'C', 'D', 'E']
29
+ attr_reader :ambulance_transport_reason_code
30
+
31
+ attr_accessor :patient_weight_in_pounds, :round_trip_purpose_description, :stretcher_purpose_description,
32
+ :transport_distance_in_miles
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype, :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ ambulance_transport_reason_code: :ambulanceTransportReasonCode,
59
+ patient_weight_in_pounds: :patientWeightInPounds,
60
+ round_trip_purpose_description: :roundTripPurposeDescription,
61
+ stretcher_purpose_description: :stretcherPurposeDescription,
62
+ transport_distance_in_miles: :transportDistanceInMiles
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ ambulance_transport_reason_code: :String,
70
+ patient_weight_in_pounds: :String,
71
+ round_trip_purpose_description: :String,
72
+ stretcher_purpose_description: :String,
73
+ transport_distance_in_miles: :String
74
+ }
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ return unless attributes.is_a?(Hash)
81
+
82
+ # convert string to symbol for hash key
83
+ attributes = attributes.transform_keys(&:to_sym)
84
+
85
+ self.ambulance_transport_reason_code = attributes[:ambulanceTransportReasonCode] if attributes.key?(:ambulanceTransportReasonCode)
86
+
87
+ self.patient_weight_in_pounds = attributes[:patientWeightInPounds] if attributes.key?(:patientWeightInPounds)
88
+
89
+ self.round_trip_purpose_description = attributes[:roundTripPurposeDescription] if attributes.key?(:roundTripPurposeDescription)
90
+
91
+ self.stretcher_purpose_description = attributes[:stretcherPurposeDescription] if attributes.key?(:stretcherPurposeDescription)
92
+
93
+ self.transport_distance_in_miles = attributes[:transportDistanceInMiles] if attributes.key?(:transportDistanceInMiles)
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ []
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ ambulance_transport_reason_code_validator = EnumAttributeValidator.new('String', %w[A B C D E])
106
+ return false unless ambulance_transport_reason_code_validator.valid?(@ambulance_transport_reason_code)
107
+
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method checking allowed values (enum).
112
+ # @param [Object] ambulance_transport_reason_code Object to be assigned
113
+ def ambulance_transport_reason_code=(ambulance_transport_reason_code)
114
+ validator = EnumAttributeValidator.new('String', %w[A B C D E])
115
+ unless validator.valid?(ambulance_transport_reason_code)
116
+ raise ArgumentError,
117
+ %(invalid value for "ambulance_transport_reason_code", must be one of #{validator.allowable_values}.)
118
+ end
119
+
120
+ @ambulance_transport_reason_code = ambulance_transport_reason_code
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(other)
126
+ return true if equal?(other)
127
+
128
+ self.class == other.class &&
129
+ ambulance_transport_reason_code == other.ambulance_transport_reason_code &&
130
+ patient_weight_in_pounds == other.patient_weight_in_pounds &&
131
+ round_trip_purpose_description == other.round_trip_purpose_description &&
132
+ stretcher_purpose_description == other.stretcher_purpose_description &&
133
+ transport_distance_in_miles == other.transport_distance_in_miles
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(other)
139
+ self == other
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Fixnum] Hash code
144
+ def hash
145
+ [ambulance_transport_reason_code, patient_weight_in_pounds, round_trip_purpose_description,
146
+ stretcher_purpose_description, transport_distance_in_miles].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+
155
+ self.class.swagger_types.each_pair do |key, type|
156
+ if type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
160
+ send("#{key}=", attributes[self.class.attribute_map[key]].map do |v|
161
+ _deserialize(Regexp.last_match(1), v)
162
+ end)
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ end
167
+ end
168
+
169
+ self
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def _deserialize(type, value)
177
+ case type.to_sym
178
+ when :DateTime
179
+ DateTime.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :BOOLEAN
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ temp_model = SwaggerClient.const_get(type).new
210
+ temp_model.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = send(attr)
232
+ next if value.nil?
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+ end
257
+ end
258
+ end
259
+ end
@@ -0,0 +1,283 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Medical Network Professional Claims v3
4
+ #
5
+ # Reference for developers
6
+ #
7
+ # OpenAPI spec version: v3
8
+ #
9
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
10
+ # Swagger Codegen version: 2.4.19
11
+ #
12
+
13
+ require 'date'
14
+
15
+ module ChangeHealthcare
16
+ module ProfessionalClaims
17
+ module SwaggerClient
18
+ class ClaiRequest
19
+ attr_accessor :billing, :claim_information, :control_number, :dependent, :ordering, :pay_to_address, :pay_to_plan,
20
+ :payer_address, :precision_threshold, :providers, :receiver, :referring, :rendering, :submitter, :subscriber, :supervising, :trading_partner_id, :trading_partner_name, :trading_partner_service_id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ billing: :billing,
26
+ claim_information: :claimInformation,
27
+ control_number: :controlNumber,
28
+ dependent: :dependent,
29
+ ordering: :ordering,
30
+ pay_to_address: :payToAddress,
31
+ pay_to_plan: :payToPlan,
32
+ payer_address: :payerAddress,
33
+ precision_threshold: :precisionThreshold,
34
+ providers: :providers,
35
+ receiver: :receiver,
36
+ referring: :referring,
37
+ rendering: :rendering,
38
+ submitter: :submitter,
39
+ subscriber: :subscriber,
40
+ supervising: :supervising,
41
+ trading_partner_id: :tradingPartnerId,
42
+ trading_partner_name: :tradingPartnerName,
43
+ trading_partner_service_id: :tradingPartnerServiceId
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ billing: :Provider,
51
+ claim_information: :ClaimInformation,
52
+ control_number: :String,
53
+ dependent: :Dependent,
54
+ ordering: :Provider,
55
+ pay_to_address: :Address,
56
+ pay_to_plan: :PayToPlan,
57
+ payer_address: :Address,
58
+ precision_threshold: :Float,
59
+ providers: :'Array<Provider>',
60
+ receiver: :Receiver,
61
+ referring: :Provider,
62
+ rendering: :Provider,
63
+ submitter: :Submitter,
64
+ subscriber: :Subscriber,
65
+ supervising: :Provider,
66
+ trading_partner_id: :String,
67
+ trading_partner_name: :String,
68
+ trading_partner_service_id: :String
69
+ }
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.transform_keys(&:to_sym)
79
+
80
+ self.billing = attributes[:billing] if attributes.key?(:billing)
81
+
82
+ self.claim_information = attributes[:claimInformation] if attributes.key?(:claimInformation)
83
+
84
+ self.control_number = attributes[:controlNumber] if attributes.key?(:controlNumber)
85
+
86
+ self.dependent = attributes[:dependent] if attributes.key?(:dependent)
87
+
88
+ self.ordering = attributes[:ordering] if attributes.key?(:ordering)
89
+
90
+ self.pay_to_address = attributes[:payToAddress] if attributes.key?(:payToAddress)
91
+
92
+ self.pay_to_plan = attributes[:payToPlan] if attributes.key?(:payToPlan)
93
+
94
+ self.payer_address = attributes[:payerAddress] if attributes.key?(:payerAddress)
95
+
96
+ self.precision_threshold = attributes[:precisionThreshold] if attributes.key?(:precisionThreshold)
97
+
98
+ if attributes.key?(:providers) && (value = attributes[:providers]).is_a?(Array)
99
+ self.providers = value
100
+ end
101
+
102
+ self.receiver = attributes[:receiver] if attributes.key?(:receiver)
103
+
104
+ self.referring = attributes[:referring] if attributes.key?(:referring)
105
+
106
+ self.rendering = attributes[:rendering] if attributes.key?(:rendering)
107
+
108
+ self.submitter = attributes[:submitter] if attributes.key?(:submitter)
109
+
110
+ self.subscriber = attributes[:subscriber] if attributes.key?(:subscriber)
111
+
112
+ self.supervising = attributes[:supervising] if attributes.key?(:supervising)
113
+
114
+ self.trading_partner_id = attributes[:tradingPartnerId] if attributes.key?(:tradingPartnerId)
115
+
116
+ self.trading_partner_name = attributes[:tradingPartnerName] if attributes.key?(:tradingPartnerName)
117
+
118
+ self.trading_partner_service_id = attributes[:tradingPartnerServiceId] if attributes.key?(:tradingPartnerServiceId)
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ []
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ true
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(other)
136
+ return true if equal?(other)
137
+
138
+ self.class == other.class &&
139
+ billing == other.billing &&
140
+ claim_information == other.claim_information &&
141
+ control_number == other.control_number &&
142
+ dependent == other.dependent &&
143
+ ordering == other.ordering &&
144
+ pay_to_address == other.pay_to_address &&
145
+ pay_to_plan == other.pay_to_plan &&
146
+ payer_address == other.payer_address &&
147
+ precision_threshold == other.precision_threshold &&
148
+ providers == other.providers &&
149
+ receiver == other.receiver &&
150
+ referring == other.referring &&
151
+ rendering == other.rendering &&
152
+ submitter == other.submitter &&
153
+ subscriber == other.subscriber &&
154
+ supervising == other.supervising &&
155
+ trading_partner_id == other.trading_partner_id &&
156
+ trading_partner_name == other.trading_partner_name &&
157
+ trading_partner_service_id == other.trading_partner_service_id
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(other)
163
+ self == other
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Fixnum] Hash code
168
+ def hash
169
+ [billing, claim_information, control_number, dependent, ordering, pay_to_address, pay_to_plan, payer_address,
170
+ precision_threshold, providers, receiver, referring, rendering, submitter, subscriber, supervising, trading_partner_id, trading_partner_name, trading_partner_service_id].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def build_from_hash(attributes)
177
+ return nil unless attributes.is_a?(Hash)
178
+
179
+ self.class.swagger_types.each_pair do |key, type|
180
+ if type =~ /\AArray<(.*)>/i
181
+ # check to ensure the input is an array given that the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
184
+ send("#{key}=", attributes[self.class.attribute_map[key]].map do |v|
185
+ _deserialize(Regexp.last_match(1), v)
186
+ end)
187
+ end
188
+ elsif !attributes[self.class.attribute_map[key]].nil?
189
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
190
+ end
191
+ end
192
+
193
+ self
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def _deserialize(type, value)
201
+ case type.to_sym
202
+ when :DateTime
203
+ DateTime.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :BOOLEAN
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ temp_model = SwaggerClient.const_get(type).new
234
+ temp_model.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = send(attr)
256
+ next if value.nil?
257
+
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map { |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+ end
281
+ end
282
+ end
283
+ end