Class: CandidApiClient::PatientRefunds::V1::AsyncV1Client
- Inherits:
-
Object
- Object
- CandidApiClient::PatientRefunds::V1::AsyncV1Client
- Defined in:
- lib/candidhealth/patient_refunds/v_1/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(amount_cents:, patient_external_id:, allocations:, refund_timestamp: nil, refund_note: nil, invoice: nil, refund_reason: nil, request_options: nil) ⇒ CandidApiClient::PatientRefunds::V1::Types::PatientRefund
Creates a new patient refund record and returns the newly created PatientRefund object.
-
#delete(patient_refund_id:, request_options: nil) ⇒ Void
Deletes the patient refund record matching the provided patient_refund_id.
-
#get(patient_refund_id:, request_options: nil) ⇒ CandidApiClient::PatientRefunds::V1::Types::PatientRefund
Retrieves a previously created patient refund by its ‘patient_refund_id`.
-
#get_multi(limit: nil, patient_external_id: nil, claim_id: nil, service_line_id: nil, billing_provider_id: nil, unattributed: nil, invoice_id: nil, sources: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::PatientRefunds::V1::Types::PatientRefundsPage
Returns all patient refunds satisfying the search criteria AND whose organization_id matches the current organization_id of the authenticated user.
- #initialize(request_client:) ⇒ CandidApiClient::PatientRefunds::V1::AsyncV1Client constructor
-
#update(patient_refund_id:, refund_timestamp: nil, refund_note: nil, invoice: nil, refund_reason: nil, request_options: nil) ⇒ CandidApiClient::PatientRefunds::V1::Types::PatientRefund
Updates the patient refund record matching the provided patient_refund_id.
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::PatientRefunds::V1::AsyncV1Client
217 218 219 |
# File 'lib/candidhealth/patient_refunds/v_1/client.rb', line 217 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
213 214 215 |
# File 'lib/candidhealth/patient_refunds/v_1/client.rb', line 213 def request_client @request_client end |
Instance Method Details
#create(amount_cents:, patient_external_id:, allocations:, refund_timestamp: nil, refund_note: nil, invoice: nil, refund_reason: nil, request_options: nil) ⇒ CandidApiClient::PatientRefunds::V1::Types::PatientRefund
Creates a new patient refund record and returns the newly created PatientRefund
object.
The allocations can describe whether the refund is being applied toward a
specific service line,
claim, or billing provider.
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/candidhealth/patient_refunds/v_1/client.rb', line 322 def create(amount_cents:, patient_external_id:, allocations:, refund_timestamp: nil, refund_note: nil, invoice: nil, refund_reason: nil, 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 = { **(&.additional_body_parameters || {}), amount_cents: amount_cents, refund_timestamp: , refund_note: refund_note, patient_external_id: patient_external_id, allocations: allocations, invoice: invoice, refund_reason: refund_reason }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/patient-refunds/v1" end CandidApiClient::PatientRefunds::V1::Types::PatientRefund.from_json(json_object: response.body) end end |
#delete(patient_refund_id:, request_options: nil) ⇒ Void
Deletes the patient refund record matching the provided patient_refund_id.
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/candidhealth/patient_refunds/v_1/client.rb', line 395 def delete(patient_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/patient-refunds/v1/#{patient_refund_id}" end end end |
#get(patient_refund_id:, request_options: nil) ⇒ CandidApiClient::PatientRefunds::V1::Types::PatientRefund
Retrieves a previously created patient refund by its ‘patient_refund_id`.
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/candidhealth/patient_refunds/v_1/client.rb', line 281 def get(patient_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/patient-refunds/v1/#{patient_refund_id}" end CandidApiClient::PatientRefunds::V1::Types::PatientRefund.from_json(json_object: response.body) end end |
#get_multi(limit: nil, patient_external_id: nil, claim_id: nil, service_line_id: nil, billing_provider_id: nil, unattributed: nil, invoice_id: nil, sources: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::PatientRefunds::V1::Types::PatientRefundsPage
Returns all patient refunds satisfying the search criteria AND whose
organization_id matches
the current organization_id of the authenticated user.
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/candidhealth/patient_refunds/v_1/client.rb', line 241 def get_multi(limit: nil, patient_external_id: nil, claim_id: nil, service_line_id: nil, billing_provider_id: nil, unattributed: nil, invoice_id: nil, sources: 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, "patient_external_id": patient_external_id, "claim_id": claim_id, "service_line_id": service_line_id, "billing_provider_id": billing_provider_id, "unattributed": unattributed, "invoice_id": invoice_id, "sources": sources, "sort": sort, "sort_direction": sort_direction, "page_token": page_token }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/patient-refunds/v1" end CandidApiClient::PatientRefunds::V1::Types::PatientRefundsPage.from_json(json_object: response.body) end end |
#update(patient_refund_id:, refund_timestamp: nil, refund_note: nil, invoice: nil, refund_reason: nil, request_options: nil) ⇒ CandidApiClient::PatientRefunds::V1::Types::PatientRefund
Updates the patient refund record matching the provided patient_refund_id.
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
# File 'lib/candidhealth/patient_refunds/v_1/client.rb', line 362 def update(patient_refund_id:, refund_timestamp: nil, refund_note: nil, invoice: 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, invoice: invoice, refund_reason: refund_reason }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/patient-refunds/v1/#{patient_refund_id}" end CandidApiClient::PatientRefunds::V1::Types::PatientRefund.from_json(json_object: response.body) end end |