Class: VericredClient::DrugsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DrugsApi

Returns a new instance of DrugsApi.



1018
1019
1020
# File 'lib/vericred_client/api/drugs_api.rb', line 1018

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



1016
1017
1018
# File 'lib/vericred_client/api/drugs_api.rb', line 1016

def api_client
  @api_client
end

Instance Method Details

#get_drug_coverages(id, year, line_of_coverage, state_code, opts = {}) ⇒ DrugCoverageResponse

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. |

Parameters:

  • id

    ID of the Drug

  • year

    Plan Year

  • line_of_coverage

    Line of coverage (medical or medicare_advantage)

  • state_code

    Two-character state code

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

    the optional parameters

Options Hash (opts):

  • :market (String)

    Plan Market (individual or small_group)

Returns:



1031
1032
1033
1034
# 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 = {}) ⇒ Array<(DrugCoverageResponse, Fixnum, Hash)>

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. |

Parameters:

  • id

    ID of the Drug

  • year

    Plan Year

  • line_of_coverage

    Line of coverage (medical or medicare_advantage)

  • state_code

    Two-character state code

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

    the optional parameters

Options Hash (opts):

  • :market (String)

    Plan Market (individual or small_group)

Returns:

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

    DrugCoverageResponse data, response status code and response headers



1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
# 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 = {}) ⇒ DrugDetails

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.

Parameters:

  • search_term

    Full or partial proprietary name of drug

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

    the optional parameters

Returns:



1102
1103
1104
1105
# 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 = {}) ⇒ Array<(DrugDetails, Fixnum, Hash)>

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.

Parameters:

  • search_term

    Full or partial proprietary name of drug

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

    the optional parameters

Returns:

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

    DrugDetails data, response status code and response headers



1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
# 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