Class: CandidApiClient::PreEncounter::EligibilityChecks::V1::V1Client
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::EligibilityChecks::V1::V1Client
- Defined in:
- lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#batch(request:, request_options: nil) ⇒ CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse
Sends a batch of eligibility checks to payers through Stedi.
- #initialize(request_client:) ⇒ CandidApiClient::PreEncounter::EligibilityChecks::V1::V1Client constructor
-
#poll_batch(batch_id:, request_options: nil) ⇒ CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage
Polls the status of a batch eligibility check.
-
#post(request:, request_options: nil) ⇒ CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::ELIGIBILITY_RESPONSE
Sends real-time eligibility checks to payers through Stedi.
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::PreEncounter::EligibilityChecks::V1::V1Client
20 21 22 |
# File 'lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb', line 20 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::RequestClient (readonly)
16 17 18 |
# File 'lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb', line 16 def request_client @request_client end |
Instance Method Details
#batch(request:, request_options: nil) ⇒ CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse
Sends a batch of eligibility checks to payers through Stedi.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb', line 92 def batch(request:, request_options: nil) response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.body = { **(request || {}), **(&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(environment: PreEncounter, request_options: )}/eligibility-checks/v1/batch" end CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse.from_json(json_object: response.body) end |
#poll_batch(batch_id:, request_options: nil) ⇒ CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage
Polls the status of a batch eligibility check.
<Note>Batch eligibility checks are not yet available. Please reach out to the
Candid team for more information.</Note>
path-parameters:
119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb', line 119 def poll_batch(batch_id:, request_options: nil) response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.url "#{@request_client.get_url(environment: PreEncounter, request_options: )}/eligibility-checks/v1/batch/#{batch_id}" end CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage.from_json(json_object: response.body) end |
#post(request:, request_options: nil) ⇒ CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::ELIGIBILITY_RESPONSE
Sends real-time eligibility checks to payers through Stedi.
<Warning>Please only send one concurrent request to this endpoint. Batch
requests must be made in succession, otherwise, it will cause this service to
fail. A batch endpoint is in development - please reach out to the Candid team
for more information.</Warning>
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb', line 52 def post(request:, request_options: nil) response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.body = { **(request || {}), **(&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(environment: PreEncounter, request_options: )}/eligibility-checks/v1" end CandidApiClient::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck.from_json(json_object: response.body) end |