class VericredClient::DrugsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/vericred_client/api/drugs_api.rb, line 1018
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_drug_coverages(id, year, line_of_coverage, state_code, opts = {}) click to toggle source

Drug Coverage Search Drug coverages are the specific tier level, quantity limit, prior authorization and step therapy for a given Drug/Plan combination. This endpoint returns all drug coverages for a given Drug. #### Tiers Possible values for tier: | Tier | Description | | ———————— | ——————————————————————————————————————————————————————————- | | __generic__ | Unbranded drugs, with the same active ingredients as their brand-name equivalents, and generally available at a lower cost. | | preferred_brand | Brand-name drugs included on the health plan's formulary. Generally more expensive than generics, and less expensive than non-preferred drugs. | | non_preferred_brand | Brand-name drugs not included on the health plan's formulary. These generally have a higher coinsurance. | | __specialty__ | Used to treat complex conditions like cancer. May require special handling or monitoring. May be generic or brand-name. Generally the most expensive drugs covered by a plan. | | not_covered | Specifically excluded from the health plan. | | not_listed | Neither included nor excluded from the health plan. Most plans provide some default level of coverage for unlisted drugs. | @param id ID of the Drug @param year Plan Year @param line_of_coverage Line of coverage (medical or medicare_advantage) @param state_code Two-character state code @param [Hash] opts the optional parameters @option opts [String] :market Plan Market (individual or small_group) @return [DrugCoverageResponse]

# File lib/vericred_client/api/drugs_api.rb, line 1031
def get_drug_coverages(id, year, line_of_coverage, state_code, opts = {})
  data, _status_code, _headers = get_drug_coverages_with_http_info(id, year, line_of_coverage, state_code, opts)
  return data
end
get_drug_coverages_with_http_info(id, year, line_of_coverage, state_code, opts = {}) click to toggle source

Drug Coverage Search Drug coverages are the specific tier level, quantity limit, prior authorization and step therapy for a given Drug/Plan combination. This endpoint returns all drug coverages for a given Drug. #### Tiers Possible values for tier: | Tier | Description | | ———————— | ——————————————————————————————————————————————————————————- | | __generic__ | Unbranded drugs, with the same active ingredients as their brand-name equivalents, and generally available at a lower cost. | | preferred_brand | Brand-name drugs included on the health plan&#39;s formulary. Generally more expensive than generics, and less expensive than non-preferred drugs. | | non_preferred_brand | Brand-name drugs not included on the health plan&#39;s formulary. These generally have a higher coinsurance. | | __specialty__ | Used to treat complex conditions like cancer. May require special handling or monitoring. May be generic or brand-name. Generally the most expensive drugs covered by a plan. | | not_covered | Specifically excluded from the health plan. | | not_listed | Neither included nor excluded from the health plan. Most plans provide some default level of coverage for unlisted drugs. | @param id ID of the Drug @param year Plan Year @param line_of_coverage Line of coverage (medical or medicare_advantage) @param state_code Two-character state code @param [Hash] opts the optional parameters @option opts [String] :market Plan Market (individual or small_group) @return [Array<(DrugCoverageResponse, Fixnum, Hash)>] DrugCoverageResponse data, response status code and response headers

# File lib/vericred_client/api/drugs_api.rb, line 1045
def get_drug_coverages_with_http_info(id, year, line_of_coverage, state_code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DrugsApi.get_drug_coverages ..."
  end
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling DrugsApi.get_drug_coverages" if id.nil?
  # verify the required parameter 'year' is set
  fail ArgumentError, "Missing the required parameter 'year' when calling DrugsApi.get_drug_coverages" if year.nil?
  # verify the required parameter 'line_of_coverage' is set
  fail ArgumentError, "Missing the required parameter 'line_of_coverage' when calling DrugsApi.get_drug_coverages" if line_of_coverage.nil?
  # verify the required parameter 'state_code' is set
  fail ArgumentError, "Missing the required parameter 'state_code' when calling DrugsApi.get_drug_coverages" if state_code.nil?
  # resource path
  local_var_path = "/drugs/{id}/coverages".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}
  query_params[:'year'] = year
  query_params[:'line_of_coverage'] = line_of_coverage
  query_params[:'state_code'] = state_code
  query_params[:'market'] = opts[:'market'] if !opts[:'market'].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 => 'DrugCoverageResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DrugsApi#get_drug_coverages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_drugs(search_term, opts = {}) click to toggle source

Drug Search Search for drugs by proprietary name. **New Verison:** In order to use this endpoint, please set your version header to `v7`. We still support previous versions of this endpoint. For more information on how to set version headers, see [Versioning](header-versioning) of this document. @param search_term Full or partial proprietary name of drug @param [Hash] opts the optional parameters @return [DrugDetails]

# File lib/vericred_client/api/drugs_api.rb, line 1102
def list_drugs(search_term, opts = {})
  data, _status_code, _headers = list_drugs_with_http_info(search_term, opts)
  return data
end
list_drugs_with_http_info(search_term, opts = {}) click to toggle source

Drug Search Search for drugs by proprietary name. **New Verison:** In order to use this endpoint, please set your version header to &#x60;v7&#x60;. We still support previous versions of this endpoint. For more information on how to set version headers, see [Versioning](header-versioning) of this document. @param search_term Full or partial proprietary name of drug @param [Hash] opts the optional parameters @return [Array<(DrugDetails, Fixnum, Hash)>] DrugDetails data, response status code and response headers

# File lib/vericred_client/api/drugs_api.rb, line 1112
def list_drugs_with_http_info(search_term, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DrugsApi.list_drugs ..."
  end
  # verify the required parameter 'search_term' is set
  fail ArgumentError, "Missing the required parameter 'search_term' when calling DrugsApi.list_drugs" if search_term.nil?
  # resource path
  local_var_path = "/drugs".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'search_term'] = search_term

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  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 = ['application/json']
  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 => 'DrugDetails')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DrugsApi#list_drugs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end