Class: CandidApiClient::Contracts::V2::AsyncV2Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/contracts/v_2/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::Contracts::V2::AsyncV2Client

Parameters:



241
242
243
# File 'lib/candidhealth/contracts/v_2/client.rb', line 241

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



237
238
239
# File 'lib/candidhealth/contracts/v_2/client.rb', line 237

def request_client
  @request_client
end

Instance Method Details

#create(effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:, medicaid_insurance_types:, contracting_provider_id:, rendering_provider_ids:, payer_uuid:, expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil, _field_set: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders

Creates a new contract within the user’s current organization

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.contracts.v_2.create(
  contracting_provider_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  rendering_provider_ids: Set["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"],
  payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"
)

Parameters:

  • effective_date (String)

    The starting day upon which the contract is effective

  • expiration_date (String) (defaults to: nil)

    An optional end day upon which the contract expires

  • regions (CandidApiClient::Commons::Types::Regions)

    The state(s) to which the contract’s coverage extends. It may also be set to “national” for the entirety of the US.

  • contract_status (CandidApiClient::Contracts::V2::Types::ContractStatus) (defaults to: nil)
  • authorized_signatory (Hash) (defaults to: nil)

    Request of type CandidApiClient::Contracts::V2::Types::AuthorizedSignatory, as a Hash

    • :first_name (String)

    • :last_name (String)

    • :title (String)

    • :email (String)

    • :phone (String)

    • :fax (String)

  • commercial_insurance_types (CandidApiClient::Contracts::V2::Types::InsuranceTypes)

    The commercial plan insurance types this contract applies.

  • medicare_insurance_types (CandidApiClient::Contracts::V2::Types::InsuranceTypes)

    The Medicare plan insurance types this contract applies.

  • medicaid_insurance_types (CandidApiClient::Contracts::V2::Types::InsuranceTypes)

    The Medicaid plan insurance types this contract applies.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition

  • _field_set (Object) (defaults to: nil)
  • contracting_provider_id (String)

    The UUID of the provider under agreement to the contract

  • rendering_provider_ids (Set<String>)

    A rendering provider isn’t contracted directly with the payer but can render services under the contract held by the contracting provider. Max items is 100.

  • payer_uuid (String)

    The UUID of the insurance company under agreement to the contract

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

Returns:



349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/candidhealth/contracts/v_2/client.rb', line 349

def create(effective_date:, regions:, commercial_insurance_types:, medicare_insurance_types:,
           medicaid_insurance_types:, contracting_provider_id:, rendering_provider_ids:, payer_uuid:, expiration_date: nil, contract_status: nil, authorized_signatory: nil, additional_properties: nil, _field_set: nil, 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_options&.additional_body_parameters || {}),
        effective_date: effective_date,
        expiration_date: expiration_date,
        regions: regions,
        contract_status: contract_status,
        authorized_signatory: authorized_signatory,
        commercial_insurance_types: commercial_insurance_types,
        medicare_insurance_types: medicare_insurance_types,
        medicaid_insurance_types: medicaid_insurance_types,
        additional_properties: additional_properties,
        _field_set: _field_set,
        contracting_provider_id: contracting_provider_id,
        rendering_provider_ids: rendering_provider_ids,
        payer_uuid: payer_uuid
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/contracts/v2"
    end
    CandidApiClient::Contracts::V2::Types::ContractWithProviders.from_json(json_object: response.body)
  end
end

#delete(contract_id:, request_options: nil) ⇒ Void

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.contracts.v_2.delete(contract_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:

  • (Void)


389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/candidhealth/contracts/v_2/client.rb', line 389

def delete(contract_id:, request_options: nil)
  Async do
    @request_client.conn.delete 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/contracts/v2/#{contract_id}"
    end
  end
end

#get(contract_id:, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders

Examples:

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

Parameters:

Returns:



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/candidhealth/contracts/v_2/client.rb', line 251

def get(contract_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/contracts/v2/#{contract_id}"
    end
    CandidApiClient::Contracts::V2::Types::ContractWithProviders.from_json(json_object: response.body)
  end
end

#get_multi(page_token: nil, limit: nil, contracting_provider_id: nil, rendering_provider_ids: nil, payer_names: nil, states: nil, contract_status: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractsPage

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.contracts.v_2.get_multi(
  page_token: "eyJ0b2tlbiI6IjEiLCJwYWdlX3Rva2VuIjoiMiJ9",
  limit: 1,
  contracting_provider_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  rendering_provider_ids: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  payer_names: "string",
  states: AA,
  contract_status: PENDING
)

Parameters:

  • page_token (String) (defaults to: nil)
  • limit (Integer) (defaults to: nil)

    Max number of contracts returned. Defaults to 1000. Max is 1000.

  • contracting_provider_id (String) (defaults to: nil)
  • rendering_provider_ids (String) (defaults to: nil)
  • payer_names (String) (defaults to: nil)

    Filter to contracts that include any of the included payer names.

  • states (CandidApiClient::Commons::Types::State) (defaults to: nil)
  • contract_status (CandidApiClient::Contracts::V2::Types::ContractStatus) (defaults to: nil)

    The status of the contract. Defaults to ‘pending`

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

Returns:



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/candidhealth/contracts/v_2/client.rb', line 288

def get_multi(page_token: nil, limit: nil, contracting_provider_id: nil, rendering_provider_ids: nil,
              payer_names: nil, states: nil, contract_status: 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 || {}),
        "page_token": page_token,
        "limit": limit,
        "contracting_provider_id": contracting_provider_id,
        "rendering_provider_ids": rendering_provider_ids,
        "payer_names": payer_names,
        "states": states,
        "contract_status": contract_status
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/contracts/v2"
    end
    CandidApiClient::Contracts::V2::Types::ContractsPage.from_json(json_object: response.body)
  end
end

#update(contract_id:, rendering_provider_ids: nil, effective_date: nil, expiration_date: nil, regions: nil, contract_status: nil, authorized_signatory: nil, commercial_insurance_types: nil, medicare_insurance_types: nil, medicaid_insurance_types: nil, request_options: nil) ⇒ CandidApiClient::Contracts::V2::Types::ContractWithProviders

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.contracts.v_2.update(
  contract_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  rendering_provider_ids: Set["d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"],
  effective_date: "string",
  contract_status: PENDING
)

Parameters:

Returns:



428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/candidhealth/contracts/v_2/client.rb', line 428

def update(contract_id:, rendering_provider_ids: nil, effective_date: nil, expiration_date: nil, regions: nil,
           contract_status: nil, authorized_signatory: nil, commercial_insurance_types: nil, medicare_insurance_types: nil, medicaid_insurance_types: nil, 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_options&.additional_body_parameters || {}),
        rendering_provider_ids: rendering_provider_ids,
        effective_date: effective_date,
        expiration_date: expiration_date,
        regions: regions,
        contract_status: contract_status,
        authorized_signatory: authorized_signatory,
        commercial_insurance_types: commercial_insurance_types,
        medicare_insurance_types: medicare_insurance_types,
        medicaid_insurance_types: medicaid_insurance_types
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/contracts/v2/#{contract_id}"
    end
    CandidApiClient::Contracts::V2::Types::ContractWithProviders.from_json(json_object: response.body)
  end
end