eligible 2.3 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CONTRIBUTORS +5 -1
- data/README.md +265 -69
- data/eligible.gemspec +6 -7
- data/lib/eligible.rb +53 -59
- data/lib/eligible/api_resource.rb +3 -1
- data/lib/eligible/claim.rb +17 -11
- data/lib/eligible/coverage.rb +13 -18
- data/lib/eligible/demographic.rb +9 -39
- data/lib/eligible/eligible_object.rb +1 -1
- data/lib/eligible/enrollment.rb +12 -17
- data/lib/eligible/json.rb +5 -15
- data/lib/eligible/medicare.rb +19 -0
- data/lib/eligible/payment.rb +11 -8
- data/lib/eligible/ticket.rb +40 -0
- data/lib/eligible/util.rb +32 -60
- data/lib/eligible/version.rb +1 -1
- data/lib/eligible/x12.rb +3 -12
- data/test/test_eligible.rb +13 -179
- data/test/test_helper.rb +30 -20
- metadata +18 -21
- data/lib/eligible/plan.rb +0 -42
- data/lib/eligible/service.rb +0 -59
- data/lib/eligible/webhook.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1ed13fe5084703a13e0d531de177e73e1f38a4e
|
4
|
+
data.tar.gz: 43b6296949c68d3113f6ec1f1db1d5d6aaaf6d43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5769440475201703b7162d82cf4d28156389e9e52c2e0c5ac83b3c560589848c014898bc41831383ce70a830a34fa26a1517e8b0c6fcaf877d83088d6e551a14
|
7
|
+
data.tar.gz: da1097a703dc3d255c6fea2871c43e2ccc087f2ee3298252205113f5328981aa156624adf85d4b401bdc6660dafbd0814ebad35076b1c62ddf5c12db4841bbe1
|
data/CONTRIBUTORS
CHANGED
data/README.md
CHANGED
@@ -16,22 +16,113 @@ Or install it yourself with:
|
|
16
16
|
|
17
17
|
$ gem install eligible
|
18
18
|
|
19
|
-
|
19
|
+
# Important notes
|
20
|
+
|
21
|
+
## Payer List for Eligibility
|
22
|
+
|
23
|
+
the parameter *payer_id*, required for most of the api calls, is provided by EligibleAPI from its website,
|
24
|
+
in xml and json format, which you can embed into your applications.
|
25
|
+
|
26
|
+
[https://eligibleapi.com/resources/information-sources.xml](https://eligibleapi.com/resources/information-sources.xml)
|
27
|
+
[https://eligibleapi.com/resources/information-sources.json](https://eligibleapi.com/resources/information-sources.json)
|
28
|
+
|
29
|
+
## Payer List for Claims
|
30
|
+
|
31
|
+
the parameter *payer_id*, required for claims, is provided by EligibleAPI from its website,
|
32
|
+
in xml and json format, which you can embed into your applications.
|
33
|
+
|
34
|
+
[https://eligibleapi.com/resources/claims-payer.xml](https://eligibleapi.com/resources/claims-payer.xml)
|
35
|
+
[https://eligibleapi.com/resources/claims-payer.json](https://eligibleapi.com/resources/claims-payer.json)
|
36
|
+
|
37
|
+
## Service Type Codes
|
38
|
+
|
39
|
+
the parameter *service_type*, required on the api calls, is provided by EligibleAPI from its website,
|
40
|
+
in xml and json format, which you can embed into your applications.
|
41
|
+
[https://eligibleapi.com/resources/service-codes.xml](https://eligibleapi.com/resources/service-codes.xml)
|
42
|
+
https://eligibleapi.com/resources/service-codes.json](ttps://eligibleapi.com/resources/service-codes.json)
|
43
|
+
|
44
|
+
## Place of Service
|
45
|
+
|
46
|
+
[https://eligibleapi.com/resources/place_of_service.json](https://eligibleapi.com/resources/place_of_service.json)
|
47
|
+
|
48
|
+
## Health Care Provider Taxonomy
|
49
|
+
|
50
|
+
[https://eligibleapi.com/resources/health-care-provider-taxonomy-code-set.json](https://eligibleapi.com/resources/health-care-provider-taxonomy-code-set.json)
|
51
|
+
|
52
|
+
|
53
|
+
# Usage
|
20
54
|
|
21
55
|
### Setup
|
56
|
+
```ruby
|
22
57
|
require 'eligible'
|
23
58
|
Eligible.api_key = 'YOUR_KEY'
|
59
|
+
```
|
60
|
+
|
24
61
|
### Test
|
25
62
|
```ruby
|
26
63
|
Eligible.test = true
|
27
|
-
|
28
|
-
Include `{ :test => "true" }` in the params for sandbox access.
|
29
|
-
### Format
|
64
|
+
```
|
30
65
|
|
31
|
-
|
66
|
+
### Parameters overwrite
|
32
67
|
|
68
|
+
On each api call, you can overwrite the api key or the test parameter, i.e.
|
33
69
|
|
34
|
-
|
70
|
+
```ruby
|
71
|
+
Eligible::Demographic.get(params.merge({:api_key => 'NEW_KEY', :test => false})
|
72
|
+
```
|
73
|
+
|
74
|
+
### Response Format
|
75
|
+
|
76
|
+
By default, all the responses came in JSON, but you can request raw access to X12 by adding is as a parameter on the api call.
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
Eligible::Demographic.get(params.merge({:format => "x12"}))
|
80
|
+
```
|
81
|
+
|
82
|
+
### Api Call Results
|
83
|
+
|
84
|
+
On all the results, you can check for errors in *result.error*, you can get get the raw json format in a has by using *result.to_hash*.
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
demographic = Eligible::Demographic.get(params)
|
88
|
+
demographic.error
|
89
|
+
demographic.to_hash
|
90
|
+
```
|
91
|
+
|
92
|
+
## Coverage
|
93
|
+
|
94
|
+
### Reference
|
95
|
+
|
96
|
+
[https://eligibleapi.com/rest-api-v1-1/coverage-all#apiCoverageInfo](https://eligibleapi.com/rest-api-v1-1/coverage-all#apiCoverageInfo)
|
97
|
+
|
98
|
+
### Retrieve eligibility & benefit information
|
99
|
+
|
100
|
+
```ruby
|
101
|
+
params = {
|
102
|
+
:service_type => "33",
|
103
|
+
:network => "OUT",
|
104
|
+
:payer_id => "000001",
|
105
|
+
:provider_last_name => "Last",
|
106
|
+
:provider_first_name => "First",
|
107
|
+
:provider_npi => "12345678",
|
108
|
+
:member_id => "12345678",
|
109
|
+
:member_last_name => "Austen",
|
110
|
+
:member_first_name => "Jane",
|
111
|
+
:member_dob => "1955-12-14"
|
112
|
+
}
|
113
|
+
|
114
|
+
coverage = Eligible::Coverage.get(params)
|
115
|
+
coverage.to_hash # returns all coverage info for the request
|
116
|
+
coverage.error # return error, if any
|
117
|
+
```
|
118
|
+
|
119
|
+
## Demographic
|
120
|
+
|
121
|
+
### Reference
|
122
|
+
|
123
|
+
[https://eligibleapi.com/rest-api-v1-1/demographic-all#apiDemographics](https://eligibleapi.com/rest-api-v1-1/demographic-all#apiDemographics)
|
124
|
+
|
125
|
+
### Fetch demographics for a patient
|
35
126
|
|
36
127
|
```ruby
|
37
128
|
params = {
|
@@ -47,18 +138,52 @@ params = {
|
|
47
138
|
}
|
48
139
|
|
49
140
|
demographic = Eligible::Demographic.get(params)
|
50
|
-
demographic.
|
141
|
+
demographic.to_hash # returns all coverage info for the request
|
142
|
+
demographic.error # return error, if any
|
51
143
|
```
|
52
144
|
|
145
|
+
## Medicare
|
146
|
+
|
147
|
+
### Reference
|
53
148
|
|
149
|
+
[https://eligibleapi.com/rest-api-v1-1/medicare#apiMedicare](https://eligibleapi.com/rest-api-v1-1/medicare#apiMedicare)
|
54
150
|
|
55
|
-
|
56
|
-
**POST** `https://gds.eligibleapi.com/v1.1/demographic/all/batch.json`
|
151
|
+
### Retrieve eligibility & benefit information from CMS Medicare for a patient.
|
57
152
|
|
58
153
|
```ruby
|
154
|
+
params = {
|
155
|
+
:payer_id => "000001",
|
156
|
+
:provider_last_name => "Last",
|
157
|
+
:provider_first_name => "First",
|
158
|
+
:provider_npi => "12345678",
|
159
|
+
:member_id => "12345678",
|
160
|
+
:member_last_name => "Austen",
|
161
|
+
:member_first_name => "Jane",
|
162
|
+
:member_dob => "1955-12-14"
|
163
|
+
}
|
164
|
+
medicare = Eligible::Medicare.get(params)
|
165
|
+
medicare.to_hash # returns all coverage info for the request
|
166
|
+
medicare.error # return error, if any
|
59
167
|
|
60
|
-
|
168
|
+
```
|
169
|
+
|
170
|
+
## Batch API
|
171
|
+
|
172
|
+
### Reference
|
173
|
+
|
174
|
+
[https://github.com/EligibleAPI/tools/wiki/Batch-Api](https://github.com/EligibleAPI/tools/wiki/Batch-Api)
|
175
|
+
|
176
|
+
Its important to notice that all the batch api calls, will notify the results by a webhook.
|
177
|
+
|
178
|
+
You can setup a webhook in your [Dashboard](https://www.eligibleapi.com/dashboard/webhooks).
|
179
|
+
|
180
|
+
All the batch api calls, returns a *reference_id* value and the *number_of_items* submitted.
|
181
|
+
|
182
|
+
### Coverage Batch API
|
183
|
+
|
184
|
+
```ruby
|
61
185
|
params = {
|
186
|
+
"api_key"=>"81ef98e5-4584-19fb-0d8c-6e987b95d695",
|
62
187
|
"parameters"=>[
|
63
188
|
{
|
64
189
|
"id"=>1,
|
@@ -86,41 +211,16 @@ params = {
|
|
86
211
|
}
|
87
212
|
]
|
88
213
|
}
|
89
|
-
Eligible::Demographic.batch_post params
|
90
|
-
# return
|
91
|
-
Eligible::EligibleObject:0x000000058914a8 @api_key="XXX",
|
92
|
-
@values={:reference_id=>"1ea06414-2132-52e1-1580-aea92f37720b",
|
93
|
-
:number_of_items=>2},
|
94
|
-
@unsaved_values=#<Set: {}>,
|
95
|
-
@transient_values=#<Set: {}>>
|
96
|
-
```
|
97
|
-
|
98
|
-
### Retrieve Coverage object
|
99
|
-
|
100
|
-
```ruby
|
101
|
-
params = {
|
102
|
-
:service_type => "33",
|
103
|
-
:network => "OUT",
|
104
|
-
:payer_id => "000001",
|
105
|
-
:provider_last_name => "Last",
|
106
|
-
:provider_first_name => "First",
|
107
|
-
:provider_npi => "12345678",
|
108
|
-
:member_id => "12345678",
|
109
|
-
:member_last_name => "Austen",
|
110
|
-
:member_first_name => "Jane",
|
111
|
-
:member_dob => "1955-12-14"
|
112
|
-
}
|
113
214
|
|
114
|
-
|
115
|
-
|
215
|
+
result = Eligible::Coverage.batch_post(params)
|
216
|
+
result.to_hash # returns the api call results
|
217
|
+
result.error # return error, if any
|
116
218
|
```
|
117
|
-
|
118
|
-
|
219
|
+
|
220
|
+
### Demographic Batch API
|
119
221
|
|
120
222
|
```ruby
|
121
|
-
Eligible.test = true
|
122
223
|
params = {
|
123
|
-
"api_key"=>"81ef98e5-4584-19fb-0d8c-6e987b95d695",
|
124
224
|
"parameters"=>[
|
125
225
|
{
|
126
226
|
"id"=>1,
|
@@ -148,21 +248,14 @@ params = {
|
|
148
248
|
}
|
149
249
|
]
|
150
250
|
}
|
151
|
-
|
152
|
-
|
153
|
-
#
|
154
|
-
Eligible::EligibleObject:0x000000059a11b8 @api_key="XXX",
|
155
|
-
@values={:reference_id=>"1ea06414-2132-52e1-1580-aea92f37720b",
|
156
|
-
:number_of_items=>2},
|
157
|
-
@unsaved_values=#<Set: {}>,
|
158
|
-
@transient_values=#<Set: {}>>
|
159
|
-
|
251
|
+
result = Eligible::Demographic.batch_post(params)
|
252
|
+
result.to_hash # returns the api call results
|
253
|
+
result.error # return error, if any
|
160
254
|
```
|
161
|
-
|
162
|
-
|
255
|
+
|
256
|
+
### Medicare Batch API
|
163
257
|
|
164
258
|
```ruby
|
165
|
-
Eligible.test = true
|
166
259
|
params = {
|
167
260
|
"parameters"=>[
|
168
261
|
{
|
@@ -189,19 +282,20 @@ params = {
|
|
189
282
|
}
|
190
283
|
|
191
284
|
Eligible::Coverage.batch_medicare_post params
|
192
|
-
#
|
193
|
-
|
194
|
-
@values={:reference_id=>"1ea06414-2132-52e1-1580-aea92f37720b",
|
195
|
-
:number_of_items=>2},
|
196
|
-
@unsaved_values=#<Set: {}>,
|
197
|
-
@transient_values=#<Set: {}>>
|
285
|
+
result.to_hash # returns the api call results
|
286
|
+
result.error # return error, if any
|
198
287
|
```
|
199
288
|
|
289
|
+
## Enrollment
|
200
290
|
|
291
|
+
### Reference
|
201
292
|
|
293
|
+
[https://github.com/EligibleAPI/tools/wiki/Enrollments](https://github.com/EligibleAPI/tools/wiki/Enrollments)
|
202
294
|
|
295
|
+
Its important to notice than an Enrollment Request can have multiple Enrollment NPIs, and that the API has been designed
|
296
|
+
in a way that you can repeat the enrollment for a NPI multiple times across different Enrollment request.
|
203
297
|
|
204
|
-
###
|
298
|
+
### Create an Enrollment Request
|
205
299
|
|
206
300
|
```ruby
|
207
301
|
params = {
|
@@ -234,21 +328,34 @@ params = {
|
|
234
328
|
"00282"
|
235
329
|
]
|
236
330
|
}
|
331
|
+
result = Eligible::Enrollment.post(params)
|
332
|
+
result.to_hash # returns the api call results
|
333
|
+
result.error # return error, if any
|
237
334
|
|
238
|
-
Eligible::Enrollment.post(params)
|
239
335
|
```
|
240
336
|
|
241
|
-
### Retrieve Enrollment
|
337
|
+
### Retrieve an Enrollment Request
|
242
338
|
|
243
339
|
```ruby
|
244
|
-
params = {
|
340
|
+
params = { :enrollment_request_id => 123 }
|
341
|
+
enrollment = Eligible::Enrollment.get(params)
|
342
|
+
enrollment.to_hash # return the api call results
|
343
|
+
enrollment.error # return error, if any
|
344
|
+
enrollment.enrollment_npis # quick access to the enrollment npis within the enrollment request object
|
245
345
|
|
346
|
+
params = { :npis => %w(123 456 789).join(',') }
|
246
347
|
enrollment = Eligible::Enrollment.get(params)
|
247
348
|
|
248
|
-
enrollment.enrollment_npis # returns a list of enroll the provider(s)
|
249
349
|
```
|
250
350
|
|
251
|
-
|
351
|
+
|
352
|
+
## Claims
|
353
|
+
|
354
|
+
### Reference
|
355
|
+
|
356
|
+
[https://github.com/EligibleAPI/tools/wiki/Claims](https://github.com/EligibleAPI/tools/wiki/Claims)
|
357
|
+
|
358
|
+
### Create Claim object
|
252
359
|
|
253
360
|
```ruby
|
254
361
|
params = {
|
@@ -318,7 +425,9 @@ params = {
|
|
318
425
|
}
|
319
426
|
}
|
320
427
|
|
321
|
-
Eligible::Claim.post(params)
|
428
|
+
result = Eligible::Claim.post(params)
|
429
|
+
enrollment.to_hash # return the api call results
|
430
|
+
enrollment.error # return error, if any
|
322
431
|
```
|
323
432
|
|
324
433
|
### Retrieve all Claim objects/acknowledgments
|
@@ -337,6 +446,12 @@ params = {
|
|
337
446
|
claim = Eligible::Claim.get(params) # returns acknoweldement information on an individual claim identified by its reference_id
|
338
447
|
```
|
339
448
|
|
449
|
+
## Payment Status
|
450
|
+
|
451
|
+
### Reference
|
452
|
+
|
453
|
+
[https://eligibleapi.com/rest-api-v1-1/beta/payment-status#apiPaymentStatus](https://eligibleapi.com/rest-api-v1-1/beta/payment-status#apiPaymentStatus)
|
454
|
+
|
340
455
|
### Retrieve Payment status
|
341
456
|
|
342
457
|
```ruby
|
@@ -345,18 +460,84 @@ params = { :reference_id => "89898989" }
|
|
345
460
|
Eligible::Payment.get(params) # returns status information on an individual payment identified by its reference_id
|
346
461
|
```
|
347
462
|
|
463
|
+
## X12
|
464
|
+
|
465
|
+
### Reference
|
348
466
|
|
467
|
+
[https://github.com/EligibleAPI/tools/wiki/X12](https://github.com/EligibleAPI/tools/wiki/X12)
|
349
468
|
|
350
469
|
### X12 post
|
351
470
|
|
352
471
|
```ruby
|
353
|
-
|
472
|
+
params = { :x12 => "ISA*00* *00* *ZZ*SENDERID *ZZ*ELIGIB *130610*0409*^*00501*100000001*0*T*:~GS*HS*SENDERID*ELIGIB*20130610*0409*1*X*005010X279A1~ST*270*0001*005010X279A1~BHT*0022*13*137083739083716126837*20130610*0409~HL*1**20*1~NM1*PR*2*UnitedHealthCare*****PI*112~HL*2*1*21*1~NM1*1P*1*AUSTEN*JANE****XX*1222494919~HL*3*2*22*0~TRN*1*1*1453915417~NM1*IL*1*FRANKLIN*BENJAMIN****MI*23412342~DMG*D8*17371207~DTP*291*D8*20130610~EQ*30~SE*13*0001~GE*1*1~IEA*1*100000001~" }
|
473
|
+
|
474
|
+
result = Eligible::X12.post(params)
|
475
|
+
```
|
476
|
+
|
477
|
+
## Tickets
|
478
|
+
|
479
|
+
### Reference
|
480
|
+
|
481
|
+
[https://github.com/EligibleAPI/tools/wiki/Tickets](https://github.com/EligibleAPI/tools/wiki/Tickets)
|
482
|
+
|
483
|
+
### Create a ticket
|
484
|
+
|
485
|
+
```ruby
|
486
|
+
params = {:priority => 'normal',
|
487
|
+
:title => 'TITLE',
|
488
|
+
:notification_email => 'admin@eligibleapi.com',
|
489
|
+
:body => 'Your comment'}
|
490
|
+
result = Eligible::Ticket.create params
|
491
|
+
result.to_hash # return the api call results
|
492
|
+
enrollment.error # return error, if any
|
493
|
+
```
|
494
|
+
|
495
|
+
### Get a ticket
|
496
|
+
|
497
|
+
```ruby
|
498
|
+
ticket = Eligible::Ticket.get(:id => 1)
|
499
|
+
ticket.to_hash # return the api call result
|
500
|
+
ticket.error # return error, if any
|
501
|
+
```
|
502
|
+
|
503
|
+
### Update a ticket
|
504
|
+
|
505
|
+
```ruby
|
506
|
+
params = { :id => 1,
|
507
|
+
:priority => 'normal',
|
508
|
+
:title => 'TITLE',
|
509
|
+
:notification_email => 'your_email@test.com',
|
510
|
+
:body => 'Your comment'}
|
511
|
+
result = Eligible::Ticket.update(params)
|
512
|
+
result.to_hash # return the api call results
|
513
|
+
enrollment.error # return error, if any
|
514
|
+
```
|
515
|
+
|
516
|
+
### Get comments for a ticket
|
517
|
+
|
518
|
+
```ruby
|
519
|
+
comments = Eligible::Ticket.get(:id => 1)
|
520
|
+
comments.to_hash # return the api call result
|
521
|
+
comments.error # return error, if any
|
522
|
+
|
523
|
+
```
|
524
|
+
|
525
|
+
### Delete a ticket
|
526
|
+
```ruby
|
527
|
+
result = Eligible::Ticket.delete(:id => 1)
|
528
|
+
comments.to_hash # return the api call result
|
529
|
+
comments.error # return error, if any
|
530
|
+
```
|
531
|
+
|
532
|
+
|
533
|
+
### Get all tickets
|
354
534
|
|
355
|
-
|
535
|
+
```ruby
|
536
|
+
Eligible::Ticket.all
|
356
537
|
```
|
357
538
|
|
358
539
|
|
359
|
-
|
540
|
+
# Tests
|
360
541
|
|
361
542
|
You can run tests with
|
362
543
|
|
@@ -376,10 +557,25 @@ If you do send a pull request, please add passing tests for the new feature/fix.
|
|
376
557
|
6. Create new Pull Request
|
377
558
|
|
378
559
|
## Changelog
|
560
|
+
|
561
|
+
#### 2.4
|
562
|
+
- Refactoring Code
|
563
|
+
- More test cases
|
564
|
+
- Removed legacy endpoint for *plans*, *coverage* should be used instead.
|
565
|
+
- Removed legacy endpoint for *services*, *coverage* should be used instead.
|
566
|
+
- List of contributors and documentation updated.
|
567
|
+
- Gemfile updated, dependencies updated as well.
|
568
|
+
- Removed json gem in favor of multi_json
|
569
|
+
- Fixed the code to let the users make x12 requests at anytime.
|
570
|
+
- New endpoint for Tickets
|
571
|
+
|
572
|
+
#### 2.3
|
573
|
+
- New endpoint for Batch
|
574
|
+
|
379
575
|
#### 2.2
|
380
576
|
- New endpoint for x12 POST
|
381
|
-
#### 2.1
|
382
577
|
|
578
|
+
#### 2.1
|
383
579
|
- New endpoint for payment status
|
384
580
|
|
385
581
|
#### 2.0
|