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.



137
138
139
# File 'lib/vericred_client/api/providers_api.rb', line 137

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



135
136
137
# File 'lib/vericred_client/api/providers_api.rb', line 135

def api_client
  @api_client
end

Instance Method Details

#get_provider(npi, opts = {}) ⇒ ProviderShowResponse

Find a Provider To retrieve a specific provider, just perform a GET using his NPI number

Parameters:

  • npi

    NPI number

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

    the optional parameters

Options Hash (opts):

  • :year (String)

    Only show plan ids for the given year

  • :state (String)

    Only show plan ids for the given state

Returns:



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

def get_provider(npi, opts = {})
  data, _status_code, _headers = get_provider_with_http_info(npi, opts)
  return data
end

#get_provider_with_http_info(npi, opts = {}) ⇒ Array<(ProviderShowResponse, Fixnum, Hash)>

Find a Provider To retrieve a specific provider, just perform a GET using his NPI number

Parameters:

  • npi

    NPI number

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

    the optional parameters

Options Hash (opts):

  • :year (String)

    Only show plan ids for the given year

  • :state (String)

    Only show plan ids for the given state

Returns:

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

    ProviderShowResponse data, response status code and response headers



160
161
162
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
# File 'lib/vericred_client/api/providers_api.rb', line 160

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

  # query parameters
  query_params = {}
  query_params[:'year'] = opts[:'year'] if !opts[:'year'].nil?
  query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?

  # 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 = ['Vericred-Api-Key']
  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 => 'ProviderShowResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProvidersApi#get_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_providers(opts = {}) ⇒ ProvidersSearchResponse

Find Providers All ‘Provider` searches require a `zip_code`, which we use for weighting the search results to favor `Provider`s that are near the user. For example, we would want "Dr. John Smith" who is 5 miles away to appear before "Dr. John Smith" who is 100 miles away. The weighting also allows for non-exact matches. In our prior example, we would want "Dr. Jon Smith" who is 2 miles away to appear before the exact match "Dr. John Smith" who is 100 miles away because it is more likely that the user just entered an incorrect name. The free text search also supports Specialty name search and "body part" Specialty name search. So, searching "John Smith nose" would return "Dr. John Smith", the ENT Specialist before "Dr. John Smith" the Internist.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



209
210
211
212
# File 'lib/vericred_client/api/providers_api.rb', line 209

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

#get_providers_with_http_info(opts = {}) ⇒ Array<(ProvidersSearchResponse, Fixnum, Hash)>

Find Providers All &#x60;Provider&#x60; searches require a &#x60;zip_code&#x60;, which we use for weighting the search results to favor &#x60;Provider&#x60;s that are near the user. For example, we would want &quot;Dr. John Smith&quot; who is 5 miles away to appear before &quot;Dr. John Smith&quot; who is 100 miles away. The weighting also allows for non-exact matches. In our prior example, we would want &quot;Dr. Jon Smith&quot; who is 2 miles away to appear before the exact match &quot;Dr. John Smith&quot; who is 100 miles away because it is more likely that the user just entered an incorrect name. The free text search also supports Specialty name search and &quot;body part&quot; Specialty name search. So, searching &quot;John Smith nose&quot; would return &quot;Dr. John Smith&quot;, the ENT Specialist before &quot;Dr. John Smith&quot; the Internist.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    ProvidersSearchResponse data, response status code and response headers



219
220
221
222
223
224
225
226
227
228
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
# File 'lib/vericred_client/api/providers_api.rb', line 219

def get_providers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProvidersApi.get_providers ..."
  end
  # resource path
  local_var_path = "/providers/search".sub('{format}','json')

  # 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 = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['Vericred-Api-Key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ProvidersSearchResponse')
  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