Class: Verity::Resources::PriorAuth
- Inherits:
-
Object
- Object
- Verity::Resources::PriorAuth
- Defined in:
- lib/verity/resources/prior_auth.rb
Instance Method Summary collapse
- #check(procedure_codes:, diagnosis_codes: nil, state: nil, payer: 'medicare', criteria_page: 1, criteria_per_page: 25, idempotency_key: nil) ⇒ Object
- #get_research(research_id) ⇒ Object
-
#initialize(client) ⇒ PriorAuth
constructor
A new instance of PriorAuth.
- #research(procedure_codes:, payer: nil, state: nil, diagnosis_codes: nil, clinical_context: nil, sync: false) ⇒ Object
Constructor Details
#initialize(client) ⇒ PriorAuth
Returns a new instance of PriorAuth.
6 7 8 |
# File 'lib/verity/resources/prior_auth.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#check(procedure_codes:, diagnosis_codes: nil, state: nil, payer: 'medicare', criteria_page: 1, criteria_per_page: 25, idempotency_key: nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/verity/resources/prior_auth.rb', line 10 def check(procedure_codes:, diagnosis_codes: nil, state: nil, payer: 'medicare', criteria_page: 1, criteria_per_page: 25, idempotency_key: nil) body = { procedure_codes: procedure_codes } body[:diagnosis_codes] = diagnosis_codes if diagnosis_codes body[:state] = state if state body[:payer] = payer if payer body[:criteria_page] = criteria_page if criteria_page body[:criteria_per_page] = criteria_per_page if criteria_per_page headers = {} headers['X-Idempotency-Key'] = idempotency_key if idempotency_key @client.request(:post, '/prior-auth/check', body: body, headers: headers) end |
#get_research(research_id) ⇒ Object
34 35 36 |
# File 'lib/verity/resources/prior_auth.rb', line 34 def get_research(research_id) @client.request(:get, "/prior-auth/research/#{research_id}") end |
#research(procedure_codes:, payer: nil, state: nil, diagnosis_codes: nil, clinical_context: nil, sync: false) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/verity/resources/prior_auth.rb', line 24 def research(procedure_codes:, payer: nil, state: nil, diagnosis_codes: nil, clinical_context: nil, sync: false) body = { procedure_codes: procedure_codes, sync: sync } body[:payer] = payer if payer body[:state] = state if state body[:diagnosis_codes] = diagnosis_codes if diagnosis_codes body[:clinical_context] = clinical_context if clinical_context @client.request(:post, '/prior-auth/research', body: body) end |