eligible 3.0.0.beta28 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +1 -1
  3. data/.gitignore +0 -1
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +11 -99
  6. data/Gemfile +0 -4
  7. data/Gemfile.lock +36 -41
  8. data/README.md +54 -51
  9. data/eligible.gemspec +6 -6
  10. data/lib/eligible/api_resource.rb +6 -27
  11. data/lib/eligible/calculator_deploy_url.rb +2 -2
  12. data/lib/eligible/claim.rb +10 -10
  13. data/lib/eligible/coverage.rb +4 -8
  14. data/lib/eligible/coverage_resource.rb +4 -4
  15. data/lib/eligible/customer.rb +8 -8
  16. data/lib/eligible/enrollment.rb +8 -8
  17. data/lib/eligible/errors/eligible_error.rb +1 -2
  18. data/lib/eligible/icd.rb +6 -6
  19. data/lib/eligible/lockbox.rb +6 -6
  20. data/lib/eligible/ocr.rb +2 -2
  21. data/lib/eligible/original_signature_pdf.rb +10 -12
  22. data/lib/eligible/payer.rb +6 -6
  23. data/lib/eligible/payment.rb +4 -4
  24. data/lib/eligible/preauth_resource.rb +4 -4
  25. data/lib/eligible/precert.rb +2 -2
  26. data/lib/eligible/provider_model.rb +2 -2
  27. data/lib/eligible/public_key.rb +8 -8
  28. data/lib/eligible/received_pdf.rb +4 -6
  29. data/lib/eligible/risk_assessment.rb +6 -6
  30. data/lib/eligible/session_token.rb +4 -4
  31. data/lib/eligible/ticket.rb +12 -12
  32. data/lib/eligible/util.rb +3 -3
  33. data/lib/eligible/version.rb +1 -1
  34. data/lib/eligible/visit_type.rb +4 -4
  35. data/lib/eligible/x12.rb +2 -2
  36. data/lib/eligible.rb +38 -150
  37. metadata +17 -56
  38. data/lib/eligible/oauth_token.rb +0 -9
  39. data/lib/eligible/payer_mapping.rb +0 -37
  40. data/lib/eligible/v1_0/action.rb +0 -9
  41. data/lib/eligible/v1_0/attribute.rb +0 -9
  42. data/lib/eligible/v1_0/balance_capture.rb +0 -21
  43. data/lib/eligible/v1_0/charge.rb +0 -13
  44. data/lib/eligible/v1_0/claim.rb +0 -25
  45. data/lib/eligible/v1_0/claim_service_line.rb +0 -9
  46. data/lib/eligible/v1_0/contract.rb +0 -9
  47. data/lib/eligible/v1_0/device.rb +0 -9
  48. data/lib/eligible/v1_0/discount.rb +0 -9
  49. data/lib/eligible/v1_0/enrollment.rb +0 -17
  50. data/lib/eligible/v1_0/estimate.rb +0 -29
  51. data/lib/eligible/v1_0/estimate_service_line.rb +0 -17
  52. data/lib/eligible/v1_0/fee.rb +0 -21
  53. data/lib/eligible/v1_0/fee_refund.rb +0 -29
  54. data/lib/eligible/v1_0/file.rb +0 -17
  55. data/lib/eligible/v1_0/file_link.rb +0 -13
  56. data/lib/eligible/v1_0/insurance_company.rb +0 -21
  57. data/lib/eligible/v1_0/insurance_company_alias.rb +0 -9
  58. data/lib/eligible/v1_0/insurance_policy.rb +0 -9
  59. data/lib/eligible/v1_0/patient_question.rb +0 -9
  60. data/lib/eligible/v1_0/patient_questionnaire.rb +0 -9
  61. data/lib/eligible/v1_0/patient_record.rb +0 -9
  62. data/lib/eligible/v1_0/patient_statement.rb +0 -59
  63. data/lib/eligible/v1_0/patient_statement_service_line.rb +0 -13
  64. data/lib/eligible/v1_0/payment_report.rb +0 -21
  65. data/lib/eligible/v1_0/product.rb +0 -9
  66. data/lib/eligible/v1_0/provider.rb +0 -9
  67. data/lib/eligible/v1_0/refund.rb +0 -21
  68. data/lib/eligible/v1_0/remark.rb +0 -21
  69. data/lib/eligible/v1_0/rest_api_base.rb +0 -44
  70. data/lib/eligible/v1_0/rule.rb +0 -13
  71. data/lib/eligible/v1_0/session.rb +0 -21
  72. data/lib/eligible/v1_0/transaction.rb +0 -21
  73. data/lib/eligible/v1_0/treatment.rb +0 -9
  74. data/lib/eligible/v1_0/value_list.rb +0 -9
  75. data/lib/eligible/v1_0/value_list_item.rb +0 -9
  76. data/lib/eligible/v1_0/verification.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf8455223ff365cd551b1a5bdbd0e351b5309a5c8c0a28dda09c319827927f36
4
- data.tar.gz: e52aa4ecebbf23afcaca15ca986153dcc9a1cd543073aa5be2cdbd09c1b4013d
3
+ metadata.gz: 0da7714383e0531eae08e29fddaef4723a40de320e5788af1fe3b4720e82a5d6
4
+ data.tar.gz: c7974c3752355d4812881fb64c13e31f28debc4e04d2b7ec374b8557bf328cab
5
5
  SHA512:
6
- metadata.gz: ee64fad75721bca309384dff2e28fc4bc9e51994dd144ebfd32d06101dca90fcc5d08f99fdf8195d2dc781b574420428e6017cf039ef1c88d9efc187fe6fd320
7
- data.tar.gz: 771554974f2bc9f4af86bdda7084c7e8e6a2068f953064873027d01605a13f661ab8d511a290e31e4474743a664d90a2063235fb32aefe77d97776c25c243af4
6
+ metadata.gz: d6d06d5316800d32f1cdbe30dbc127bae4c0a60b4bd6da639beceb3958fbe55ef0e6ab2e8ab2dd8747fd32e5e791d743918379d91cf986ac9d84ccae15ad4191
7
+ data.tar.gz: 067ba3f72873f361edcedfa1c4137e2d04fd9fbe2169f40d26d3d1caeffb2fc0e7eec8e7c2d991e1b516908f1224714dba72474840bec86477460ab6b808a37d
data/.circleci/config.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  version: 2
2
2
  default_environment: &default_environment
3
3
  docker:
4
- - image: circleci/ruby:2.4-stretch-browsers
4
+ - image: cimg/ruby:3.1.0
5
5
  environment:
6
6
  BUNDLE_JOBS: 3
7
7
  BUNDLE_RETRY: 3
data/.gitignore CHANGED
@@ -17,4 +17,3 @@ test/tmp
17
17
  test/version_tmp
18
18
  tmp
19
19
  .idea
20
- .DS_Store
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.3
1
+ 3.1.0
data/CHANGELOG.md CHANGED
@@ -1,112 +1,24 @@
1
1
  # Changelog
2
+ ## 3.0.0 - 2024-01-17
3
+ - Add support for ruby 3 versions
2
4
 
3
- ## 3.0.0.beta28 - 2022-02-07
5
+ ## 2.9.15 - 2024-01-11
4
6
  - Updated pinned GDS SSL certificate
5
7
 
6
- ## 3.0.0.beta27 - 2021-09-23
7
- - Updated pinned api.eligible.com certificate
8
-
9
- ## 3.0.0.beta26 - 2021-05-12
10
- - Updated pinned GDS SSL certificate for Staging
11
-
12
- ## 3.0.0.beta25 - 2021-04-12
8
+ ## 2.9.14 - 2023-01-16
13
9
  - Updated pinned GDS SSL certificate
14
10
 
15
- ## 3.0.0.beta24 - 2021-04-01
11
+ ## 2.9.13 - 2022-02-07
16
12
  - Updated pinned GDS SSL certificate
17
13
 
18
- ## 3.0.0.beta23 - 2020-11-13
19
- - Bug fixes
20
-
21
- ## 3.0.0.beta22 - 2020-10-21
22
- - Bug fixes
23
-
24
- ## 3.0.0.beta21 - 2020-10-21
25
- - Add post method for CE API to avoid 414 error with large X12 inputs
26
-
27
- ## 3.0.0.beta20 - 2020-08-17
28
- - Bug fixes
29
-
30
- ## 3.0.0.beta19 - 2020-07-28
31
- - Added refunds and balance_captures REST API endpoints
32
-
33
- ## 3.0.0.beta18 - 2020-07-24
34
- - Added claim_submit endpoint API url for PatientStatement endpoint
14
+ ## 2.9.12 - 2021-04-12
15
+ - Fixing the pinned GDS SSL certificate
35
16
 
36
- ## 3.0.0.beta17 - 2020-07-13
37
- - Bug fixes
38
-
39
- ## 3.0.0.beta16 - 2020-07-10
40
- - Migrated "Patient" endpoint to "PatientRecord"
41
-
42
- ## 3.0.0.beta15 - 2020-06-12
43
- - Added support for patient questionnaire, patient questions API endpoints
44
-
45
- ## 3.0.0.beta14 - 2020-06-08
46
- - Added Fee and FeeRefund new REST API endpoints
47
-
48
- ## 3.0.0.beta13 - 2020-06-05
49
- - Added create, update, delete and validate endpoints support for rules
50
-
51
- ## 3.0.0.beta12 - 2020-05-12
17
+ ## 2.9.11 - 2021-04-01
52
18
  - Updated pinned GDS SSL certificate
53
19
 
54
- ## 3.0.0.beta11 - 2020-05-12
55
- - Added summary and escalate actions for Enrollments endpoint
56
- - Added Action endpoint
57
- - Added Attribute endpoint
58
- - Added Claim endpoint
59
- - Added ClaimServiceLine endpoint
60
- - Added Device endpoint
61
- - Added Discount endpoint
62
- - Renamed FileObject to File in order to kept consistency
63
- - Added FileLink endpoint
64
- - Added InsuranceCompanyAlias endpoint
65
- - Added PaymentReport endpoint
66
- - Added Remark endpoint
67
- - Added Rule endpoint
68
- - Added Session endpoint
69
- - Added Transaction endpoint
70
- - Added ValueList endpoint
71
- - Added ValueListItem endpoint
72
- - Added Verification endpoint
73
- - Updated Charge endpoint to raise exception on delete action
74
- - Updated Estimate endpoint, raise exception on update and delete actions, and added missing actions process, reestimate, convert
75
- - Update EstimateServiceLine endpoint to raise exception on update and delete actions
76
- - Updated InsuranceCompany endpoint to raise exception on delete action
77
-
78
- ## 3.0.0.beta10 - 2020-05-06
79
- - Added support for new REST API endpoints "Contract, Enrollment, Provider"
80
- - Added support delete operations on new API.
81
-
82
- ## 3.0.0.beta9 - 2020-05-04
83
- - Added support for new REST API endpoints "Charge, Estimate, EstimateServiceLine, Product, Treatment"
84
-
85
- ## 3.0.0.beta8 - 2020-04-30
86
- - Fixed payment and payment_reports API urls for new PatientStatement endpoint
87
-
88
- ## 3.0.0.beta7 - 2020-04-16
89
- - Removed un-wanted parameters from the API request while making calls to new REST API endpoint
90
-
91
- ## 3.0.0.beta6 - 2020-04-08
92
- - Bug fix for "PatientStatement" endpoint
93
-
94
- ## 3.0.0.beta5 - 2020-03-31
95
- - Added support for new REST API endpoints "Insurance Company, Insurance Policy, Patient"
96
-
97
- ## 3.0.0.beta4 - 2020-03-16
98
- - Fixed query params conversion to support Expand feature for new REST API Endpoints
99
- - Changed new REST API endpoints format to support `ID` field or `params`
100
-
101
- ## 3.0.0.beta3 - 2020-03-09
102
- - Added support for new REST API endpoint "PatientStatement" and "PatientStatementServiceLine"
103
-
104
- ## 3.0.0.beta2 - 2020-03-03
105
- - Added support for V1.0 REST API endpoints and added Files endpoints
106
- - Update pinned api.eligible.com and wildcard.eligible.com certificate
107
-
108
- ## 3.0.0.beta1 - 2019-10-01
109
- - Added support for Eligible-Account Header in the API requests when used Eligible Connect feature
20
+ ## 2.9.10 - 2020-05-13
21
+ - Updated pinned GDS SSL certificate
110
22
 
111
23
  ## 2.9.9 - 2019-08-07
112
24
  - Added Icd code endpoints
@@ -162,7 +74,7 @@
162
74
  - Documentation updates for the endpoints
163
75
 
164
76
  ## 2.6.0 - 2016-02-23
165
- - Added new endpoints customer, original signature pdf, and payer.
77
+ - Added new endpoints customer, original signature pdf and payer.
166
78
  - Added specs
167
79
  - Bumped api version to 1.5
168
80
  - Fixed few bugs
data/Gemfile CHANGED
@@ -1,8 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # cut patch number off the version number and lock it down to the minor version
4
- ruby_version = File.read(File.expand_path('.ruby-version', __dir__)).chomp.split('.')[0..1].join('.')
5
- ruby "~> #{ruby_version}"
6
-
7
3
  # Specify your gem's dependencies in eligible.gemspec
8
4
  gemspec
data/Gemfile.lock CHANGED
@@ -1,66 +1,61 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eligible (3.0.0.beta28)
5
- multi_json (~> 1.7)
6
- rest-client (~> 2.0.0)
4
+ eligible (3.0.0)
5
+ multi_json (~> 1.15.0)
6
+ rest-client (~> 2.1.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- diff-lcs (1.3)
12
- docile (1.1.5)
13
- domain_name (0.5.20190701)
14
- unf (>= 0.0.5, < 1.0.0)
15
- http-cookie (1.0.4)
11
+ diff-lcs (1.5.0)
12
+ docile (1.4.0)
13
+ domain_name (0.6.20240107)
14
+ http-accept (1.7.0)
15
+ http-cookie (1.0.5)
16
16
  domain_name (~> 0.5)
17
- json (2.1.0)
18
- mime-types (3.4.1)
17
+ mime-types (3.5.2)
19
18
  mime-types-data (~> 3.2015)
20
- mime-types-data (3.2022.0105)
19
+ mime-types-data (3.2023.1205)
21
20
  multi_json (1.15.0)
22
21
  netrc (0.11.0)
23
- rake (12.3.0)
24
- rest-client (2.0.2)
22
+ rake (13.0.6)
23
+ rest-client (2.1.0)
24
+ http-accept (>= 1.7.0, < 2.0)
25
25
  http-cookie (>= 1.0.2, < 2.0)
26
26
  mime-types (>= 1.16, < 4.0)
27
27
  netrc (~> 0.8)
28
- rspec (3.7.0)
29
- rspec-core (~> 3.7.0)
30
- rspec-expectations (~> 3.7.0)
31
- rspec-mocks (~> 3.7.0)
32
- rspec-core (3.7.1)
33
- rspec-support (~> 3.7.0)
34
- rspec-expectations (3.7.0)
28
+ rspec (3.11.0)
29
+ rspec-core (~> 3.11.0)
30
+ rspec-expectations (~> 3.11.0)
31
+ rspec-mocks (~> 3.11.0)
32
+ rspec-core (3.11.0)
33
+ rspec-support (~> 3.11.0)
34
+ rspec-expectations (3.11.1)
35
35
  diff-lcs (>= 1.2.0, < 2.0)
36
- rspec-support (~> 3.7.0)
37
- rspec-mocks (3.7.0)
36
+ rspec-support (~> 3.11.0)
37
+ rspec-mocks (3.11.1)
38
38
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.7.0)
40
- rspec-support (3.7.1)
41
- rspec_junit_formatter (0.3.0)
39
+ rspec-support (~> 3.11.0)
40
+ rspec-support (3.11.1)
41
+ rspec_junit_formatter (0.5.1)
42
42
  rspec-core (>= 2, < 4, != 2.12.0)
43
- simplecov (0.15.1)
44
- docile (~> 1.1.0)
45
- json (>= 1.8, < 3)
46
- simplecov-html (~> 0.10.0)
47
- simplecov-html (0.10.2)
48
- unf (0.1.4)
49
- unf_ext
50
- unf_ext (0.0.8)
43
+ simplecov (0.21.2)
44
+ docile (~> 1.1)
45
+ simplecov-html (~> 0.11)
46
+ simplecov_json_formatter (~> 0.1)
47
+ simplecov-html (0.12.3)
48
+ simplecov_json_formatter (0.1.4)
51
49
 
52
50
  PLATFORMS
53
51
  ruby
54
52
 
55
53
  DEPENDENCIES
56
54
  eligible!
57
- rake (~> 12.0)
58
- rspec (~> 3.4)
59
- rspec_junit_formatter (~> 0.3.0)
60
- simplecov (~> 0.11)
61
-
62
- RUBY VERSION
63
- ruby 2.4.3p205
55
+ rake (~> 13.0.6)
56
+ rspec (~> 3.11.0)
57
+ rspec_junit_formatter (~> 0.5.1x)
58
+ simplecov (~> 0.21.2)
64
59
 
65
60
  BUNDLED WITH
66
- 1.17.3
61
+ 2.1.4
data/README.md CHANGED
@@ -38,7 +38,7 @@ Eligible.test = true
38
38
  On each api call, you can overwrite the api key or the test parameter:
39
39
 
40
40
  ```ruby
41
- Eligible::Coverage.get({:api_key => 'NEW_KEY', :test => false})
41
+ Eligible::Coverage.get({api_key: 'NEW_KEY', test: false})
42
42
  ```
43
43
 
44
44
  ### Response Format
@@ -47,7 +47,7 @@ By default, all responses are in JSON, but you can request raw
47
47
  access to X12 by adding is as a parameter on the api call:
48
48
 
49
49
  ```ruby
50
- Eligible::Coverage.get({:format => "x12"})
50
+ Eligible::Coverage.get({format: "x12"})
51
51
  ```
52
52
 
53
53
  # Important notes
@@ -123,17 +123,18 @@ coverage.to_hash
123
123
  ### Retrieve eligibility and benefit information
124
124
 
125
125
  ```ruby
126
+
126
127
  params = {
127
- :service_type => "33",
128
- :network => "OUT",
129
- :payer_id => "000001",
130
- :provider_last_name => "Last",
131
- :provider_first_name => "First",
132
- :provider_npi => "12345678",
133
- :member_id => "12345678",
134
- :member_last_name => "Austen",
135
- :member_first_name => "Jane",
136
- :member_dob => "1955-12-14"
128
+ service_type: "30",
129
+ payer_id: "ELIG_SNDBX",
130
+ provider_last_name: "Last",
131
+ provider_first_name: "First",
132
+ provider_npi: "1234567893",
133
+ member_id: "AETNA00OAMC",
134
+ member_last_name: "Austen",
135
+ member_first_name: "Jane",
136
+ member_dob: "1955-12-14",
137
+ test: true
137
138
  }
138
139
 
139
140
  coverage = Eligible::Coverage.get(params)
@@ -154,10 +155,11 @@ params = {
154
155
  network: 'IN',
155
156
  payer_id: '00001',
156
157
  provider_npi: '1234567893',
157
- member_id: 'COST_ESTIMATE_001',
158
+ member_id: 'COST_ESTIMATES_001',
158
159
  member_dob: '1886-01-01',
159
160
  provider_price: '200',
160
- level: 'individual'
161
+ level: 'individual',
162
+ test: true
161
163
  }
162
164
 
163
165
  cost_estimate = Eligible::Coverage.cost_estimate(params)
@@ -174,14 +176,15 @@ cost_estimate.to_hash # returns all coverage info along with cost estimate
174
176
 
175
177
  ```ruby
176
178
  params = {
177
- :payer_id => "000001",
178
- :provider_last_name => "Last",
179
- :provider_first_name => "First",
180
- :provider_npi => "12345678",
181
- :member_id => "12345678",
182
- :member_last_name => "Austen",
183
- :member_first_name => "Jane",
184
- :member_dob => "1955-12-14"
179
+ payer_id: "ELIG_SNDBX",
180
+ provider_last_name: "Last",
181
+ provider_first_name: "First",
182
+ provider_npi: "1234567893",
183
+ member_id: "333333333A",
184
+ member_last_name: "Austen",
185
+ member_first_name: "Jane",
186
+ member_dob: "1955-12-14",
187
+ test: true
185
188
  }
186
189
  medicare = Eligible::Medicare.get(params)
187
190
  medicare.to_hash # returns all coverage info for the request
@@ -238,13 +241,13 @@ result.error # return error, if any
238
241
  ### Retrieve an Enrollment Request
239
242
 
240
243
  ```ruby
241
- params = { :enrollment_request_id => 123 }
244
+ params = { enrollment_request_id: 123 }
242
245
  enrollment = Eligible::Enrollment.get(params)
243
246
  enrollment.to_hash # return the api call results
244
247
  enrollment.error # return error, if any
245
248
  enrollment.enrollment_npis # quick access to the enrollment npis within the enrollment request object
246
249
 
247
- params = { :npis => %w(123 456 789).join(',') }
250
+ params = { npis: %w(123 456 789).join(',') }
248
251
  enrollment = Eligible::Enrollment.get(params)
249
252
  ```
250
253
 
@@ -339,7 +342,7 @@ claims = Eligible::Claim.all # returns acknowledgment information for all claims
339
342
 
340
343
  ```ruby
341
344
  params = {
342
- :reference_id => "12345"
345
+ reference_id: "12345"
343
346
  }
344
347
 
345
348
  claim = Eligible::Claim.get(params) # returns acknowledgment information on an individual claim identified by its reference_id
@@ -354,18 +357,18 @@ claim = Eligible::Claim.get(params) # returns acknowledgment information on an i
354
357
  ### Retrieve Payment status
355
358
 
356
359
  ```ruby
357
- params = { :payer_id => '00001',
358
- :provider_tax_id => '4373208923',
359
- :provider_npi => '1234567890',
360
- :provider_first_name => 'Thomas',
361
- :provider_first_name => 'Thomas',
362
- :member_id => '123',
363
- :member_first_name => 'Benjamin',
364
- :member_last_name => 'Franklin',
365
- :member_dob => '01-01-1980',
366
- :charge_amount => '100.00',
367
- :start_date => '2013-03-25',
368
- :end_date => '2013-03-25' }
360
+ params = { payer_id: '00001',
361
+ provider_tax_id: '4373208923',
362
+ provider_npi: '1234567890',
363
+ provider_first_name: 'Thomas',
364
+ provider_first_name: 'Thomas',
365
+ member_id: '123',
366
+ member_first_name: 'Benjamin',
367
+ member_last_name: 'Franklin',
368
+ member_dob: '01-01-1980',
369
+ charge_amount: '100.00',
370
+ start_date: '2013-03-25',
371
+ end_date: '2013-03-25' }
369
372
 
370
373
  result = Eligible::Payment.get(params)
371
374
  result.to_hash # return the api call results
@@ -377,7 +380,7 @@ result.error # return error, if any
377
380
  ### X12 post
378
381
 
379
382
  ```ruby
380
- 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~" }
383
+ 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~" }
381
384
 
382
385
  result = Eligible::X12.post(params)
383
386
  ```
@@ -391,10 +394,10 @@ result = Eligible::X12.post(params)
391
394
  ### Create a ticket
392
395
 
393
396
  ```ruby
394
- params = {:priority => 'normal',
395
- :title => 'TITLE',
396
- :notification_email => 'admin@eligible.com',
397
- :body => 'Your comment'}
397
+ params = {priority: 'normal',
398
+ title: 'TITLE',
399
+ notification_email: 'admin@eligible.com',
400
+ body: 'Your comment'}
398
401
  result = Eligible::Ticket.create params
399
402
  result.to_hash # return the api call results
400
403
  enrollment.error # return error, if any
@@ -403,7 +406,7 @@ enrollment.error # return error, if any
403
406
  ### Get a ticket
404
407
 
405
408
  ```ruby
406
- ticket = Eligible::Ticket.get(:id => 1)
409
+ ticket = Eligible::Ticket.get(id: 1)
407
410
  ticket.to_hash # return the api call result
408
411
  ticket.error # return error, if any
409
412
  ```
@@ -411,11 +414,11 @@ ticket.error # return error, if any
411
414
  ### Update a ticket
412
415
 
413
416
  ```ruby
414
- params = { :id => 1,
415
- :priority => 'normal',
416
- :title => 'TITLE',
417
- :notification_email => 'your_email@test.com',
418
- :body => 'Your comment'}
417
+ params = { id: 1,
418
+ priority: 'normal',
419
+ title: 'TITLE',
420
+ notification_email: 'your_email@test.com',
421
+ body: 'Your comment'}
419
422
  result = Eligible::Ticket.update(params)
420
423
  result.to_hash # return the api call results
421
424
  enrollment.error # return error, if any
@@ -424,7 +427,7 @@ enrollment.error # return error, if any
424
427
  ### Get comments for a ticket
425
428
 
426
429
  ```ruby
427
- comments = Eligible::Ticket.get(:id => 1)
430
+ comments = Eligible::Ticket.get(id: 1)
428
431
  comments.to_hash # return the api call result
429
432
  comments.error # return error, if any
430
433
 
@@ -432,7 +435,7 @@ comments.error # return error, if any
432
435
 
433
436
  ### Delete a ticket
434
437
  ```ruby
435
- result = Eligible::Ticket.delete(:id => 1)
438
+ result = Eligible::Ticket.delete(id: 1)
436
439
  comments.to_hash # return the api call result
437
440
  comments.error # return error, if any
438
441
  ```
@@ -679,7 +682,7 @@ result.error # returns error, if any
679
682
  ### Use session token without api_key
680
683
 
681
684
  ```ruby
682
- Eligible::Coverage.get({:session_token => 'SESSION_TOKEN', :test => false})
685
+ Eligible::Coverage.get({session_token: 'SESSION_TOKEN', test: false})
683
686
  ```
684
687
 
685
688
 
data/eligible.gemspec CHANGED
@@ -16,11 +16,11 @@ Gem::Specification.new do |gem|
16
16
  gem.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
17
  gem.require_paths = ['lib']
18
18
 
19
- gem.add_dependency('rest-client', '~> 2.0.0')
20
- gem.add_dependency('multi_json', '~> 1.7')
19
+ gem.add_dependency('rest-client', '~> 2.1.0')
20
+ gem.add_dependency('multi_json', '~> 1.15.0')
21
21
 
22
- gem.add_development_dependency('rake', '~> 12.0')
23
- gem.add_development_dependency('rspec', '~> 3.4')
24
- gem.add_development_dependency('rspec_junit_formatter', '~> 0.3.0')
25
- gem.add_development_dependency('simplecov', '~> 0.11')
22
+ gem.add_development_dependency('rake', '~> 13.0.6')
23
+ gem.add_development_dependency('rspec', '~> 3.11.0')
24
+ gem.add_development_dependency('rspec_junit_formatter', '~> 0.5.1x')
25
+ gem.add_development_dependency('simplecov', '~> 0.21.2')
26
26
  end
@@ -6,10 +6,10 @@ module Eligible
6
6
 
7
7
  def self.api_url(base, params = nil, param_id = nil)
8
8
  if params.nil?
9
- "/#{base}"
9
+ "/#{base}.json"
10
10
  else
11
11
  id = Util.value(params, param_id)
12
- "/#{base}/#{id}"
12
+ "/#{base}/#{id}.json"
13
13
  end
14
14
  end
15
15
 
@@ -20,39 +20,18 @@ module Eligible
20
20
  "/#{CGI.escape(class_name.downcase)}/"
21
21
  end
22
22
 
23
- def self.endpoint_name
24
- self.const_get('ENDPOINT_NAME')
25
- end
26
-
27
23
  def self.require_param(value, name)
28
24
  fail ArgumentError, "#{name} of the #{class_name} is required" if value.nil? || (value.is_a?(String) && value.empty?)
29
25
  end
30
26
 
31
- def self.required_param_validation(params:, required_params:)
32
- return if required_params.nil? || !required_params.is_a?(Array)
33
-
34
- required_params.each do |required_param_name|
27
+ def self.send_request(method, url, api_key, params, required_param_name = nil)
28
+ unless required_param_name.nil?
35
29
  required_param = Util.value(params, required_param_name)
36
30
  require_param(required_param, required_param_name)
37
31
  end
38
- end
39
-
40
- def self.rest_api_params(id_or_params)
41
- id_or_params.is_a?(Hash) ? id_or_params : { id: id_or_params }
42
- end
43
-
44
- def self.send_request(method, url, params, opts)
45
- headers = opts.clone
46
- client_secret = headers.delete(:client_secret)
47
- api_key = headers.delete(:api_key)
48
- api_key = client_secret unless client_secret.nil?
49
-
50
- required_param_validation(params: params, required_params: headers.delete(:required_params))
51
-
52
- # Here rest_api_version is related to New REST API Endpoints
53
- params = self.const_defined?(:REST_API_VERSION) ? params.merge(rest_api_version: self::REST_API_VERSION) : params
54
- response, api_key = Eligible.request(method, url, api_key, params, headers)
32
+ response, api_key = Eligible.request(method, url, api_key, **params)
55
33
  Util.convert_to_eligible_object(response, api_key)
56
34
  end
35
+
57
36
  end
58
37
  end
@@ -1,7 +1,7 @@
1
1
  module Eligible
2
2
  class CalculatorDeployUrl < APIResource
3
- def self.fetch_or_create(params, opts = {})
4
- send_request :get, '/calculator_deploy_urls.json', params, opts
3
+ def self.fetch_or_create(params, api_key = nil)
4
+ send_request(:get, '/calculator_deploy_urls.json', api_key, **params)
5
5
  end
6
6
  end
7
7
  end
@@ -1,28 +1,28 @@
1
1
  module Eligible
2
2
  class Claim < APIResource
3
- def self.ack(params, opts = {})
3
+ def self.ack(params, api_key = nil)
4
4
  reference_id = Util.value(params, :reference_id)
5
- send_request :get, "/claims/#{reference_id}/acknowledgements.json", params, opts.merge(required_params: [:reference_id])
5
+ send_request(:get, "/claims/#{reference_id}/acknowledgements.json", api_key, params, :reference_id)
6
6
  end
7
7
 
8
- def self.post(params, opts = {})
9
- send_request :post, '/claims.json', params, opts
8
+ def self.post(params, api_key = nil)
9
+ send_request(:post, '/claims.json', api_key, **params)
10
10
  end
11
11
 
12
- def self.acks(params, opts = {})
13
- send_request :get, '/claims/acknowledgements.json', params, opts
12
+ def self.acks(params, api_key = nil)
13
+ send_request(:get, '/claims/acknowledgements.json', api_key, **params)
14
14
  end
15
15
 
16
- def self.payment_report(params, opts = {})
16
+ def self.payment_report(params, api_key = nil)
17
17
  reference_id = Util.value(params, :reference_id)
18
18
  require_param(reference_id, 'Reference id')
19
19
  id = Util.value(params, :id)
20
20
  url = id.nil? ? "/claims/#{reference_id}/payment_reports" : "/claims/#{reference_id}/payment_reports/#{id}"
21
- send_request :get, url, params, opts
21
+ send_request(:get, url, api_key, **params)
22
22
  end
23
23
 
24
- def self.payment_reports(params, opts = {})
25
- send_request :get, '/claims/payment_reports.json', params, opts
24
+ def self.payment_reports(params, api_key = nil)
25
+ send_request(:get, '/claims/payment_reports.json', api_key, **params)
26
26
  end
27
27
  end
28
28
  end
@@ -8,16 +8,12 @@ module Eligible
8
8
  return '/coverage/all/batch.json'
9
9
  end
10
10
 
11
- def self.cost_estimate(params, opts = {})
12
- send_request :get, '/coverage/cost_estimates.json', params, opts
11
+ def self.cost_estimate(params, api_key = nil)
12
+ send_request(:get, '/coverage/cost_estimates.json', api_key, **params)
13
13
  end
14
14
 
15
- def self.cost_estimate_post(params, opts = {})
16
- send_request :post, '/coverage/cost_estimates.json', params, opts
17
- end
18
-
19
- def self.batch_medicare_post(params, opts = {})
20
- send_request :post, '/medicare/coverage/batch.json', params, opts
15
+ def self.batch_medicare_post(params, api_key = nil)
16
+ send_request(:post, '/medicare/coverage/batch.json', api_key, **params)
21
17
  end
22
18
  end
23
19
  end
@@ -1,11 +1,11 @@
1
1
  module Eligible
2
2
  class CoverageResource < APIResource
3
- def self.get(params, opts = {})
4
- send_request :get, get_uri, params, opts
3
+ def self.get(params, api_key = nil)
4
+ send_request(:get, get_uri, api_key, params)
5
5
  end
6
6
 
7
- def self.post(params, opts = {})
8
- send_request :post, post_uri, params, opts
7
+ def self.post(params, api_key = nil)
8
+ send_request(:post, post_uri, api_key, params)
9
9
  end
10
10
 
11
11
  def self.get_uri