Class: CandidApiClient::PayerPlanGroups::V1::AsyncV1Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/payer_plan_groups/v_1/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::PayerPlanGroups::V1::AsyncV1Client

Parameters:



186
187
188
# File 'lib/candidhealth/payer_plan_groups/v_1/client.rb', line 186

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



182
183
184
# File 'lib/candidhealth/payer_plan_groups/v_1/client.rb', line 182

def request_client
  @request_client
end

Instance Method Details

#create(request:, request_options: nil) ⇒ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup

Create a payer plan group

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.payer_plan_groups.v_1.create(request: { plan_group_name: "plan_group_name", payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", plan_type: SELF_PAY })

Parameters:

  • request (Hash)

    Request of type CandidApiClient::PayerPlanGroups::V1::Types::MutablePayerPlanGroup, as a Hash

    • :plan_group_name (String)

    • :payer_uuid (String)

    • :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)

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

Returns:



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/candidhealth/payer_plan_groups/v_1/client.rb', line 281

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/payer-plan-groups/v1"
    end
    CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
  end
end

#deactivate(payer_plan_group_id:, request_options: nil) ⇒ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup

Marks the payer plan group as deactivated

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.payer_plan_groups.v_1.deactivate(payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/candidhealth/payer_plan_groups/v_1/client.rb', line 337

def deactivate(payer_plan_group_id:, 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.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/payer-plan-groups/v1/#{payer_plan_group_id}"
    end
    CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
  end
end

#get(payer_plan_group_id:, request_options: nil) ⇒ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup

Return a plan group with a given ID.

Examples:

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

Parameters:

Returns:



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/candidhealth/payer_plan_groups/v_1/client.rb', line 253

def get(payer_plan_group_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/payer-plan-groups/v1/#{payer_plan_group_id}"
    end
    CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
  end
end

#get_multi(plan_group_name: nil, payer_uuid: nil, payer_id: nil, plan_type: nil, is_active: nil, payer_plan_group_id: nil, limit: nil, sort_by_similarity: nil, sort: nil, sort_direction: nil, page_token: nil, request_options: nil) ⇒ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupPage

Returns all payer plan groups matching filter criteria.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.payer_plan_groups.v_1.get_multi

Parameters:

  • plan_group_name (String) (defaults to: nil)
  • payer_uuid (String) (defaults to: nil)
  • payer_id (String) (defaults to: nil)
  • plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode) (defaults to: nil)
  • is_active (Boolean) (defaults to: nil)
  • payer_plan_group_id (String) (defaults to: nil)
  • limit (Integer) (defaults to: nil)

    Defaults to 100. Cannot exc

  • sort_by_similarity (String) (defaults to: nil)

    If this property is passed, the results will be ordered by those that contain a payer_id, payer_name, plan_group_name, or payer_address most similar to the value passed. This will take precedence over the sort and sort_direction properties. This will always sort in order of most similar to least similar.

  • sort (CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupSortField) (defaults to: nil)

    Defaults to plan_group_name. If sort_by_similarity is passed, that sort will takes precedence over this property.

  • sort_direction (CandidApiClient::Commons::Types::SortDirection) (defaults to: nil)

    Sort direction. Defaults to ascending order if not provided.

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

Returns:



213
214
215
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/payer_plan_groups/v_1/client.rb', line 213

def get_multi(plan_group_name: nil, payer_uuid: nil, payer_id: nil, plan_type: nil, is_active: nil,
              payer_plan_group_id: nil, limit: nil, sort_by_similarity: nil, sort: nil, sort_direction: nil, page_token: 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 || {}),
        "plan_group_name": plan_group_name,
        "payer_uuid": payer_uuid,
        "payer_id": payer_id,
        "plan_type": plan_type,
        "is_active": is_active,
        "payer_plan_group_id": payer_plan_group_id,
        "limit": limit,
        "sort_by_similarity": sort_by_similarity,
        "sort": sort,
        "sort_direction": sort_direction,
        "page_token": page_token
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/payer-plan-groups/v1"
    end
    CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroupPage.from_json(json_object: response.body)
  end
end

#update(payer_plan_group_id:, request:, request_options: nil) ⇒ CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup

Update any of the fields on a payer plan group

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.payer_plan_groups.v_1.update(payer_plan_group_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { plan_group_name: "plan_group_name", payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", plan_type: SELF_PAY })

Parameters:

  • payer_plan_group_id (String)
  • request (Hash)

    Request of type CandidApiClient::PayerPlanGroups::V1::Types::MutablePayerPlanGroup, as a Hash

    • :plan_group_name (String)

    • :payer_uuid (String)

    • :plan_type (CandidApiClient::Commons::Types::SourceOfPaymentCode)

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

Returns:



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/candidhealth/payer_plan_groups/v_1/client.rb', line 311

def update(payer_plan_group_id:, request:, request_options: nil)
  Async do
    response = @request_client.conn.put 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/payer-plan-groups/v1/#{payer_plan_group_id}"
    end
    CandidApiClient::PayerPlanGroups::V1::Types::PayerPlanGroup.from_json(json_object: response.body)
  end
end