Class: CandidApiClient::InsurancePayments::V1::AsyncV1Client
- Inherits:
-
Object
- Object
- CandidApiClient::InsurancePayments::V1::AsyncV1Client
- Defined in:
- lib/candidhealth/insurance_payments/v_1/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(request:, request_options: nil) ⇒ CandidApiClient::InsurancePayments::V1::Types::InsurancePayment
Creates a new insurance payment record and returns the newly created ‘InsurancePayment` object.
-
#delete(insurance_payment_id:, request_options: nil) ⇒ Void
Deletes the insurance payment record matching the provided ‘insurance_payment_id`.
-
#get(insurance_payment_id:, request_options: nil) ⇒ CandidApiClient::InsurancePayments::V1::Types::InsurancePayment
Retrieves a previously created insurance payment by its ‘insurance_payment_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::InsurancePayments::V1::Types::InsurancePaymentsPage
Returns all non-ERA originated insurance payments satisfying the search criteria.
- #initialize(request_client:) ⇒ CandidApiClient::InsurancePayments::V1::AsyncV1Client constructor
-
#update(insurance_payment_id:, payment_timestamp: nil, payment_note: nil, request_options: nil) ⇒ CandidApiClient::InsurancePayments::V1::Types::InsurancePayment
Updates the patient payment record matching the provided insurance_payment_id.
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::InsurancePayments::V1::AsyncV1Client
199 200 201 |
# File 'lib/candidhealth/insurance_payments/v_1/client.rb', line 199 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ CandidApiClient::AsyncRequestClient (readonly)
195 196 197 |
# File 'lib/candidhealth/insurance_payments/v_1/client.rb', line 195 def request_client @request_client end |
Instance Method Details
#create(request:, request_options: nil) ⇒ CandidApiClient::InsurancePayments::V1::Types::InsurancePayment
Creates a new insurance payment record and returns the newly created
`InsurancePayment` object. This endpoint
should only be used for insurance payments that do not have a corresponding ERA
(for example: a settlement check
from a payer). If the payment is an ERA, then you should used the
insurance-adjudications API.
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/candidhealth/insurance_payments/v_1/client.rb', line 300 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-payments/v1" end CandidApiClient::InsurancePayments::V1::Types::InsurancePayment.from_json(json_object: response.body) end end |
#delete(insurance_payment_id:, request_options: nil) ⇒ Void
Deletes the insurance payment record matching the provided
`insurance_payment_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.
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/candidhealth/insurance_payments/v_1/client.rb', line 363 def delete(insurance_payment_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-payments/v1/#{insurance_payment_id}" end end end |
#get(insurance_payment_id:, request_options: nil) ⇒ CandidApiClient::InsurancePayments::V1::Types::InsurancePayment
Retrieves a previously created insurance payment by its ‘insurance_payment_id`.
If the payment does not exist, a `403` will be thrown.
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/candidhealth/insurance_payments/v_1/client.rb', line 265 def get(insurance_payment_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-payments/v1/#{insurance_payment_id}" end CandidApiClient::InsurancePayments::V1::Types::InsurancePayment.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::InsurancePayments::V1::Types::InsurancePaymentsPage
Returns all non-ERA originated insurance payments satisfying the search criteria
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/candidhealth/insurance_payments/v_1/client.rb', line 227 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-payments/v1" end CandidApiClient::InsurancePayments::V1::Types::InsurancePaymentsPage.from_json(json_object: response.body) end end |
#update(insurance_payment_id:, payment_timestamp: nil, payment_note: nil, request_options: nil) ⇒ CandidApiClient::InsurancePayments::V1::Types::InsurancePayment
Updates the patient payment record matching the provided insurance_payment_id.
If updating the payment amount,
then the allocations must be appropriately updated as well.
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 |
# File 'lib/candidhealth/insurance_payments/v_1/client.rb', line 330 def update(insurance_payment_id:, payment_timestamp: nil, payment_note: 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 || {}), payment_timestamp: , payment_note: payment_note }.compact req.url "#{@request_client.get_url(environment: CandidApi, request_options: )}/api/insurance-payments/v1/#{insurance_payment_id}" end CandidApiClient::InsurancePayments::V1::Types::InsurancePayment.from_json(json_object: response.body) end end |