Class: CandidApiClient::PreEncounter::EligibilityChecks::V1::AsyncV1Client
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::EligibilityChecks::V1::AsyncV1Client
- 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::AsyncV1Client 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::AsyncV1Client
141 142 143 |
# File 'lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb', line 141 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
137 138 139 |
# File 'lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb', line 137 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.
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb', line 215 def batch(request:, request_options: nil) Async do 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 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:
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb', line 244 def poll_batch(batch_id:, request_options: nil) Async do 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 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>
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/candidhealth/pre_encounter/eligibility_checks/v_1/client.rb', line 173 def post(request:, request_options: nil) Async do 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 end |