eligible 2.1 → 2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a4997734c6c3bc08f26486f24b423abf9aa42cda
4
+ data.tar.gz: dec4c20fa5afade770a8bf15ccc001f0407d7737
5
+ SHA512:
6
+ metadata.gz: d956ab6db3fa44141f7a829974158d282cbf1a3f0d1d5e2517f575dc9d27a9d9f9339f2cf4ad1b8465cf98f5a1011bc27d07a664c3608f5456706ebf1b9b15ea
7
+ data.tar.gz: 6cf83993819f65db71fadf831ebe4f4aa900e75bd40b3db8038089b717b961f270f2b730d4e73a7a8356f8d20aa0560550ed51725345e22aee84b6cf8c89486c
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .idea
data/README.md CHANGED
@@ -20,34 +20,18 @@ Or install it yourself with:
20
20
 
21
21
  ### Setup
22
22
  require 'eligible'
23
- Eligible.api_key = YOUR_KEY
24
-
23
+ Eligible.api_key = 'YOUR_KEY'
24
+ ### Test
25
+ ```ruby
26
+ Eligible.test = true
27
+ ```
28
+ Include `{ :test => "true" }` in the params for sandbox access.
25
29
  ### Format
26
30
 
27
31
  Include `{ :format => "X12" }` in the params hash to get back the raw X12 response.
28
32
 
29
- ### Retrieve Plan object and query it
30
33
 
31
- ```ruby
32
- params = {
33
- :payer_name => "Aetna",
34
- :payer_id => "000001",
35
- :provider_last_name => "Last",
36
- :provider_first_name => "First",
37
- :provider_npi => "12345678",
38
- :member_id => "12345678",
39
- :member_last_name => "Austen",
40
- :member_first_name => "Jane",
41
- :member_dob => "1955-12-14"
42
- }
43
-
44
- plan = Eligible::Plan.get(params)
45
- plan.all # returns all fields on the plan, per the plan/all endpoint
46
- plan.status # returns status fields on the plan, per the plan/status endpoint
47
- ## Etc.: plan.deductible, plan.dates, plan.balance, plan.stop_loss
48
- ```
49
-
50
- ### Retrieve Service object and query it
34
+ ### Retrieve Demographic object and query it
51
35
 
52
36
  ```ruby
53
37
  params = {
@@ -62,21 +46,17 @@ params = {
62
46
  :member_dob => "1955-12-14"
63
47
  }
64
48
 
65
- service = Eligible::Service.get(params)
66
- service.all # returns all fields for the service, per service/all
67
- service.visits # returns the visits for the service, per service/visits
68
- ## Etc.: service.copayment, service.coinsurance, service.deductible
69
-
70
- ## The endpoints 'general' and 'list' have a slightly different syntax than the others:
71
- json = Eligible::Service.general(params)
72
- json = Eligible::Service.list(params)
49
+ demographic = Eligible::Demographic.get(params)
50
+ demographic.all # returns all fields for the demographic, per demographic/all
73
51
  ```
74
52
 
75
- ### Retrieve Demographic object and query it
53
+
54
+ ### Retrieve Coverage object
76
55
 
77
56
  ```ruby
78
57
  params = {
79
- :payer_name => "Aetna",
58
+ :service_type => "33",
59
+ :network => "OUT",
80
60
  :payer_id => "000001",
81
61
  :provider_last_name => "Last",
82
62
  :provider_first_name => "First",
@@ -87,51 +67,16 @@ params = {
87
67
  :member_dob => "1955-12-14"
88
68
  }
89
69
 
90
- demographic = Eligible::Demographic.get(params)
91
- demographic.all # returns all fields for the demographic, per demographic/all
92
- demographic.zip # returns the patient's zip code, per demographic/zip
93
- ## Etc.: demographic.employer, demographic.address, demographic.dob
70
+ coverage = Eligible::Coverage.get(params)
71
+ coverage.all # returns all coverage info for the request
94
72
  ```
95
73
 
96
- ### Retrieve Claim object
97
-
98
- ```ruby
99
- params = {
100
- :payer_name => "Aetna",
101
- :payer_id => "000001",
102
- :information_receiver_organization_name => "Organization",
103
- :information_receiver_last_name => "Last",
104
- :information_receiver_first_name => "First",
105
- :information_receiver_etin => "12345678",
106
- :provider_organization_name => "Marshall Group",
107
- :provider_last_name => "Last",
108
- :provider_first_name => "First",
109
- :provider_npi => "12345678",
110
- :provider_tax_id => "12345678",
111
- :member_id => "12345678",
112
- :member_last_name => "Last",
113
- :member_first_name => "First",
114
- :member_dob => "1955-12-14",
115
- :dependent_last_name => "Last",
116
- :dependent_first_name => "First",
117
- :dependent_dob => "1975-12-14",
118
- :dependent_gender => "M",
119
- :trace_number => "12345",
120
- :claim_control_number => "67890",
121
- :claim_charge_amount => "45.00",
122
- :claim_start_date => "2013-01-05",
123
- :claim_end_date => "2013-01-05"
124
- }
125
-
126
- claim = Eligible::Claim.get(params)
127
- claim.status # Returns in real time the status (paid, not paid, rejected, denied, etc) of claim specified.
128
- ```
129
74
 
130
75
  ### Post Enrollment object
131
76
 
132
77
  ```ruby
133
78
  params = {
134
- "provider_list" => [
79
+ "service_provider_list" => [
135
80
  {
136
81
  "facility_name" => "Quality",
137
82
  "provider_name" => "Jane Austen",
@@ -170,129 +115,118 @@ Eligible::Enrollment.post(params)
170
115
  params = { "enrollment_request_id" => "123" }
171
116
 
172
117
  enrollment = Eligible::Enrollment.get(params)
173
- enrollment.status # returns the status of the request to enroll the provider(s)
174
- ```
175
-
176
- ### Retrieve Coverage object
177
-
178
- ```ruby
179
- params = {
180
- :service_type => "33",
181
- :network => "OUT",
182
- :payer_id => "000001",
183
- :provider_last_name => "Last",
184
- :provider_first_name => "First",
185
- :provider_npi => "12345678",
186
- :member_id => "12345678",
187
- :member_last_name => "Austen",
188
- :member_first_name => "Jane",
189
- :member_dob => "1955-12-14"
190
- }
191
118
 
192
- coverage = Eligible::Coverage.get(params)
193
- coverage.all # returns all coverage info for the request
119
+ enrollment.enrollment_npis # returns a list of enroll the provider(s)
194
120
  ```
195
121
 
196
122
  ### Post Claim object
197
123
 
198
124
  ```ruby
199
125
  params = {
200
- "api_key": "asdfsdfsd21132ddsfsdfd",
201
- "billing_provider": {
202
- "taxonomy_code": "332B00000X",
203
- "practice_name": "Jane Austen Practice",
204
- "npi": "1922222222",
205
- "address": {
206
- "street_line_1": "419 Fulton",
207
- "street_line_2": "",
208
- "city": "San Francisco",
209
- "state": "CA",
210
- "zip": "94102"
126
+ "receiver" => {
127
+ "name" => "AETNA",
128
+ "id" => "60054"
129
+ },
130
+ "billing_provider" => {
131
+ "taxonomy_code" => "332B00000X",
132
+ "practice_name" => "Jane Austen Practice",
133
+ "npi" => "1922222222",
134
+ "address" => {
135
+ "street_line_1" => "419 Fulton",
136
+ "street_line_2" => "",
137
+ "city" => "San Francisco",
138
+ "state" => "CA",
139
+ "zip" => "94102"
211
140
  },
212
- "tin": "43291023"
141
+ "tin" => "43291023"
213
142
  },
214
- "subscriber": {
215
- "last_name": "Franklin",
216
- "first_name": "Benjamin",
217
- "member_id": "W2832032427",
218
- "group_id": "455716",
219
- "group_name": "",
220
- "dob": "1734-05-04",
221
- "gender": "M",
222
- "address": {
223
- "street_line_1": "435 Sugar Lane",
224
- "street_line_2": "",
225
- "city": "Sweet",
226
- "state": "OH",
227
- "zip": "436233127"
143
+ "subscriber" => {
144
+ "last_name" => "Franklin",
145
+ "first_name" => "Benjamin",
146
+ "member_id" => "12312312",
147
+ "group_id" => "455716",
148
+ "group_name" => "",
149
+ "dob" => "1734-05-04",
150
+ "gender" => "M",
151
+ "address" => {
152
+ "street_line_1" => "435 Sugar Lane",
153
+ "street_line_2" => "",
154
+ "city" => "Sweet",
155
+ "state" => "OH",
156
+ "zip" => "436233127"
228
157
  }
229
158
  },
230
- "payer": {
231
- "name": "AETNA",
232
- "id": "60054",
233
- "address": {
234
- "street_line_1": "Po Box 981106",
235
- "street_line_2": "",
236
- "city": "El Paso",
237
- "state": "TX",
238
- "zip": "799981222"
159
+ "payer" => {
160
+ "name" => "AETNA",
161
+ "id" => "60054",
162
+ "address" => {
163
+ "street_line_1" => "Po Box 981106",
164
+ "street_line_2" => "",
165
+ "city" => "El Paso",
166
+ "state" => "TX",
167
+ "zip" => "799981222"
239
168
  }
240
169
  },
241
- "claim": {
242
- "total_charge_amount": "275",
243
- "claim_frequency": "1",
244
- "patient_signature_on_file": "Y",
245
- "provider_plan_participation": "A",
246
- "direct_payment_authorized": "Y",
247
- "release_of_information": "I",
248
- "service_lines": [
170
+ "claim" => {
171
+ "total_charge_amount" => "275",
172
+ "claim_frequency" => "1",
173
+ "patient_signature_on_file" => "Y",
174
+ "provider_plan_participation" => "A",
175
+ "direct_payment_authorized" => "Y",
176
+ "release_of_information" => "I",
177
+ "service_lines" => [
249
178
  {
250
- "line_number": "1",
251
- "service_start": "2013-03-07",
252
- "service_end": "2013-03-07",
253
- "place_of_service": "11",
254
- "charge_amount": "275",
255
- "product_service": "99213",
256
- "qualifier": "HC",
257
- "diagnosis_1": "32723"
179
+ "line_number" => "1",
180
+ "service_start" => "2013-03-07",
181
+ "service_end" => "2013-03-07",
182
+ "place_of_service" => "11",
183
+ "charge_amount" => "275",
184
+ "product_service" => "99213",
185
+ "qualifier" => "HC",
186
+ "diagnosis_1" => "32723"
258
187
  }
259
188
  ]
260
189
  }
261
190
  }
262
191
 
263
-
264
192
  Eligible::Claim.post(params)
265
193
  ```
266
194
 
267
195
  ### Retrieve all Claim objects/acknowledgments
268
196
 
269
197
  ```ruby
270
- claims = Eligible::Claim.all # returns status information for all claims that have been submitted with the API key
198
+ claims = Eligible::Claim.all # returns acknowlegdement information for all claims that have been submitted with the API key
271
199
  ```
272
200
 
273
- ### Retrieve Payment
201
+ ### Retrieve individual Claim object/acknowledgment
274
202
 
275
- params = {
203
+ ```ruby
204
+ params = {
276
205
  :reference_id => "12345"
277
206
  }
278
207
 
279
- payment = Eligible::Payment.get(params) # returns information about the claim with the given reference id.
208
+ claim = Eligible::Claim.get(params) # returns acknoweldement information on an individual claim identified by its reference_id
209
+ ```
280
210
 
281
- ### Retrieve all Payment objects
211
+ ### Retrieve Payment status
282
212
 
283
- payments = Eligible::Payment.all # returns claim information for all claims that have been submitted with the API key
284
- payments[:statuses]
213
+ ```ruby
214
+ params = { :reference_id => "89898989" }
285
215
 
286
- ### Retrieve individual Claim object/acknowledgment
216
+ Eligible::Payment.get(params) # returns status information on an individual payment identified by its reference_id
217
+ ```
218
+
219
+
220
+
221
+ ### X12 post
287
222
 
288
223
  ```ruby
289
- params = {
290
- :response_id => "12345"
291
- }
224
+ param = "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~"
292
225
 
293
- claim = Eligible::Claim.get(params) # returns status information on an individual claim
226
+ Eligible::X12.post param # <Net::HTTPOK 200 OK readbody=true>
294
227
  ```
295
228
 
229
+
296
230
  ## Tests
297
231
 
298
232
  You can run tests with
@@ -313,7 +247,8 @@ If you do send a pull request, please add passing tests for the new feature/fix.
313
247
  6. Create new Pull Request
314
248
 
315
249
  ## Changelog
316
-
250
+ #### 2.2
251
+ - New endpoint for x12 POST
317
252
  #### 2.1
318
253
 
319
254
  - New endpoint for payment status
@@ -329,4 +264,4 @@ If you do send a pull request, please add passing tests for the new feature/fix.
329
264
 
330
265
  #### 1.0
331
266
 
332
- - Initial release
267
+ - Initial release
@@ -20,15 +20,18 @@ require 'eligible/claim'
20
20
  require 'eligible/enrollment'
21
21
  require 'eligible/coverage'
22
22
  require 'eligible/payment'
23
+ require 'eligible/x12'
23
24
 
24
25
  # Errors
25
26
  require 'eligible/errors/eligible_error'
26
27
  require 'eligible/errors/api_connection_error'
27
28
  require 'eligible/errors/authentication_error'
28
29
  require 'eligible/errors/api_error'
30
+ require 'eligible/errors/invalid_request_error'
29
31
 
30
32
  module Eligible
31
33
  @@api_key = nil
34
+ @@test = false
32
35
  @@api_base = "https://gds.eligibleapi.com/v1.1"
33
36
  @@api_version = 1.1
34
37
 
@@ -44,6 +47,15 @@ module Eligible
44
47
  @@api_key = api_key
45
48
  end
46
49
 
50
+
51
+ def self.test
52
+ @@test? 'true':'false'
53
+ end
54
+
55
+ def self.test=(is_test)
56
+ @@test = is_test
57
+ end
58
+
47
59
  def self.api_version=(version)
48
60
  @@api_version = version
49
61
  end
@@ -95,11 +107,11 @@ module Eligible
95
107
  query_string = Util.flatten_params(params).collect{|key, value| "#{key}=#{Util.url_encode(value)}"}.join('&')
96
108
  url += "&#{query_string}"
97
109
  end
110
+ url +="&test=#{self.test}"
98
111
  payload = nil
99
112
  else
100
- payload = params.merge!({"api_key" => api_key }).to_json #Util.flatten_params(params).collect{|(key, value)| "#{key}=#{Util.url_encode(value)}"}.join('&')
113
+ payload = params.merge!({'api_key' => api_key ,'test' => self.test }).to_json #Util.flatten_params(params).collect{|(key, value)| "#{key}=#{Util.url_encode(value)}"}.join('&')
101
114
  end
102
-
103
115
  begin
104
116
  headers = { :x_eligible_client_user_agent => Eligible::JSON.dump(ua) }.merge(headers)
105
117
  rescue => e
@@ -190,7 +202,7 @@ module Eligible
190
202
  end
191
203
 
192
204
  def self.invalid_request_error(error, rcode, rbody, error_obj)
193
- InvalidRequestError.new(error[0][:message], error[:param], rcode, rbody, error_obj)
205
+ InvalidRequestError.new(error, rcode, rbody, error_obj)
194
206
  end
195
207
 
196
208
  def self.authentication_error(error, rcode, rbody, error_obj)
@@ -6,7 +6,7 @@ module Eligible
6
6
  end
7
7
 
8
8
  def self.post(params, api_key=nil)
9
- response, api_key = Eligible.request(:get, "/claims.json", api_key, params)
9
+ response, api_key = Eligible.request(:post, "/claims.json", api_key, params)
10
10
  Util.convert_to_eligible_object(response, api_key)
11
11
  end
12
12
 
@@ -15,6 +15,14 @@ module Eligible
15
15
  def all
16
16
  error ? nil : to_hash
17
17
  end
18
+
19
+ def enrollment_npis
20
+ r = Array.new
21
+ values[0].each do |value|
22
+ r << value[:enrollment_npi]
23
+ end
24
+ r
25
+ end
18
26
  end
19
27
 
20
28
  end
@@ -0,0 +1,4 @@
1
+ module Eligible
2
+ class InvalidRequestError < EligibleError
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module Eligible
2
- VERSION = "2.1"
2
+ VERSION = '2.2'
3
3
  end
@@ -0,0 +1,19 @@
1
+ module Eligible
2
+ class X12 < APIResource
3
+
4
+ def self.post(params, api_key=nil)
5
+ require 'net/http'
6
+ require 'net/https'
7
+ require 'uri'
8
+ uri = URI.parse("https://gds.eligibleapi.com")
9
+
10
+ post_args = "x12=#{params}&api_key=#{Eligible.api_key}&test=#{Eligible.test}"
11
+ http = Net::HTTP.new(uri.host, uri.port)
12
+ http.use_ssl = true
13
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
14
+ path = "/v1.1/x12"
15
+ response = http.post(path, post_args)
16
+ Util.convert_to_eligible_object(response, Eligible.api_key)
17
+ end
18
+ end
19
+ end
@@ -7,15 +7,15 @@ require 'rest-client'
7
7
  class TestEligible < Test::Unit::TestCase
8
8
  include Mocha
9
9
 
10
- context "Version" do
11
- should "have a version number" do
10
+ context 'Version' do
11
+ should 'have a version number' do
12
12
  assert_not_nil Eligible::VERSION
13
13
  end
14
14
  end
15
15
 
16
- context "General API" do
16
+ context' "General API"' do
17
17
  setup do
18
- Eligible.api_key = "TEST"
18
+ Eligible.api_key = 'TEST'
19
19
  @mock = mock
20
20
  Eligible.mock_rest_client = @mock
21
21
  end
@@ -25,15 +25,15 @@ class TestEligible < Test::Unit::TestCase
25
25
  Eligible.api_key = nil
26
26
  end
27
27
 
28
- should "not specifying api credentials should raise an exception" do
28
+ should 'not specifying api credentials should raise an exception' do
29
29
  Eligible.api_key = nil
30
30
  assert_raises Eligible::AuthenticationError do
31
31
  Eligible::Plan.get({})
32
32
  end
33
33
  end
34
34
 
35
- should "specifying invalid api credentials should raise an exception" do
36
- Eligible.api_key = "invalid"
35
+ should 'specifying invalid api credentials should raise an exception' do
36
+ Eligible.api_key = 'invalid'
37
37
  response = test_response(test_invalid_api_key_error, 401)
38
38
  assert_raises Eligible::AuthenticationError do
39
39
  @mock.expects(:get).once.raises(RestClient::ExceptionWithResponse.new(response, 401))
@@ -42,9 +42,9 @@ class TestEligible < Test::Unit::TestCase
42
42
  end
43
43
  end
44
44
 
45
- context "Plan" do
45
+ context 'Plan' do
46
46
  setup do
47
- Eligible.api_key = "TEST"
47
+ Eligible.api_key = 'TEST'
48
48
  @mock = mock
49
49
  Eligible.mock_rest_client = @mock
50
50
  end
@@ -54,7 +54,7 @@ class TestEligible < Test::Unit::TestCase
54
54
  Eligible.api_key = nil
55
55
  end
56
56
 
57
- should "return an error if no params are supplied" do
57
+ should 'return an error if no params are supplied' do
58
58
  params = {}
59
59
  response = test_response(test_plan_missing_params)
60
60
  @mock.expects(:get).returns(response)
@@ -62,7 +62,7 @@ class TestEligible < Test::Unit::TestCase
62
62
  assert_not_nil plan.error
63
63
  end
64
64
 
65
- should "return plan information if valid params are supplied" do
65
+ should 'return plan information if valid params are supplied' do
66
66
  params = {
67
67
  :payer_name => "Aetna",
68
68
  :payer_id => "000001",
@@ -81,7 +81,7 @@ class TestEligible < Test::Unit::TestCase
81
81
  assert_not_nil plan.all
82
82
  end
83
83
 
84
- should "return the right subsets of the data when requested" do
84
+ should 'return the right subsets of the data when requested' do
85
85
  params = {
86
86
  :payer_name => "Aetna",
87
87
  :payer_id => "000001",
@@ -111,9 +111,9 @@ class TestEligible < Test::Unit::TestCase
111
111
  end
112
112
  end
113
113
 
114
- context "Service" do
114
+ context 'Service' do
115
115
  setup do
116
- Eligible.api_key = "TEST"
116
+ Eligible.api_key = 'TEST'
117
117
  @mock = mock
118
118
  Eligible.mock_rest_client = @mock
119
119
  end
@@ -123,7 +123,7 @@ class TestEligible < Test::Unit::TestCase
123
123
  Eligible.api_key = nil
124
124
  end
125
125
 
126
- should "return an error if no params are supplied" do
126
+ should 'return an error if no params are supplied' do
127
127
  params = {}
128
128
  response = test_response(test_service_missing_params)
129
129
  @mock.expects(:get).returns(response)
@@ -131,7 +131,7 @@ class TestEligible < Test::Unit::TestCase
131
131
  assert_not_nil service.error
132
132
  end
133
133
 
134
- should "return eligibility information if valid params are supplied" do
134
+ should 'return eligibility information if valid params are supplied' do
135
135
  params = {
136
136
  :payer_name => "Aetna",
137
137
  :payer_id => "000001",
@@ -150,7 +150,7 @@ class TestEligible < Test::Unit::TestCase
150
150
  assert_not_nil service.all
151
151
  end
152
152
 
153
- should "return the right subsets of the data when requested" do
153
+ should 'return the right subsets of the data when requested' do
154
154
  params = {
155
155
  :payer_name => "Aetna",
156
156
  :payer_id => "000001",
@@ -178,9 +178,9 @@ class TestEligible < Test::Unit::TestCase
178
178
  end
179
179
  end
180
180
 
181
- context "Demographic" do
181
+ context 'Demographic' do
182
182
  setup do
183
- Eligible.api_key = "TEST"
183
+ Eligible.api_key = 'TEST'
184
184
  @mock = mock
185
185
  Eligible.mock_rest_client = @mock
186
186
  end
@@ -190,7 +190,7 @@ class TestEligible < Test::Unit::TestCase
190
190
  Eligible.api_key = nil
191
191
  end
192
192
 
193
- should "return an error if no params are supplied" do
193
+ should 'return an error if no params are supplied' do
194
194
  params = {}
195
195
  response = test_response(test_demographic_missing_params)
196
196
  @mock.expects(:get).returns(response)
@@ -198,7 +198,7 @@ class TestEligible < Test::Unit::TestCase
198
198
  assert_not_nil demographic.error
199
199
  end
200
200
 
201
- should "return demographic information if valid params are supplied" do
201
+ should 'return demographic information if valid params are supplied' do
202
202
  params = {
203
203
  :payer_name => "Aetna",
204
204
  :payer_id => "000001",
@@ -217,7 +217,7 @@ class TestEligible < Test::Unit::TestCase
217
217
  assert_not_nil demographic.all
218
218
  end
219
219
 
220
- should "return the right subsets of the data when requested" do
220
+ should 'return the right subsets of the data when requested' do
221
221
  params = {
222
222
  :payer_name => "Aetna",
223
223
  :payer_id => "000001",
@@ -245,9 +245,9 @@ class TestEligible < Test::Unit::TestCase
245
245
  end
246
246
  end
247
247
 
248
- context "Claim" do
248
+ context 'Claim' do
249
249
  setup do
250
- Eligible.api_key = "TEST"
250
+ Eligible.api_key = 'TEST'
251
251
  @mock = mock
252
252
  Eligible.mock_rest_client = @mock
253
253
  end
@@ -257,7 +257,7 @@ class TestEligible < Test::Unit::TestCase
257
257
  Eligible.api_key = nil
258
258
  end
259
259
 
260
- should "return an error if no params are supplied" do
260
+ should 'return an error if no params are supplied' do
261
261
  params = {}
262
262
  response = test_response(test_claim_missing_params)
263
263
  @mock.expects(:get).returns(response)
@@ -265,15 +265,15 @@ class TestEligible < Test::Unit::TestCase
265
265
  assert claim["success"] == "false"
266
266
  end
267
267
 
268
- should "post a claim" do
268
+ should 'post a claim' do
269
269
  params = {"api_key"=>"asdfsdfsd21132ddsfsdfd", "billing_provider"=>{"taxonomy_code"=>"332B00000X", "practice_name"=>"Jane Austen Practice", "npi"=>"1922222222", "address"=>{"street_line_1"=>"419 Fulton", "street_line_2"=>"", "city"=>"San Francisco", "state"=>"CA", "zip"=>"94102"}, "tin"=>"43291023", "insurance_provider_id"=>"129873210"}, "pay_to_provider"=>{"address"=>{"street_line_1"=>"", "street_line_2"=>"", "city"=>"", "state"=>"", "zip"=>""}}, "subscriber"=>{"last_name"=>"Franklin", "first_name"=>"Benjamin", "member_id"=>"W2832032427", "group_id"=>"455716", "group_name"=>"none", "dob"=>"1734-05-04", "gender"=>"M", "address"=>{"street_line_1"=>"435 Sugar Lane", "street_line_2"=>"", "city"=>"Sweet", "state"=>"OH", "zip"=>"436233127"}}, "payer"=>{"name"=>"AETNA", "id"=>"60054", "address"=>{"street_line_1"=>"Po Box 981106", "street_line_2"=>"", "city"=>"El Paso", "state"=>"TX", "zip"=>"799981222"}}, "dependent"=>{"relationship"=>"", "last_name"=>"", "first_name"=>"", "dob"=>"", "gender"=>"", "address"=>{"street_line_1"=>"", "street_line_2"=>"", "city"=>"", "state"=>"", "zip"=>""}}, "claim"=>{"total_charge_amount"=>"275", "claim_frequency"=>"1", "patient_signature_on_file"=>"Y", "provider_plan_participation"=>"A", "direct_payment_authorized"=>"Y", "release_of_information"=>"I", "service_lines"=>[{"line_number"=>"1", "service_start"=>"2013-03-07", "service_end"=>"2013-03-07", "authorization_code"=>"", "place_of_service"=>"11", "charge_amount"=>"275", "product_service"=>"99213", "qualifier"=>"HC", "description"=>"", "modifier_1"=>"", "diagnosis_1"=>"32723"}]}}
270
270
  response = test_response(test_post_claim)
271
271
  end
272
272
  end
273
273
 
274
- context "Coverage" do
274
+ context 'Coverage' do
275
275
  setup do
276
- Eligible.api_key = "TEST"
276
+ Eligible.api_key = 'TEST'
277
277
  @mock = mock
278
278
  Eligible.mock_rest_client = @mock
279
279
  end
@@ -283,7 +283,7 @@ class TestEligible < Test::Unit::TestCase
283
283
  Eligible.api_key = nil
284
284
  end
285
285
 
286
- should "return an error if no params are supplied" do
286
+ should 'return an error if no params are supplied' do
287
287
  params = {}
288
288
  response = test_response(test_coverage_missing_params)
289
289
  @mock.expects(:get).returns(response)
@@ -291,7 +291,7 @@ class TestEligible < Test::Unit::TestCase
291
291
  assert_not_nil coverage.error
292
292
  end
293
293
 
294
- should "return coverage information if valid params are supplied" do
294
+ should 'return coverage information if valid params are supplied' do
295
295
  params = {
296
296
  :payer_name => "Aetna",
297
297
  :payer_id => "000001",
@@ -311,9 +311,9 @@ class TestEligible < Test::Unit::TestCase
311
311
  end
312
312
  end
313
313
 
314
- context "Enrollment" do
314
+ context 'Enrollment' do
315
315
  setup do
316
- Eligible.api_key = "TEST"
316
+ Eligible.api_key = 'TEST'
317
317
  @mock = mock
318
318
  Eligible.mock_rest_client = @mock
319
319
  end
@@ -323,7 +323,7 @@ class TestEligible < Test::Unit::TestCase
323
323
  Eligible.api_key = nil
324
324
  end
325
325
 
326
- should "post an enrollment request" do
326
+ should 'post an enrollment request' do
327
327
  params = {"service_provider_list"=>[{"facility_name"=>"Quality", "provider_name"=>"Jane Austen", "tax_id"=>"12345678", "address"=>"125 Snow Shoe Road", "city"=>"Sacramento", "state"=>"CA", "zip"=>"94107", "ptan"=>"54321", "npi"=>"987654321"}, {"facility_name"=>"Aetna", "provider_name"=>"Jack Austen", "tax_id"=>"12345678", "address"=>"985 Snow Shoe Road", "city"=>"Menlo Park", "state"=>"CA", "zip"=>"94107", "ptan"=>"54321", "npi"=>"987654321"}], "payer_ids"=>["00431", "00282"]}
328
328
  response = test_response(test_post_enrollment)
329
329
 
@@ -333,7 +333,7 @@ class TestEligible < Test::Unit::TestCase
333
333
  assert_not_nil enrollment.all[:enrollment_request]
334
334
  end
335
335
 
336
- should "get the status of an enrollment request" do
336
+ should 'get the status of an enrollment request' do
337
337
  params = { "NPI" => "1028384219" }
338
338
  response = test_response(test_get_enrollment)
339
339
  @mock.expects(:get).returns(response)
metadata CHANGED
@@ -1,77 +1,90 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eligible
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.1'
5
- prerelease:
4
+ version: '2.2'
6
5
  platform: ruby
7
6
  authors:
8
7
  - Andy Brett
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-17 00:00:00.000000000 Z
11
+ date: 2013-08-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: mocha
16
- requirement: &70166105750240 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *70166105750240
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: shoulda
27
- requirement: &70166105749820 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *70166105749820
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: test-unit
38
- requirement: &70166105749400 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ! '>='
45
+ - - '>='
42
46
  - !ruby/object:Gem::Version
43
47
  version: '0'
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *70166105749400
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: rake
49
- requirement: &70166105748980 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ! '>='
59
+ - - '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  type: :development
56
63
  prerelease: false
57
- version_requirements: *70166105748980
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: rest-client
60
- requirement: &70166105748480 !ruby/object:Gem::Requirement
61
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
62
72
  requirements:
63
73
  - - ~>
64
74
  - !ruby/object:Gem::Version
65
75
  version: '1.4'
66
76
  type: :runtime
67
77
  prerelease: false
68
- version_requirements: *70166105748480
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '1.4'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: multi_json
71
- requirement: &70166105747960 !ruby/object:Gem::Requirement
72
- none: false
85
+ requirement: !ruby/object:Gem::Requirement
73
86
  requirements:
74
- - - ! '>='
87
+ - - '>='
75
88
  - !ruby/object:Gem::Version
76
89
  version: 1.0.4
77
90
  - - <
@@ -79,7 +92,14 @@ dependencies:
79
92
  version: '2'
80
93
  type: :runtime
81
94
  prerelease: false
82
- version_requirements: *70166105747960
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - '>='
98
+ - !ruby/object:Gem::Version
99
+ version: 1.0.4
100
+ - - <
101
+ - !ruby/object:Gem::Version
102
+ version: '2'
83
103
  description: Eligible is a developer-friendly way to process health care eligibility
84
104
  checks. Learn more at https://eligibleapi.com
85
105
  email:
@@ -106,6 +126,7 @@ files:
106
126
  - lib/eligible/errors/api_error.rb
107
127
  - lib/eligible/errors/authentication_error.rb
108
128
  - lib/eligible/errors/eligible_error.rb
129
+ - lib/eligible/errors/invalid_request_error.rb
109
130
  - lib/eligible/json.rb
110
131
  - lib/eligible/payment.rb
111
132
  - lib/eligible/plan.rb
@@ -113,32 +134,32 @@ files:
113
134
  - lib/eligible/util.rb
114
135
  - lib/eligible/version.rb
115
136
  - lib/eligible/webhook.rb
137
+ - lib/eligible/x12.rb
116
138
  - test/test_eligible.rb
117
139
  - test/test_helper.rb
118
140
  homepage: https://eligibleapi.com/
119
141
  licenses:
120
142
  - MIT
143
+ metadata: {}
121
144
  post_install_message:
122
145
  rdoc_options: []
123
146
  require_paths:
124
147
  - lib
125
148
  required_ruby_version: !ruby/object:Gem::Requirement
126
- none: false
127
149
  requirements:
128
- - - ! '>='
150
+ - - '>='
129
151
  - !ruby/object:Gem::Version
130
152
  version: '0'
131
153
  required_rubygems_version: !ruby/object:Gem::Requirement
132
- none: false
133
154
  requirements:
134
- - - ! '>='
155
+ - - '>='
135
156
  - !ruby/object:Gem::Version
136
157
  version: '0'
137
158
  requirements: []
138
159
  rubyforge_project:
139
- rubygems_version: 1.8.13
160
+ rubygems_version: 2.0.3
140
161
  signing_key:
141
- specification_version: 3
162
+ specification_version: 4
142
163
  summary: Ruby wrapper for the Eligible API
143
164
  test_files:
144
165
  - test/test_eligible.rb