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,40 @@
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
+ module ChangeHealthcare
12
+ module Eligibility
13
+ module SwaggerClient
14
+ class ApiError < ::ChangeHealthcare::Eligibility::Error
15
+ attr_reader :code, :response_headers, :response_body
16
+
17
+ # Usage examples:
18
+ # ApiError.new
19
+ # ApiError.new("message")
20
+ # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
21
+ # ApiError.new(:code => 404, :message => "Not Found")
22
+ def initialize(arg = nil)
23
+ if arg.is_a? Hash
24
+ if arg.key?(:message) || arg.key?('message')
25
+ super(arg[:message] || arg['message'])
26
+ else
27
+ super arg
28
+ end
29
+
30
+ arg.each do |k, v|
31
+ instance_variable_set "@#{k}", v
32
+ end
33
+ else
34
+ super arg
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,202 @@
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 'addressable/uri'
12
+
13
+ module ChangeHealthcare
14
+ module Eligibility
15
+ module SwaggerClient
16
+ class Configuration
17
+ # Defines url scheme
18
+ attr_accessor :scheme
19
+
20
+ # Defines url host
21
+ attr_accessor :host
22
+
23
+ # Defines url base path
24
+ attr_accessor :base_path
25
+
26
+ # Defines API keys used with API Key authentications.
27
+ #
28
+ # @return [Hash] key: parameter name, value: parameter value (API key)
29
+ #
30
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
31
+ # config.api_key['api_key'] = 'xxx'
32
+ attr_accessor :api_key
33
+
34
+ # Defines API key prefixes used with API Key authentications.
35
+ #
36
+ # @return [Hash] key: parameter name, value: API key prefix
37
+ #
38
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
39
+ # config.api_key_prefix['api_key'] = 'Token'
40
+ attr_accessor :api_key_prefix
41
+
42
+ # Defines the username used with HTTP basic authentication.
43
+ #
44
+ # @return [String]
45
+ attr_accessor :username
46
+
47
+ # Defines the password used with HTTP basic authentication.
48
+ #
49
+ # @return [String]
50
+ attr_accessor :password
51
+
52
+ # Defines the access token (Bearer) used with OAuth2.
53
+ attr_accessor :access_token
54
+
55
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
56
+ # details will be logged with `logger.debug` (see the `logger` attribute).
57
+ # Default to false.
58
+ #
59
+ # @return [true, false]
60
+ attr_accessor :debugging
61
+
62
+ # Defines the logger used for debugging.
63
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
64
+ #
65
+ # @return [#debug]
66
+ attr_accessor :logger
67
+
68
+ # Defines the temporary folder to store downloaded files
69
+ # (for API endpoints that have file response).
70
+ # Default to use `Tempfile`.
71
+ #
72
+ # @return [String]
73
+ attr_accessor :temp_folder_path
74
+
75
+ # The time limit for HTTP request in seconds.
76
+ # Default to 0 (never times out).
77
+ attr_accessor :timeout
78
+
79
+ # Set this to false to skip client side validation in the operation.
80
+ # Default to true.
81
+ # @return [true, false]
82
+ attr_accessor :client_side_validation
83
+
84
+ ### TLS/SSL setting
85
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
86
+ # Default to true.
87
+ #
88
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
89
+ #
90
+ # @return [true, false]
91
+ attr_accessor :verify_ssl
92
+
93
+ ### TLS/SSL setting
94
+ # Set this to false to skip verifying SSL host name
95
+ # Default to true.
96
+ #
97
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
98
+ #
99
+ # @return [true, false]
100
+ attr_accessor :verify_ssl_host
101
+
102
+ ### TLS/SSL setting
103
+ # Set this to customize the certificate file to verify the peer.
104
+ #
105
+ # @return [String] the path to the certificate file
106
+ #
107
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
108
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
109
+ attr_accessor :ssl_ca_cert
110
+
111
+ ### TLS/SSL setting
112
+ # Client certificate file (for client certificate)
113
+ attr_accessor :cert_file
114
+
115
+ ### TLS/SSL setting
116
+ # Client private key file (for client certificate)
117
+ attr_accessor :key_file
118
+
119
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
120
+ # Default to nil.
121
+ #
122
+ # @see The params_encoding option of Ethon. Related source code:
123
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
124
+ attr_accessor :params_encoding
125
+
126
+ attr_accessor :inject_format, :force_ending_format
127
+
128
+ def initialize
129
+ @scheme = 'https'
130
+ @host = 'sandbox.apis.changehealthcare.com'
131
+ @base_path = '/medicalnetwork/eligibility/v3'
132
+ @api_key = {}
133
+ @api_key_prefix = {}
134
+ @timeout = 0
135
+ @client_side_validation = true
136
+ @verify_ssl = true
137
+ @verify_ssl_host = true
138
+ @params_encoding = nil
139
+ @cert_file = nil
140
+ @key_file = nil
141
+ @debugging = false
142
+ @inject_format = false
143
+ @force_ending_format = false
144
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
145
+
146
+ yield(self) if block_given?
147
+ end
148
+
149
+ # The default Configuration object.
150
+ def self.default
151
+ @@default ||= Configuration.new
152
+ end
153
+
154
+ def configure
155
+ yield(self) if block_given?
156
+ end
157
+
158
+ def scheme=(scheme)
159
+ # remove :// from scheme
160
+ @scheme = scheme.sub(%r{://}, '')
161
+ end
162
+
163
+ def host=(host)
164
+ # remove http(s):// and anything after a slash
165
+ @host = host.sub(%r{https?://}, '').split('/').first
166
+ end
167
+
168
+ def base_path=(base_path)
169
+ # Add leading and trailing slashes to base_path
170
+ @base_path = "/#{base_path}".gsub(%r{/+}, '/')
171
+ @base_path = '' if @base_path == '/'
172
+ end
173
+
174
+ def base_url
175
+ url = "#{scheme}://#{[host, base_path].join('/').gsub(%r{/+}, '/')}".sub(%r{/+\z}, '')
176
+ Addressable::URI.encode(url)
177
+ end
178
+
179
+ # Gets API key (with prefix if set).
180
+ # @param [String] param_name the parameter name of API key auth
181
+ def api_key_with_prefix(param_name)
182
+ if @api_key_prefix[param_name]
183
+ "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
184
+ else
185
+ @api_key[param_name]
186
+ end
187
+ end
188
+
189
+ # Gets Basic Auth token string
190
+ def basic_auth_token
191
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
192
+ end
193
+
194
+ # Returns Auth Settings hash for api client.
195
+ def auth_settings
196
+ {
197
+ }
198
+ end
199
+ end
200
+ end
201
+ end
202
+ end
@@ -0,0 +1,198 @@
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 'uri'
12
+
13
+ module ChangeHealthcare
14
+ module Eligibility
15
+ module SwaggerClient
16
+ class EligibilityApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ ##
24
+ # Seamlessly check a member eligibility and health plan benefit details with hundreds of payers.
25
+ # takes a json object model of a 270 EDI request and produces a json object model of a 271 response
26
+ # @param authorization Bearer Your-Access-Token
27
+ # @param request request
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [Response]
30
+ def eligibility(authorization, request, opts = {})
31
+ data, _status_code, _headers = eligibility_with_http_info(authorization, request, opts)
32
+ data
33
+ end
34
+
35
+ ##
36
+ # Seamlessly check a member eligibility and health plan benefit details with hundreds of payers.
37
+ # takes a json object model of a 270 EDI request and produces a json object model of a 271 response
38
+ # @param authorization Bearer Your-Access-Token
39
+ # @param request request
40
+ # @param [Hash] opts the optional parameters
41
+ # @return [Array<(Response, Fixnum, Hash)>] Response data, response status code and response headers
42
+ def eligibility_with_http_info(authorization, request, _opts = {})
43
+ @api_client.config.logger.debug 'Calling API: EligibilityApi.eligibility ...' if @api_client.config.debugging
44
+ # verify the required parameter 'authorization' is set
45
+ if @api_client.config.client_side_validation && authorization.nil?
46
+ raise ArgumentError, "Missing the required parameter 'authorization' when calling EligibilityApi.eligibility"
47
+ end
48
+ # verify the required parameter 'request' is set
49
+ if @api_client.config.client_side_validation && request.nil?
50
+ raise ArgumentError, "Missing the required parameter 'request' when calling EligibilityApi.eligibility"
51
+ end
52
+
53
+ # resource path
54
+ local_var_path = '/'
55
+
56
+ # query parameters
57
+ query_params = {}
58
+
59
+ # header parameters
60
+ header_params = {}
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
63
+ # HTTP header 'Content-Type'
64
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
65
+ header_params[:Authorization] = authorization
66
+
67
+ # form parameters
68
+ form_params = {}
69
+
70
+ # http body (model)
71
+ post_body = @api_client.object_to_http_body(request)
72
+ auth_names = []
73
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
74
+ header_params: header_params,
75
+ query_params: query_params,
76
+ form_params: form_params,
77
+ body: post_body,
78
+ auth_names: auth_names,
79
+ return_type: 'Response')
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: EligibilityApi#eligibility\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ [data, status_code, headers]
84
+ end
85
+
86
+ # healthCheck
87
+ # @param authorization Bearer Your-Access-Token
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [HealthCheck]
90
+ def health_check_using_get(authorization, opts = {})
91
+ data, _status_code, _headers = health_check_using_get_with_http_info(authorization, opts)
92
+ data
93
+ end
94
+
95
+ # healthCheck
96
+ # @param authorization Bearer Your-Access-Token
97
+ # @param [Hash] opts the optional parameters
98
+ # @return [Array<(HealthCheck, Fixnum, Hash)>] HealthCheck data, response status code and response headers
99
+ def health_check_using_get_with_http_info(authorization, _opts = {})
100
+ @api_client.config.logger.debug 'Calling API: EligibilityApi.health_check_using_get ...' if @api_client.config.debugging
101
+ # verify the required parameter 'authorization' is set
102
+ if @api_client.config.client_side_validation && authorization.nil?
103
+ raise ArgumentError, "Missing the required parameter 'authorization' when calling EligibilityApi.health_check_using_get"
104
+ end
105
+
106
+ # resource path
107
+ local_var_path = '/healthcheck'
108
+
109
+ # query parameters
110
+ query_params = {}
111
+
112
+ # header parameters
113
+ header_params = {}
114
+ # HTTP header 'Accept' (if needed)
115
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
116
+ header_params[:Authorization] = authorization
117
+
118
+ # form parameters
119
+ form_params = {}
120
+
121
+ # http body (model)
122
+ post_body = nil
123
+ auth_names = []
124
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
125
+ header_params: header_params,
126
+ query_params: query_params,
127
+ form_params: form_params,
128
+ body: post_body,
129
+ auth_names: auth_names,
130
+ return_type: 'HealthCheck')
131
+ if @api_client.config.debugging
132
+ @api_client.config.logger.debug "API called: EligibilityApi#health_check_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
133
+ end
134
+ [data, status_code, headers]
135
+ end
136
+
137
+ # send and receive raw x12 for 270 and 271 transactions
138
+ # @param authorization Bearer Your-Access-Token
139
+ # @param request request
140
+ # @param [Hash] opts the optional parameters
141
+ # @return [Response]
142
+ def raw_x12_using_post(authorization, request, opts = {})
143
+ data, _status_code, _headers = raw_x12_using_post_with_http_info(authorization, request, opts)
144
+ data
145
+ end
146
+
147
+ # send and receive raw x12 for 270 and 271 transactions
148
+ # @param authorization Bearer Your-Access-Token
149
+ # @param request request
150
+ # @param [Hash] opts the optional parameters
151
+ # @return [Array<(Response, Fixnum, Hash)>] Response data, response status code and response headers
152
+ def raw_x12_using_post_with_http_info(authorization, request, _opts = {})
153
+ @api_client.config.logger.debug 'Calling API: EligibilityApi.raw_x12_using_post ...' if @api_client.config.debugging
154
+ # verify the required parameter 'authorization' is set
155
+ if @api_client.config.client_side_validation && authorization.nil?
156
+ raise ArgumentError, "Missing the required parameter 'authorization' when calling EligibilityApi.raw_x12_using_post"
157
+ end
158
+ # verify the required parameter 'request' is set
159
+ if @api_client.config.client_side_validation && request.nil?
160
+ raise ArgumentError, "Missing the required parameter 'request' when calling EligibilityApi.raw_x12_using_post"
161
+ end
162
+
163
+ # resource path
164
+ local_var_path = '/raw-x12'
165
+
166
+ # query parameters
167
+ query_params = {}
168
+
169
+ # header parameters
170
+ header_params = {}
171
+ # HTTP header 'Accept' (if needed)
172
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
173
+ # HTTP header 'Content-Type'
174
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
175
+ header_params[:Authorization] = authorization
176
+
177
+ # form parameters
178
+ form_params = {}
179
+
180
+ # http body (model)
181
+ post_body = @api_client.object_to_http_body(request)
182
+ auth_names = []
183
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
184
+ header_params: header_params,
185
+ query_params: query_params,
186
+ form_params: form_params,
187
+ body: post_body,
188
+ auth_names: auth_names,
189
+ return_type: 'Response')
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug "API called: EligibilityApi#raw_x12_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
192
+ end
193
+ [data, status_code, headers]
194
+ end
195
+ end
196
+ end
197
+ end
198
+ end
@@ -0,0 +1,266 @@
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 AdditionalIdentification
17
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=Y4 Agency Claim Number
18
+ attr_accessor :agency_claim_number
19
+
20
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=CT Contract Number
21
+ attr_accessor :contract_number
22
+
23
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=F6 Health Insurance (HIC) Number
24
+ attr_accessor :health_insurance_claim_number
25
+
26
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=GH Identification Card Serial Number
27
+ attr_accessor :identification_card_serial_number
28
+
29
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=IG Insurance Policy Number
30
+ attr_accessor :insurance_policy_number
31
+
32
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=EA Medical Record Identification Number
33
+ attr_accessor :medical_record_identification_number
34
+
35
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=1W Member Identification Number
36
+ attr_accessor :member_identification_number
37
+
38
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=EJ Patient Account Number
39
+ attr_accessor :patient_account_number
40
+
41
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=N6 Plan Network Identification Number
42
+ attr_accessor :plan_network_identification_number
43
+
44
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=18 Plan Number
45
+ attr_accessor :plan_number
46
+
47
+ # Loop: 2100[C|D], Segment: REF, Element: REF02, Notes: REF01=1L Group or Policy Number
48
+ attr_accessor :policy_number
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ 'agency_claim_number': :agencyClaimNumber,
54
+ 'contract_number': :contractNumber,
55
+ 'health_insurance_claim_number': :healthInsuranceClaimNumber,
56
+ 'identification_card_serial_number': :identificationCardSerialNumber,
57
+ 'insurance_policy_number': :insurancePolicyNumber,
58
+ 'medical_record_identification_number': :medicalRecordIdentificationNumber,
59
+ 'member_identification_number': :memberIdentificationNumber,
60
+ 'patient_account_number': :patientAccountNumber,
61
+ 'plan_network_identification_number': :planNetworkIdentificationNumber,
62
+ 'plan_number': :planNumber,
63
+ 'policy_number': :policyNumber
64
+ }
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.swagger_types
69
+ {
70
+ 'agency_claim_number': :String,
71
+ 'contract_number': :String,
72
+ 'health_insurance_claim_number': :String,
73
+ 'identification_card_serial_number': :String,
74
+ 'insurance_policy_number': :String,
75
+ 'medical_record_identification_number': :String,
76
+ 'member_identification_number': :String,
77
+ 'patient_account_number': :String,
78
+ 'plan_network_identification_number': :String,
79
+ 'plan_number': :String,
80
+ 'policy_number': :String
81
+ }
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ return unless attributes.is_a?(Hash)
88
+
89
+ # convert string to symbol for hash key
90
+ attributes = attributes.transform_keys(&:to_sym)
91
+
92
+ self.agency_claim_number = attributes[:agencyClaimNumber] if attributes.key?(:agencyClaimNumber)
93
+
94
+ self.contract_number = attributes[:contractNumber] if attributes.key?(:contractNumber)
95
+
96
+ self.health_insurance_claim_number = attributes[:healthInsuranceClaimNumber] if attributes.key?(:healthInsuranceClaimNumber)
97
+
98
+ self.identification_card_serial_number = attributes[:identificationCardSerialNumber] if attributes.key?(:identificationCardSerialNumber)
99
+
100
+ self.insurance_policy_number = attributes[:insurancePolicyNumber] if attributes.key?(:insurancePolicyNumber)
101
+
102
+ self.medical_record_identification_number = attributes[:medicalRecordIdentificationNumber] if attributes.key?(:medicalRecordIdentificationNumber)
103
+
104
+ self.member_identification_number = attributes[:memberIdentificationNumber] if attributes.key?(:memberIdentificationNumber)
105
+
106
+ self.patient_account_number = attributes[:patientAccountNumber] if attributes.key?(:patientAccountNumber)
107
+
108
+ self.plan_network_identification_number = attributes[:planNetworkIdentificationNumber] if attributes.key?(:planNetworkIdentificationNumber)
109
+
110
+ self.plan_number = attributes[:planNumber] if attributes.key?(:planNumber)
111
+
112
+ self.policy_number = attributes[:policyNumber] if attributes.key?(:policyNumber)
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ []
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ true
125
+ end
126
+
127
+ # Checks equality by comparing each attribute.
128
+ # @param [Object] Object to be compared
129
+ def ==(o)
130
+ return true if equal?(o)
131
+
132
+ self.class == o.class &&
133
+ agency_claim_number == o.agency_claim_number &&
134
+ contract_number == o.contract_number &&
135
+ health_insurance_claim_number == o.health_insurance_claim_number &&
136
+ identification_card_serial_number == o.identification_card_serial_number &&
137
+ insurance_policy_number == o.insurance_policy_number &&
138
+ medical_record_identification_number == o.medical_record_identification_number &&
139
+ member_identification_number == o.member_identification_number &&
140
+ patient_account_number == o.patient_account_number &&
141
+ plan_network_identification_number == o.plan_network_identification_number &&
142
+ plan_number == o.plan_number &&
143
+ policy_number == o.policy_number
144
+ end
145
+
146
+ # @see the `==` method
147
+ # @param [Object] Object to be compared
148
+ def eql?(o)
149
+ self == o
150
+ end
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Fixnum] Hash code
154
+ def hash
155
+ [agency_claim_number, contract_number, health_insurance_claim_number, identification_card_serial_number, insurance_policy_number, medical_record_identification_number, member_identification_number, patient_account_number, plan_network_identification_number, plan_number, policy_number].hash
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+
164
+ self.class.swagger_types.each_pair do |key, type|
165
+ if type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
169
+ send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(Regexp.last_match(1), v) })
170
+ end
171
+ elsif !attributes[self.class.attribute_map[key]].nil?
172
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
174
+ end
175
+
176
+ self
177
+ end
178
+
179
+ # Deserializes the data based on type
180
+ # @param string type Data type
181
+ # @param string value Value to be deserialized
182
+ # @return [Object] Deserialized data
183
+ def _deserialize(type, value)
184
+ case type.to_sym
185
+ when :DateTime
186
+ DateTime.parse(value)
187
+ when :Date
188
+ Date.parse(value)
189
+ when :String
190
+ value.to_s
191
+ when :Integer
192
+ value.to_i
193
+ when :Float
194
+ value.to_f
195
+ when :BOOLEAN
196
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
197
+ true
198
+ else
199
+ false
200
+ end
201
+ when :Object
202
+ # generic object (usually a Hash), return directly
203
+ value
204
+ when /\AArray<(?<inner_type>.+)>\z/
205
+ inner_type = Regexp.last_match[:inner_type]
206
+ value.map { |v| _deserialize(inner_type, v) }
207
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
208
+ k_type = Regexp.last_match[:k_type]
209
+ v_type = Regexp.last_match[:v_type]
210
+ {}.tap do |hash|
211
+ value.each do |k, v|
212
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
213
+ end
214
+ end
215
+ else # model
216
+ temp_model = SwaggerClient.const_get(type).new
217
+ temp_model.build_from_hash(value)
218
+ end
219
+ end
220
+
221
+ # Returns the string representation of the object
222
+ # @return [String] String presentation of the object
223
+ def to_s
224
+ to_hash.to_s
225
+ end
226
+
227
+ # to_body is an alias to to_hash (backward compatibility)
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_body
230
+ to_hash
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = send(attr)
239
+ next if value.nil?
240
+
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+ end
264
+ end
265
+ end
266
+ end