vericred_client 0.0.33 → 0.0.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -1096,7 +1096,7 @@ module VericredClient
1096
1096
  attr_accessor :name
1097
1097
 
1098
1098
  # A list of plan identifiers and years indicating the previous plans that the plan replaces
1099
- attr_accessor :plan_ancestor
1099
+ attr_accessor :plan_ancestors
1100
1100
 
1101
1101
  # Are deductibles and MOOPs reset on Dec-31 (\"calendar year\"), 365 day(s) after enrollment date (\"plan year\"), or are both options available (\"both\")?
1102
1102
  attr_accessor :plan_calendar
@@ -1166,7 +1166,7 @@ module VericredClient
1166
1166
  :'mail_order_rx' => :'mail_order_rx',
1167
1167
  :'market' => :'market',
1168
1168
  :'name' => :'name',
1169
- :'plan_ancestor' => :'plan_ancestor',
1169
+ :'plan_ancestors' => :'plan_ancestors',
1170
1170
  :'plan_calendar' => :'plan_calendar',
1171
1171
  :'plan_market' => :'plan_market',
1172
1172
  :'plan_type' => :'plan_type',
@@ -1213,7 +1213,7 @@ module VericredClient
1213
1213
  :'mail_order_rx' => :'Float',
1214
1214
  :'market' => :'String',
1215
1215
  :'name' => :'String',
1216
- :'plan_ancestor' => :'String',
1216
+ :'plan_ancestors' => :'Array<PlanAncestor>',
1217
1217
  :'plan_calendar' => :'String',
1218
1218
  :'plan_market' => :'String',
1219
1219
  :'plan_type' => :'String',
@@ -1351,8 +1351,10 @@ module VericredClient
1351
1351
  self.name = attributes[:'name']
1352
1352
  end
1353
1353
 
1354
- if attributes.has_key?(:'plan_ancestor')
1355
- self.plan_ancestor = attributes[:'plan_ancestor']
1354
+ if attributes.has_key?(:'plan_ancestors')
1355
+ if (value = attributes[:'plan_ancestors']).is_a?(Array)
1356
+ self.plan_ancestors = value
1357
+ end
1356
1358
  end
1357
1359
 
1358
1360
  if attributes.has_key?(:'plan_calendar')
@@ -1451,7 +1453,7 @@ module VericredClient
1451
1453
  mail_order_rx == o.mail_order_rx &&
1452
1454
  market == o.market &&
1453
1455
  name == o.name &&
1454
- plan_ancestor == o.plan_ancestor &&
1456
+ plan_ancestors == o.plan_ancestors &&
1455
1457
  plan_calendar == o.plan_calendar &&
1456
1458
  plan_market == o.plan_market &&
1457
1459
  plan_type == o.plan_type &&
@@ -1475,7 +1477,7 @@ module VericredClient
1475
1477
  # Calculates hash code according to all attributes.
1476
1478
  # @return [Fixnum] Hash code
1477
1479
  def hash
1478
- [abortion_rider, actively_marketed, actuarial_value, age29_rider, audience, benefits, benefits_summary_url, buy_link, chiropractic_services_bool, coinsurance, covered_ages, display_name, dp_rider, drug_formulary_url, embedded_deductible, essential_health_benefits_percentage, external_id, external_ids, fp_rider, gated, hsa_eligible, infertility_rider, issuer_vericred_id, key_benefits_complete, level, mail_order_rx, market, name, plan_ancestor, plan_calendar, plan_market, plan_type, private_exchange, privileged_data, sbc_name, service_area_external_key, skilled_nursing_facility_365, source, state_code, telemedicine, year].hash
1480
+ [abortion_rider, actively_marketed, actuarial_value, age29_rider, audience, benefits, benefits_summary_url, buy_link, chiropractic_services_bool, coinsurance, covered_ages, display_name, dp_rider, drug_formulary_url, embedded_deductible, essential_health_benefits_percentage, external_id, external_ids, fp_rider, gated, hsa_eligible, infertility_rider, issuer_vericred_id, key_benefits_complete, level, mail_order_rx, market, name, plan_ancestors, plan_calendar, plan_market, plan_type, private_exchange, privileged_data, sbc_name, service_area_external_key, skilled_nursing_facility_365, source, state_code, telemedicine, year].hash
1479
1481
  end
1480
1482
 
1481
1483
  # Builds the object from hash
@@ -0,0 +1,1195 @@
1
+ =begin
2
+ #Vericred API
3
+
4
+ ## Getting Started
5
+
6
+ ## Signing Up
7
+
8
+ Visit our [Developer Portal](https://developers.vericred.com) to
9
+ create an account.
10
+
11
+ Once you have created an account, you can create one Application for your
12
+ Production environment and another for a Sandbox (select the appropriate Plan when you create the Application).
13
+
14
+ ## SDKs
15
+
16
+ Our API follows standard REST conventions, so you can use any HTTP client
17
+ to integrate with us. You will likely find it easier to use one of our
18
+ [autogenerated SDKs](https://github.com/vericred/?query=vericred-),
19
+ which we make available for several common programming languages.
20
+
21
+ ## Authentication
22
+
23
+ To authenticate, pass the API Key you created in the Developer Portal as
24
+ a `Vericred-Api-Key` header.
25
+
26
+ `curl -H 'Vericred-Api-Key: YOUR_KEY' "https://api.vericred.com/drugs?search_term=Lipitor"`
27
+
28
+ ## Versioning
29
+
30
+ Vericred's API default to the latest version. However, if you need a specific
31
+ version, you can request it with an `Accept-Version` header.
32
+
33
+ The current version is `v6`. We support prior versions. Our latest
34
+ stable version is `v7` and we will indicate in the documentation for an
35
+ endpoint if it's required.
36
+
37
+ `curl -H 'Vericred-Api-Key: YOUR_KEY' -H 'Accept-Version: v6' "https://api.vericred.com/drugs?search_term=Lipitor"`
38
+
39
+ ## Pagination
40
+
41
+ Endpoints that accept `page` and `per_page` parameters are paginated. They expose
42
+ four additional fields that contain data about your position in the response,
43
+ namely `Total`, `Per-Page`, `Link`, and `Page` as described in [RFC-5988](https://tools.ietf.org/html/rfc5988).
44
+
45
+ For example, to display 5 results per page and view the second page of a
46
+ `GET` to `/networks`, your final request would be `GET /networks?....page=2&per_page=5`.
47
+
48
+ ## Sideloading
49
+
50
+ When we return multiple levels of an object graph (e.g. `Provider`s and their
51
+ `State`s we typically the associated data. In this example, we would
52
+ provide an Array of `State`s and a `state_id` for each provider. This is
53
+ done primarily to reduce the payload size since many of the `Provider`s
54
+ will share a `State`
55
+
56
+ ### Simplified Example
57
+ ```
58
+ {
59
+ providers: [{ id: 1, state_id: 1}, { id: 2, state_id: 1 }],
60
+ states: [{ id: 1, code: 'NY' }]
61
+ }
62
+ ```
63
+
64
+ If you need the second level of the object graph, you can just match the
65
+ corresponding id.
66
+
67
+ ## Selecting specific data
68
+
69
+ All endpoints allow you to specify which fields you would like to return.
70
+ This allows you to limit the response to contain only the data you need.
71
+
72
+ For example, let's take a request that returns the following JSON by default
73
+
74
+ ```
75
+ {
76
+ provider: {
77
+ id: 1,
78
+ name: 'John',
79
+ phone: '1234567890',
80
+ field_we_dont_care_about: 'value_we_dont_care_about'
81
+ },
82
+ states: [{
83
+ id: 1,
84
+ name: 'New York',
85
+ code: 'NY',
86
+ field_we_dont_care_about: 'value_we_dont_care_about'
87
+ }]
88
+ }
89
+ ```
90
+
91
+ To limit our results to only return the fields we care about, we specify the
92
+ `select` in the query string for a `GET` or the body for a `POST`.
93
+
94
+ In this case, we want to select `name` and `phone` from the `provider` key,
95
+ so we would add the parameters `select=provider.name,provider.phone`.
96
+ We also want the `name` and `code` from the `states` key, so we would
97
+ add the parameters `select=states.name,states.code`. The id field of
98
+ each document is always returned whether or not it is requested.
99
+
100
+ Our final request would be `GET /providers/1234567898?select=provider.name,provider.phone,states.name,states.code`
101
+
102
+ The response would be
103
+
104
+ ```
105
+ {
106
+ provider: {
107
+ id: 1234567898,
108
+ name: 'John',
109
+ phone: '1234567890'
110
+ },
111
+ states: [{
112
+ id: 1,
113
+ name: 'New York',
114
+ code: 'NY'
115
+ }]
116
+ }
117
+ ```
118
+
119
+ # Plan and Rate Data
120
+
121
+ Vericred's Plan and Rate Data let you search and quote Major Medical and Ancillary Insurance Plans in a given area for a particular family in the Individual Market or a group of families in the Small Group Market. Vericred provides the relevant data via this API and via our Bulk Format (documented [below](#Bulk Plan and Rate Data))
122
+
123
+ ## Plans
124
+
125
+ A Plan defines a set of Benefits available to its purchaser. For example, a Major Medical Plan would specify cost-share Benefits for services like a Primary Care Provider visit, a Specialist visit or an Emergency Room visit. A Dental Plan might specify Benefits for Periodontics and Fluroride Treatments. The Benefits for each Product type ([Major Medical](#header-major-medical), [Dental](#header-dental), and [Vision](#header-vision)) are documented below.
126
+
127
+ ### Benefits Format
128
+
129
+ Benefits for Plans can be quite complex. With the goals of capturing and standardizing the complexity while retaining a human-readable format, we have developed a [Bakus-Naur Form](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form)(BNF) context-free grammar, with which we present Benefits.
130
+
131
+ Benefit cost-share strings are formatted to capture:
132
+ * Network tiers
133
+ * Compound or conditional cost-share
134
+ * Limits on the cost-share
135
+ * Benefit-specific maximum out-of-pocket costs
136
+
137
+ **Example #1**
138
+ As an example, we would represent [this Summary of Benefits &amp; Coverage](https://s3.amazonaws.com/vericred-data/SBC/2017/33602TX0780032.pdf) as:
139
+
140
+ * **Hospital stay facility fees**:
141
+ - Network Provider: `$400 copay/admit plus 20% coinsurance`
142
+ - Out-of-Network Provider: `$1,500 copay/admit plus 50% coinsurance`
143
+ - 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`
144
+
145
+ * **Rehabilitation services:**
146
+ - Network Provider: `20% coinsurance`
147
+ - Out-of-Network Provider: `50% coinsurance`
148
+ - Limitations & Exceptions: `35 visit maximum per benefit period combined with Chiropractic care.`
149
+ - Vericred's format for this benefit: `In-Network: 20% after deductible / Out-of-Network: 50% after deductible | limit: 35 visit(s) per Benefit Period`
150
+
151
+ **Example #2**
152
+ 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.
153
+ * **Specialty drugs:**
154
+ - Network Provider: `40% coinsurance up to a $500 maximum for up to a 30 day supply`
155
+ - Out-of-Network Provider `Not covered`
156
+ - Vericred's format for this benefit: `In-Network: 40% after deductible, up to $500 per script / Out-of-Network: 100%`
157
+
158
+ **BNF**
159
+
160
+ Here's a description of the benefits summary string, represented as a context-free grammar:
161
+
162
+ ```
163
+ root ::= coverage
164
+
165
+ coverage ::= (simple_coverage | tiered_coverage) (space pipe space coverage_modifier)?
166
+ tiered_coverage ::= tier (space slash space tier)*
167
+ tier ::= tier_name colon space (tier_coverage | not_applicable)
168
+ tier_coverage ::= simple_coverage (space (then | or | and) space simple_coverage)* tier_limitation?
169
+ simple_coverage ::= (pre_coverage_limitation space)? coverage_amount (space post_coverage_limitation)? (comma? space coverage_condition)?
170
+ coverage_modifier ::= limit_condition colon space (((simple_coverage | simple_limitation) (semicolon space see_carrier_documentation)?) | see_carrier_documentation | waived_if_admitted | shared_across_tiers)
171
+ waived_if_admitted ::= ("copay" space)? "waived if admitted"
172
+ simple_limitation ::= pre_coverage_limitation space "copay applies"
173
+ tier_name ::= "In-Network-Tier-2" | "Out-of-Network" | "In-Network"
174
+ limit_condition ::= "limit" | "condition"
175
+ tier_limitation ::= comma space "up to" space (currency | (integer space time_unit plural?)) (space post_coverage_limitation)?
176
+ coverage_amount ::= currency | unlimited | included | unknown | percentage | (digits space (treatment_unit | time_unit) plural?)
177
+ pre_coverage_limitation ::= first space digits space time_unit plural?
178
+ post_coverage_limitation ::= (((then space currency) | "per condition") space)? "per" space (treatment_unit | (integer space time_unit) | time_unit) plural?
179
+ coverage_condition ::= ("before deductible" | "after deductible" | "penalty" | allowance | "in-state" | "out-of-state") (space allowance)?
180
+ allowance ::= upto_allowance | after_allowance
181
+ upto_allowance ::= "up to" space (currency space)? "allowance"
182
+ after_allowance ::= "after" space (currency space)? "allowance"
183
+ see_carrier_documentation ::= "see carrier documentation for more information"
184
+ shared_across_tiers ::= "shared across all tiers"
185
+ unknown ::= "unknown"
186
+ unlimited ::= /[uU]nlimited/
187
+ included ::= /[iI]ncluded in [mM]edical/
188
+ 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/)
189
+ treatment_unit ::= /[pP]erson/ | /[gG]roup/ | /[cC]ondition/ | /[sS]cript/ | /[vV]isit/ | /[eE]xam/ | /[iI]tem/ | /[sS]tay/ | /[tT]reatment/ | /[aA]dmission/ | /[eE]pisode/
190
+ comma ::= ","
191
+ colon ::= ":"
192
+ semicolon ::= ";"
193
+ pipe ::= "|"
194
+ slash ::= "/"
195
+ plural ::= "(s)" | "s"
196
+ then ::= "then" | ("," space) | space
197
+ or ::= "or"
198
+ and ::= "and"
199
+ not_applicable ::= "Not Applicable" | "N/A" | "NA"
200
+ first ::= "first"
201
+ currency ::= "$" number
202
+ percentage ::= number "%"
203
+ number ::= float | integer
204
+ float ::= digits "." digits
205
+ integer ::= /[0-9]/+ (comma_int | under_int)*
206
+ comma_int ::= ("," /[0-9]/*3) !"_"
207
+ under_int ::= ("_" /[0-9]/*3) !","
208
+ digits ::= /[0-9]/+ ("_" /[0-9]/+)*
209
+ space ::= /[ \t]/+
210
+ ```
211
+
212
+
213
+ ### Major Medical
214
+
215
+ Vericred's data covers all Major Medical Plans available in the Individual and Small Groups (2-50 or 2-100) Markets in the US. These Plans are governed by CMS and are ACA-compliant. We do not include certain Plans that fall outside of the ACA, for example, Faith-Based Plans or Short-Term Medical Plans
216
+
217
+ We support the following Benefits Fields for Major Medical Plans. These represent the vast majority of fields available on a [Summary of Benefits and Coverage](https://www.healthcare.gov/health-care-law-protections/summary-of-benefits-and-coverage/)
218
+
219
+ The following are the appropriate Benefit Fields for Major Medical:
220
+
221
+ - ambulance
222
+ - child\_eye\_exam
223
+ - child\_eyewear
224
+ - chiropractic\_services
225
+ - diagnostic\_test
226
+ - durable\_medical\_equipment
227
+ - emergency\_room
228
+ - family\_drug\_deductible
229
+ - family\_drug\_moop
230
+ - family\_medical\_deductible
231
+ - family\_medical\_moop
232
+ - generic\_drugs
233
+ - habilitation\_services
234
+ - home\_health\_care
235
+ - hospice\_service
236
+ - imaging\_center
237
+ - imaging\_physician
238
+ - individual\_drug\_deductible
239
+ - individual\_drug\_moop
240
+ - individual\_medical\_deductible
241
+ - individual\_medical\_moop
242
+ - inpatient\_birth
243
+ - inpatient\_facility
244
+ - inpatient\_mental\_health
245
+ - inpatient\_physician
246
+ - inpatient\_substance
247
+ - lab\_test
248
+ - non\_preferred\_brand\_drugs
249
+ - nonpreferred\_generic\_drug\_share
250
+ - nonpreferred\_specialty\_drug\_share
251
+ - outpatient\_ambulatory\_care\_center
252
+ - outpatient\_facility
253
+ - outpatient\_mental\_health
254
+ - outpatient\_physician
255
+ - outpatient\_substance
256
+ - postnatal\_care
257
+ - preferred\_brand\_drugs
258
+ - prenatal\_care
259
+ - preventative\_care
260
+ - primary\_care\_physician
261
+ - rehabilitation\_services
262
+ - skilled\_nursing
263
+ - specialist
264
+ - specialty\_drugs
265
+ - urgent\_care
266
+
267
+ ### Dental
268
+
269
+ Dental benefits are less standardized than [Major Medical](#header-major-medical). Because of this, we have captured benefits for the most commonly specified services and procedures. If a Plan only specifies cost-share for "Major", "Minor", "Elective", etc, we determine the category for each of the benefits that we support and display the appropriate value for its category.
270
+
271
+ To view the technical documentation, [click here](#dental-plans).
272
+
273
+ The following are the supported Benefit Fields for Dental:
274
+
275
+ - bridges
276
+ - crowns
277
+ - denture\_relines\_rebases
278
+ - denture\_repair\_and\_adjustments
279
+ - dentures
280
+ - emergency\_treatment
281
+ - endodontics
282
+ - family\_annual\_max
283
+ - family\_deductible
284
+ - fluoride\_treatment
285
+ - implants
286
+ - individual\_annual\_max
287
+ - individual\_deductible
288
+ - inlays
289
+ - onlays
290
+ - oral\_exam
291
+ - oral\_surgery
292
+ - orthodontics\_adult
293
+ - orthodontics\_child
294
+ - periodontal\_maintenance
295
+ - periodontics
296
+ - prophylaxis\_cleaning
297
+ - radiograph\_bitewings
298
+ - radiograph\_other
299
+ - restoration\_fillings
300
+ - sealant
301
+ - simple\_extraction
302
+ - space\_maintainers
303
+
304
+ ### Vision
305
+
306
+ Vision benefits are similar in structure to [Dental](#header-dental). Again, when benefits are broken out by category, we determine the appropriate category for each service or procedure and display the approprate value for its category.
307
+
308
+ To view the technical documentation, [click here](#vision-plans).
309
+
310
+ The following are the supported Benefit Fields for Vision:
311
+
312
+ - eye\_exam
313
+ - retinal\_imaging
314
+ - frame
315
+ - eyeglass\_lenses\_single\_vision
316
+ - eyeglass\_lenses\_bifocal
317
+ - eyeglass\_lenses\_trifocal
318
+ - eyeglass\_lenses\_lenticular
319
+ - uv\_coating
320
+ - tint
321
+ - standard\_antireflective\_coating
322
+ - premium\_antireflective\_coating
323
+ - standard\_polycarbonate\_lenses\_child
324
+ - standard\_polycarbonate\_lenses\_adult
325
+ - standard\_progressive\_lenses
326
+ - premium\_progressive\_lenses
327
+ - standard\_scratch\_resistance
328
+ - polarized\_lenses
329
+ - photochromatic\_lenses
330
+ - standard\_contact\_lens\_fit\_and\_follow\_up
331
+ - premium\_contact\_lens\_fit\_and\_follow\_up
332
+ - contact\_lenses\_conventional
333
+ - contact\_lenses\_disposable
334
+ - contact\_lenses\_medically\_necessary
335
+ - laser\_vision\_correction
336
+ - additional\_pairs\_of\_eyeglasses
337
+
338
+ ### Medicare Advantage
339
+
340
+ Medicare Advantage endpoints support MA (Medicare Advantage plans without prescription drug benefits), MAPD (Medicare Advantage plans with prescription drug benefits), and PDP (prescription drug benefits only) plans.
341
+
342
+ Medical and hospital benefits - we support over 4000 individual plans through our API nationwide. At this time, we do not support EGHP (employer group health plans).
343
+
344
+ Prescription drug benefits - drug benefits are categorized into initial coverage phase, coverage gap phase, and catastrophic phase. Each phase is broken down by drug tiers, pharmacy tiers, and length of supply.
345
+
346
+ [Click here](#header-medicare-advantage-quotes) to learn more about quoting Medicare Advantage plans.
347
+
348
+ ## Rates
349
+
350
+ Rates are returned from the API as a part of [Quoting](#header-quoting). We calculate Rates in one of two ways.
351
+
352
+ ### Sheet Rates
353
+ When a Carrier supplies us with Sheet Rates, we display *exactly* the value provided to us. For example, in the Major Medical market, most Carriers provide a single rate for each combination of Applicant age and tobacco status in a given [Rating Area](#header-rating-areas). For example, in Austin, TX, a 21-year-old non-tobacco-user may be $312.41 per month while a 22-year-old tobacco-user may be $401.75 per month. Certain Vision and Dental Carriers supply Sheet Rates as well, though it is less common.
354
+
355
+ ### Rate Factors
356
+ Certain [Major Medical](#header-major-medical) Carriers and most [Vision](#header-vision) and [Dental](#header-dental) Carriers supply Rate Factors. The attributes on which the factors are based are the same as [Sheet Rates](#header-sheet-rates) for the [Major Medical](#header-major-medical) market (due to restrictions on what factors may be used in ACA Plans, which limit the possible factors to age and tobacco status).
357
+
358
+ In [Dental](#header-dental) and [Vision](#header-vision), the types of [Rate Factors](#header-rate-factors) are more varied. For example, SIC Code and Group size in the Group market and Gender in the Individual Market are commonly used [Rate Factors](#header-rate-factors)
359
+
360
+ Other common [Rate Factors](#header-rate-factors) for [Dental](#header-dental) and [Vision](#header-vision) products are Geographic and "Trend" (enrollment date) Factors. In [Major Medical](#header-major-medical), these types of variance are handled by CMS-defined [Rating Areas](#header-rating-areas).
361
+
362
+ In order to calculate a Rate using [Rate Factors](#header-rate-factors), the following methodology is applied:
363
+
364
+ ```
365
+ B = Base Rate
366
+ f = Rate Factor Function 1
367
+ f' = Rate Factor Function 2
368
+
369
+ B * f(x) * f'(y) [* f''(z)] ... = n
370
+ ```
371
+
372
+ ## Rating Areas
373
+ For [Major Medical](#header-major-medical) products, [CMS](https://www.cms.gov/) defines [Rating Areas](https://www.cms.gov/cciio/programs-and-initiatives/health-insurance-market-reforms/state-gra.html). Under the ACA, *all* [Rate Factors](#header-rate-factors) in a Rating Area must be identical for a given time period. E.g. in Arizona, the rate for a 21-year-old non-tobacco user must be identical in all counties contained in Rating Area 1 (Mohave, Coconino, Apache, and Navajo), but *may* be different than the rate for a 21-year-old non-tobacco user in all counties Rating Area 2 (Yavapai county only) for a given year in the Individual Market and a given quartern in the Small Group market.
374
+
375
+ [Rating Areas](#header-rating-areas) are defined either by County, Zip Code or both, depending on the State. Because of this variance, all API endpoints that require a [Location](#header-specifying-the-location) require both `zip_code` and `fips_code` (a county code). [Bulk Data](#bulkplanandratedata) for [Rating Areas](#bulkratingareas) and [Service Areas](#bulkserviceareas) also specifies locations using both `zip_code` and `fips_code`.
376
+
377
+ *Rating Areas do not apply to products other than [Major Medical](#header-major-medical)*
378
+
379
+ ## Service Areas
380
+ CMS mandates that [Major Medical](#header-major-medical) Rates be defined by [Rating Areas](#header-rating-areas), which themselves define a geography in which Plans are offered. Carriers often choose *not* to offer a Plan in and entire [Rating Area](#header-rating-areas) due to network coverage or other factors. Instead, the Carrier would define a [Service Area](#header-service-areas) that specifies where a given Plan is offered.
381
+
382
+ Each Plan is available in a single [Service Area](#header-service-areas) and each [Service Area](#header-service-areas) is defined by either County, Zip Code, or both, depending on the Carrier. Because of this variance, all API endpoints that require a [Location](#header-specifying-the-location) require both `zip_code` and `fips_code` (a county code). [Bulk Data](#bulkplanandratedata) for [Rating Areas](#bulkratingareas) and [Service Areas](#bulkserviceareas) also specifies locations using both `zip_code` and `fips_code`.
383
+
384
+ In [Dental](#header-dental) and [Vision](#header-vision) plans, we use a [Service Area](#header-service-areas) to define availability as well, although it typically mirrors a Geographic [Rate Factor](#header-rate-factors).
385
+
386
+ # Quoting
387
+
388
+ One of the primary use-cases for the Vericred API is to run Quotes to determine the Rate for a given family (in the Individual Market) or group (in the Small Group Market). We support quoting across [Major Medical](#header-major-medical), [Vision](#header-vision), and [Dental](#header-dental). In both cases, the process of generating a Quote is broken out into several steps:
389
+
390
+ 1. Find all available [Plans](#header-plans) in the relevent [Service Areas](#header-service-areas) for the family or group.
391
+ 1. Using [Business Rules](#header-business-rules) for each [Plan](#header-plans), determine if the family or group is eligible for that [Plan](#header-plans).
392
+ 1. Using [Business Rules](#header-business-rules) for each [Plan](#header-plans), determine which members of the family or which members of each family in the group should be considered for Rating.
393
+ 1. Using the [Sheet Rates](#header-sheet-rates) or [Rate Factors](#header-rate-factors) for each [Plan](#header-plans), determine the Rate the family, or for each family in the group.
394
+ 1. If running a [Composite](#compositerates) quote, determine the portion of the total Rate that each family will pay.
395
+
396
+ ## Individual Quotes
397
+ An Individual Quote is one for Plans that are available to a particular family, outside the context of their Employer. In the [Major Medical](#header-major-medical) market, many of these Plans are available on [Healthcare.gov](https://www.healthcare.gov) or the State-Based Exchange for non-Healthcare.gov states. The API supports both on-market and off-market Plans.
398
+
399
+ For details on Major Medical Quoting API calls see [below](#medicalplans-medicalplans-post)
400
+
401
+ ### Specifying the Location
402
+ In order to determine which plans are [available](#header-service-areas) and the [rate](#header-rating-areas) for each Plan, you must specify a location. When creating a [Quote](#header-quoting) for the Individual Market, that information is contained in the `POST` body of the request:
403
+ ```
404
+ POST /plans/medical/search
405
+ {
406
+ ...
407
+ "zip_code": "11201",
408
+ "fips_code": "36047"
409
+ ...
410
+ }
411
+
412
+ ```
413
+
414
+ ### Specifying Applicants
415
+ Applicants are the members of the family being quoted and are specified in the `POST` body of the request.
416
+ ```
417
+ POST /plans/medical/search
418
+ {
419
+ ...
420
+ "applicants": [
421
+ {
422
+ "age": 34,
423
+ "smoker": true,
424
+ "child": false
425
+ },
426
+ {
427
+ "age": 32,
428
+ "smoker": false,
429
+ "child": false
430
+ },
431
+ {
432
+ "age": 4,
433
+ "smoker": false,
434
+ "child": true
435
+ }
436
+ ]
437
+ ...
438
+ }
439
+ ```
440
+
441
+ ### Specifying Enrollment Date
442
+ The `enrollment_date` determines which [Plans](#header-plans) and [Rates](#header-rates) are returned. Specifying an `enrollment_date` in the past allows you to calculate historical data as far back as 2014.
443
+
444
+ ### Plan Benefits
445
+ Plan Benefits are returned in the response for [Individual Quotes](#individualquotes)
446
+ ```
447
+ POST /plans/medical/search
448
+ {
449
+ ...
450
+ }
451
+
452
+ Response:
453
+ {
454
+ "plans": [
455
+ {
456
+ ...
457
+ "individual_medical_deductible": "$5,000",
458
+ "family_medical_deductible": "$10,000"
459
+ ...
460
+ }
461
+
462
+ ]
463
+ }
464
+
465
+ ```
466
+
467
+ ### Premiums
468
+ The value for the family being quoted is returned in the `premium` field. If no [Applicants](#specifyingapplicants) are provided, the `premium` field will be `0`
469
+
470
+ ### Major Medical Quotes
471
+ In order to [Quote](#header-quoting) [Major Medical](#header-major-medical) Plans, send a `POST` to `/plans/medical/search`. In addition, the `age`, `smoker` and `child` attributes of each Applicant must be present.
472
+
473
+ #### Subsidies
474
+ On-market ([Healthcare.gov](https://www.healthcare.gov) and State-Based Exchange) [Major Medical](#header-major-medical) Plans are eligible for government subsidies. The subsidy calculation is based on the percentage of the family's income that the IRS has designated as "affordable" for that family and the Second Lowest-Cost Silver Plan available to that family.
475
+
476
+ In order to calculate subsidies for a family the following parameters must be supplied:
477
+ ```
478
+ POST /plans/medical/search
479
+ {
480
+ ...
481
+ "household_size": 4,
482
+ "household_income": 40000
483
+ ...
484
+ }
485
+ ```
486
+
487
+ The amount that the family will pay after subsidy is returned in the `premium_subsidized` field for each plan.
488
+
489
+ ##### Subsidy Calculation
490
+ Here is how subsidies are calculated. This is fully handled by the Vericred API, but the steps are enumerated below for clarity.
491
+
492
+ 1. Determine the percentage of the [Federal Poverty Level](https://aspe.hhs.gov/poverty-guidelines) for the family based on the household size and income.
493
+ 1. Reference the [CMS table](https://www.irs.gov/pub/irs-drop/rp-17-36.pdf) to determine the appropriate percentage of income for the family to spend on healthcare.
494
+ 1. Multiply that value by the family's income. This is the total amount that the family can spend on healthcare for the year, after the subsidy.
495
+ 1. Find the cost of the Second Least-Expensive Silver Plan available to the family, accounting for the percentage of premium that goes to [Essential Health Benefits](https://www.healthcare.gov/glossary/essential-health-benefits/)
496
+ 1. Calculate the difference in price between the amount the family should spend on healthcare and the Second Least-Expensive Silver Plan's premium. This is the subsidy.
497
+ 1. Apply the subsidy to all on-market Plans available to the family. The subsidized premium can never be below $0 (for example, a low-cost Bronze Plan may be less expensive than the subsidy)
498
+
499
+ #### Cost Sharing Reduction Plans
500
+ [Cost Sharing Reduction (CSR)](https://www.healthcare.gov/glossary/cost-sharing-reduction/) Plans are available to lower income families and offer enhanced benefits for certain Silver Plans at the same cost as the non-CSR Plans available to higher-income families.
501
+
502
+ If a family is eligible for CSR Plans, the Vericred API will return the relevant Plan in place of the non-CSR version.
503
+
504
+ In order to include CSR Plans where applicable, the following parameters must be supplied:
505
+ ```
506
+ POST /plans/medical/search
507
+ {
508
+ ...
509
+ "household_size": 4,
510
+ "household_income": 40000
511
+ ...
512
+ }
513
+ ```
514
+
515
+ #### The Children's Health Insurance Program (CHIP)
516
+ [The Children's Health Insurance Program (CHIP)](https://www.healthcare.gov/medicaid-chip/childrens-health-insurance-program/) provides low-cost health coverage to children in families that earn too much money to qualify for Medicaid.
517
+
518
+ If a family is eligible for CHIP, the Vericred API will include the subsidy in the returned premiums. In order to include CHIP subsidies in premium calculations, the following parameters must be supplied:
519
+ ```
520
+ POST /plans/medical/search
521
+ {
522
+ ...
523
+ "applicants": [
524
+ {
525
+ "age": 34,
526
+ "smoker": true,
527
+ "child": false
528
+ },
529
+ {
530
+ "age": 32,
531
+ "smoker": false,
532
+ "child": false
533
+ },
534
+ {
535
+ "age": 4,
536
+ "smoker": false,
537
+ "child": true
538
+ },
539
+ {
540
+ "age": 4,
541
+ "smoker": false,
542
+ "child": true
543
+ }
544
+ ],
545
+ "household_size": 4,
546
+ "household_income": 40000
547
+ ...
548
+ }
549
+ ```
550
+
551
+ CHIP eligibility is displayed within the meta-tag in the response as `eligible_for_chip_medicaid`:
552
+ ```
553
+ {
554
+ "meta": {
555
+ "total": 150,
556
+ "eligible_for_chip_medicaid": true,
557
+ "premium_tax_credit": 500.20
558
+ },
559
+ "coverages": [],
560
+ "plans": [...]
561
+ }
562
+ ```
563
+
564
+ If you do not want CHIP subsidies to be included in the premiums, simply do not include the `household_income` parameter in the request.
565
+
566
+ ### Dental Quotes
567
+ Quoting [Dental](#header-dental) Plans for a family requires slightly different parameters for [Applicants](#specifyingapplicants), due to the method with which Plans are [rated](#header-rate-factors). The folloiwng example contains the require parameters:
568
+ ```
569
+ POST /plans/dental/search
570
+ {
571
+ ...
572
+ "applicants": [
573
+ {
574
+ "age": 34,
575
+ "gender": "M",
576
+ "child": false
577
+ },
578
+ {
579
+ "age": 32,
580
+ "gender": "F",
581
+ "child": false
582
+ },
583
+ {
584
+ "age": 4,
585
+ "gender": "M",
586
+ "child": true
587
+ }
588
+ ]
589
+ ...
590
+ }
591
+ ```
592
+
593
+ Note that in contrast to [Major Medical Quotes](#majormedicalquotes), [Dental Quotes](#dentalquotes) require `gender`, but *do not* require `smoker`.
594
+
595
+ Also note that [Subsidies](#subsidies) and [Cost Sharing Reduction](#costsharingreductionplans) are *not* relevant for [Dental Quotes](#dentalquotes).
596
+
597
+ ### Vision Quotes
598
+
599
+ Quoting [Vision](#header-vision) Plans for a family requires slightly different parameters for [Applicants](#specifyingapplicants), due to the method with which Plans are [rated](#header-rate-factors). The folloiwng example contains the require parameters:
600
+ ```
601
+ POST /plans/vision/search
602
+ {
603
+ ...
604
+ "applicants": [
605
+ {
606
+ "age": 34,
607
+ "gender": "M",
608
+ "child": false
609
+ },
610
+ {
611
+ "age": 32,
612
+ "gender": "F",
613
+ "child": false
614
+ },
615
+ {
616
+ "age": 4,
617
+ "gender": "M",
618
+ "child": true
619
+ }
620
+ ]
621
+ ...
622
+ }
623
+ ```
624
+
625
+ Note that in contrast to [Major Medical Quotes](#majormedicalquotes), [Vision Quotes](#visionquotes) require `gender`, but *do not* require `smoker`.
626
+
627
+ Also note that [Subsidies](#subsidies) and [Cost Sharing Reduction](#costsharingreductionplans) are *not* relevant for [Vision Quotes](#visionquotes).
628
+
629
+ ### Medicare Advantage quotes
630
+
631
+ Given an enrollment date and location, you can search all plans available at this location using [/plans/medadv/search](#medicare-advantage-plans-medicare-advantage-plans-post); you can also search a specific plan using its plan ID with [/plans/medadv/{plan_id}](#medicare-advantage-plans-medicare-advantage-plans-get) if the plan ID is already known. The following example contains the required parameters:
632
+ ```
633
+ {
634
+ "zip_code": "02880",
635
+ "fips_code": "44009",
636
+ "enrollment_date": "2019-01-01"
637
+ }
638
+ ```
639
+ To view the technical documentation, [click here](#medicare-advantage-plans).
640
+
641
+
642
+ ## Quotes for Groups
643
+ A Group Quote finds [Plans](#header-plans) and [Rates](#header-rates) for a group of employees for a small business. Different [Plans](#header-plans) are available to small groups than are available in [Individual Quoting](#individualquotes). In addition, [Business Rules](#header-business-rules) that apply across multiple families or based upon employer attributes such as [SIC](https://en.wikipedia.org/wiki/Standard_Industrial_Classification) code factor into rates and availability.
644
+
645
+ In addition, due to performance requirements and for enhanced auditing, [Group Quotes](#groupquotes) are persisted across requests. This means that a given [Quote](#groupquotes) can be retrieved after it has been created.
646
+
647
+ ### Identifiers
648
+ In order to make it easier to cross-reference local copies of data with [Quotes](#header-creating-a-quote) and other data in the Vericred API, most entities allow for the specification of an `external_id` field. You can use this to store a primary or natural key from your system in order to easily match records returned from the API with records in your system.
649
+
650
+ ### Specifying the Group
651
+ Creating a group is the first step in [Group Quoting](#groupquoting). The API requires that certain information such as `sic_code`, and `chamber_association` be provided and returns a the attributes and `id` for the newly created `Group`
652
+
653
+ Full documentation is available [below](#groupscreate)
654
+
655
+ ### Specifying the Locations
656
+ When creating a `Group`, you must also specify one or more `Location`s. Of those `Location`s specified, one must be `primary`. That `Location` is used to calculate Plan eligibility using the relevant [Service Areas](#header-service-areas). Some Carriers use secondary `Location`s to determine eligibility as well, which is why those must be specified as well.
657
+
658
+ ```
659
+ POST /groups
660
+ {
661
+ "group": {
662
+ ...
663
+ },
664
+ "locations": [
665
+ {
666
+ ...
667
+ "zip_code": "11201",
668
+ "fips_code": "36047",
669
+ "primary": true
670
+ ...
671
+ }
672
+ ]
673
+ }
674
+ ```
675
+
676
+ ### Specifying the Census
677
+ A Census is the collection of `Member`s contained in the `Group`. The attributes of each `Member` and his or her `Dependent`s determine the [Rate](#header-rates) for the `Group` as a whole. Certain attributes of the `Member` are important for calculating [Rates](#header-rates) and applying [Business Rules](#header-business-rules). For example, the `Member`'s home address and in which office he or she works are relevant for certain [Business Rules](#header-business-rules).
678
+
679
+ #### Dependent Relationships
680
+ The `Dependent`s for a given `Member` also factor into the [Rates](#header-rates) and application of [Business Rules](#header-business-rules). For example, certain [Plans](#header-plans) cover only `Dependent`s of particular types and/or only `Dependent`s of a particular type who live in the same household as the primary `Member`
681
+
682
+ Valid Dependent Relationships:
683
+ - `adopted_child`
684
+ - `child`
685
+ - `court_appointed_guardian`
686
+ - `dependent_of_dependent`
687
+ - `ex_spouse`
688
+ - `foster_child`
689
+ - `grand_child`
690
+ - `guardian`
691
+ - `life_partner`
692
+ - `other`
693
+ - `sibling`
694
+ - `sponsored_dependent`
695
+ - `spouse`
696
+ - `step_child`
697
+ - `ward`
698
+
699
+ ```
700
+ POST
701
+
702
+ /groups/{id}/members
703
+ {
704
+ "members": [
705
+ ...
706
+ {
707
+ "cobra": false,
708
+ "date_of_birth": "1980-01-01",
709
+ "fips_code": "36047"
710
+ "gender": "M",
711
+ "last_used_tobacco": "2017-01-01",
712
+ "location_id": :location_id
713
+ "retiree": false,
714
+ "zip_code": "11201",
715
+ "dependents": [
716
+ ...
717
+ {
718
+ "relationship": "child",
719
+ "same_household": true
720
+ }
721
+ ...
722
+ ]
723
+ }
724
+ ...
725
+ ]
726
+ }
727
+
728
+ ```
729
+
730
+ ### Creating a Quote
731
+ Once the [Census](#header-specifying-the-census) has been created, we can generate a `Quote` for the `Group`.
732
+
733
+ #### Major Medical Quotes
734
+ To generate a [Major Medical](#header-major-medical) Quote, specify the `product_line` of `Quote` as `medical`
735
+
736
+ ```
737
+ POST /groups/{id}/quotes
738
+ {
739
+ ...
740
+ "product_line": "medical"
741
+ ...
742
+ }
743
+ ```
744
+
745
+ #### Dental Quotes
746
+ To generate a [Dental](#header-dental) Quote, specify the `product_line` of `Quote` as `dental`
747
+
748
+ ```
749
+ POST /groups/{id}/quotes
750
+ {
751
+ ...
752
+ "product_line": "dental"
753
+ ...
754
+ }
755
+ ```
756
+
757
+ #### Vision Quotes
758
+ To generate a [Vision](#header-vision) Quote, specify the `product_line` of `Quote` as `vision`
759
+
760
+ ```
761
+ POST /groups/{id}/quotes
762
+ {
763
+ ...
764
+ "product_line": "vision"
765
+ ...
766
+ }
767
+ ```
768
+
769
+ ### Retrieving Aggregate Rates
770
+ Once you have created a [Quote](#header-creating-a-quote), you can retrieve its aggregate [Rates](#header-rates). [Rates](#header-rates) are broken down by `Member` and `Dependent`, so that you can show the final cost in different scenarios where an employer might cover a different percentage of `Member` and `Dependent` costs.
771
+
772
+ ```
773
+ GET /quotes/{id}/rates
774
+
775
+ Response
776
+ {
777
+ "rates": [
778
+ ...
779
+ {
780
+ "id": "123abc",
781
+ "plan_id": "12345NY6789012",
782
+ "total_premium": "2800.00",
783
+ "member_premium": "1000.00",
784
+ "dependent_premium": "1800.00",
785
+ "premiums": {
786
+ "age_banded": {
787
+ "total_member": "1000.00",
788
+ "total_dependent": "1800.00",
789
+ "total": "2800.00"
790
+ },
791
+ "2_tier_composite": {
792
+ "employee_only": "200.00",
793
+ "employee_plus_family": "400.00",
794
+ "total": "2800.00"
795
+ },
796
+ "3_tier_composite": {
797
+ "employee_only": "200.00",
798
+ "employee_plus_one": "250.00",
799
+ "employee_plus_family": "330.00",
800
+ "total": "2800.00"
801
+ },
802
+ "4_tier_composite": {
803
+ "employee_only": "200.00",
804
+ "employee_plus_child": "220.00",
805
+ "employee_plus_spouse": "250.00",
806
+ "employee_plus_family": "330.00",
807
+ "total": "2800.00"
808
+ }
809
+ }
810
+ }
811
+ ...
812
+ ]
813
+ }
814
+ ```
815
+
816
+
817
+ #### Loading Plan Data
818
+ Aggregate [Rates](#header-rates) responses *do not* include [Plan](#header-plans) details in order to keep the payload small. [Plan](#header-plans) data can be retrieved in one of two ways:
819
+
820
+ Loading the [Plan](#header-plans) from the API:
821
+ ```
822
+ GET /plans/{id}
823
+
824
+ Response:
825
+ {
826
+ "plans": [
827
+ ...
828
+ {
829
+ ...
830
+ "individual_medical_deductible": "$5,000",
831
+ "family_medical_deductible": "$10,000",
832
+ ...
833
+ }
834
+ ...
835
+
836
+ ]
837
+ }
838
+ ```
839
+ Pulling in [Bulk Plan Data](#bulkplans) and matching up [Plans](#header-plans) by their `id`.
840
+
841
+ ### Retrieving Member-Level Rates
842
+ In order to retrieve the exact [Rate](#header-rates) for each `Member` and their `Dependents` for given [Plan](#header-plans), you can load Member-Level `Rates`.
843
+
844
+ ```
845
+ GET /rates/{id}/member_rates
846
+
847
+ Response
848
+ {
849
+ "member_rates": [
850
+ ...
851
+ {
852
+ "id": "123abc",
853
+ "member_id": "234def",
854
+ "member_external_id": "externally-supplied-id",
855
+ "member_premium": 500.0,
856
+ "dependent_premium": 600.0,
857
+ "total_premium": 1100.0
858
+ }
859
+ ...
860
+ ]
861
+ }
862
+
863
+ ```
864
+
865
+ Note that *all* `MemberRate`s are for one particular [Plan](#header-plans) - the one referenced by the parent [Rate](#header-rates).
866
+
867
+ ### Business Rules
868
+ Vericred works with our Carrier partners to acquire and apply Business Rules that can affect either [Plan](#header-plans) availability or the way in which `Member`s and `Dependent`s are rated. For example, one Carrier's Business Rules might specify that `Member`s and `Dependent`s who have used tobacco in the past 4 months are considered "tobacco-users", while another's may specify that period to be 1 year.
869
+
870
+ These rules are applied transparently during the [Quoting](#header-quoting) process and *do not* require any additional action or input on your part.
871
+
872
+ For a full accounting of Business Rules and a list of Carriers whose Business Rules are applied, please contact support@vericred.com
873
+
874
+ ### Composite Rates
875
+ Composite Rates are commonly used in [Major Medical](#header-major-medical), [Dental](#header-dental), and [Vision](#header-vision) [Plans](#header-plans) to simplify operations by charging each family the weighted average of the `Group`'s total premium. The most common methodology is as follows:
876
+
877
+ 1. Calculate the [Rates](#header-rates) for the entire `Group` using [Sheet Rates](#header-sheet-rates) or [Rate Factors](#header-rate-factors) as appropriate
878
+ 1. Categorize each Family within the Group. The categorization differs depending on whether the Composite Rate is 2, 3, or 4-tier
879
+ 1. Multiply the number of Families in each category by the constant for that category. These constants are provided to Vericred by the Carrier. This determines the total number of "Rating Units"
880
+ 1. Divide the total premium calculated in Step 1 by the total number of Rating Units to get the price per Rating Unit
881
+ 1. The [Rate](#header-rates) each Family pays is the constant for that Family's category multiplied by the price per Rating Unit.
882
+
883
+ You can request that a [Quote](#header-quoting) be calculated using Composite Rates when creating it:
884
+ ```
885
+ POST /quotes
886
+ {
887
+ ...
888
+ "rating_method": "4_tier_composite"
889
+ ...
890
+ }
891
+ ```
892
+ If no Composite Rates methodology is available, the Vericred API will return standard age-banded Rates.
893
+
894
+ # Network and Provider Data
895
+
896
+ A `Provider` is an individual or organization in the medical profession. For example, an individual doctor is a `Provider` as are certain clinics and hospitals.
897
+
898
+ `Provider`s are related to `Network`s. A `Network` is a collection of `Provider`s that are under a particular contract with a given `Carrier`. A given `Carrier` will often have multiple `Network`s. For example, there may be a large national `Network` as well as several smaller regional `Network`s.
899
+
900
+ Each `Plan` has a `Network`. A consumer who visits a `Provider` typically incurs fewer costs when visiting a `Provider` in the `Network` covered by his or her `Plan`. The `premium` for a `Plan` is often proportional to the size of its `Network`
901
+
902
+ ## Finding Providers
903
+ In order to determine if a particular `Plan` covers a given `Provider`, you must first identify the `Provider`. To do so, use the [Provider Search API endpoint](#providers-providers-post) and specify some search criteria:
904
+
905
+ ```
906
+ POST /providers/search
907
+ {
908
+ "search_term": "foo",
909
+ "zip_code": "11201"
910
+ }
911
+ ```
912
+
913
+ The API will return an ordered list of `Provider`s who match the query along with their names, addresses, and other demographic data. The `id` field returned refers to the `Provider`'s [NPI number](https://www.cms.gov/Regulations-and-Guidance/Administrative-Simplification/NationalProvIdentStand/). This is the key that is used to identify the `Provider` across different API endpoints.
914
+
915
+ ## Finding Networks
916
+
917
+ A `Network` is a collection of `Provider`s that are under a particular contract with a given `Carrier`. A given `Carrier` will often have multiple `Network`s. For example, there may be a large national `Network` as well as several smaller regional `Network`s.
918
+
919
+ The API supports searching for `Networks` by Carrier, market and state. For more details view the [endpoint documentation](#networks-networks-get)
920
+
921
+ ## Matching Providers to Networks
922
+ In order to determine if a `Provider` is covered by a user's `Plan`, you will need to map the `Provider` to a `Network`. There are several methods to do this using the API
923
+
924
+ ### Using Plan Search
925
+ You can specify one or more `npi` values in the [`plan` search](#majormedicalplans-majormedicalplans-post). To do so, include a list of `providers` in the request
926
+ ```
927
+ POST /plans/medical/search
928
+ {
929
+ ...
930
+ "providers": [
931
+ { "npi": 1234567890 },
932
+ { "npi": 2345678901 }
933
+ ]
934
+ ...
935
+ }
936
+
937
+ The response will then return a list of `in_network_ids` and `out_of_network_ids` for each `Plan`
938
+
939
+ ```
940
+ {
941
+ "plans": [
942
+ ...
943
+ {
944
+ ...
945
+ "id": "12345NY1234567",
946
+ "in_network_ids": [1234567890],
947
+ "out_of_network_ids": [1234567890]
948
+ ...
949
+ },
950
+ {
951
+ ...
952
+ "id": "12345NY2345678",
953
+ "in_network_ids": [1234567890, 1234567890],
954
+ "out_of_network_ids": []
955
+ ...
956
+ }
957
+ ...
958
+ ]
959
+ }
960
+
961
+ Simply reference the `Provider` in question by its `id` for each `Plan` to see if that `Provider` is in-network for the `Plan`.
962
+
963
+ ### Matching by Plan ID
964
+ Given a `Provider`'s `id`, you can retrieve all of his or her `hios_ids`
965
+
966
+ For more details see the [endpoint documentation](#providers-providers-get)
967
+
968
+ ```
969
+ GET /providers/1234567890
970
+ {
971
+ "provider": {
972
+ ...
973
+ "hios_ids": [
974
+ ...
975
+ "12345NY1234567"
976
+ ...
977
+ ]
978
+ ...
979
+ }
980
+ }
981
+ ```
982
+
983
+ The returned `hios_ids` can be used to cross-reference a `Plan`
984
+
985
+ ### Matching by Network
986
+ Once you have an ID returned from the [`Network` search endpoint](#networks-networks-get), you can cross-reference it with the `network_ids` returned from both the [`Provider` search](#providers-providers-post) and [`Provider` details](#providers-providers-get) endpoints.
987
+
988
+ This is useful for large group data or when you are not dealing with `Plan`s directly, but rather at the `Network` level.
989
+
990
+
991
+ OpenAPI spec version: 1.0.0
992
+
993
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
994
+
995
+ Licensed under the Apache License, Version 2.0 (the "License");
996
+ you may not use this file except in compliance with the License.
997
+ You may obtain a copy of the License at
998
+
999
+ http://www.apache.org/licenses/LICENSE-2.0
1000
+
1001
+ Unless required by applicable law or agreed to in writing, software
1002
+ distributed under the License is distributed on an "AS IS" BASIS,
1003
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1004
+ See the License for the specific language governing permissions and
1005
+ limitations under the License.
1006
+
1007
+ =end
1008
+
1009
+ require 'date'
1010
+
1011
+ module VericredClient
1012
+
1013
+ class PlanAncestor
1014
+ # Plan Ancestor Identifier Value
1015
+ attr_accessor :plan_id
1016
+
1017
+ # Plan Ancestor year
1018
+ attr_accessor :year
1019
+
1020
+
1021
+ # Attribute mapping from ruby-style variable name to JSON key.
1022
+ def self.attribute_map
1023
+ {
1024
+ :'plan_id' => :'plan_id',
1025
+ :'year' => :'year'
1026
+ }
1027
+ end
1028
+
1029
+ # Attribute type mapping.
1030
+ def self.swagger_types
1031
+ {
1032
+ :'plan_id' => :'String',
1033
+ :'year' => :'Integer'
1034
+ }
1035
+ end
1036
+
1037
+ # Initializes the object
1038
+ # @param [Hash] attributes Model attributes in the form of hash
1039
+ def initialize(attributes = {})
1040
+ return unless attributes.is_a?(Hash)
1041
+
1042
+ # convert string to symbol for hash key
1043
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
1044
+
1045
+ if attributes.has_key?(:'plan_id')
1046
+ self.plan_id = attributes[:'plan_id']
1047
+ end
1048
+
1049
+ if attributes.has_key?(:'year')
1050
+ self.year = attributes[:'year']
1051
+ end
1052
+
1053
+ end
1054
+
1055
+ # Show invalid properties with the reasons. Usually used together with valid?
1056
+ # @return Array for valid properies with the reasons
1057
+ def list_invalid_properties
1058
+ invalid_properties = Array.new
1059
+ return invalid_properties
1060
+ end
1061
+
1062
+ # Check to see if the all the properties in the model are valid
1063
+ # @return true if the model is valid
1064
+ def valid?
1065
+ return true
1066
+ end
1067
+
1068
+ # Checks equality by comparing each attribute.
1069
+ # @param [Object] Object to be compared
1070
+ def ==(o)
1071
+ return true if self.equal?(o)
1072
+ self.class == o.class &&
1073
+ plan_id == o.plan_id &&
1074
+ year == o.year
1075
+ end
1076
+
1077
+ # @see the `==` method
1078
+ # @param [Object] Object to be compared
1079
+ def eql?(o)
1080
+ self == o
1081
+ end
1082
+
1083
+ # Calculates hash code according to all attributes.
1084
+ # @return [Fixnum] Hash code
1085
+ def hash
1086
+ [plan_id, year].hash
1087
+ end
1088
+
1089
+ # Builds the object from hash
1090
+ # @param [Hash] attributes Model attributes in the form of hash
1091
+ # @return [Object] Returns the model itself
1092
+ def build_from_hash(attributes)
1093
+ return nil unless attributes.is_a?(Hash)
1094
+ self.class.swagger_types.each_pair do |key, type|
1095
+ if type =~ /\AArray<(.*)>/i
1096
+ # check to ensure the input is an array given that the the attribute
1097
+ # is documented as an array but the input is not
1098
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
1099
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
1100
+ end
1101
+ elsif !attributes[self.class.attribute_map[key]].nil?
1102
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
1103
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
1104
+ end
1105
+
1106
+ self
1107
+ end
1108
+
1109
+ # Deserializes the data based on type
1110
+ # @param string type Data type
1111
+ # @param string value Value to be deserialized
1112
+ # @return [Object] Deserialized data
1113
+ def _deserialize(type, value)
1114
+ case type.to_sym
1115
+ when :DateTime
1116
+ DateTime.parse(value)
1117
+ when :Date
1118
+ Date.parse(value)
1119
+ when :String
1120
+ value.to_s
1121
+ when :Integer
1122
+ value.to_i
1123
+ when :Float
1124
+ value.to_f
1125
+ when :BOOLEAN
1126
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1127
+ true
1128
+ else
1129
+ false
1130
+ end
1131
+ when :Object
1132
+ # generic object (usually a Hash), return directly
1133
+ value
1134
+ when /\AArray<(?<inner_type>.+)>\z/
1135
+ inner_type = Regexp.last_match[:inner_type]
1136
+ value.map { |v| _deserialize(inner_type, v) }
1137
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
1138
+ k_type = Regexp.last_match[:k_type]
1139
+ v_type = Regexp.last_match[:v_type]
1140
+ {}.tap do |hash|
1141
+ value.each do |k, v|
1142
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1143
+ end
1144
+ end
1145
+ else # model
1146
+ temp_model = VericredClient.const_get(type).new
1147
+ temp_model.build_from_hash(value)
1148
+ end
1149
+ end
1150
+
1151
+ # Returns the string representation of the object
1152
+ # @return [String] String presentation of the object
1153
+ def to_s
1154
+ to_hash.to_s
1155
+ end
1156
+
1157
+ # to_body is an alias to to_hash (backward compatibility)
1158
+ # @return [Hash] Returns the object in the form of hash
1159
+ def to_body
1160
+ to_hash
1161
+ end
1162
+
1163
+ # Returns the object in the form of hash
1164
+ # @return [Hash] Returns the object in the form of hash
1165
+ def to_hash
1166
+ hash = {}
1167
+ self.class.attribute_map.each_pair do |attr, param|
1168
+ value = self.send(attr)
1169
+ next if value.nil?
1170
+ hash[param] = _to_hash(value)
1171
+ end
1172
+ hash
1173
+ end
1174
+
1175
+ # Outputs non-array value in the form of hash
1176
+ # For object, use to_hash. Otherwise, just return the value
1177
+ # @param [Object] value Any valid value
1178
+ # @return [Hash] Returns the value in the form of hash
1179
+ def _to_hash(value)
1180
+ if value.is_a?(Array)
1181
+ value.compact.map{ |v| _to_hash(v) }
1182
+ elsif value.is_a?(Hash)
1183
+ {}.tap do |hash|
1184
+ value.each { |k, v| hash[k] = _to_hash(v) }
1185
+ end
1186
+ elsif value.respond_to? :to_hash
1187
+ value.to_hash
1188
+ else
1189
+ value
1190
+ end
1191
+ end
1192
+
1193
+ end
1194
+
1195
+ end