Class: CandidApiClient::InsuranceRefunds::V1::AsyncV1Client
- Inherits:
-
Object
- Object
- CandidApiClient::InsuranceRefunds::V1::AsyncV1Client
- Defined in:
- lib/candidhealth/insurance_refunds/v_1/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(request:, request_options: nil) ⇒ CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefund
Creates a new insurance refund record and returns the newly created ‘InsuranceRefund` object.
-
#delete(insurance_refund_id:, request_options: nil) ⇒ Void
Deletes the insurance refund record matching the provided ‘insurance_refund_id`.
-
#get(insurance_refund_id:, request_options: nil) ⇒ CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefund
Retrieves a previously created insurance refund by its ‘insurance_refund_id`.
-
#get_multi(limit: nil, payer_uuid: nil, claim_id: nil, service_line_id: nil, billing_provider_id: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefundsPage
Returns all insurance refunds satisfying the search criteria AND whose organization_id matches the current organization_id of the authenticated user.
- #initialize(request_client:) ⇒ CandidApiClient::InsuranceRefunds::V1::AsyncV1Client constructor
-
#update(insurance_refund_id:, refund_timestamp: nil, refund_note: nil, refund_reason: nil, request_options: nil) ⇒ CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefund
Updates the patient refund record matching the provided insurance_refund_id.
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::InsuranceRefunds::V1::AsyncV1Client
195 196 197 |
# File 'lib/candidhealth/insurance_refunds/v_1/client.rb', line 195 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
191 192 193 |
# File 'lib/candidhealth/insurance_refunds/v_1/client.rb', line 191 def request_client @request_client end |
Instance Method Details
#create(request:, request_options: nil) ⇒ CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefund
Creates a new insurance refund record and returns the newly created
`InsuranceRefund` object.
The allocations can describe whether the refund is being applied toward a
specific service line,
claim, or billing provider.
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/candidhealth/insurance_refunds/v_1/client.rb', line 289 def create(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: CandidApi, request_options: )}/api/insurance-refunds/v1" end CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefund.from_json(json_object: response.body) end end |
#delete(insurance_refund_id:, request_options: nil) ⇒ Void
Deletes the insurance refund record matching the provided ‘insurance_refund_id`.
If the matching record's organization_id does not match the authenticated user's
current organization_id, then a response code of `403` will be returned.
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
# File 'lib/candidhealth/insurance_refunds/v_1/client.rb', line 354 def delete(insurance_refund_id:, request_options: nil) Async do @request_client.conn.delete 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: CandidApi, request_options: )}/api/insurance-refunds/v1/#{insurance_refund_id}" end end end |
#get(insurance_refund_id:, request_options: nil) ⇒ CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefund
Retrieves a previously created insurance refund by its ‘insurance_refund_id`.
If the refund does not exist, a `403` will be thrown.
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/candidhealth/insurance_refunds/v_1/client.rb', line 254 def get(insurance_refund_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: CandidApi, request_options: )}/api/insurance-refunds/v1/#{insurance_refund_id}" end CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefund.from_json(json_object: response.body) end end |
#get_multi(limit: nil, payer_uuid: nil, claim_id: nil, service_line_id: nil, billing_provider_id: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefundsPage
Returns all insurance refunds satisfying the search criteria AND whose
organization_id matches
the current organization_id of the authenticated user.
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/candidhealth/insurance_refunds/v_1/client.rb', line 216 def get_multi(limit: nil, payer_uuid: nil, claim_id: nil, service_line_id: nil, billing_provider_id: nil, sort: nil, sort_direction: nil, page_token: nil, 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.params = { **(&.additional_query_parameters || {}), "limit": limit, "payer_uuid": payer_uuid, "claim_id": claim_id, "service_line_id": service_line_id, "billing_provider_id": billing_provider_id, "sort": sort, "sort_direction": sort_direction, "page_token": page_token }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/insurance-refunds/v1" end CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefundsPage.from_json(json_object: response.body) end end |
#update(insurance_refund_id:, refund_timestamp: nil, refund_note: nil, refund_reason: nil, request_options: nil) ⇒ CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefund
Updates the patient refund record matching the provided insurance_refund_id. If
updating the refund amount,
then the allocations must be appropriately updated as well.
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/candidhealth/insurance_refunds/v_1/client.rb', line 320 def update(insurance_refund_id:, refund_timestamp: nil, refund_note: nil, refund_reason: nil, request_options: nil) Async do response = @request_client.conn.patch 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 = { **(&.additional_body_parameters || {}), refund_timestamp: , refund_note: refund_note, refund_reason: refund_reason }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/insurance-refunds/v1/#{insurance_refund_id}" end CandidApiClient::InsuranceRefunds::V1::Types::InsuranceRefund.from_json(json_object: response.body) end end |