eligible 2.4.3 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.rspec +2 -0
- data/.rubocop.yml +12 -0
- data/ChangeLog +51 -0
- data/LICENSE +1 -1
- data/README.md +71 -133
- data/Rakefile +12 -2
- data/eligible.gemspec +14 -15
- data/lib/eligible.rb +96 -68
- data/lib/eligible/api_resource.rb +4 -6
- data/lib/eligible/claim.rb +12 -18
- data/lib/eligible/coverage.rb +16 -17
- data/lib/eligible/demographic.rb +7 -10
- data/lib/eligible/eligible_object.rb +12 -14
- data/lib/eligible/enrollment.rb +12 -13
- data/lib/eligible/errors/eligible_error.rb +2 -2
- data/lib/eligible/medicare.rb +8 -14
- data/lib/eligible/payment.rb +4 -9
- data/lib/eligible/ticket.rb +23 -30
- data/lib/eligible/util.rb +31 -35
- data/lib/eligible/version.rb +1 -1
- data/lib/eligible/x12.rb +2 -4
- metadata +50 -52
- data/CONTRIBUTORS +0 -5
- data/test/test_eligible.rb +0 -178
- data/test/test_helper.rb +0 -97
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17923f2b677856fbfddf6fcb264f50c1df9978a3
|
4
|
+
data.tar.gz: 5893d5023436251f4210528eb04427a3b8df88b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7b78bb2711b50bf924913be82666f60231968cc9fa04b2dbb327bd0db11f0ac178b2554173139bbb4adf1d68516425f932fd9abd876a6db22d73c4ea644fe2e
|
7
|
+
data.tar.gz: f74b959d868e42bf2a85a903e28aa487fe9d6a5c420cc8f38e83e41bf85d5277ff2c9f7431d207ea90a55cdc791e082d3f68aeeb393d3037bd81894ee5c1c8ce
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/ChangeLog
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
2016-01-07 Eligible <support@eligible.com>
|
2
|
+
|
3
|
+
* 2.5.0
|
4
|
+
- Added certificate pinning
|
5
|
+
- Added rubocop and fixed style/linting/metrics issues
|
6
|
+
- Migrated from outdated test-unit/mocha to current rspec for test suite
|
7
|
+
|
8
|
+
0000-00-00 Eligible <support@eligible.com>
|
9
|
+
|
10
|
+
* 2.4
|
11
|
+
- Refactoring Code
|
12
|
+
- More test cases
|
13
|
+
- Removed legacy endpoint for *plans*, *coverage* should be used instead.
|
14
|
+
- Removed legacy endpoint for *services*, *coverage* should be used instead.
|
15
|
+
- List of contributors and documentation updated.
|
16
|
+
- Gemfile updated, dependencies updated as well.
|
17
|
+
- Removed json gem in favor of multi_json
|
18
|
+
- Fixed the code to let the users make x12 requests at anytime.
|
19
|
+
- New endpoint for Tickets
|
20
|
+
|
21
|
+
0000-00-00 Eligible <support@eligible.com>
|
22
|
+
|
23
|
+
* 2.3
|
24
|
+
- New endpoint for Batch
|
25
|
+
|
26
|
+
0000-00-00 Eligible <support@eligible.com>
|
27
|
+
|
28
|
+
* 2.2
|
29
|
+
- New endpoint for x12 POST
|
30
|
+
|
31
|
+
0000-00-00 Eligible <support@eligible.com>
|
32
|
+
|
33
|
+
* 2.1
|
34
|
+
- New endpoint for payment status
|
35
|
+
|
36
|
+
0000-00-00 Eligible <support@eligible.com>
|
37
|
+
|
38
|
+
* 2.0
|
39
|
+
- Additional endpoints for claims, enrollments, and coverage
|
40
|
+
|
41
|
+
0000-00-00 Eligible <support@eligible.com>
|
42
|
+
|
43
|
+
* 1.1
|
44
|
+
- Additional endpoints for service/general and service/list
|
45
|
+
- Support x12 format in params
|
46
|
+
|
47
|
+
0000-00-00 Eligible <support@eligible.com>
|
48
|
+
|
49
|
+
* 1.0
|
50
|
+
- Initial release
|
51
|
+
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Eligible
|
2
2
|
|
3
|
-
|
3
|
+
[![Circle CI](https://circleci.com/gh/eligible/eligible-ruby.svg?style=svg)](https://circleci.com/gh/eligible/eligible-ruby)
|
4
|
+
|
5
|
+
Ruby bindings for the [Eligible API](https://eligible.com/rest)
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -16,72 +18,77 @@ Or install it yourself with:
|
|
16
18
|
|
17
19
|
$ gem install eligible
|
18
20
|
|
19
|
-
|
21
|
+
## Usage
|
20
22
|
|
21
|
-
|
23
|
+
### Setup
|
24
|
+
```ruby
|
25
|
+
require 'eligible'
|
26
|
+
Eligible.api_key = 'YOUR_KEY'
|
27
|
+
```
|
22
28
|
|
23
|
-
|
24
|
-
|
29
|
+
### Test
|
30
|
+
```ruby
|
31
|
+
Eligible.test = true
|
32
|
+
```
|
25
33
|
|
26
|
-
|
27
|
-
[https://eligibleapi.com/resources/information-sources.json](https://eligibleapi.com/resources/information-sources.json)
|
34
|
+
### Parameters overwrite
|
28
35
|
|
29
|
-
|
36
|
+
On each api call, you can overwrite the api key or the test parameter:
|
30
37
|
|
31
|
-
|
32
|
-
|
38
|
+
```ruby
|
39
|
+
Eligible::Demographic.get({:api_key => 'NEW_KEY', :test => false})
|
40
|
+
```
|
33
41
|
|
34
|
-
|
35
|
-
[https://eligibleapi.com/resources/claims-payer.json](https://eligibleapi.com/resources/claims-payer.json)
|
42
|
+
### Response Format
|
36
43
|
|
37
|
-
|
44
|
+
By default, all responses are in JSON, but you can request raw
|
45
|
+
access to X12 by adding is as a parameter on the api call:
|
38
46
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
https://eligibleapi.com/resources/service-codes.json](ttps://eligibleapi.com/resources/service-codes.json)
|
47
|
+
```ruby
|
48
|
+
Eligible::Demographic.get({:format => "x12"})
|
49
|
+
```
|
43
50
|
|
44
|
-
|
51
|
+
# Important notes
|
45
52
|
|
46
|
-
|
53
|
+
## Payer List for Eligibility
|
47
54
|
|
48
|
-
|
55
|
+
the parameter `payer_id`, required for most of the api calls, is
|
56
|
+
provided by Eligible from its website, in xml and json format, which
|
57
|
+
you can embed into your applications.
|
49
58
|
|
50
|
-
[https://
|
59
|
+
[https://eligible.com/resources/information-sources.xml](https://eligible.com/resources/information-sources.xml)
|
60
|
+
[https://eligible.com/resources/information-sources.json](https://eligible.com/resources/information-sources.json)
|
51
61
|
|
62
|
+
## Payer List for Claims
|
52
63
|
|
53
|
-
|
64
|
+
the parameter `payer_id`, required for claims, is provided by Eligible
|
65
|
+
from its website, in xml and json format, which you can embed into
|
66
|
+
your applications.
|
54
67
|
|
55
|
-
|
56
|
-
|
57
|
-
require 'eligible'
|
58
|
-
Eligible.api_key = 'YOUR_KEY'
|
59
|
-
```
|
68
|
+
[https://eligible.com/resources/claims-payer.xml](https://eligible.com/resources/claims-payer.xml)
|
69
|
+
[https://eligible.com/resources/claims-payer.json](https://eligible.com/resources/claims-payer.json)
|
60
70
|
|
61
|
-
|
62
|
-
```ruby
|
63
|
-
Eligible.test = true
|
64
|
-
```
|
71
|
+
## Service Type Codes
|
65
72
|
|
66
|
-
|
73
|
+
the parameter `service_type`, required on the api calls, is provided
|
74
|
+
by Eligible from its website, in xml and json format, which you can
|
75
|
+
embed into your applications.
|
67
76
|
|
68
|
-
|
77
|
+
[https://eligible.com/resources/service-codes.xml](https://eligible.com/resources/service-codes.xml)
|
78
|
+
[https://eligible.com/resources/service-codes.json](ttps://eligible.com/resources/service-codes.json)
|
69
79
|
|
70
|
-
|
71
|
-
Eligible::Demographic.get({:api_key => 'NEW_KEY', :test => false})
|
72
|
-
```
|
80
|
+
## Place of Service
|
73
81
|
|
74
|
-
|
82
|
+
[https://eligible.com/resources/place_of_service.json](https://eligible.com/resources/place_of_service.json)
|
75
83
|
|
76
|
-
|
84
|
+
## Health Care Provider Taxonomy
|
77
85
|
|
78
|
-
|
79
|
-
Eligible::Demographic.get({:format => "x12"})
|
80
|
-
```
|
86
|
+
[https://eligible.com/resources/health-care-provider-taxonomy-code-set.json](https://eligible.com/resources/health-care-provider-taxonomy-code-set.json)
|
81
87
|
|
82
88
|
### Api Call Results
|
83
89
|
|
84
|
-
On all
|
90
|
+
On all results you can check for errors in `result.error`. The raw
|
91
|
+
json format is available by using `result.to_hash`.
|
85
92
|
|
86
93
|
```ruby
|
87
94
|
demographic = Eligible::Demographic.get(params)
|
@@ -93,9 +100,9 @@ demographic.to_hash
|
|
93
100
|
|
94
101
|
### Reference
|
95
102
|
|
96
|
-
[https://
|
103
|
+
[https://eligible.com/rest#coverage](https://eligible.com/rest#coverage)
|
97
104
|
|
98
|
-
### Retrieve eligibility
|
105
|
+
### Retrieve eligibility and benefit information
|
99
106
|
|
100
107
|
```ruby
|
101
108
|
params = {
|
@@ -120,7 +127,7 @@ coverage.error # return error, if any
|
|
120
127
|
|
121
128
|
### Reference
|
122
129
|
|
123
|
-
[https://
|
130
|
+
[https://eligible.com/rest#demographics](https://eligible.com/rest#demographics)
|
124
131
|
|
125
132
|
### Fetch demographics for a patient
|
126
133
|
|
@@ -144,11 +151,7 @@ demographic.error # return error, if any
|
|
144
151
|
|
145
152
|
## Medicare
|
146
153
|
|
147
|
-
###
|
148
|
-
|
149
|
-
[https://github.com/EligibleAPI/tools/wiki/Medicare](https://github.com/EligibleAPI/tools/wiki/Medicare)
|
150
|
-
|
151
|
-
### Retrieve eligibility & benefit information from CMS Medicare for a patient.
|
154
|
+
### Retrieve eligibility and benefit information from CMS Medicare for a patient.
|
152
155
|
|
153
156
|
```ruby
|
154
157
|
params = {
|
@@ -164,20 +167,15 @@ params = {
|
|
164
167
|
medicare = Eligible::Medicare.get(params)
|
165
168
|
medicare.to_hash # returns all coverage info for the request
|
166
169
|
medicare.error # return error, if any
|
167
|
-
|
168
170
|
```
|
169
171
|
|
170
172
|
## Batch API
|
171
173
|
|
172
|
-
|
173
|
-
|
174
|
-
[
|
175
|
-
|
176
|
-
|
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.
|
174
|
+
All the batch api calls will notify the results via webhook. You can
|
175
|
+
setup a webhook in your
|
176
|
+
[Dashboard](https://ligible.com/dashboard/webhooks). All batch api
|
177
|
+
calls return a *reference_id* value and the *number_of_items*
|
178
|
+
submitted.
|
181
179
|
|
182
180
|
### Coverage Batch API
|
183
181
|
|
@@ -288,12 +286,9 @@ result.error # return error, if any
|
|
288
286
|
|
289
287
|
## Enrollment
|
290
288
|
|
291
|
-
|
292
|
-
|
293
|
-
|
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.
|
289
|
+
Enrollment requests can have multiple enrollment NPIs. You can repeat
|
290
|
+
the enrollment for a NPI multiple times across different enrollment
|
291
|
+
requests.
|
297
292
|
|
298
293
|
### Create an Enrollment Request
|
299
294
|
|
@@ -331,7 +326,6 @@ params = {
|
|
331
326
|
result = Eligible::Enrollment.post(params)
|
332
327
|
result.to_hash # returns the api call results
|
333
328
|
result.error # return error, if any
|
334
|
-
|
335
329
|
```
|
336
330
|
|
337
331
|
### Retrieve an Enrollment Request
|
@@ -345,16 +339,10 @@ enrollment.enrollment_npis # quick access to the enrollment npis within the enro
|
|
345
339
|
|
346
340
|
params = { :npis => %w(123 456 789).join(',') }
|
347
341
|
enrollment = Eligible::Enrollment.get(params)
|
348
|
-
|
349
342
|
```
|
350
343
|
|
351
|
-
|
352
344
|
## Claims
|
353
345
|
|
354
|
-
### Reference
|
355
|
-
|
356
|
-
[https://github.com/EligibleAPI/tools/wiki/Claims](https://github.com/EligibleAPI/tools/wiki/Claims)
|
357
|
-
|
358
346
|
### Create Claim object
|
359
347
|
|
360
348
|
```ruby
|
@@ -433,24 +421,24 @@ enrollment.error # return error, if any
|
|
433
421
|
### Retrieve all Claim objects/acknowledgments
|
434
422
|
|
435
423
|
```ruby
|
436
|
-
claims = Eligible::Claim.all # returns
|
424
|
+
claims = Eligible::Claim.all # returns acknowledgment information for all claims that have been submitted with the API key
|
437
425
|
```
|
438
426
|
|
439
427
|
### Retrieve individual Claim object/acknowledgment
|
440
428
|
|
441
429
|
```ruby
|
442
|
-
params = {
|
430
|
+
params = {
|
443
431
|
:reference_id => "12345"
|
444
432
|
}
|
445
433
|
|
446
|
-
claim = Eligible::Claim.get(params) # returns
|
434
|
+
claim = Eligible::Claim.get(params) # returns acknowledgment information on an individual claim identified by its reference_id
|
447
435
|
```
|
448
436
|
|
449
437
|
## Payment Status
|
450
438
|
|
451
439
|
### Reference
|
452
440
|
|
453
|
-
[https://
|
441
|
+
[https://eligible.com/rest#payment-status](https://eligible.com/rest#payment-status)
|
454
442
|
|
455
443
|
### Retrieve Payment status
|
456
444
|
|
@@ -475,10 +463,6 @@ result.error # return error, if any
|
|
475
463
|
|
476
464
|
## X12
|
477
465
|
|
478
|
-
### Reference
|
479
|
-
|
480
|
-
[https://github.com/EligibleAPI/tools/wiki/X12](https://github.com/EligibleAPI/tools/wiki/X12)
|
481
|
-
|
482
466
|
### X12 post
|
483
467
|
|
484
468
|
```ruby
|
@@ -489,16 +473,12 @@ result = Eligible::X12.post(params)
|
|
489
473
|
|
490
474
|
## Tickets
|
491
475
|
|
492
|
-
### Reference
|
493
|
-
|
494
|
-
[https://github.com/EligibleAPI/tools/wiki/Tickets](https://github.com/EligibleAPI/tools/wiki/Tickets)
|
495
|
-
|
496
476
|
### Create a ticket
|
497
477
|
|
498
478
|
```ruby
|
499
479
|
params = {:priority => 'normal',
|
500
480
|
:title => 'TITLE',
|
501
|
-
:notification_email => 'admin@
|
481
|
+
:notification_email => 'admin@eligible.com',
|
502
482
|
:body => 'Your comment'}
|
503
483
|
result = Eligible::Ticket.create params
|
504
484
|
result.to_hash # return the api call results
|
@@ -542,64 +522,22 @@ comments.to_hash # return the api call result
|
|
542
522
|
comments.error # return error, if any
|
543
523
|
```
|
544
524
|
|
545
|
-
|
546
525
|
### Get all tickets
|
547
526
|
|
548
527
|
```ruby
|
549
528
|
Eligible::Ticket.all
|
550
529
|
```
|
551
530
|
|
552
|
-
|
553
|
-
# Tests
|
554
|
-
|
555
|
-
You can run tests with
|
556
|
-
|
557
|
-
```ruby
|
558
|
-
rake test
|
559
|
-
```
|
560
|
-
|
561
|
-
If you do send a pull request, please add passing tests for the new feature/fix.
|
562
|
-
|
563
531
|
## Contributing
|
564
532
|
|
533
|
+
Running `rake` will run the test suite along with rubocop as a basic
|
534
|
+
style assessment. If you are going to submit a pull request, please
|
535
|
+
verify that all tests pass and there are no rubocop errors. Please add
|
536
|
+
additional tests for any features or fixes provided.
|
537
|
+
|
565
538
|
1. Fork it
|
566
539
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
567
540
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
568
541
|
4. Run tests (see above)
|
569
542
|
5. Push to the branch (`git push origin my-new-feature`)
|
570
543
|
6. Create new Pull Request
|
571
|
-
|
572
|
-
## Changelog
|
573
|
-
|
574
|
-
#### 2.4
|
575
|
-
- Refactoring Code
|
576
|
-
- More test cases
|
577
|
-
- Removed legacy endpoint for *plans*, *coverage* should be used instead.
|
578
|
-
- Removed legacy endpoint for *services*, *coverage* should be used instead.
|
579
|
-
- List of contributors and documentation updated.
|
580
|
-
- Gemfile updated, dependencies updated as well.
|
581
|
-
- Removed json gem in favor of multi_json
|
582
|
-
- Fixed the code to let the users make x12 requests at anytime.
|
583
|
-
- New endpoint for Tickets
|
584
|
-
|
585
|
-
#### 2.3
|
586
|
-
- New endpoint for Batch
|
587
|
-
|
588
|
-
#### 2.2
|
589
|
-
- New endpoint for x12 POST
|
590
|
-
|
591
|
-
#### 2.1
|
592
|
-
- New endpoint for payment status
|
593
|
-
|
594
|
-
#### 2.0
|
595
|
-
|
596
|
-
- Additional endpoints for claims, enrollments, and coverage
|
597
|
-
|
598
|
-
#### 1.1
|
599
|
-
|
600
|
-
- Additional endpoints for service/general and service/list
|
601
|
-
- Support x12 format in params
|
602
|
-
|
603
|
-
#### 1.0
|
604
|
-
|
605
|
-
- Initial release
|
data/Rakefile
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
2
|
require 'rake/testtask'
|
3
|
+
require 'rubocop/rake_task'
|
4
|
+
require 'rspec/core/rake_task'
|
3
5
|
|
4
|
-
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
7
|
+
|
8
|
+
desc 'Run RuboCop on the lib directory'
|
9
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
10
|
+
task.patterns = ['lib/**/*.rb']
|
11
|
+
task.fail_on_error = false
|
12
|
+
end
|
13
|
+
|
14
|
+
task default: [:rubocop, :spec]
|