Class: VericredClient::ProvidersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/vericred_client/api/providers_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProvidersApi

Returns a new instance of ProvidersApi.



132
133
134
# File 'lib/vericred_client/api/providers_api.rb', line 132

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



130
131
132
# File 'lib/vericred_client/api/providers_api.rb', line 130

def api_client
  @api_client
end

Instance Method Details

#get_providers(search_term, zip_code, opts = {}) ⇒ ProviderResponse

Parameters:

  • search_term

    String to search by

  • zip_code

    Zip Code to search near

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :accepts_insurance (String)

    Limit results to Providers who accept at least one insurance plan. Note that the inverse of this filter is not supported and any value will evaluate to true

  • :page (String)

    Page number

  • :per_page (String)

    Number of records to return per page

  • :radius (String)

    Radius (in miles) to use to limit results

  • :type (String)

    Either organization or individual

Returns:



147
148
149
150
# File 'lib/vericred_client/api/providers_api.rb', line 147

def get_providers(search_term, zip_code, opts = {})
  data, _status_code, _headers = get_providers_with_http_info(search_term, zip_code, opts)
  return data
end

#get_providers_npi(npi, opts = {}) ⇒ ProviderResponse

Parameters:

  • npi

    NPI number

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



219
220
221
222
# File 'lib/vericred_client/api/providers_api.rb', line 219

def get_providers_npi(npi, opts = {})
  data, _status_code, _headers = get_providers_npi_with_http_info(npi, opts)
  return data
end

#get_providers_npi_with_http_info(npi, opts = {}) ⇒ Array<(ProviderResponse, Fixnum, Hash)>

Returns ProviderResponse data, response status code and response headers.

Parameters:

  • npi

    NPI number

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ProviderResponse, Fixnum, Hash)>)

    ProviderResponse data, response status code and response headers



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/vericred_client/api/providers_api.rb', line 229

def get_providers_npi_with_http_info(npi, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProvidersApi.get_providers_npi ..."
  end
  # verify the required parameter 'npi' is set
  fail ArgumentError, "Missing the required parameter 'npi' when calling ProvidersApi.get_providers_npi" if npi.nil?
  # resource path
  local_var_path = "/providers/{npi}".sub('{format}','json').sub('{' + 'npi' + '}', npi.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ProviderResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProvidersApi#get_providers_npi\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_providers_with_http_info(search_term, zip_code, opts = {}) ⇒ Array<(ProviderResponse, Fixnum, Hash)>

Returns ProviderResponse data, response status code and response headers.

Parameters:

  • search_term

    String to search by

  • zip_code

    Zip Code to search near

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :accepts_insurance (String)

    Limit results to Providers who accept at least one insurance plan. Note that the inverse of this filter is not supported and any value will evaluate to true

  • :page (String)

    Page number

  • :per_page (String)

    Number of records to return per page

  • :radius (String)

    Radius (in miles) to use to limit results

  • :type (String)

    Either organization or individual

Returns:

  • (Array<(ProviderResponse, Fixnum, Hash)>)

    ProviderResponse data, response status code and response headers



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/vericred_client/api/providers_api.rb', line 163

def get_providers_with_http_info(search_term, zip_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProvidersApi.get_providers ..."
  end
  # verify the required parameter 'search_term' is set
  fail ArgumentError, "Missing the required parameter 'search_term' when calling ProvidersApi.get_providers" if search_term.nil?
  # verify the required parameter 'zip_code' is set
  fail ArgumentError, "Missing the required parameter 'zip_code' when calling ProvidersApi.get_providers" if zip_code.nil?
  # resource path
  local_var_path = "/providers".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'search_term'] = search_term
  query_params[:'zip_code'] = zip_code
  query_params[:'accepts_insurance'] = opts[:'accepts_insurance'] if opts[:'accepts_insurance']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'per_page'] = opts[:'per_page'] if opts[:'per_page']
  query_params[:'radius'] = opts[:'radius'] if opts[:'radius']
  query_params[:'type'] = opts[:'type'] if opts[:'type']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ProviderResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProvidersApi#get_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end