Class: CandidApiClient::Tasks::V3::AsyncV3Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/tasks/v_3/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::Tasks::V3::AsyncV3Client

Parameters:



194
195
196
# File 'lib/candidhealth/tasks/v_3/client.rb', line 194

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



190
191
192
# File 'lib/candidhealth/tasks/v_3/client.rb', line 190

def request_client
  @request_client
end

Instance Method Details

#create(request:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.tasks.v_3.create(request: { encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", task_type: CUSTOMER_DATA_REQUEST, description: "string", blocks_claim_submission: true, assignee_user_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", category: OTHER, work_queue_id: "string" })

Parameters:

  • request (Hash)

    Request of type CandidApiClient::Tasks::V3::Types::TaskCreateV3, as a Hash

    • :encounter_id (String)

    • :task_type (CandidApiClient::Tasks::Commons::Types::TaskType)

    • :description (String)

    • :blocks_claim_submission (Boolean)

    • :assignee_user_id (String)

    • :category (CandidApiClient::Tasks::Commons::Types::TaskCategory)

    • :work_queue_id (String)

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/candidhealth/tasks/v_3/client.rb', line 323

def create(request:, request_options: nil)
  Async do
    response = @request_client.conn.post do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/tasks/v3"
    end
    CandidApiClient::Tasks::V3::Types::Task.from_json(json_object: response.body)
  end
end

#get(task_id:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.tasks.v_3.get(task_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/candidhealth/tasks/v_3/client.rb', line 293

def get(task_id:, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/tasks/v3/#{task_id}"
    end
    CandidApiClient::Tasks::V3::Types::Task.from_json(json_object: response.body)
  end
end

#get_actions(task_id:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskActions

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.tasks.v_3.get_actions(task_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/candidhealth/tasks/v_3/client.rb', line 204

def get_actions(task_id:, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/tasks/v3/#{task_id}/actions"
    end
    CandidApiClient::Tasks::V3::Types::TaskActions.from_json(json_object: response.body)
  end
end

#get_multi(limit: nil, page_token: nil, status: nil, task_type: nil, categories: nil, updated_since: nil, encounter_id: nil, search_term: nil, assigned_to_id: nil, date_of_service_min: nil, date_of_service_max: nil, billing_provider_npi: nil, sort: nil, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::TaskPage

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.tasks.v_3.get_multi(
  limit: 1,
  page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
  status: FINISHED,
  task_type: CUSTOMER_DATA_REQUEST,
  categories: "string",
  updated_since: DateTime.parse(2024-01-15T09:30:00.000Z),
  encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  search_term: "string",
  assigned_to_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  date_of_service_min: DateTime.parse(2023-01-15),
  date_of_service_max: DateTime.parse(2023-01-15),
  billing_provider_npi: "string",
  sort: UPDATED_AT_ASC
)

Parameters:

  • limit (Integer) (defaults to: nil)

    Defaults to 100

  • page_token (String) (defaults to: nil)
  • status (CandidApiClient::Tasks::Commons::Types::TaskStatus) (defaults to: nil)
  • task_type (CandidApiClient::Tasks::Commons::Types::TaskType) (defaults to: nil)
  • categories (String) (defaults to: nil)

    Only return tasks with categories that match one in this comma-separated list.

  • updated_since (DateTime) (defaults to: nil)

    Only return tasks updated on or after this date-time

  • encounter_id (String) (defaults to: nil)

    Only return tasks associated with this encounter

  • search_term (String) (defaults to: nil)

    Query tasks by encounter_id, claim_id, task_id, or external_id

  • assigned_to_id (String) (defaults to: nil)

    Only return tasks assigned to this user

  • date_of_service_min (Date) (defaults to: nil)

    The minimum date of service for the linked encounter

  • date_of_service_max (Date) (defaults to: nil)

    The maximum date of service for the linked encounter

  • billing_provider_npi (String) (defaults to: nil)

    The NPI of the billing provider associated with the task’s claim

  • sort (CandidApiClient::Tasks::V3::Types::TaskSortOptions) (defaults to: nil)

    Defaults to updated_at:desc

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/candidhealth/tasks/v_3/client.rb', line 253

def get_multi(limit: nil, page_token: nil, status: nil, task_type: nil, categories: nil, updated_since: nil,
              encounter_id: nil, search_term: nil, assigned_to_id: nil, date_of_service_min: nil, date_of_service_max: nil, billing_provider_npi: nil, sort: nil, request_options: nil)
  Async do
    response = @request_client.conn.get do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.params = {
        **(request_options&.additional_query_parameters || {}),
        "limit": limit,
        "page_token": page_token,
        "status": status,
        "task_type": task_type,
        "categories": categories,
        "updated_since": updated_since,
        "encounter_id": encounter_id,
        "search_term": search_term,
        "assigned_to_id": assigned_to_id,
        "date_of_service_min": date_of_service_min,
        "date_of_service_max": date_of_service_max,
        "billing_provider_npi": billing_provider_npi,
        "sort": sort
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/tasks/v3"
    end
    CandidApiClient::Tasks::V3::Types::TaskPage.from_json(json_object: response.body)
  end
end

#update(task_id:, request:, request_options: nil) ⇒ CandidApiClient::Tasks::V3::Types::Task

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.tasks.v_3.update(task_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { status: FINISHED, assignee_user_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", blocks_claim_submission: true })

Parameters:

  • task_id (String)
  • request (Hash)

    Request of type CandidApiClient::Tasks::V3::Types::TaskUpdateV3, as a Hash

    • :status (CandidApiClient::Tasks::Commons::Types::TaskStatus)

    • :assignee_user_id (String)

    • :blocks_claim_submission (Boolean)

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/candidhealth/tasks/v_3/client.rb', line 351

def update(task_id:, request:, request_options: nil)
  Async do
    response = @request_client.conn.patch do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/tasks/v3/#{task_id}"
    end
    CandidApiClient::Tasks::V3::Types::Task.from_json(json_object: response.body)
  end
end