# vericred-client

vericredClient - JavaScript client for vericred-client
Vericred's API allows you to search for Health Plans that a specific doctor
accepts.

## Getting Started

Visit our [Developer Portal](https://developers.vericred.com) to
create an account.

Once you have created an account, you can create one Application for
Production and another for our Sandbox (select the appropriate Plan when
you create the Application).

## SDKs

Our API follows standard REST conventions, so you can use any HTTP client
to integrate with us. You will likely find it easier to use one of our
[autogenerated SDKs](https://github.com/vericred/?query=vericred-),
which we make available for several common programming languages.

## Authentication

To authenticate, pass the API Key you created in the Developer Portal as
a `Vericred-Api-Key` header.

`curl -H 'Vericred-Api-Key: YOUR_KEY' "https://api.vericred.com/providers?search_term=Foo&zip_code=11215"`

## Versioning

Vericred's API default to the latest version.  However, if you need a specific
version, you can request it with an `Accept-Version` header.

The current version is `v3`.  Previous versions are `v1` and `v2`.

`curl -H 'Vericred-Api-Key: YOUR_KEY' -H 'Accept-Version: v2' "https://api.vericred.com/providers?search_term=Foo&zip_code=11215"`

## Pagination

Endpoints that accept `page` and `per_page` parameters are paginated. They expose
four additional fields that contain data about your position in the response,
namely `Total`, `Per-Page`, `Link`, and `Page` as described in [RFC-5988](https://tools.ietf.org/html/rfc5988).

For example, to display 5 results per page and view the second page of a
`GET` to `/networks`, your final request would be `GET /networks?....page=2&per_page=5`.

## Sideloading

When we return multiple levels of an object graph (e.g. `Provider`s and their `State`s
we sideload the associated data.  In this example, we would provide an Array of
`State`s and a `state_id` for each provider.  This is done primarily to reduce the
payload size since many of the `Provider`s will share a `State`

```
{
  providers: [{ id: 1, state_id: 1}, { id: 2, state_id: 1 }],
  states: [{ id: 1, code: 'NY' }]
}
```

If you need the second level of the object graph, you can just match the
corresponding id.

## Selecting specific data

All endpoints allow you to specify which fields you would like to return.
This allows you to limit the response to contain only the data you need.

For example, let's take a request that returns the following JSON by default

```
{
  provider: {
    id: 1,
    name: 'John',
    phone: '1234567890',
    field_we_dont_care_about: 'value_we_dont_care_about'
  },
  states: [{
    id: 1,
    name: 'New York',
    code: 'NY',
    field_we_dont_care_about: 'value_we_dont_care_about'
  }]
}
```

To limit our results to only return the fields we care about, we specify the
`select` query string parameter for the corresponding fields in the JSON
document.

In this case, we want to select `name` and `phone` from the `provider` key,
so we would add the parameters `select=provider.name,provider.phone`.
We also want the `name` and `code` from the `states` key, so we would
add the parameters `select=states.name,states.code`.  The id field of
each document is always returned whether or not it is requested.

Our final request would be `GET /providers/12345?select=provider.name,provider.phone,states.name,states.code`

The response would be

```
{
  provider: {
    id: 1,
    name: 'John',
    phone: '1234567890'
  },
  states: [{
    id: 1,
    name: 'New York',
    code: 'NY'
  }]
}
```

## Benefits summary format
Benefit cost-share strings are formatted to capture:
 * Network tiers
 * Compound or conditional cost-share
 * Limits on the cost-share
 * Benefit-specific maximum out-of-pocket costs

**Example #1**
As an example, we would represent [this Summary of Benefits &amp; Coverage](https://s3.amazonaws.com/vericred-data/SBC/2017/33602TX0780032.pdf) as:

* **Hospital stay facility fees**:
  - Network Provider: `$400 copay/admit plus 20% coinsurance`
  - Out-of-Network Provider: `$1,500 copay/admit plus 50% coinsurance`
  - 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`

* **Rehabilitation services:**
  - Network Provider: `20% coinsurance`
  - Out-of-Network Provider: `50% coinsurance`
  - Limitations & Exceptions: `35 visit maximum per benefit period combined with Chiropractic care.`
  - Vericred's format for this benefit: `In-Network: 20% after deductible / Out-of-Network: 50% after deductible | limit: 35 visit(s) per Benefit Period`

**Example #2**
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.
* **Specialty drugs:**
  - Network Provider: `40% coinsurance up to a $500 maximum for up to a 30 day supply`
  - Out-of-Network Provider `Not covered`
  - Vericred's format for this benefit: `In-Network: 40% after deductible, up to $500 per script / Out-of-Network: 100%`

**BNF**

Here's a description of the benefits summary string, represented as a context-free grammar:

```
root                      ::= coverage

coverage                  ::= (simple_coverage | tiered_coverage) (space pipe space coverage_modifier)?
tiered_coverage           ::= tier (space slash space tier)*
tier                      ::= tier_name colon space (tier_coverage | not_applicable)
tier_coverage             ::= simple_coverage (space (then | or | and) space simple_coverage)* tier_limitation?
simple_coverage           ::= (pre_coverage_limitation space)? coverage_amount (space post_coverage_limitation)? (comma? space coverage_condition)?
coverage_modifier         ::= limit_condition colon space (((simple_coverage | simple_limitation) (semicolon space see_carrier_documentation)?) | see_carrier_documentation | waived_if_admitted | shared_across_tiers)
waived_if_admitted        ::= ("copay" space)? "waived if admitted"
simple_limitation         ::= pre_coverage_limitation space "copay applies"
tier_name                 ::= "In-Network-Tier-2" | "Out-of-Network" | "In-Network"
limit_condition           ::= "limit" | "condition"
tier_limitation           ::= comma space "up to" space (currency | (integer space time_unit plural?)) (space post_coverage_limitation)?
coverage_amount           ::= currency | unlimited | included | unknown | percentage | (digits space (treatment_unit | time_unit) plural?)
pre_coverage_limitation   ::= first space digits space time_unit plural?
post_coverage_limitation  ::= (((then space currency) | "per condition") space)? "per" space (treatment_unit | (integer space time_unit) | time_unit) plural?
coverage_condition        ::= ("before deductible" | "after deductible" | "penalty" | allowance | "in-state" | "out-of-state") (space allowance)?
allowance                 ::= upto_allowance | after_allowance
upto_allowance            ::= "up to" space (currency space)? "allowance"
after_allowance           ::= "after" space (currency space)? "allowance"
see_carrier_documentation ::= "see carrier documentation for more information"
shared_across_tiers       ::= "shared across all tiers"
unknown                   ::= "unknown"
unlimited                 ::= /[uU]nlimited/
included                  ::= /[iI]ncluded in [mM]edical/
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/)
treatment_unit            ::= /[pP]erson/ | /[gG]roup/ | /[cC]ondition/ | /[sS]cript/ | /[vV]isit/ | /[eE]xam/ | /[iI]tem/ | /[sS]tay/ | /[tT]reatment/ | /[aA]dmission/ | /[eE]pisode/
comma                     ::= ","
colon                     ::= ":"
semicolon                 ::= ";"
pipe                      ::= "|"
slash                     ::= "/"
plural                    ::= "(s)" | "s"
then                      ::= "then" | ("," space) | space
or                        ::= "or"
and                       ::= "and"
not_applicable            ::= "Not Applicable" | "N/A" | "NA"
first                     ::= "first"
currency                  ::= "$" number
percentage                ::= number "%"
number                    ::= float | integer
float                     ::= digits "." digits
integer                   ::= /[0-9]/+ (comma_int | under_int)*
comma_int                 ::= ("," /[0-9]/*3) !"_"
under_int                 ::= ("_" /[0-9]/*3) !","
digits                    ::= /[0-9]/+ ("_" /[0-9]/+)*
space                     ::= /[ \t]/+
```


This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 1.0.0
- Package version: 0.0.12
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install vericred-client --save
```

#### git
#
If the library is hosted at a git repository, e.g.
https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
    npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var vericredClient = require('vericred-client');

var defaultClient = vericredClient.ApiClient.instance;

// Configure API key authorization: Vericred-Api-Key
var vericred_key = defaultClient.authentications['Vericred-Api-Key'];
vericred_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//vericred_key.apiKeyPrefix['Vericred-Api-Key'] = "Token"

var api = new vericredClient.DrugCoveragesApi()

var ndcPackageCode = "07777-3105-01"; // {String} NDC package code

var audience = "individual"; // {String} Plan Audience (individual or small_group)

var stateCode = "CA"; // {String} Two-character state code


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getDrugCoverages(ndcPackageCode, audience, stateCode, callback);

```

## Documentation for API Endpoints

All URIs are relative to *https://api.vericred.com/*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*vericredClient.DrugCoveragesApi* | [**getDrugCoverages**](docs/DrugCoveragesApi.md#getDrugCoverages) | **GET** /drug_packages/{ndc_package_code}/coverages | Search for DrugCoverages
*vericredClient.DrugPackagesApi* | [**showFormularyDrugPackageCoverage**](docs/DrugPackagesApi.md#showFormularyDrugPackageCoverage) | **GET** /formularies/{formulary_id}/drug_packages/{ndc_package_code} | Formulary Drug Package Search
*vericredClient.DrugsApi* | [**listDrugs**](docs/DrugsApi.md#listDrugs) | **GET** /drugs | Drug Search
*vericredClient.FormulariesApi* | [**listFormularies**](docs/FormulariesApi.md#listFormularies) | **GET** /formularies | Formulary Search
*vericredClient.MedicalPlansApi* | [**findPlans**](docs/MedicalPlansApi.md#findPlans) | **POST** /plans/medical/search | Find Plans
*vericredClient.MedicalPlansApi* | [**showPlan**](docs/MedicalPlansApi.md#showPlan) | **GET** /plans/medical/{id} | Show Plan
*vericredClient.NetworkSizesApi* | [**listStateNetworkSizes**](docs/NetworkSizesApi.md#listStateNetworkSizes) | **GET** /states/{state_id}/network_sizes | State Network Sizes
*vericredClient.NetworkSizesApi* | [**searchNetworkSizes**](docs/NetworkSizesApi.md#searchNetworkSizes) | **POST** /network_sizes/search | Network Sizes
*vericredClient.NetworksApi* | [**createNetworkComparisons**](docs/NetworksApi.md#createNetworkComparisons) | **POST** /networks/{id}/network_comparisons | Network Comparisons
*vericredClient.NetworksApi* | [**listNetworks**](docs/NetworksApi.md#listNetworks) | **GET** /networks | Networks
*vericredClient.NetworksApi* | [**showNetwork**](docs/NetworksApi.md#showNetwork) | **GET** /networks/{id} | Network Details
*vericredClient.PlansApi* | [**findPlans**](docs/PlansApi.md#findPlans) | **POST** /plans/search | Find Plans
*vericredClient.PlansApi* | [**showPlan**](docs/PlansApi.md#showPlan) | **GET** /plans/{id} | Show Plan
*vericredClient.ProviderNotificationSubscriptionsApi* | [**createProviderNotificationSubscription**](docs/ProviderNotificationSubscriptionsApi.md#createProviderNotificationSubscription) | **POST** /providers/subscription | Subscribe
*vericredClient.ProviderNotificationSubscriptionsApi* | [**deleteProviderNotificationSubscription**](docs/ProviderNotificationSubscriptionsApi.md#deleteProviderNotificationSubscription) | **DELETE** /providers/subscription/{nonce} | Unsubscribe
*vericredClient.ProviderNotificationSubscriptionsApi* | [**notifyProviderNotificationSubscription**](docs/ProviderNotificationSubscriptionsApi.md#notifyProviderNotificationSubscription) | **POST** /CALLBACK_URL | Webhook
*vericredClient.ProvidersApi* | [**getProvider**](docs/ProvidersApi.md#getProvider) | **GET** /providers/{npi} | Find a Provider
*vericredClient.ProvidersApi* | [**getProviders**](docs/ProvidersApi.md#getProviders) | **POST** /providers/search | Find Providers
*vericredClient.ProvidersApi* | [**getProviders_0**](docs/ProvidersApi.md#getProviders_0) | **POST** /providers/search/geocode | Find Providers
*vericredClient.ZipCountiesApi* | [**getZipCounties**](docs/ZipCountiesApi.md#getZipCounties) | **GET** /zip_counties | Search for Zip Counties
*vericredClient.ZipCountiesApi* | [**showZipCounty**](docs/ZipCountiesApi.md#showZipCounty) | **GET** /zip_counties/{id} | Show an individual ZipCounty


## Documentation for Models

 - [vericredClient.ACAPlan](docs/ACAPlan.md)
 - [vericredClient.ACAPlan2018](docs/ACAPlan2018.md)
 - [vericredClient.ACAPlan2018SearchResponse](docs/ACAPlan2018SearchResponse.md)
 - [vericredClient.ACAPlan2018SearchResult](docs/ACAPlan2018SearchResult.md)
 - [vericredClient.ACAPlan2018ShowResponse](docs/ACAPlan2018ShowResponse.md)
 - [vericredClient.ACAPlanPre2018](docs/ACAPlanPre2018.md)
 - [vericredClient.ACAPlanPre2018SearchResponse](docs/ACAPlanPre2018SearchResponse.md)
 - [vericredClient.ACAPlanPre2018SearchResult](docs/ACAPlanPre2018SearchResult.md)
 - [vericredClient.ACAPlanPre2018ShowResponse](docs/ACAPlanPre2018ShowResponse.md)
 - [vericredClient.Base](docs/Base.md)
 - [vericredClient.BasePlanSearchResponse](docs/BasePlanSearchResponse.md)
 - [vericredClient.Carrier](docs/Carrier.md)
 - [vericredClient.CarrierGroupRequest](docs/CarrierGroupRequest.md)
 - [vericredClient.CarrierRequest](docs/CarrierRequest.md)
 - [vericredClient.CarrierSubsidiary](docs/CarrierSubsidiary.md)
 - [vericredClient.County](docs/County.md)
 - [vericredClient.CountyBulk](docs/CountyBulk.md)
 - [vericredClient.DentalPlan](docs/DentalPlan.md)
 - [vericredClient.DentalPlanBenefits](docs/DentalPlanBenefits.md)
 - [vericredClient.DentalPlanSearchApplicant](docs/DentalPlanSearchApplicant.md)
 - [vericredClient.DentalPlanSearchRequest](docs/DentalPlanSearchRequest.md)
 - [vericredClient.DentalPlanSearchResponse](docs/DentalPlanSearchResponse.md)
 - [vericredClient.DentalPlanShowResponse](docs/DentalPlanShowResponse.md)
 - [vericredClient.DentalPlanUpdate](docs/DentalPlanUpdate.md)
 - [vericredClient.DentalPlanUpdateRequest](docs/DentalPlanUpdateRequest.md)
 - [vericredClient.Drug](docs/Drug.md)
 - [vericredClient.DrugCoverage](docs/DrugCoverage.md)
 - [vericredClient.DrugCoverageResponse](docs/DrugCoverageResponse.md)
 - [vericredClient.DrugPackage](docs/DrugPackage.md)
 - [vericredClient.DrugSearchResponse](docs/DrugSearchResponse.md)
 - [vericredClient.EmbargoRequest](docs/EmbargoRequest.md)
 - [vericredClient.Formulary](docs/Formulary.md)
 - [vericredClient.FormularyDrugPackageResponse](docs/FormularyDrugPackageResponse.md)
 - [vericredClient.FormularyResponse](docs/FormularyResponse.md)
 - [vericredClient.IssuerRequest](docs/IssuerRequest.md)
 - [vericredClient.Meta](docs/Meta.md)
 - [vericredClient.MetaPlanSearchResponse](docs/MetaPlanSearchResponse.md)
 - [vericredClient.Network](docs/Network.md)
 - [vericredClient.NetworkComparison](docs/NetworkComparison.md)
 - [vericredClient.NetworkComparisonRequest](docs/NetworkComparisonRequest.md)
 - [vericredClient.NetworkComparisonResponse](docs/NetworkComparisonResponse.md)
 - [vericredClient.NetworkDetails](docs/NetworkDetails.md)
 - [vericredClient.NetworkDetailsResponse](docs/NetworkDetailsResponse.md)
 - [vericredClient.NetworkSearchResponse](docs/NetworkSearchResponse.md)
 - [vericredClient.NetworkSize](docs/NetworkSize.md)
 - [vericredClient.NotificationSubscription](docs/NotificationSubscription.md)
 - [vericredClient.NotificationSubscriptionResponse](docs/NotificationSubscriptionResponse.md)
 - [vericredClient.Plan](docs/Plan.md)
 - [vericredClient.PlanCounty](docs/PlanCounty.md)
 - [vericredClient.PlanCountyBulk](docs/PlanCountyBulk.md)
 - [vericredClient.PlanDeleted](docs/PlanDeleted.md)
 - [vericredClient.PlanIdentifier](docs/PlanIdentifier.md)
 - [vericredClient.PlanMedicare](docs/PlanMedicare.md)
 - [vericredClient.PlanMedicareBulk](docs/PlanMedicareBulk.md)
 - [vericredClient.PlanPricingMedicare](docs/PlanPricingMedicare.md)
 - [vericredClient.PlanSearchResponse](docs/PlanSearchResponse.md)
 - [vericredClient.PlanShowResponse](docs/PlanShowResponse.md)
 - [vericredClient.Provider](docs/Provider.md)
 - [vericredClient.ProviderDetails](docs/ProviderDetails.md)
 - [vericredClient.ProviderGeocode](docs/ProviderGeocode.md)
 - [vericredClient.ProviderNetworkEventNotification](docs/ProviderNetworkEventNotification.md)
 - [vericredClient.ProviderShowResponse](docs/ProviderShowResponse.md)
 - [vericredClient.ProvidersGeocodeResponse](docs/ProvidersGeocodeResponse.md)
 - [vericredClient.ProvidersSearchResponse](docs/ProvidersSearchResponse.md)
 - [vericredClient.RateRequest](docs/RateRequest.md)
 - [vericredClient.RatingArea](docs/RatingArea.md)
 - [vericredClient.RequestPlanFind](docs/RequestPlanFind.md)
 - [vericredClient.RequestPlanFindApplicant](docs/RequestPlanFindApplicant.md)
 - [vericredClient.RequestPlanFindCarrierVerification](docs/RequestPlanFindCarrierVerification.md)
 - [vericredClient.RequestPlanFindDrugPackage](docs/RequestPlanFindDrugPackage.md)
 - [vericredClient.RequestPlanFindProvider](docs/RequestPlanFindProvider.md)
 - [vericredClient.RequestProviderNotificationSubscription](docs/RequestProviderNotificationSubscription.md)
 - [vericredClient.RequestProvidersSearch](docs/RequestProvidersSearch.md)
 - [vericredClient.RxCuiIdentifier](docs/RxCuiIdentifier.md)
 - [vericredClient.RxCuiIdentifierSearchResponse](docs/RxCuiIdentifierSearchResponse.md)
 - [vericredClient.ServiceArea](docs/ServiceArea.md)
 - [vericredClient.ServiceAreaZipCounty](docs/ServiceAreaZipCounty.md)
 - [vericredClient.State](docs/State.md)
 - [vericredClient.StateNetworkSizeRequest](docs/StateNetworkSizeRequest.md)
 - [vericredClient.StateNetworkSizeResponse](docs/StateNetworkSizeResponse.md)
 - [vericredClient.VisionPlan](docs/VisionPlan.md)
 - [vericredClient.VisionPlanBenefits](docs/VisionPlanBenefits.md)
 - [vericredClient.VisionPlanSearchApplicant](docs/VisionPlanSearchApplicant.md)
 - [vericredClient.VisionPlanSearchRequest](docs/VisionPlanSearchRequest.md)
 - [vericredClient.VisionPlanSearchResponse](docs/VisionPlanSearchResponse.md)
 - [vericredClient.VisionPlanShowResponse](docs/VisionPlanShowResponse.md)
 - [vericredClient.VisionPlanUpdate](docs/VisionPlanUpdate.md)
 - [vericredClient.VisionPlanUpdateRequest](docs/VisionPlanUpdateRequest.md)
 - [vericredClient.ZipCode](docs/ZipCode.md)
 - [vericredClient.ZipCountiesResponse](docs/ZipCountiesResponse.md)
 - [vericredClient.ZipCounty](docs/ZipCounty.md)
 - [vericredClient.ZipCountyBulk](docs/ZipCountyBulk.md)
 - [vericredClient.ZipCountyResponse](docs/ZipCountyResponse.md)


## Documentation for Authorization


### Vericred-Api-Key

- **Type**: API key
- **API key parameter name**: Vericred-Api-Key
- **Location**: HTTP header

