eligible 1.0 → 3.0.0.beta17
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 +7 -0
- data/.circleci/config.yml +76 -0
- data/.codeclimate.yml +23 -0
- data/.gitignore +3 -0
- data/.rspec +3 -0
- data/.rubocop.yml +1158 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +170 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +66 -0
- data/LICENSE +1 -1
- data/README.md +700 -93
- data/Rakefile +12 -2
- data/eligible.gemspec +14 -16
- data/lib/eligible/api_resource.rb +49 -5
- data/lib/eligible/calculator_deploy_url.rb +7 -0
- data/lib/eligible/claim.rb +22 -6
- data/lib/eligible/coverage.rb +19 -0
- data/lib/eligible/coverage_resource.rb +23 -0
- data/lib/eligible/customer.rb +19 -0
- data/lib/eligible/demographic.rb +6 -35
- data/lib/eligible/eligible_object.rb +12 -15
- data/lib/eligible/encryptor.rb +121 -0
- data/lib/eligible/enrollment.rb +23 -0
- data/lib/eligible/errors/eligible_error.rb +6 -3
- data/lib/eligible/errors/invalid_request_error.rb +4 -0
- data/lib/eligible/icd.rb +16 -0
- data/lib/eligible/json.rb +5 -15
- data/lib/eligible/lockbox.rb +39 -0
- data/lib/eligible/medicare.rb +11 -0
- data/lib/eligible/oauth_token.rb +9 -0
- data/lib/eligible/ocr.rb +15 -0
- data/lib/eligible/original_signature_pdf.rb +45 -0
- data/lib/eligible/payer.rb +17 -0
- data/lib/eligible/payer_mapping.rb +37 -0
- data/lib/eligible/payment.rb +11 -0
- data/lib/eligible/preauth_resource.rb +11 -0
- data/lib/eligible/precert.rb +15 -0
- data/lib/eligible/provider_model.rb +7 -0
- data/lib/eligible/public_key.rb +27 -0
- data/lib/eligible/received_pdf.rb +26 -0
- data/lib/eligible/referral.rb +11 -0
- data/lib/eligible/risk_assessment.rb +15 -0
- data/lib/eligible/session_token.rb +11 -0
- data/lib/eligible/ticket.rb +40 -0
- data/lib/eligible/util.rb +29 -38
- data/lib/eligible/v1_0/action.rb +9 -0
- data/lib/eligible/v1_0/attribute.rb +9 -0
- data/lib/eligible/v1_0/charge.rb +13 -0
- data/lib/eligible/v1_0/claim.rb +25 -0
- data/lib/eligible/v1_0/claim_service_line.rb +9 -0
- data/lib/eligible/v1_0/contract.rb +9 -0
- data/lib/eligible/v1_0/device.rb +9 -0
- data/lib/eligible/v1_0/discount.rb +9 -0
- data/lib/eligible/v1_0/enrollment.rb +17 -0
- data/lib/eligible/v1_0/estimate.rb +29 -0
- data/lib/eligible/v1_0/estimate_service_line.rb +17 -0
- data/lib/eligible/v1_0/fee.rb +21 -0
- data/lib/eligible/v1_0/fee_refund.rb +29 -0
- data/lib/eligible/v1_0/file.rb +17 -0
- data/lib/eligible/v1_0/file_link.rb +13 -0
- data/lib/eligible/v1_0/insurance_company.rb +21 -0
- data/lib/eligible/v1_0/insurance_company_alias.rb +9 -0
- data/lib/eligible/v1_0/insurance_policy.rb +9 -0
- data/lib/eligible/v1_0/patient_question.rb +9 -0
- data/lib/eligible/v1_0/patient_questionnaire.rb +9 -0
- data/lib/eligible/v1_0/patient_record.rb +9 -0
- data/lib/eligible/v1_0/patient_statement.rb +54 -0
- data/lib/eligible/v1_0/patient_statement_service_line.rb +13 -0
- data/lib/eligible/v1_0/payment_report.rb +21 -0
- data/lib/eligible/v1_0/product.rb +9 -0
- data/lib/eligible/v1_0/provider.rb +9 -0
- data/lib/eligible/v1_0/remark.rb +21 -0
- data/lib/eligible/v1_0/reports/accuracy_stats.rb +23 -0
- data/lib/eligible/v1_0/reports/estimate_friction.rb +23 -0
- data/lib/eligible/v1_0/reports/in_scope_distribution.rb +23 -0
- data/lib/eligible/v1_0/rest_api_base.rb +44 -0
- data/lib/eligible/v1_0/rule.rb +13 -0
- data/lib/eligible/v1_0/session.rb +21 -0
- data/lib/eligible/v1_0/transaction.rb +21 -0
- data/lib/eligible/v1_0/treatment.rb +9 -0
- data/lib/eligible/v1_0/value_list.rb +9 -0
- data/lib/eligible/v1_0/value_list_item.rb +9 -0
- data/lib/eligible/v1_0/verification.rb +17 -0
- data/lib/eligible/version.rb +1 -1
- data/lib/eligible/visit_type.rb +11 -0
- data/lib/eligible/x12.rb +8 -0
- data/lib/eligible.rb +320 -110
- metadata +148 -67
- data/CONTRIBUTORS +0 -1
- data/lib/eligible/plan.rb +0 -42
- data/lib/eligible/service.rb +0 -39
- data/test/test_eligible.rb +0 -279
- data/test/test_helper.rb +0 -67
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
class InsuranceCompany < RestAPIBase
|
6
|
+
ENDPOINT_NAME = 'insurance_companies'.freeze
|
7
|
+
|
8
|
+
def self.create(_params, _opts = {})
|
9
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.update(_params, _opts = {})
|
13
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.delete(_params, _opts = {})
|
17
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
class PatientStatement < RestAPIBase
|
6
|
+
ENDPOINT_NAME = 'patient_statements'.freeze
|
7
|
+
|
8
|
+
# Finalize the patient statement
|
9
|
+
def self.finalize(id, opts = {})
|
10
|
+
send_request :post, "/#{endpoint_name}/#{object_id(id)}/finalize", rest_api_params(id), opts.merge(required_params: [:id])
|
11
|
+
end
|
12
|
+
|
13
|
+
# Post a payment
|
14
|
+
def self.pay(params, opts = {})
|
15
|
+
send_request :post, "/#{endpoint_name}/#{object_id(params)}/payment_reports", rest_api_params(params), opts.merge(required_params: [:id])
|
16
|
+
end
|
17
|
+
|
18
|
+
# List all payments
|
19
|
+
def self.payments(params, opts = {})
|
20
|
+
send_request :get, "/#{endpoint_name}/#{object_id(params)}/payment_reports", rest_api_params(params), opts.merge(required_params: [:id])
|
21
|
+
end
|
22
|
+
|
23
|
+
# Capture a Patient Statement
|
24
|
+
def self.capture(params, opts = {})
|
25
|
+
send_request :post, "/#{endpoint_name}/#{object_id(params)}/capture", rest_api_params(params), opts.merge(required_params: [:id])
|
26
|
+
end
|
27
|
+
|
28
|
+
# Process a Patient Statement
|
29
|
+
def self.process(params, opts = {})
|
30
|
+
send_request :post, "/#{endpoint_name}/#{object_id(params)}/process", rest_api_params(params), opts.merge(required_params: [:id])
|
31
|
+
end
|
32
|
+
|
33
|
+
# Send a Patient Statement
|
34
|
+
def self.send(id, opts = {})
|
35
|
+
send_request :post, "/#{endpoint_name}/#{object_id(id)}/send", rest_api_params(id), opts.merge(required_params: [:id])
|
36
|
+
end
|
37
|
+
|
38
|
+
# Void a Patient Statement
|
39
|
+
def self.void(id, opts = {})
|
40
|
+
send_request :post, "/#{endpoint_name}/#{object_id(id)}/void", rest_api_params(id), opts.merge(required_params: [:id])
|
41
|
+
end
|
42
|
+
|
43
|
+
# Mark UnCollectible
|
44
|
+
def self.mark_uncollectible(id, opts = {})
|
45
|
+
send_request :post, "/#{endpoint_name}/#{object_id(id)}/mark_uncollectible", rest_api_params(id), opts.merge(required_params: [:id])
|
46
|
+
end
|
47
|
+
|
48
|
+
# Reestimate a Patient Statement
|
49
|
+
def self.reestimate(params, opts = {})
|
50
|
+
send_request :post, "/#{endpoint_name}/#{object_id(params)}/reestimate", rest_api_params(params), opts.merge(required_params: [:id])
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
class PatientStatementServiceLine < RestAPIBase
|
6
|
+
ENDPOINT_NAME = 'patient_statement_service_lines'.freeze
|
7
|
+
|
8
|
+
def self.update(_params, _opts = {})
|
9
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
class PaymentReport < RestAPIBase
|
6
|
+
ENDPOINT_NAME = 'payment_reports'.freeze
|
7
|
+
|
8
|
+
def self.create(_params, _opts = {})
|
9
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.update(_params, _opts = {})
|
13
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.delete(_params, _opts = {})
|
17
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
class Remark < RestAPIBase
|
6
|
+
ENDPOINT_NAME = 'remarks'.freeze
|
7
|
+
|
8
|
+
def self.create(_params, _opts = {})
|
9
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.update(_params, _opts = {})
|
13
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.delete(_params, _opts = {})
|
17
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
module Reports
|
6
|
+
class AccuracyStats < RestAPIBase
|
7
|
+
ENDPOINT_NAME = 'reports/accuracy_stats'.freeze
|
8
|
+
|
9
|
+
def self.create(_params, _opts = {})
|
10
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.update(_params, _opts = {})
|
14
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.delete(_params, _opts = {})
|
18
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
module Reports
|
6
|
+
class EstimateFriction < RestAPIBase
|
7
|
+
ENDPOINT_NAME = 'reports/estimate_frictions'.freeze
|
8
|
+
|
9
|
+
def self.create(_params, _opts = {})
|
10
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.update(_params, _opts = {})
|
14
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.delete(_params, _opts = {})
|
18
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
module Reports
|
6
|
+
class InScopeDistribution < RestAPIBase
|
7
|
+
ENDPOINT_NAME = 'reports/in_scope_distributions'.freeze
|
8
|
+
|
9
|
+
def self.create(_params, _opts = {})
|
10
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.update(_params, _opts = {})
|
14
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.delete(_params, _opts = {})
|
18
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
class RestAPIBase < APIResource
|
6
|
+
REST_API_VERSION = '1.0'.freeze
|
7
|
+
|
8
|
+
def self.retrieve(id, opts = {})
|
9
|
+
send_request :get, api_url(endpoint_name, rest_api_params(id), :id), rest_api_params(id), opts.merge(required_params: [:id])
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.create(params, opts = {})
|
13
|
+
send_request :post, api_url(endpoint_name), rest_api_params(params), opts
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.update(params, opts = {})
|
17
|
+
send_request :put, api_url(endpoint_name, rest_api_params(params), :id), rest_api_params(params), opts.merge(required_params: [:id])
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.list(params, opts = {})
|
21
|
+
send_request :get, api_url(endpoint_name), rest_api_params(params), opts
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.delete(id, opts = {})
|
25
|
+
send_request :delete, api_url(endpoint_name, rest_api_params(id), :id), rest_api_params(id), opts.merge(required_params: [:id])
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def self.object_id(id_or_params)
|
31
|
+
id_or_params.is_a?(Hash) ? Util.value(id_or_params, :id) : id_or_params
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.fee_refund_id(params)
|
35
|
+
Util.value(rest_api_params(params), :id)
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.fee_url(params)
|
39
|
+
fee_id = Util.value(rest_api_params(params), :fee)
|
40
|
+
"/fees/#{fee_id}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
class Rule < RestAPIBase
|
6
|
+
ENDPOINT_NAME = 'rules'.freeze
|
7
|
+
|
8
|
+
def self.validate(params, opts = {})
|
9
|
+
send_request :post, "/#{endpoint_name}/validate", rest_api_params(params), opts
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
class Session < RestAPIBase
|
6
|
+
ENDPOINT_NAME = 'sessions'.freeze
|
7
|
+
|
8
|
+
def self.update(_params, _opts = {})
|
9
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.delete(_params, _opts = {})
|
13
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.list(_params, _opts = {})
|
17
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
class Transaction < RestAPIBase
|
6
|
+
ENDPOINT_NAME = 'transactions'.freeze
|
7
|
+
|
8
|
+
def self.create(_params, _opts = {})
|
9
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.update(_params, _opts = {})
|
13
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.delete(_params, _opts = {})
|
17
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Eligible
|
4
|
+
module V1_0
|
5
|
+
class Verification < RestAPIBase
|
6
|
+
ENDPOINT_NAME = 'verifications'.freeze
|
7
|
+
|
8
|
+
def self.update(_params, _opts = {})
|
9
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.delete(_params, _opts = {})
|
13
|
+
fail NotImplementedError, "Not an allowed operation for this endpoint"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/eligible/version.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
module Eligible
|
2
|
+
class VisitType < APIResource
|
3
|
+
def self.list(params, opts = {})
|
4
|
+
send_request :get, '/visit_types.json', params, opts
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.insurance_company_ids(params, opts = {})
|
8
|
+
send_request :get, '/visit_types/insurance_company_ids.json', params, opts
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|