eligible 2.9.10 → 3.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 362731ed126b7b752cd6b9a8cc44d0c1bf6ac010b61dbb6474f3d53a44c44b17
4
- data.tar.gz: f53b4e635edf0047373c6e364fe866fe92f3aa0ac0b7c7eb1e5611c3a3fddfbd
3
+ metadata.gz: 5f26d623c6899f3464e7e248ac88bc443bf7bc9ca483b7aebe989e430a1f01d4
4
+ data.tar.gz: 532753d9a4753bec287e0f4d74202b15596711a07898d2e24ad47712ec6580e0
5
5
  SHA512:
6
- metadata.gz: 981575d454242a9ee907b4b3bfc43e4aecb7e0f4f9cf53684562528bba3e7b30f9032bb84f520c19b0dfc7fe7435ee168559a4195205ece9abae814101ff7102
7
- data.tar.gz: 916ec4f8c6da55eccbb789019d84e884a8ee78556d79ebbf1ed3026d29e55df5a53a4776bf36eedd679f5285abbf894e54d368c855bdcc9bd6aaa492eb0bc5f6
6
+ metadata.gz: d579842a87e0968e409d4aa095975c754e8deecb869c474594ee4587156154b69644d69ad951c3cf56dda61cf02202c38dfa2e0159c9e4b0e473c5e1bfc1c34f
7
+ data.tar.gz: 7f3884cdb6665753356acca910e296b3f8ac57dbae9dab1c6e93ba3d753ced3ae2f90c0642c41ecd3c7808f38998cefcf2f8e59c6ab2256aec97af456c17218a
@@ -1,7 +1,7 @@
1
1
  version: 2
2
2
  default_environment: &default_environment
3
3
  docker:
4
- - image: circleci/ruby:2.2-jessie-browsers
4
+ - image: circleci/ruby:2.4-stretch-browsers
5
5
  environment:
6
6
  BUNDLE_JOBS: 3
7
7
  BUNDLE_RETRY: 3
@@ -1 +1 @@
1
- 2.2.3
1
+ 2.4.3
@@ -1,6 +1,7 @@
1
1
  # Changelog
2
- ## 2.9.10 - 2020-05-13
3
- - Updated pinned GDS SSL certificate
2
+
3
+ ## 3.0.0.beta1 - 2019-10-01
4
+ - Added support for Eligible-Account Header in the API requests when used Eligible Connect feature
4
5
 
5
6
  ## 2.9.9 - 2019-08-07
6
7
  - Added Icd code endpoints
data/Gemfile CHANGED
@@ -1,4 +1,8 @@
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
+
3
7
  # Specify your gem's dependencies in eligible.gemspec
4
8
  gemspec
@@ -25,8 +25,10 @@ require 'eligible/ticket'
25
25
  require 'eligible/customer'
26
26
  require 'eligible/ocr'
27
27
  require 'eligible/original_signature_pdf'
28
+ require 'eligible/oauth_token'
28
29
  require 'eligible/received_pdf'
29
30
  require 'eligible/payer'
31
+ require 'eligible/payer_mapping'
30
32
  require 'eligible/preauth_resource'
31
33
  require 'eligible/precert'
32
34
  require 'eligible/referral'
@@ -51,13 +53,22 @@ module Eligible
51
53
  @@test = false
52
54
  @@api_version = '1.5'
53
55
  @@api_base = "https://gds.eligibleapi.com/v#{@@api_version}"
54
- @@fingerprints = %w(a1cd762a9f4be0f3b6bdd6300e52c6ce8d7d67f5
55
- 36d6b6f98a2b9bcdf4321d1978553e23cf044b53)
56
+ @@fingerprints = %w(9df5f186fb20ad25ffd864942a6394840b02a480
57
+ a1cd762a9f4be0f3b6bdd6300e52c6ce8d7d67f5)
58
+ @@eligible_account = nil
56
59
 
57
60
  def self.api_url(url = '')
58
61
  @@api_base + url.to_s
59
62
  end
60
63
 
64
+ def self.eligible_account
65
+ @@eligible_account
66
+ end
67
+
68
+ def self.eligible_account=(eligible_account)
69
+ @@eligible_account = eligible_account
70
+ end
71
+
61
72
  def self.api_key
62
73
  @@api_key
63
74
  end
@@ -163,6 +174,7 @@ module Eligible
163
174
  }.merge(headers)
164
175
 
165
176
  headers[:eligible_version] = api_version if api_version
177
+ headers[:eligible_account] = eligible_account if eligible_account
166
178
 
167
179
  opts = {
168
180
  method: method,
@@ -24,12 +24,24 @@ module Eligible
24
24
  fail ArgumentError, "#{name} of the #{class_name} is required" if value.nil? || (value.is_a?(String) && value.empty?)
25
25
  end
26
26
 
27
- def self.send_request(method, url, api_key, params, required_param_name = nil)
28
- unless required_param_name.nil?
27
+ def self.required_param_validation(params:, required_params:)
28
+ return if required_params.nil? || !required_params.is_a?(Array)
29
+
30
+ required_params.each do |required_param_name|
29
31
  required_param = Util.value(params, required_param_name)
30
32
  require_param(required_param, required_param_name)
31
33
  end
32
- response, api_key = Eligible.request(method, url, api_key, params)
34
+ end
35
+
36
+ def self.send_request(method, url, params, opts)
37
+ headers = opts.clone
38
+ client_secret = headers.delete(:client_secret)
39
+ api_key = headers.delete(:api_key)
40
+ api_key = client_secret unless client_secret.nil?
41
+
42
+ required_param_validation(params: params, required_params: headers.delete(:required_params))
43
+
44
+ response, api_key = Eligible.request(method, url, api_key, params, headers)
33
45
  Util.convert_to_eligible_object(response, api_key)
34
46
  end
35
47
 
@@ -1,7 +1,7 @@
1
1
  module Eligible
2
2
  class CalculatorDeployUrl < APIResource
3
- def self.fetch_or_create(params, api_key = nil)
4
- send_request(:get, '/calculator_deploy_urls.json', api_key, params)
3
+ def self.fetch_or_create(params, opts = {})
4
+ send_request :get, '/calculator_deploy_urls.json', params, opts
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, api_key = nil)
3
+ def self.ack(params, opts = {})
4
4
  reference_id = Util.value(params, :reference_id)
5
- send_request(:get, "/claims/#{reference_id}/acknowledgements.json", api_key, params, :reference_id)
5
+ send_request :get, "/claims/#{reference_id}/acknowledgements.json", params, opts.merge(required_params: [:reference_id])
6
6
  end
7
7
 
8
- def self.post(params, api_key = nil)
9
- send_request(:post, '/claims.json', api_key, params)
8
+ def self.post(params, opts = {})
9
+ send_request :post, '/claims.json', params, opts
10
10
  end
11
11
 
12
- def self.acks(params, api_key = nil)
13
- send_request(:get, '/claims/acknowledgements.json', api_key, params)
12
+ def self.acks(params, opts = {})
13
+ send_request :get, '/claims/acknowledgements.json', params, opts
14
14
  end
15
15
 
16
- def self.payment_report(params, api_key = nil)
16
+ def self.payment_report(params, opts = {})
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, api_key, params)
21
+ send_request :get, url, params, opts
22
22
  end
23
23
 
24
- def self.payment_reports(params, api_key = nil)
25
- send_request(:get, '/claims/payment_reports.json', api_key, params)
24
+ def self.payment_reports(params, opts = {})
25
+ send_request :get, '/claims/payment_reports.json', params, opts
26
26
  end
27
27
  end
28
28
  end
@@ -8,12 +8,12 @@ module Eligible
8
8
  return '/coverage/all/batch.json'
9
9
  end
10
10
 
11
- def self.cost_estimate(params, api_key = nil)
12
- send_request(:get, '/coverage/cost_estimates.json', api_key, params)
11
+ def self.cost_estimate(params, opts = {})
12
+ send_request :get, '/coverage/cost_estimates.json', params, opts
13
13
  end
14
14
 
15
- def self.batch_medicare_post(params, api_key = nil)
16
- send_request(:post, '/medicare/coverage/batch.json', api_key, params)
15
+ def self.batch_medicare_post(params, opts = {})
16
+ send_request :post, '/medicare/coverage/batch.json', params, opts
17
17
  end
18
18
  end
19
19
  end
@@ -1,11 +1,11 @@
1
1
  module Eligible
2
2
  class CoverageResource < APIResource
3
- def self.get(params, api_key = nil)
4
- send_request(:get, get_uri, api_key, params)
3
+ def self.get(params, opts = {})
4
+ send_request :get, get_uri, params, opts
5
5
  end
6
6
 
7
- def self.post(params, api_key = nil)
8
- send_request(:post, post_uri, api_key, params)
7
+ def self.post(params, opts = {})
8
+ send_request :post, post_uri, params, opts
9
9
  end
10
10
 
11
11
  def self.get_uri
@@ -1,19 +1,19 @@
1
1
  module Eligible
2
2
  class Customer < APIResource
3
- def self.get(params, api_key = nil)
4
- send_request(:get, api_url('customers', params, :customer_id), api_key, params, :customer_id)
3
+ def self.get(params, opts = {})
4
+ send_request :get, api_url('customers', params, :customer_id), params, opts.merge(required_params: [:customer_id])
5
5
  end
6
6
 
7
- def self.post(params, api_key = nil)
8
- send_request(:post, api_url('customers'), api_key, params)
7
+ def self.post(params, opts = {})
8
+ send_request :post, api_url('customers'), params, opts
9
9
  end
10
10
 
11
- def self.update(params, api_key = nil)
12
- send_request(:put, api_url('customers', params, :customer_id), api_key, params, :customer_id)
11
+ def self.update(params, opts = {})
12
+ send_request :put, api_url('customers', params, :customer_id), params, opts.merge(required_params: [:customer_id])
13
13
  end
14
14
 
15
- def self.all(params, api_key = nil)
16
- send_request(:get, api_url('customers'), api_key, params)
15
+ def self.all(params, opts = {})
16
+ send_request :get, api_url('customers'), params, opts
17
17
  end
18
18
  end
19
19
  end
@@ -1,19 +1,19 @@
1
1
  module Eligible
2
2
  class Enrollment < APIResource
3
- def self.get(params, api_key = nil)
4
- send_request(:get, api_url('enrollment_npis', params, :enrollment_npi_id), api_key, params, :enrollment_npi_id)
3
+ def self.get(params, opts = {})
4
+ send_request :get, api_url('enrollment_npis', params, :enrollment_npi_id), params, opts.merge(required_params: [:enrollment_npi_id])
5
5
  end
6
6
 
7
- def self.list(params, api_key = nil)
8
- send_request(:get, api_url('enrollment_npis'), api_key, params)
7
+ def self.list(params, opts = {})
8
+ send_request :get, api_url('enrollment_npis'), params, opts
9
9
  end
10
10
 
11
- def self.post(params, api_key = nil)
12
- send_request(:post, api_url('enrollment_npis'), api_key, params)
11
+ def self.post(params, opts = {})
12
+ send_request :post, api_url('enrollment_npis'), params, opts
13
13
  end
14
14
 
15
- def self.update(params, api_key = nil)
16
- send_request(:put, api_url('enrollment_npis', params, :enrollment_npi_id), api_key, params, :enrollment_npi_id)
15
+ def self.update(params, opts = {})
16
+ send_request :put, api_url('enrollment_npis', params, :enrollment_npi_id), params, opts.merge(required_params: [:enrollment_npi_id])
17
17
  end
18
18
 
19
19
  def enrollment_npis
@@ -16,7 +16,8 @@ module Eligible
16
16
 
17
17
  def to_s
18
18
  status_string = @http_status.nil? ? '' : "(Status #{@http_status}) "
19
- "#{status_string}#{@message}: #{@errors.to_json}"
19
+ json_errors = errors.presence || (json_body&.key?(:error) ? [json_body] : [])
20
+ "#{status_string}#{@message}: #{json_errors.to_json}"
20
21
  end
21
22
  end
22
23
  end
@@ -1,16 +1,16 @@
1
1
  module Eligible
2
2
  class Icd < APIResource
3
3
 
4
- def self.list(params, api_key = nil)
5
- send_request(:get, "/icds/#{Util.value(params, :type)}", api_key, params)
4
+ def self.list(params, opts = {})
5
+ send_request :get, "/icds/#{Util.value(params, :type)}", params, opts
6
6
  end
7
7
 
8
- def self.describe(params, api_key = nil)
9
- send_request(:get, "/icds/#{Util.value(params, :type)}/describe/#{Util.value(params, :code)}", api_key, params)
8
+ def self.describe(params, opts = {})
9
+ send_request :get, "/icds/#{Util.value(params, :type)}/describe/#{Util.value(params, :code)}", params, opts
10
10
  end
11
11
 
12
- def self.crosswalk(params, api_key = nil)
13
- send_request(:get, "/icds/#{Util.value(params, :type)}/crosswalk/#{Util.value(params, :code)}", api_key, params)
12
+ def self.crosswalk(params, opts = {})
13
+ send_request :get, "/icds/#{Util.value(params, :type)}/crosswalk/#{Util.value(params, :code)}", params, opts
14
14
  end
15
15
  end
16
16
  end
@@ -3,12 +3,12 @@ require 'base64'
3
3
 
4
4
  module Eligible
5
5
  class Lockbox < APIResource
6
- def self.get(params, api_key = nil)
7
- send_request(:get, api_url('lockboxes', params, :lockbox_id), api_key, params, :lockbox_id)
6
+ def self.get(params, opts = {})
7
+ send_request :get, api_url('lockboxes', params, :lockbox_id), params, opts.merge(required_params: [:lockbox_id])
8
8
  end
9
9
 
10
- def self.all(params, api_key = nil)
11
- send_request(:get, api_url('lockboxes'), api_key, params)
10
+ def self.all(params, opts = {})
11
+ send_request :get, api_url('lockboxes'), params, opts
12
12
  end
13
13
 
14
14
  def self.extract_private_key(params)
@@ -29,10 +29,10 @@ module Eligible
29
29
  Encryptor.decrypt(value: Base64.decode64(data), key: sha_key, insecure_mode: true)
30
30
  end
31
31
 
32
- def self.get_and_decrypt_from_lockbox(params, api_key = nil)
32
+ def self.get_and_decrypt_from_lockbox(params, opts = {})
33
33
  private_key = extract_private_key(params)
34
34
  delete_private_key!(params)
35
- req = get(params, api_key).to_hash
35
+ req = get(params, opts).to_hash
36
36
  decrypt_data(req[:encrypted_data], req[:encrypted_key], private_key)
37
37
  end
38
38
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Eligible
4
+ class OauthToken < APIResource
5
+ def self.post(params, opts = {})
6
+ send_request :post, '/oauth/token', params, opts
7
+ end
8
+ end
9
+ end
@@ -5,9 +5,9 @@ module Eligible
5
5
  params[:file] = File.new(file, 'rb') if file.is_a?(String)
6
6
  end
7
7
 
8
- def self.post(params, api_key = nil)
8
+ def self.post(params, opts = {})
9
9
  setup_file(params)
10
- send_request(:post, '/card_scans.json', api_key, params)
10
+ send_request :post, '/card_scans.json', params, opts
11
11
  end
12
12
 
13
13
  private_class_method :setup_file
@@ -5,8 +5,8 @@ module Eligible
5
5
  "/enrollment_npis/#{enrollment_npi_id}/original_signature_pdf"
6
6
  end
7
7
 
8
- def self.get(params, api_key = nil)
9
- send_request(:get, original_signature_pdf_url(params), api_key, params, :enrollment_npi_id)
8
+ def self.get(params, opts = {})
9
+ send_request :get, original_signature_pdf_url(params), params, opts.merge(required_params: [:enrollment_npi_id])
10
10
  end
11
11
 
12
12
  def self.setup_file(params)
@@ -14,25 +14,27 @@ module Eligible
14
14
  params[:file] = File.new(file, 'rb') if file.is_a?(String)
15
15
  end
16
16
 
17
- def self.post(params, api_key = nil)
17
+ def self.post(params, opts = {})
18
18
  setup_file(params)
19
- send_request(:post, original_signature_pdf_url(params), api_key, params, :enrollment_npi_id)
19
+ send_request :post, original_signature_pdf_url(params), params, opts.merge(required_params: [:enrollment_npi_id])
20
20
  end
21
21
 
22
- def self.update(params, api_key = nil)
22
+ def self.update(params, opts = {})
23
23
  setup_file(params)
24
- send_request(:put, original_signature_pdf_url(params), api_key, params, :enrollment_npi_id)
24
+ send_request :put, original_signature_pdf_url(params), params, opts.merge(required_params: [:enrollment_npi_id])
25
25
  end
26
26
 
27
- def self.delete(params, api_key = nil)
28
- send_request(:delete, original_signature_pdf_url(params), api_key, params, :enrollment_npi_id)
27
+ def self.delete(params, opts = {})
28
+ send_request :delete, original_signature_pdf_url(params), params, opts.merge(required_params: [:enrollment_npi_id])
29
29
  end
30
30
 
31
- def self.download(params, api_key = nil)
31
+ def self.download(params, opts = {})
32
32
  enrollment_npi_id = Util.value(params, :enrollment_npi_id)
33
33
  require_param(enrollment_npi_id, 'Enrollment Npi id')
34
34
  params[:format] = 'x12'
35
- response = Eligible.request(:get, "/enrollment_npis/#{enrollment_npi_id}/original_signature_pdf/download", api_key, params)[0]
35
+ headers = opts.clone
36
+ api_key = headers.delete(:api_key)
37
+ response = Eligible.request(:get, "/enrollment_npis/#{enrollment_npi_id}/original_signature_pdf/download", api_key, params, headers)[0]
36
38
  filename = params[:filename] || '/tmp/original_signature_pdf.pdf'
37
39
  file = File.new(filename, 'w')
38
40
  file.write response
@@ -1,17 +1,17 @@
1
1
  module Eligible
2
2
  class Payer < APIResource
3
- def self.list(params, api_key = nil)
4
- send_request(:get, api_url('payers'), api_key, params)
3
+ def self.list(params, opts = {})
4
+ send_request :get, api_url('payers'), params, opts
5
5
  end
6
6
 
7
- def self.get(params, api_key = nil)
8
- send_request(:get, api_url('payers', params, :payer_id), api_key, params, :payer_id)
7
+ def self.get(params, opts = {})
8
+ send_request :get, api_url('payers', params, :payer_id), params, opts.merge(required_params: [:payer_id])
9
9
  end
10
10
 
11
- def self.search_options(params, api_key = nil)
11
+ def self.search_options(params, opts = {})
12
12
  payer_id = Util.value(params, :payer_id)
13
13
  url = payer_id.nil? ? '/payers/search_options' : "/payers/#{payer_id}/search_options"
14
- send_request(:get, url, api_key, params)
14
+ send_request :get, url, params, opts
15
15
  end
16
16
  end
17
17
  end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Eligible
4
+ class PayerMapping < APIResource
5
+ def self.mapper(params, opts = {})
6
+ send_request :post, '/payer_mapping/mapper', params, opts
7
+ end
8
+
9
+ def self.mapper_batch(params, opts = {})
10
+ send_request :post, '/payer_mapping/mapper/batch', params, opts
11
+ end
12
+
13
+ def self.search(params, opts = {})
14
+ send_request :post, '/payer_mapping/search', params, opts
15
+ end
16
+
17
+ def self.search_batch(params, opts = {})
18
+ send_request :post, '/payer_mapping/search/batch', params, opts
19
+ end
20
+
21
+ def self.normalize(params, opts = {})
22
+ send_request :post, '/payer_mapping/normalize', params, opts
23
+ end
24
+
25
+ def self.normalize_batch(params, opts = {})
26
+ send_request :post, '/payer_mapping/normalize/batch', params, opts
27
+ end
28
+
29
+ def self.normalize_cased(params, opts = {})
30
+ send_request :post, '/payer_mapping/normalize_cased', params, opts
31
+ end
32
+
33
+ def self.normalize_cased_batch(params, opts = {})
34
+ send_request :post, '/payer_mapping/normalize_cased/batch', params, opts
35
+ end
36
+ end
37
+ end
@@ -1,11 +1,11 @@
1
1
  module Eligible
2
2
  class Payment < APIResource
3
- def self.get(params, api_key = nil)
4
- send_request(:get, '/payment/status.json', api_key, params)
3
+ def self.get(params, opts = {})
4
+ send_request :get, '/payment/status.json', params, opts
5
5
  end
6
6
 
7
- def self.batch(params, api_key = nil)
8
- send_request(:get, '/batch/payment/status.json', api_key, params)
7
+ def self.batch(params, opts = {})
8
+ send_request :get, '/batch/payment/status.json', params, opts
9
9
  end
10
10
  end
11
11
  end
@@ -1,11 +1,11 @@
1
1
  module Eligible
2
2
  class PreauthResource < CoverageResource
3
- def self.inquiry(params, api_key = nil)
4
- get(params, api_key)
3
+ def self.inquiry(params, opts = {})
4
+ get(params, opts)
5
5
  end
6
6
 
7
- def self.create(params, api_key = nil)
8
- post(params, api_key)
7
+ def self.create(params, opts = {})
8
+ post(params, opts)
9
9
  end
10
10
  end
11
11
  end
@@ -1,7 +1,7 @@
1
1
  module Eligible
2
2
  class Precert < PreauthResource
3
- def self.require(params, api_key = nil)
4
- send_request(:get, '/precert/require.json', api_key, params)
3
+ def self.require(params, opts = {})
4
+ send_request :get, '/precert/require.json', params, opts
5
5
  end
6
6
 
7
7
  def self.get_uri
@@ -1,7 +1,7 @@
1
1
  module Eligible
2
2
  class ProviderModel < APIResource
3
- def self.get(params, api_key = nil)
4
- send_request(:get, '/provider_models.json', api_key, params)
3
+ def self.get(params, opts = {})
4
+ send_request :get, '/provider_models.json', params, opts
5
5
  end
6
6
  end
7
7
  end
@@ -2,21 +2,21 @@ require 'openssl'
2
2
 
3
3
  module Eligible
4
4
  class PublicKey < APIResource
5
- def self.get(params, api_key = nil)
6
- send_request(:get, api_url('public_keys', params, :key_id), api_key, params, :key_id)
5
+ def self.get(params, opts = {})
6
+ send_request :get, api_url('public_keys', params, :key_id), params, opts.merge(required_params: [:key_id])
7
7
  end
8
8
 
9
- def self.post(params, api_key = nil)
10
- send_request(:post, api_url('public_keys'), api_key, params)
9
+ def self.post(params, opts = {})
10
+ send_request :post, api_url('public_keys'), params, opts
11
11
  end
12
12
 
13
- def self.activate(params, api_key = nil)
13
+ def self.activate(params, opts = {})
14
14
  key_id = Util.value(params, :key_id)
15
- send_request(:get, "/public_keys/#{key_id}/activate.json", api_key, params, :key_id)
15
+ send_request :get, "/public_keys/#{key_id}/activate.json", params, opts.merge(required_params: [:key_id])
16
16
  end
17
17
 
18
- def self.all(params, api_key = nil)
19
- send_request(:get, api_url('public_keys'), api_key, params)
18
+ def self.all(params, opts = {})
19
+ send_request :get, api_url('public_keys'), params, opts
20
20
  end
21
21
 
22
22
  def self.create_pair
@@ -5,15 +5,17 @@ module Eligible
5
5
  "/enrollment_npis/#{enrollment_npi_id}/received_pdf"
6
6
  end
7
7
 
8
- def self.get(params, api_key = nil)
9
- send_request(:get, received_pdf_url(params), api_key, params, :enrollment_npi_id)
8
+ def self.get(params, opts = {})
9
+ send_request :get, received_pdf_url(params), params, opts.merge(required_params: [:enrollment_npi_id])
10
10
  end
11
11
 
12
- def self.download(params, api_key = nil)
12
+ def self.download(params, opts = {})
13
13
  enrollment_npi_id = Util.value(params, :enrollment_npi_id)
14
14
  require_param(enrollment_npi_id, 'Enrollment Npi id')
15
15
  params[:format] = 'x12'
16
- response = Eligible.request(:get, "/enrollment_npis/#{params[:enrollment_npi_id]}/received_pdf/download", api_key, params)[0]
16
+ headers = opts.clone
17
+ api_key = headers.delete(:api_key)
18
+ response = Eligible.request(:get, "/enrollment_npis/#{params[:enrollment_npi_id]}/received_pdf/download", api_key, params, headers)[0]
17
19
  filename = params[:filename] || '/tmp/received_pdf.pdf'
18
20
  file = File.new(filename, 'w')
19
21
  file.write response
@@ -1,15 +1,15 @@
1
1
  module Eligible
2
2
  class RiskAssessment < APIResource
3
- def self.criteria(params, api_key = nil)
4
- send_request(:get, '/risk_assessments/criteria.json', api_key, params)
3
+ def self.criteria(params, opts = {})
4
+ send_request :get, '/risk_assessments/criteria.json', params, opts
5
5
  end
6
6
 
7
- def self.cost_estimate(params, api_key = nil)
8
- send_request(:get, '/risk_assessments/cost_estimates.json', api_key, params)
7
+ def self.cost_estimate(params, opts = {})
8
+ send_request :get, '/risk_assessments/cost_estimates.json', params, opts
9
9
  end
10
10
 
11
- def self.fetch(params, api_key = nil)
12
- send_request(:get, '/risk_assessments/fetch.json', api_key, params)
11
+ def self.fetch(params, opts = {})
12
+ send_request :get, '/risk_assessments/fetch.json', params, opts
13
13
  end
14
14
  end
15
15
  end
@@ -1,11 +1,11 @@
1
1
  module Eligible
2
2
  class SessionToken < APIResource
3
- def self.create(params, api_key = nil)
4
- send_request(:post, '/session_tokens/create.json', api_key, params)
3
+ def self.create(params, opts = {})
4
+ send_request :post, '/session_tokens/create.json', params, opts
5
5
  end
6
6
 
7
- def self.revoke(params, api_key = nil)
8
- send_request(:post, '/session_tokens/revoke.json', api_key, params)
7
+ def self.revoke(params, opts = {})
8
+ send_request :post, '/session_tokens/revoke.json', params, opts
9
9
  end
10
10
  end
11
11
  end
@@ -13,28 +13,28 @@ module Eligible
13
13
  end
14
14
  end
15
15
 
16
- def self.create(params, api_key = nil)
17
- send_request(:post, ticket_url, api_key, params)
16
+ def self.create(params, opts = {})
17
+ send_request :post, ticket_url, params, opts
18
18
  end
19
19
 
20
- def self.comments(params, api_key = nil)
21
- send_request(:post, ticket_url(params, true), api_key, params, :id)
20
+ def self.comments(params, opts = {})
21
+ send_request :post, ticket_url(params, true), params, opts.merge(required_params: [:id])
22
22
  end
23
23
 
24
- def self.all(params, api_key = nil)
25
- send_request(:get, ticket_url, api_key, params)
24
+ def self.all(params, opts = {})
25
+ send_request :get, ticket_url, params, opts
26
26
  end
27
27
 
28
- def self.get(params, api_key = nil)
29
- send_request(:get, ticket_url(params), api_key, params, :id)
28
+ def self.get(params, opts = {})
29
+ send_request :get, ticket_url(params), params, opts.merge(required_params: [:id])
30
30
  end
31
31
 
32
- def self.delete(params, api_key = nil)
33
- send_request(:delete, ticket_url(params), api_key, params, :id)
32
+ def self.delete(params, opts = {})
33
+ send_request :delete, ticket_url(params), params, opts.merge(required_params: [:id])
34
34
  end
35
35
 
36
- def self.update(params, api_key = nil)
37
- send_request(:put, ticket_url(params), api_key, params, :id)
36
+ def self.update(params, opts = {})
37
+ send_request :put, ticket_url(params), params, opts.merge(required_params: [:id])
38
38
  end
39
39
  end
40
40
  end
@@ -1,3 +1,3 @@
1
1
  module Eligible
2
- VERSION = '2.9.10'.freeze
2
+ VERSION = '3.0.0.beta1'.freeze
3
3
  end
@@ -1,11 +1,11 @@
1
1
  module Eligible
2
2
  class VisitType < APIResource
3
- def self.list(params, api_key = nil)
4
- send_request(:get, '/visit_types.json', api_key, params)
3
+ def self.list(params, opts = {})
4
+ send_request :get, '/visit_types.json', params, opts
5
5
  end
6
6
 
7
- def self.insurance_company_ids(params, api_key = nil)
8
- send_request(:get, '/visit_types/insurance_company_ids.json', api_key, params)
7
+ def self.insurance_company_ids(params, opts = {})
8
+ send_request :get, '/visit_types/insurance_company_ids.json', params, opts
9
9
  end
10
10
  end
11
11
  end
@@ -1,8 +1,8 @@
1
1
  module Eligible
2
2
  class X12 < APIResource
3
- def self.post(params, api_key = nil)
3
+ def self.post(params, opts = {})
4
4
  params[:format] = 'x12'
5
- send_request(:post, '/x12', api_key, params)
5
+ send_request :post, '/x12', params, opts
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eligible
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.10
4
+ version: 3.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katelyn Gleaon
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-05-13 00:00:00.000000000 Z
13
+ date: 2020-02-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client
@@ -139,9 +139,11 @@ files:
139
139
  - lib/eligible/json.rb
140
140
  - lib/eligible/lockbox.rb
141
141
  - lib/eligible/medicare.rb
142
+ - lib/eligible/oauth_token.rb
142
143
  - lib/eligible/ocr.rb
143
144
  - lib/eligible/original_signature_pdf.rb
144
145
  - lib/eligible/payer.rb
146
+ - lib/eligible/payer_mapping.rb
145
147
  - lib/eligible/payment.rb
146
148
  - lib/eligible/preauth_resource.rb
147
149
  - lib/eligible/precert.rb
@@ -171,11 +173,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
173
  version: '0'
172
174
  required_rubygems_version: !ruby/object:Gem::Requirement
173
175
  requirements:
174
- - - ">="
176
+ - - ">"
175
177
  - !ruby/object:Gem::Version
176
- version: '0'
178
+ version: 1.3.1
177
179
  requirements: []
178
- rubygems_version: 3.0.6
180
+ rubyforge_project:
181
+ rubygems_version: 2.7.10
179
182
  signing_key:
180
183
  specification_version: 4
181
184
  summary: Ruby wrapper for the Eligible API