vericred_client 0.0.9 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +116 -13
  3. data/docs/Base.md +1 -1
  4. data/docs/Drug.md +1 -0
  5. data/docs/DrugCoverage.md +2 -1
  6. data/docs/DrugCoverageResponse.md +1 -1
  7. data/docs/DrugCoveragesApi.md +69 -0
  8. data/docs/DrugPackage.md +1 -0
  9. data/docs/DrugPackagesApi.md +66 -0
  10. data/docs/DrugSearchResponse.md +1 -1
  11. data/docs/DrugsApi.md +0 -61
  12. data/docs/Formulary.md +9 -0
  13. data/docs/FormularyDrugPackageResponse.md +10 -0
  14. data/docs/FormularyResponse.md +9 -0
  15. data/docs/Network.md +1 -1
  16. data/docs/NetworkDetails.md +10 -0
  17. data/docs/NetworkDetailsResponse.md +8 -0
  18. data/docs/NetworkSearchResponse.md +1 -1
  19. data/docs/NetworkSize.md +10 -0
  20. data/docs/NetworkSizesApi.md +124 -0
  21. data/docs/NetworksApi.md +55 -0
  22. data/docs/Plan.md +6 -4
  23. data/docs/PlanSearchResponse.md +2 -2
  24. data/docs/PlanSearchResponseMeta.md +9 -0
  25. data/docs/PlanSearchResult.md +6 -4
  26. data/docs/PlansApi.md +12 -10
  27. data/docs/Provider.md +1 -6
  28. data/docs/ProviderDetails.md +31 -0
  29. data/docs/ProviderGeocode.md +10 -0
  30. data/docs/ProvidersApi.md +61 -7
  31. data/docs/ProvidersGeocodeResponse.md +9 -0
  32. data/docs/ProvidersSearchResponse.md +1 -1
  33. data/docs/RequestPlanFindApplicant.md +2 -0
  34. data/docs/RequestPlanFindDrugPackage.md +1 -0
  35. data/docs/RequestProvidersSearch.md +5 -2
  36. data/docs/StateNetworkSizeRequest.md +9 -0
  37. data/docs/StateNetworkSizeResponse.md +9 -0
  38. data/docs/ZipCountiesApi.md +56 -1
  39. data/lib/vericred_client.rb +103 -2
  40. data/lib/vericred_client/api/drug_coverages_api.rb +295 -0
  41. data/lib/vericred_client/api/drug_packages_api.rb +289 -0
  42. data/lib/vericred_client/api/drugs_api.rb +88 -68
  43. data/lib/vericred_client/api/network_sizes_api.rb +348 -0
  44. data/lib/vericred_client/api/networks_api.rb +145 -1
  45. data/lib/vericred_client/api/plans_api.rb +108 -15
  46. data/lib/vericred_client/api/providers_api.rb +155 -9
  47. data/lib/vericred_client/api/zip_counties_api.rb +148 -4
  48. data/lib/vericred_client/api_client.rb +110 -21
  49. data/lib/vericred_client/api_error.rb +88 -1
  50. data/lib/vericred_client/configuration.rb +88 -1
  51. data/lib/vericred_client/models/applicant.rb +90 -3
  52. data/lib/vericred_client/models/base.rb +91 -4
  53. data/lib/vericred_client/models/carrier.rb +90 -3
  54. data/lib/vericred_client/models/carrier_subsidiary.rb +90 -3
  55. data/lib/vericred_client/models/county.rb +90 -3
  56. data/lib/vericred_client/models/county_bulk.rb +90 -3
  57. data/lib/vericred_client/models/drug.rb +101 -4
  58. data/lib/vericred_client/models/drug_coverage.rb +111 -14
  59. data/lib/vericred_client/models/drug_coverage_response.rb +91 -4
  60. data/lib/vericred_client/models/drug_package.rb +104 -7
  61. data/lib/vericred_client/models/drug_search_response.rb +91 -4
  62. data/lib/vericred_client/models/formulary.rb +404 -0
  63. data/lib/vericred_client/models/formulary_drug_package_response.rb +414 -0
  64. data/lib/vericred_client/models/formulary_response.rb +406 -0
  65. data/lib/vericred_client/models/meta.rb +90 -3
  66. data/lib/vericred_client/models/network.rb +91 -4
  67. data/lib/vericred_client/models/network_details.rb +416 -0
  68. data/lib/vericred_client/models/{pricing.rb → network_details_response.rb} +99 -112
  69. data/lib/vericred_client/models/network_search_response.rb +91 -4
  70. data/lib/vericred_client/models/network_size.rb +414 -0
  71. data/lib/vericred_client/models/plan.rb +115 -8
  72. data/lib/vericred_client/models/plan_county.rb +90 -3
  73. data/lib/vericred_client/models/plan_county_bulk.rb +90 -3
  74. data/lib/vericred_client/models/plan_search_response.rb +93 -6
  75. data/lib/vericred_client/models/plan_search_response_meta.rb +404 -0
  76. data/lib/vericred_client/models/plan_search_result.rb +115 -8
  77. data/lib/vericred_client/models/plan_show_response.rb +90 -3
  78. data/lib/vericred_client/models/provider.rb +101 -66
  79. data/lib/vericred_client/models/provider_details.rb +628 -0
  80. data/lib/vericred_client/models/provider_geocode.rb +414 -0
  81. data/lib/vericred_client/models/provider_show_response.rb +90 -3
  82. data/lib/vericred_client/models/providers_geocode_response.rb +406 -0
  83. data/lib/vericred_client/models/providers_search_response.rb +91 -4
  84. data/lib/vericred_client/models/rating_area.rb +90 -3
  85. data/lib/vericred_client/models/request_plan_find.rb +90 -3
  86. data/lib/vericred_client/models/request_plan_find_applicant.rb +114 -7
  87. data/lib/vericred_client/models/request_plan_find_drug_package.rb +104 -7
  88. data/lib/vericred_client/models/request_plan_find_provider.rb +90 -3
  89. data/lib/vericred_client/models/request_providers_search.rb +143 -26
  90. data/lib/vericred_client/models/service_area.rb +90 -3
  91. data/lib/vericred_client/models/service_area_zip_county.rb +90 -3
  92. data/lib/vericred_client/models/state.rb +90 -3
  93. data/lib/vericred_client/models/state_network_size_request.rb +408 -0
  94. data/lib/vericred_client/models/state_network_size_response.rb +406 -0
  95. data/lib/vericred_client/models/zip_code.rb +90 -3
  96. data/lib/vericred_client/models/zip_counties_response.rb +90 -3
  97. data/lib/vericred_client/models/zip_county.rb +90 -3
  98. data/lib/vericred_client/models/zip_county_bulk.rb +90 -3
  99. data/lib/vericred_client/models/zip_county_response.rb +90 -3
  100. data/lib/vericred_client/version.rb +89 -2
  101. data/spec/api/drug_coverages_api_spec.rb +254 -0
  102. data/spec/api/drug_packages_api_spec.rb +253 -0
  103. data/spec/api/drugs_api_spec.rb +88 -15
  104. data/spec/api/network_sizes_api_spec.rb +266 -0
  105. data/spec/api/networks_api_spec.rb +100 -1
  106. data/spec/api/plans_api_spec.rb +92 -4
  107. data/spec/api/providers_api_spec.rb +102 -3
  108. data/spec/api/zip_counties_api_spec.rb +101 -2
  109. data/spec/api_client_spec.rb +91 -25
  110. data/spec/configuration_spec.rb +88 -1
  111. data/spec/models/applicant_spec.rb +88 -1
  112. data/spec/models/base_spec.rb +88 -1
  113. data/spec/models/carrier_spec.rb +88 -1
  114. data/spec/models/carrier_subsidiary_spec.rb +88 -1
  115. data/spec/models/county_bulk_spec.rb +88 -1
  116. data/spec/models/county_spec.rb +88 -1
  117. data/spec/models/drug_coverage_response_spec.rb +88 -1
  118. data/spec/models/drug_coverage_spec.rb +95 -2
  119. data/spec/models/drug_package_spec.rb +94 -1
  120. data/spec/models/drug_search_response_spec.rb +88 -1
  121. data/spec/models/drug_spec.rb +94 -1
  122. data/spec/models/formulary_drug_package_response_spec.rb +259 -0
  123. data/spec/models/formulary_response_spec.rb +253 -0
  124. data/spec/models/formulary_spec.rb +253 -0
  125. data/spec/models/meta_spec.rb +88 -1
  126. data/spec/models/network_details_response_spec.rb +247 -0
  127. data/spec/models/network_details_spec.rb +259 -0
  128. data/spec/models/network_search_response_spec.rb +88 -1
  129. data/spec/models/network_size_spec.rb +259 -0
  130. data/spec/models/network_spec.rb +88 -1
  131. data/spec/models/plan_county_bulk_spec.rb +88 -1
  132. data/spec/models/plan_county_spec.rb +88 -1
  133. data/spec/models/plan_search_response_meta_spec.rb +253 -0
  134. data/spec/models/plan_search_response_spec.rb +88 -1
  135. data/spec/models/plan_search_result_spec.rb +100 -1
  136. data/spec/models/plan_show_response_spec.rb +88 -1
  137. data/spec/models/plan_spec.rb +100 -1
  138. data/spec/models/provider_details_spec.rb +385 -0
  139. data/spec/models/provider_geocode_spec.rb +259 -0
  140. data/spec/models/provider_show_response_spec.rb +88 -1
  141. data/spec/models/provider_spec.rb +94 -37
  142. data/spec/models/providers_geocode_response_spec.rb +253 -0
  143. data/spec/models/providers_search_response_spec.rb +88 -1
  144. data/spec/models/rating_area_spec.rb +88 -1
  145. data/spec/models/request_plan_find_applicant_spec.rb +100 -1
  146. data/spec/models/request_plan_find_drug_package_spec.rb +94 -1
  147. data/spec/models/request_plan_find_provider_spec.rb +88 -1
  148. data/spec/models/request_plan_find_spec.rb +88 -1
  149. data/spec/models/request_providers_search_spec.rb +109 -4
  150. data/spec/models/service_area_spec.rb +88 -1
  151. data/spec/models/service_area_zip_county_spec.rb +88 -1
  152. data/spec/models/state_network_size_request_spec.rb +253 -0
  153. data/spec/models/state_network_size_response_spec.rb +253 -0
  154. data/spec/models/state_spec.rb +88 -1
  155. data/spec/models/zip_code_spec.rb +88 -1
  156. data/spec/models/zip_counties_response_spec.rb +88 -1
  157. data/spec/models/zip_county_bulk_spec.rb +88 -1
  158. data/spec/models/zip_county_response_spec.rb +88 -1
  159. data/spec/models/zip_county_spec.rb +88 -1
  160. data/spec/spec_helper.rb +88 -1
  161. data/vericred_client.gemspec +90 -2
  162. metadata +66 -16
  163. data/docs/Pricing.md +0 -18
  164. data/spec/models/pricing_spec.rb +0 -220
@@ -6,13 +6,20 @@ accepts.
6
6
 
7
7
  ## Getting Started
8
8
 
9
- Visit our [Developer Portal](https://vericred.3scale.net) to
9
+ Visit our [Developer Portal](https://developers.vericred.com) to
10
10
  create an account.
11
11
 
12
12
  Once you have created an account, you can create one Application for
13
13
  Production and another for our Sandbox (select the appropriate Plan when
14
14
  you create the Application).
15
15
 
16
+ ## SDKs
17
+
18
+ Our API follows standard REST conventions, so you can use any HTTP client
19
+ to integrate with us. You will likely find it easier to use one of our
20
+ [autogenerated SDKs](https://github.com/vericred/?query=vericred-),
21
+ which we make available for several common programming languages.
22
+
16
23
  ## Authentication
17
24
 
18
25
  To authenticate, pass the API Key you created in the Developer Portal as
@@ -108,6 +115,86 @@ The response would be
108
115
  }
109
116
  ```
110
117
 
118
+ ## Benefits summary format
119
+ Benefit cost-share strings are formatted to capture:
120
+ * Network tiers
121
+ * Compound or conditional cost-share
122
+ * Limits on the cost-share
123
+ * Benefit-specific maximum out-of-pocket costs
124
+
125
+ **Example #1**
126
+ As an example, we would represent [this Summary of Benefits & Coverage](https://s3.amazonaws.com/vericred-data/SBC/2017/33602TX0780032.pdf) as:
127
+
128
+ * **Hospital stay facility fees**:
129
+ - Network Provider: `$400 copay/admit plus 20% coinsurance`
130
+ - Out-of-Network Provider: `$1,500 copay/admit plus 50% coinsurance`
131
+ - Vericred's format for this benefit: `In-Network: $400 before deductible then 20% after deductible / Out-of-Network: $1,500 before deductible then 50% after deductible`
132
+
133
+ * **Rehabilitation services:**
134
+ - Network Provider: `20% coinsurance`
135
+ - Out-of-Network Provider: `50% coinsurance`
136
+ - Limitations & Exceptions: `35 visit maximum per benefit period combined with Chiropractic care.`
137
+ - Vericred's format for this benefit: `In-Network: 20% after deductible / Out-of-Network: 50% after deductible | limit: 35 visit(s) per Benefit Period`
138
+
139
+ **Example #2**
140
+ In [this other Summary of Benefits & Coverage](https://s3.amazonaws.com/vericred-data/SBC/2017/40733CA0110568.pdf), the **specialty_drugs** cost-share has a maximum out-of-pocket for in-network pharmacies.
141
+ * **Specialty drugs:**
142
+ - Network Provider: `40% coinsurance up to a $500 maximum for up to a 30 day supply`
143
+ - Out-of-Network Provider `Not covered`
144
+ - Vericred's format for this benefit: `In-Network: 40% after deductible, up to $500 per script / Out-of-Network: 100%`
145
+
146
+ **BNF**
147
+
148
+ Here's a description of the benefits summary string, represented as a context-free grammar:
149
+
150
+ ```
151
+ root ::= coverage
152
+
153
+ coverage ::= (simple_coverage | tiered_coverage) (space pipe space coverage_limitation)?
154
+ tiered_coverage ::= tier (space slash space tier)*
155
+ tier ::= tier_name colon space (tier_coverage | not_applicable)
156
+ tier_coverage ::= simple_coverage (space (then | or | and) space simple_coverage)* tier_limitation?
157
+ simple_coverage ::= (pre_coverage_limitation space)? coverage_amount (space post_coverage_limitation)? (comma? space coverage_condition)?
158
+ coverage_limitation ::= "limit" colon space (((simple_coverage | simple_limitation) (semicolon space see_carrier_documentation)?) | see_carrier_documentation | waived_if_admitted)
159
+ waived_if_admitted ::= ("copay" space)? "waived if admitted"
160
+ simple_limitation ::= pre_coverage_limitation space "copay applies"
161
+ tier_name ::= "In-Network-Tier-2" | "Out-of-Network" | "In-Network"
162
+ tier_limitation ::= comma space "up to" space (currency | (integer space time_unit plural?)) (space post_coverage_limitation)?
163
+ coverage_amount ::= currency | unlimited | included | unknown | percentage | (digits space (treatment_unit | time_unit) plural?)
164
+ pre_coverage_limitation ::= first space digits space time_unit plural?
165
+ post_coverage_limitation ::= (((then space currency) | "per condition") space)? "per" space (treatment_unit | (integer space time_unit) | time_unit) plural?
166
+ coverage_condition ::= ("before deductible" | "after deductible" | "penalty" | allowance | "in-state" | "out-of-state") (space allowance)?
167
+ allowance ::= upto_allowance | after_allowance
168
+ upto_allowance ::= "up to" space (currency space)? "allowance"
169
+ after_allowance ::= "after" space (currency space)? "allowance"
170
+ see_carrier_documentation ::= "see carrier documentation for more information"
171
+ unknown ::= "unknown"
172
+ unlimited ::= /[uU]nlimited/
173
+ included ::= /[iI]ncluded in [mM]edical/
174
+ time_unit ::= /[hH]our/ | (((/[cC]alendar/ | /[cC]ontract/) space)? /[yY]ear/) | /[mM]onth/ | /[dD]ay/ | /[wW]eek/ | /[vV]isit/ | /[lL]ifetime/ | ((((/[bB]enefit/ plural?) | /[eE]ligibility/) space)? /[pP]eriod/)
175
+ treatment_unit ::= /[pP]erson/ | /[gG]roup/ | /[cC]ondition/ | /[sS]cript/ | /[vV]isit/ | /[eE]xam/ | /[iI]tem/ | /[sS]tay/ | /[tT]reatment/ | /[aA]dmission/ | /[eE]pisode/
176
+ comma ::= ","
177
+ colon ::= ":"
178
+ semicolon ::= ";"
179
+ pipe ::= "|"
180
+ slash ::= "/"
181
+ plural ::= "(s)" | "s"
182
+ then ::= "then" | ("," space) | space
183
+ or ::= "or"
184
+ and ::= "and"
185
+ not_applicable ::= "Not Applicable" | "N/A" | "NA"
186
+ first ::= "first"
187
+ currency ::= "$" number
188
+ percentage ::= number "%"
189
+ number ::= float | integer
190
+ float ::= digits "." digits
191
+ integer ::= /[0-9]/+ (comma_int | under_int)*
192
+ comma_int ::= ("," /[0-9]/*3) !"_"
193
+ under_int ::= ("_" /[0-9]/*3) !","
194
+ digits ::= /[0-9]/+ ("_" /[0-9]/+)*
195
+ space ::= /[ \t]/+
196
+ ```
197
+
111
198
 
112
199
 
113
200
  OpenAPI spec version: 1.0.0
@@ -142,7 +229,7 @@ module VericredClient
142
229
  # Our `Plan` endpoints require a zip code and a fips (county) code. This is because plan pricing requires both of these elements. Users are unlikely to know their fips code, so we provide this endpoint to look up a `ZipCounty` by zip code and return both the selected zip and fips codes.
143
230
  # @param zip_prefix Partial five-digit Zip
144
231
  # @param [Hash] opts the optional parameters
145
- # @return [ZipCountyResponse]
232
+ # @return [ZipCountiesResponse]
146
233
  def get_zip_counties(zip_prefix, opts = {})
147
234
  data, _status_code, _headers = get_zip_counties_with_http_info(zip_prefix, opts)
148
235
  return data
@@ -152,7 +239,7 @@ module VericredClient
152
239
  # Our `Plan` endpoints require a zip code and a fips (county) code. This is because plan pricing requires both of these elements. Users are unlikely to know their fips code, so we provide this endpoint to look up a `ZipCounty` by zip code and return both the selected zip and fips codes.
153
240
  # @param zip_prefix Partial five-digit Zip
154
241
  # @param [Hash] opts the optional parameters
155
- # @return [Array<(ZipCountyResponse, Fixnum, Hash)>] ZipCountyResponse data, response status code and response headers
242
+ # @return [Array<(ZipCountiesResponse, Fixnum, Hash)>] ZipCountiesResponse data, response status code and response headers
156
243
  def get_zip_counties_with_http_info(zip_prefix, opts = {})
157
244
  if @api_client.config.debugging
158
245
  @api_client.config.logger.debug "Calling API: ZipCountiesApi.get_zip_counties ..."
@@ -189,11 +276,68 @@ module VericredClient
189
276
  :form_params => form_params,
190
277
  :body => post_body,
191
278
  :auth_names => auth_names,
192
- :return_type => 'ZipCountyResponse')
279
+ :return_type => 'ZipCountiesResponse')
193
280
  if @api_client.config.debugging
194
281
  @api_client.config.logger.debug "API called: ZipCountiesApi#get_zip_counties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
195
282
  end
196
283
  return data, status_code, headers
197
284
  end
285
+
286
+ # Show an individual ZipCounty
287
+ # Our `Plan` endpoints require a zip code and a fips (county) code. This is because plan pricing requires both of these elements. Users are unlikely to know their fips code, so we provide this endpoint to returns the details for a `ZipCounty` by zip code and return both the selected zip and fips codes.
288
+ # @param id Unique ID for ZipCounty
289
+ # @param [Hash] opts the optional parameters
290
+ # @return [ZipCountyResponse]
291
+ def show_zip_county(id, opts = {})
292
+ data, _status_code, _headers = show_zip_county_with_http_info(id, opts)
293
+ return data
294
+ end
295
+
296
+ # Show an individual ZipCounty
297
+ # Our &#x60;Plan&#x60; endpoints require a zip code and a fips (county) code. This is because plan pricing requires both of these elements. Users are unlikely to know their fips code, so we provide this endpoint to returns the details for a &#x60;ZipCounty&#x60; by zip code and return both the selected zip and fips codes.
298
+ # @param id Unique ID for ZipCounty
299
+ # @param [Hash] opts the optional parameters
300
+ # @return [Array<(ZipCountyResponse, Fixnum, Hash)>] ZipCountyResponse data, response status code and response headers
301
+ def show_zip_county_with_http_info(id, opts = {})
302
+ if @api_client.config.debugging
303
+ @api_client.config.logger.debug "Calling API: ZipCountiesApi.show_zip_county ..."
304
+ end
305
+ # verify the required parameter 'id' is set
306
+ fail ArgumentError, "Missing the required parameter 'id' when calling ZipCountiesApi.show_zip_county" if id.nil?
307
+ # resource path
308
+ local_var_path = "/zip_counties/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
309
+
310
+ # query parameters
311
+ query_params = {}
312
+
313
+ # header parameters
314
+ header_params = {}
315
+
316
+ # HTTP header 'Accept' (if needed)
317
+ local_header_accept = []
318
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
319
+
320
+ # HTTP header 'Content-Type'
321
+ local_header_content_type = []
322
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
323
+
324
+ # form parameters
325
+ form_params = {}
326
+
327
+ # http body (model)
328
+ post_body = nil
329
+ auth_names = ['Vericred-Api-Key']
330
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
331
+ :header_params => header_params,
332
+ :query_params => query_params,
333
+ :form_params => form_params,
334
+ :body => post_body,
335
+ :auth_names => auth_names,
336
+ :return_type => 'ZipCountyResponse')
337
+ if @api_client.config.debugging
338
+ @api_client.config.logger.debug "API called: ZipCountiesApi#show_zip_county\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
339
+ end
340
+ return data, status_code, headers
341
+ end
198
342
  end
199
343
  end
@@ -6,13 +6,20 @@ accepts.
6
6
 
7
7
  ## Getting Started
8
8
 
9
- Visit our [Developer Portal](https://vericred.3scale.net) to
9
+ Visit our [Developer Portal](https://developers.vericred.com) to
10
10
  create an account.
11
11
 
12
12
  Once you have created an account, you can create one Application for
13
13
  Production and another for our Sandbox (select the appropriate Plan when
14
14
  you create the Application).
15
15
 
16
+ ## SDKs
17
+
18
+ Our API follows standard REST conventions, so you can use any HTTP client
19
+ to integrate with us. You will likely find it easier to use one of our
20
+ [autogenerated SDKs](https://github.com/vericred/?query=vericred-),
21
+ which we make available for several common programming languages.
22
+
16
23
  ## Authentication
17
24
 
18
25
  To authenticate, pass the API Key you created in the Developer Portal as
@@ -108,6 +115,86 @@ The response would be
108
115
  }
109
116
  ```
110
117
 
118
+ ## Benefits summary format
119
+ Benefit cost-share strings are formatted to capture:
120
+ * Network tiers
121
+ * Compound or conditional cost-share
122
+ * Limits on the cost-share
123
+ * Benefit-specific maximum out-of-pocket costs
124
+
125
+ **Example #1**
126
+ As an example, we would represent [this Summary of Benefits &amp; Coverage](https://s3.amazonaws.com/vericred-data/SBC/2017/33602TX0780032.pdf) as:
127
+
128
+ * **Hospital stay facility fees**:
129
+ - Network Provider: `$400 copay/admit plus 20% coinsurance`
130
+ - Out-of-Network Provider: `$1,500 copay/admit plus 50% coinsurance`
131
+ - Vericred's format for this benefit: `In-Network: $400 before deductible then 20% after deductible / Out-of-Network: $1,500 before deductible then 50% after deductible`
132
+
133
+ * **Rehabilitation services:**
134
+ - Network Provider: `20% coinsurance`
135
+ - Out-of-Network Provider: `50% coinsurance`
136
+ - Limitations & Exceptions: `35 visit maximum per benefit period combined with Chiropractic care.`
137
+ - Vericred's format for this benefit: `In-Network: 20% after deductible / Out-of-Network: 50% after deductible | limit: 35 visit(s) per Benefit Period`
138
+
139
+ **Example #2**
140
+ In [this other Summary of Benefits &amp; Coverage](https://s3.amazonaws.com/vericred-data/SBC/2017/40733CA0110568.pdf), the **specialty_drugs** cost-share has a maximum out-of-pocket for in-network pharmacies.
141
+ * **Specialty drugs:**
142
+ - Network Provider: `40% coinsurance up to a $500 maximum for up to a 30 day supply`
143
+ - Out-of-Network Provider `Not covered`
144
+ - Vericred's format for this benefit: `In-Network: 40% after deductible, up to $500 per script / Out-of-Network: 100%`
145
+
146
+ **BNF**
147
+
148
+ Here's a description of the benefits summary string, represented as a context-free grammar:
149
+
150
+ ```
151
+ root ::= coverage
152
+
153
+ coverage ::= (simple_coverage | tiered_coverage) (space pipe space coverage_limitation)?
154
+ tiered_coverage ::= tier (space slash space tier)*
155
+ tier ::= tier_name colon space (tier_coverage | not_applicable)
156
+ tier_coverage ::= simple_coverage (space (then | or | and) space simple_coverage)* tier_limitation?
157
+ simple_coverage ::= (pre_coverage_limitation space)? coverage_amount (space post_coverage_limitation)? (comma? space coverage_condition)?
158
+ coverage_limitation ::= "limit" colon space (((simple_coverage | simple_limitation) (semicolon space see_carrier_documentation)?) | see_carrier_documentation | waived_if_admitted)
159
+ waived_if_admitted ::= ("copay" space)? "waived if admitted"
160
+ simple_limitation ::= pre_coverage_limitation space "copay applies"
161
+ tier_name ::= "In-Network-Tier-2" | "Out-of-Network" | "In-Network"
162
+ tier_limitation ::= comma space "up to" space (currency | (integer space time_unit plural?)) (space post_coverage_limitation)?
163
+ coverage_amount ::= currency | unlimited | included | unknown | percentage | (digits space (treatment_unit | time_unit) plural?)
164
+ pre_coverage_limitation ::= first space digits space time_unit plural?
165
+ post_coverage_limitation ::= (((then space currency) | "per condition") space)? "per" space (treatment_unit | (integer space time_unit) | time_unit) plural?
166
+ coverage_condition ::= ("before deductible" | "after deductible" | "penalty" | allowance | "in-state" | "out-of-state") (space allowance)?
167
+ allowance ::= upto_allowance | after_allowance
168
+ upto_allowance ::= "up to" space (currency space)? "allowance"
169
+ after_allowance ::= "after" space (currency space)? "allowance"
170
+ see_carrier_documentation ::= "see carrier documentation for more information"
171
+ unknown ::= "unknown"
172
+ unlimited ::= /[uU]nlimited/
173
+ included ::= /[iI]ncluded in [mM]edical/
174
+ time_unit ::= /[hH]our/ | (((/[cC]alendar/ | /[cC]ontract/) space)? /[yY]ear/) | /[mM]onth/ | /[dD]ay/ | /[wW]eek/ | /[vV]isit/ | /[lL]ifetime/ | ((((/[bB]enefit/ plural?) | /[eE]ligibility/) space)? /[pP]eriod/)
175
+ treatment_unit ::= /[pP]erson/ | /[gG]roup/ | /[cC]ondition/ | /[sS]cript/ | /[vV]isit/ | /[eE]xam/ | /[iI]tem/ | /[sS]tay/ | /[tT]reatment/ | /[aA]dmission/ | /[eE]pisode/
176
+ comma ::= ","
177
+ colon ::= ":"
178
+ semicolon ::= ";"
179
+ pipe ::= "|"
180
+ slash ::= "/"
181
+ plural ::= "(s)" | "s"
182
+ then ::= "then" | ("," space) | space
183
+ or ::= "or"
184
+ and ::= "and"
185
+ not_applicable ::= "Not Applicable" | "N/A" | "NA"
186
+ first ::= "first"
187
+ currency ::= "$" number
188
+ percentage ::= number "%"
189
+ number ::= float | integer
190
+ float ::= digits "." digits
191
+ integer ::= /[0-9]/+ (comma_int | under_int)*
192
+ comma_int ::= ("," /[0-9]/*3) !"_"
193
+ under_int ::= ("_" /[0-9]/*3) !","
194
+ digits ::= /[0-9]/+ ("_" /[0-9]/+)*
195
+ space ::= /[ \t]/+
196
+ ```
197
+
111
198
 
112
199
 
113
200
  OpenAPI spec version: 1.0.0
@@ -132,7 +219,7 @@ require 'date'
132
219
  require 'json'
133
220
  require 'logger'
134
221
  require 'tempfile'
135
- require 'typhoeus'
222
+ require 'httpclient'
136
223
  require 'uri'
137
224
 
138
225
  module VericredClient
@@ -165,18 +252,17 @@ module VericredClient
165
252
  # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements:
166
253
  # the data deserialized from response body (could be nil), response status code and response headers.
167
254
  def call_api(http_method, path, opts = {})
168
- request = build_request(http_method, path, opts)
169
- response = request.run
255
+ response = run_request(http_method, path, opts)
170
256
 
171
257
  if @config.debugging
172
258
  @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
173
259
  end
174
260
 
175
- unless response.success?
261
+ unless response.ok?
176
262
  fail ApiError.new(:code => response.code,
177
- :response_headers => response.headers,
263
+ :response_headers => response.header,
178
264
  :response_body => response.body),
179
- response.status_message
265
+ response.reason
180
266
  end
181
267
 
182
268
  if opts[:return_type]
@@ -184,7 +270,7 @@ module VericredClient
184
270
  else
185
271
  data = nil
186
272
  end
187
- return data, response.code, response.headers
273
+ return data, response.code, response.header
188
274
  end
189
275
 
190
276
  # Builds the HTTP request
@@ -195,8 +281,8 @@ module VericredClient
195
281
  # @option opts [Hash] :query_params Query parameters
196
282
  # @option opts [Hash] :form_params Query parameters
197
283
  # @option opts [Object] :body HTTP body (JSON/XML)
198
- # @return [Typhoeus::Request] A Typhoeus Request
199
- def build_request(http_method, path, opts = {})
284
+ # @return [HTTP::Message] An HTTP Message
285
+ def run_request(http_method, path, opts = {})
200
286
  url = build_request_url(path)
201
287
  http_method = http_method.to_sym.downcase
202
288
 
@@ -210,15 +296,8 @@ module VericredClient
210
296
  _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
211
297
 
212
298
  req_opts = {
213
- :method => http_method,
214
- :headers => header_params,
215
- :params => query_params,
216
- :params_encoding => @config.params_encoding,
217
- :timeout => @config.timeout,
218
- :ssl_verifypeer => @config.verify_ssl,
219
- :ssl_verifyhost => _verify_ssl_host,
220
- :sslcert => @config.cert_file,
221
- :sslkey => @config.key_file,
299
+ :header => header_params,
300
+ :query => query_params,
222
301
  :verbose => @config.debugging
223
302
  }
224
303
 
@@ -233,7 +312,7 @@ module VericredClient
233
312
  end
234
313
  end
235
314
 
236
- Typhoeus::Request.new(url, req_opts)
315
+ http_client.send(http_method, url, req_opts)
237
316
  end
238
317
 
239
318
  # Check if the given MIME is a JSON MIME.
@@ -242,7 +321,7 @@ module VericredClient
242
321
  # application/json; charset=UTF8
243
322
  # APPLICATION/JSON
244
323
  # @param [String] mime MIME
245
- # @return [Boolean] True if the MIME is applicaton/json
324
+ # @return [Boolean] True if the MIME is application/json
246
325
  def json_mime?(mime)
247
326
  !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
248
327
  end
@@ -279,6 +358,16 @@ module VericredClient
279
358
  convert_to_type data, return_type
280
359
  end
281
360
 
361
+ # retrieve a new HTTPClient
362
+ # @return [HTTPClient] Instance of Client
363
+ def http_client
364
+ client = HTTPClient.new
365
+ client.receive_timeout = @config.timeout
366
+ client.ssl_config.set_client_cert_file(@config.cert_file, @config.key_file)
367
+ client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT unless @config.verify_ssl
368
+ client
369
+ end
370
+
282
371
  # Convert data to the given return type.
283
372
  # @param [Object] data Data to be converted
284
373
  # @param [String] return_type Return type
@@ -6,13 +6,20 @@ accepts.
6
6
 
7
7
  ## Getting Started
8
8
 
9
- Visit our [Developer Portal](https://vericred.3scale.net) to
9
+ Visit our [Developer Portal](https://developers.vericred.com) to
10
10
  create an account.
11
11
 
12
12
  Once you have created an account, you can create one Application for
13
13
  Production and another for our Sandbox (select the appropriate Plan when
14
14
  you create the Application).
15
15
 
16
+ ## SDKs
17
+
18
+ Our API follows standard REST conventions, so you can use any HTTP client
19
+ to integrate with us. You will likely find it easier to use one of our
20
+ [autogenerated SDKs](https://github.com/vericred/?query=vericred-),
21
+ which we make available for several common programming languages.
22
+
16
23
  ## Authentication
17
24
 
18
25
  To authenticate, pass the API Key you created in the Developer Portal as
@@ -108,6 +115,86 @@ The response would be
108
115
  }
109
116
  ```
110
117
 
118
+ ## Benefits summary format
119
+ Benefit cost-share strings are formatted to capture:
120
+ * Network tiers
121
+ * Compound or conditional cost-share
122
+ * Limits on the cost-share
123
+ * Benefit-specific maximum out-of-pocket costs
124
+
125
+ **Example #1**
126
+ As an example, we would represent [this Summary of Benefits &amp; Coverage](https://s3.amazonaws.com/vericred-data/SBC/2017/33602TX0780032.pdf) as:
127
+
128
+ * **Hospital stay facility fees**:
129
+ - Network Provider: `$400 copay/admit plus 20% coinsurance`
130
+ - Out-of-Network Provider: `$1,500 copay/admit plus 50% coinsurance`
131
+ - Vericred's format for this benefit: `In-Network: $400 before deductible then 20% after deductible / Out-of-Network: $1,500 before deductible then 50% after deductible`
132
+
133
+ * **Rehabilitation services:**
134
+ - Network Provider: `20% coinsurance`
135
+ - Out-of-Network Provider: `50% coinsurance`
136
+ - Limitations & Exceptions: `35 visit maximum per benefit period combined with Chiropractic care.`
137
+ - Vericred's format for this benefit: `In-Network: 20% after deductible / Out-of-Network: 50% after deductible | limit: 35 visit(s) per Benefit Period`
138
+
139
+ **Example #2**
140
+ In [this other Summary of Benefits &amp; Coverage](https://s3.amazonaws.com/vericred-data/SBC/2017/40733CA0110568.pdf), the **specialty_drugs** cost-share has a maximum out-of-pocket for in-network pharmacies.
141
+ * **Specialty drugs:**
142
+ - Network Provider: `40% coinsurance up to a $500 maximum for up to a 30 day supply`
143
+ - Out-of-Network Provider `Not covered`
144
+ - Vericred's format for this benefit: `In-Network: 40% after deductible, up to $500 per script / Out-of-Network: 100%`
145
+
146
+ **BNF**
147
+
148
+ Here's a description of the benefits summary string, represented as a context-free grammar:
149
+
150
+ ```
151
+ root ::= coverage
152
+
153
+ coverage ::= (simple_coverage | tiered_coverage) (space pipe space coverage_limitation)?
154
+ tiered_coverage ::= tier (space slash space tier)*
155
+ tier ::= tier_name colon space (tier_coverage | not_applicable)
156
+ tier_coverage ::= simple_coverage (space (then | or | and) space simple_coverage)* tier_limitation?
157
+ simple_coverage ::= (pre_coverage_limitation space)? coverage_amount (space post_coverage_limitation)? (comma? space coverage_condition)?
158
+ coverage_limitation ::= "limit" colon space (((simple_coverage | simple_limitation) (semicolon space see_carrier_documentation)?) | see_carrier_documentation | waived_if_admitted)
159
+ waived_if_admitted ::= ("copay" space)? "waived if admitted"
160
+ simple_limitation ::= pre_coverage_limitation space "copay applies"
161
+ tier_name ::= "In-Network-Tier-2" | "Out-of-Network" | "In-Network"
162
+ tier_limitation ::= comma space "up to" space (currency | (integer space time_unit plural?)) (space post_coverage_limitation)?
163
+ coverage_amount ::= currency | unlimited | included | unknown | percentage | (digits space (treatment_unit | time_unit) plural?)
164
+ pre_coverage_limitation ::= first space digits space time_unit plural?
165
+ post_coverage_limitation ::= (((then space currency) | "per condition") space)? "per" space (treatment_unit | (integer space time_unit) | time_unit) plural?
166
+ coverage_condition ::= ("before deductible" | "after deductible" | "penalty" | allowance | "in-state" | "out-of-state") (space allowance)?
167
+ allowance ::= upto_allowance | after_allowance
168
+ upto_allowance ::= "up to" space (currency space)? "allowance"
169
+ after_allowance ::= "after" space (currency space)? "allowance"
170
+ see_carrier_documentation ::= "see carrier documentation for more information"
171
+ unknown ::= "unknown"
172
+ unlimited ::= /[uU]nlimited/
173
+ included ::= /[iI]ncluded in [mM]edical/
174
+ time_unit ::= /[hH]our/ | (((/[cC]alendar/ | /[cC]ontract/) space)? /[yY]ear/) | /[mM]onth/ | /[dD]ay/ | /[wW]eek/ | /[vV]isit/ | /[lL]ifetime/ | ((((/[bB]enefit/ plural?) | /[eE]ligibility/) space)? /[pP]eriod/)
175
+ treatment_unit ::= /[pP]erson/ | /[gG]roup/ | /[cC]ondition/ | /[sS]cript/ | /[vV]isit/ | /[eE]xam/ | /[iI]tem/ | /[sS]tay/ | /[tT]reatment/ | /[aA]dmission/ | /[eE]pisode/
176
+ comma ::= ","
177
+ colon ::= ":"
178
+ semicolon ::= ";"
179
+ pipe ::= "|"
180
+ slash ::= "/"
181
+ plural ::= "(s)" | "s"
182
+ then ::= "then" | ("," space) | space
183
+ or ::= "or"
184
+ and ::= "and"
185
+ not_applicable ::= "Not Applicable" | "N/A" | "NA"
186
+ first ::= "first"
187
+ currency ::= "$" number
188
+ percentage ::= number "%"
189
+ number ::= float | integer
190
+ float ::= digits "." digits
191
+ integer ::= /[0-9]/+ (comma_int | under_int)*
192
+ comma_int ::= ("," /[0-9]/*3) !"_"
193
+ under_int ::= ("_" /[0-9]/*3) !","
194
+ digits ::= /[0-9]/+ ("_" /[0-9]/+)*
195
+ space ::= /[ \t]/+
196
+ ```
197
+
111
198
 
112
199
 
113
200
  OpenAPI spec version: 1.0.0