Class: VericredClient::PlansApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PlansApi

Returns a new instance of PlansApi.



137
138
139
# File 'lib/vericred_client/api/plans_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/plans_api.rb', line 135

def api_client
  @api_client
end

Instance Method Details

#find_plans(opts = {}) ⇒ PlanSearchResponse

Find Plans ### Location Information Searching for a set of plans requires a ‘zip_code` and `fips_code` code. These are used to determine pricing and availabity of health plans. This endpoint is paginated. Optionally, you may provide a list of Applicants or Providers ### Applicants This is a list of people who will be covered by the plan. We use this list to calculate the premium. You must include `age` and can include `smoker`, which also factors into pricing in some states. Applicants must include an age. If smoker is omitted, its value is assumed to be false. #### Multiple Applicants To get pricing for multiple applicants, just append multiple sets of data to the URL with the age and smoking status of each applicant next to each other. For example, given two applicants - one age 32 and a non-smoker and one age 29 and a smoker, you could use the following request `GET /plans?zip_code=07451&fips_code=33025&applicants[]=32&applicants[]=29&applicants[]=true` It would also be acceptible to include `applicants[]=false` after the first applicant’s age. ### Providers We identify Providers (Doctors) by their National Practitioner Index number (NPI). If you pass a list of Providers, keyed by their NPI number, we will return a list of which Providers are in and out of network for each plan returned. For example, if we had two providers with the NPI numbers ‘12345` and `23456` you would make the following request `GET /plans?zip_code=07451&fips_code=33025&providers[]=12345&providers[]=23456` ### Enrollment Date To calculate plan pricing and availability, we default to the current date as the enrollment date. To specify a date in the future (or the past), pass a string with the format `YYYY-MM-DD` in the `enrollment_date` parameter. `GET /plans?zip_code=07451&fips_code=33025&enrollment_date=2016-01-01` ### Subsidy On-marketplace plans are eligible for a subsidy based on the `household_size` and `household_income` of the applicants. If you pass those values, we will calculate the `subsidized_premium` and return it for each plan. If no values are provided, the `subsidized_premium` will be the same as the `premium` `GET /plans?zip_code=07451&fips_code=33025&household_size=4&household_income=40000` ### Sorting Plans can be sorted by the `premium`, `carrier_name`, `level`, and `plan_type` fields, by either ascending (as `asc`) or descending (as `dsc) sort under the `sort` field. For example, to sort plans by level, the sort parameter would be `level:asc`.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



146
147
148
149
# File 'lib/vericred_client/api/plans_api.rb', line 146

def find_plans(opts = {})
  data, _status_code, _headers = find_plans_with_http_info(opts)
  return data
end

#find_plans_with_http_info(opts = {}) ⇒ Array<(PlanSearchResponse, Fixnum, Hash)>

Find Plans ### Location Information Searching for a set of plans requires a &#x60;zip_code&#x60; and &#x60;fips_code&#x60; code. These are used to determine pricing and availabity of health plans. This endpoint is paginated. Optionally, you may provide a list of Applicants or Providers ### Applicants This is a list of people who will be covered by the plan. We use this list to calculate the premium. You must include &#x60;age&#x60; and can include &#x60;smoker&#x60;, which also factors into pricing in some states. Applicants must include an age. If smoker is omitted, its value is assumed to be false. #### Multiple Applicants To get pricing for multiple applicants, just append multiple sets of data to the URL with the age and smoking status of each applicant next to each other. For example, given two applicants - one age 32 and a non-smoker and one age 29 and a smoker, you could use the following request &#x60;GET /plans?zip_code&#x3D;07451&amp;fips_code&#x3D;33025&amp;applicants[]&#x3D;32&amp;applicants[]&#x3D;29&amp;applicants[]&#x3D;true&#x60; It would also be acceptible to include &#x60;applicants[]&#x3D;false&#x60; after the first applicant&#39;s age. ### Providers We identify Providers (Doctors) by their National Practitioner Index number (NPI). If you pass a list of Providers, keyed by their NPI number, we will return a list of which Providers are in and out of network for each plan returned. For example, if we had two providers with the NPI numbers &#x60;12345&#x60; and &#x60;23456&#x60; you would make the following request &#x60;GET /plans?zip_code&#x3D;07451&amp;fips_code&#x3D;33025&amp;providers[]&#x3D;12345&amp;providers[]&#x3D;23456&#x60; ### Enrollment Date To calculate plan pricing and availability, we default to the current date as the enrollment date. To specify a date in the future (or the past), pass a string with the format &#x60;YYYY-MM-DD&#x60; in the &#x60;enrollment_date&#x60; parameter. &#x60;GET /plans?zip_code&#x3D;07451&amp;fips_code&#x3D;33025&amp;enrollment_date&#x3D;2016-01-01&#x60; ### Subsidy On-marketplace plans are eligible for a subsidy based on the &#x60;household_size&#x60; and &#x60;household_income&#x60; of the applicants. If you pass those values, we will calculate the &#x60;subsidized_premium&#x60; and return it for each plan. If no values are provided, the &#x60;subsidized_premium&#x60; will be the same as the &#x60;premium&#x60; &#x60;GET /plans?zip_code&#x3D;07451&amp;fips_code&#x3D;33025&amp;household_size&#x3D;4&amp;household_income&#x3D;40000&#x60; ### Sorting Plans can be sorted by the &#x60;premium&#x60;, &#x60;carrier_name&#x60;, &#x60;level&#x60;, and &#x60;plan_type&#x60; fields, by either ascending (as &#x60;asc&#x60;) or descending (as &#x60;dsc) sort under the &#x60;sort&#x60; field. For example, to sort plans by level, the sort parameter would be &#x60;level:asc&#x60;.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    PlanSearchResponse data, response status code and response headers



156
157
158
159
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
# File 'lib/vericred_client/api/plans_api.rb', line 156

def find_plans_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PlansApi.find_plans ..."
  end
  # resource path
  local_var_path = "/plans/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 => 'PlanSearchResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PlansApi#find_plans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#show_plan(opts = {}) ⇒ PlanShowResponse

Show Plan Show the details of an individual Plan. This includes deductibles, maximums out of pocket, and co-pay/coinsurance for benefits

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :year (Integer)

    Plan year (defaults to current year)

Returns:



201
202
203
204
# File 'lib/vericred_client/api/plans_api.rb', line 201

def show_plan(opts = {})
  data, _status_code, _headers = show_plan_with_http_info(opts)
  return data
end

#show_plan_with_http_info(opts = {}) ⇒ Array<(PlanShowResponse, Fixnum, Hash)>

Show Plan Show the details of an individual Plan. This includes deductibles, maximums out of pocket, and co-pay/coinsurance for benefits

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :year (Integer)

    Plan year (defaults to current year)

Returns:

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

    PlanShowResponse data, response status code and response headers



211
212
213
214
215
216
217
218
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
# File 'lib/vericred_client/api/plans_api.rb', line 211

def show_plan_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: PlansApi.show_plan ..."
  end
  # resource path
  local_var_path = "/plans/{id}".sub('{format}','json')

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

  # 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 => 'PlanShowResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PlansApi#show_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end