Class: CandidApiClient::Tasks::V3::V3Client

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::V3Client

Parameters:



24
25
26
# File 'lib/candidhealth/tasks/v_3/client.rb', line 24

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::RequestClient (readonly)



20
21
22
# File 'lib/candidhealth/tasks/v_3/client.rb', line 20

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:



146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/candidhealth/tasks/v_3/client.rb', line 146

def create(request:, request_options: nil)
  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

#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:



118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/candidhealth/tasks/v_3/client.rb', line 118

def get(task_id:, request_options: nil)
  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

#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:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/candidhealth/tasks/v_3/client.rb', line 34

def get_actions(task_id:, request_options: nil)
  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

#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:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/candidhealth/tasks/v_3/client.rb', line 81

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)
  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

#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:



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/candidhealth/tasks/v_3/client.rb', line 171

def update(task_id:, request:, request_options: nil)
  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