Class: VericredClient::MedicalPlansApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MedicalPlansApi

Returns a new instance of MedicalPlansApi.



19
20
21
# File 'lib/vericred_client/api/medical_plans_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/vericred_client/api/medical_plans_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#find_plans(body, 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/medical?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/medical?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/medical?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/medical?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`. ### Drug coverages Are included along with the rest of the plan data. See [the description below](#drugcoverages) for more details.

Parameters:

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/vericred_client/api/medical_plans_api.rb', line 28

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

#find_plans_with_http_info(body, 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/medical?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/medical?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/medical?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/medical?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&#x60;) sort under the &#x60;sort&#x60; field. For example, to sort plans by level, the sort parameter would be &#x60;level:asc&#x60;. ### Drug coverages Are included along with the rest of the plan data. See [the description below](#drugcoverages) for more details.

Parameters:

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

    the optional parameters

Returns:

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

    PlanSearchResponse data, response status code and response headers



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/vericred_client/api/medical_plans_api.rb', line 38

def find_plans_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MedicalPlansApi.find_plans ..."
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling MedicalPlansApi.find_plans"
  end
  # resource path
  local_var_path = "/plans/medical/search"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(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: MedicalPlansApi#find_plans\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_medical_plan(vericred_id, body, opts = {}) ⇒ nil

Create/update a Medical Plan Add or update a Medical Plan to the database.

Parameters:

  • vericred_id

    The unique Vericred id

  • body

    Medical Plan Record

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

    the optional parameters

Returns:

  • (nil)


80
81
82
83
# File 'lib/vericred_client/api/medical_plans_api.rb', line 80

def put_medical_plan(vericred_id, body, opts = {})
  put_medical_plan_with_http_info(vericred_id, body, opts)
  return nil
end

#put_medical_plan_with_http_info(vericred_id, body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create/update a Medical Plan Add or update a Medical Plan to the database.

Parameters:

  • vericred_id

    The unique Vericred id

  • body

    Medical Plan Record

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/vericred_client/api/medical_plans_api.rb', line 91

def put_medical_plan_with_http_info(vericred_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MedicalPlansApi.put_medical_plan ..."
  end
  # verify the required parameter 'vericred_id' is set
  if @api_client.config.client_side_validation && vericred_id.nil?
    fail ArgumentError, "Missing the required parameter 'vericred_id' when calling MedicalPlansApi.put_medical_plan"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling MedicalPlansApi.put_medical_plan"
  end
  # resource path
  local_var_path = "/plans/medical/{vericred_id}".sub('{' + 'vericred_id' + '}', vericred_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['Vericred-Api-Key']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MedicalPlansApi#put_medical_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#show_plan(id, opts = {}) ⇒ PlanShowResponse

Show Plan Show the details of an individual Plan. This includes deductibles, maximums out of pocket, and co-pay/coinsurance for benefits (See [Benefits summary format](#header-benefits-summary-format) above.)

Parameters:

  • id

    ID of the Plan

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

    the optional parameters

Options Hash (opts):

  • :year (Integer)

    Plan year (defaults to current year)

Returns:



140
141
142
143
# File 'lib/vericred_client/api/medical_plans_api.rb', line 140

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

#show_plan_with_http_info(id, 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 (See [Benefits summary format](#header-benefits-summary-format) above.)

Parameters:

  • id

    ID of the Plan

  • 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



151
152
153
154
155
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
# File 'lib/vericred_client/api/medical_plans_api.rb', line 151

def show_plan_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: MedicalPlansApi.show_plan ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling MedicalPlansApi.show_plan"
  end
  # resource path
  local_var_path = "/plans/medical/{id}".sub('{' + 'id' + '}', id.to_s)

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

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # 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: MedicalPlansApi#show_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end