Class: CandidApiClient::FeeSchedules::V3::AsyncV3Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Parameters:



356
357
358
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 356

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



352
353
354
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 352

def request_client
  @request_client
end

Instance Method Details

#delete_rate(rate_id:, version:, request_options: nil) ⇒ Void

Soft deletes a rate from the system. Only the most recent version of a rate can

be deleted.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.delete_rate(rate_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", version: 1)

Parameters:

Returns:

  • (Void)


602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 602

def delete_rate(rate_id:, version:, 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/fee-schedules/v3/#{rate_id}/#{version}"
    end
  end
end

#get_match(service_line_id:, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchResult

Gets the rate that matches a service line. No result means no rate exists

matching the service line's dimensions.

Examples:

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

Parameters:

Returns:



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 369

def get_match(service_line_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/fee-schedules/v3/service-line/#{service_line_id}/match"
    end
    CandidApiClient::FeeSchedules::V3::Types::MatchResult.from_json(json_object: response.body)
  end
end

#get_multi(page_token: nil, limit: nil, active_date: nil, payer_uuid: nil, organization_billing_provider_id: nil, states: nil, zip_codes: nil, license_types: nil, facility_type_codes: nil, network_types: nil, payer_plan_group_ids: nil, cpt_code: nil, modifiers: nil, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::RatesPage

Gets a list of dimensions with their rates. The rates returned will always be

the most recent versions of those rates.

Examples:

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

Parameters:

Returns:



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 433

def get_multi(page_token: nil, limit: nil, active_date: nil, payer_uuid: nil,
              organization_billing_provider_id: nil, states: nil, zip_codes: nil, license_types: nil, facility_type_codes: nil, network_types: nil, payer_plan_group_ids: nil, cpt_code: nil, modifiers: 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,
        "active_date": active_date,
        "payer_uuid": payer_uuid,
        "organization_billing_provider_id": organization_billing_provider_id,
        "states": states,
        "zip_codes": zip_codes,
        "license_types": license_types,
        "facility_type_codes": facility_type_codes,
        "network_types": network_types,
        "payer_plan_group_ids": payer_plan_group_ids,
        "cpt_code": cpt_code,
        "modifiers": modifiers
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/fee-schedules/v3"
    end
    CandidApiClient::FeeSchedules::V3::Types::RatesPage.from_json(json_object: response.body)
  end
end

#get_payer_thresholds(payer_uuids:, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::PayerThresholdsPage

Gets a list of payers and thresholds by their uuids

Examples:

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

Parameters:

Returns:



650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 650

def get_payer_thresholds(payer_uuids:, 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 || {}),
        "payer_uuids": payer_uuids
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/fee-schedules/v3/payer-threshold"
    end
    CandidApiClient::FeeSchedules::V3::Types::PayerThresholdsPage.from_json(json_object: response.body)
  end
end

#get_payer_thresholds_default(request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::PayerThreshold

Gets the default payer threshold

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.get_payer_thresholds_default

Parameters:

Returns:



625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 625

def get_payer_thresholds_default(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/fee-schedules/v3/payer-threshold/default"
    end
    CandidApiClient::FeeSchedules::V3::Types::PayerThreshold.from_json(json_object: response.body)
  end
end

#get_rate_history(rate_id:, request_options: nil) ⇒ Array<CandidApiClient::FeeSchedules::V3::Types::Rate>

Gets every version of a rate.

Examples:

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

Parameters:

Returns:



531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 531

def get_rate_history(rate_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/fee-schedules/v3/#{rate_id}/history"
    end
    parsed_json = JSON.parse(response.body)
    parsed_json&.map do |item|
      item = item.to_json
      CandidApiClient::FeeSchedules::V3::Types::Rate.from_json(json_object: item)
    end
  end
end

#get_unique_values_for_dimension(pivot_dimension:, page_token: nil, limit: nil, payer_uuid: nil, organization_billing_provider_id: nil, states: nil, zip_codes: nil, license_types: nil, facility_type_codes: nil, network_types: nil, payer_plan_group_ids: nil, cpt_code: nil, modifiers: nil, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::DimensionsPage

Gets unique values for a dimension based on other selection criteria. The

response is a list of dimensions with your criteria and the unique values
populated. This API is useful for driving pivots on dimension values.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.get_unique_values_for_dimension(pivot_dimension: PAYER_UUID)

Parameters:

Returns:



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 489

def get_unique_values_for_dimension(pivot_dimension:, page_token: nil, limit: nil, payer_uuid: nil,
                                    organization_billing_provider_id: nil, states: nil, zip_codes: nil, license_types: nil, facility_type_codes: nil, network_types: nil, payer_plan_group_ids: nil, cpt_code: nil, modifiers: 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,
        "pivot_dimension": pivot_dimension,
        "payer_uuid": payer_uuid,
        "organization_billing_provider_id": organization_billing_provider_id,
        "states": states,
        "zip_codes": zip_codes,
        "license_types": license_types,
        "facility_type_codes": facility_type_codes,
        "network_types": network_types,
        "payer_plan_group_ids": payer_plan_group_ids,
        "cpt_code": cpt_code,
        "modifiers": modifiers
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/fee-schedules/v3/unique-dimension-values"
    end
    CandidApiClient::FeeSchedules::V3::Types::DimensionsPage.from_json(json_object: response.body)
  end
end

#set_payer_threshold(payer_uuid:, request:, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::PayerThreshold

Sets the threshold information for a payer

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.set_payer_threshold(payer_uuid: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", request: { disable_paid_incorrectly: true })

Parameters:

  • payer_uuid (String)
  • request (Hash)

    Request of type CandidApiClient::FeeSchedules::V3::Types::PayerThreshold, as a Hash

    • :upper_threshold_cents (Integer)

    • :lower_threshold_cents (Integer)

    • :disable_paid_incorrectly (Boolean)

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

Returns:



683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 683

def set_payer_threshold(payer_uuid:, 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/fee-schedules/v3/payer-threshold/#{payer_uuid}"
    end
    CandidApiClient::FeeSchedules::V3::Types::PayerThreshold.from_json(json_object: response.body)
  end
end

#test_match(service_line_id:, rate_id:, request_options: nil) ⇒ CandidApiClient::FeeSchedules::V3::Types::MatchTestResult

Tests a service line against a rate to see if it matches.

Examples:

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

Parameters:

Returns:



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 395

def test_match(service_line_id:, rate_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/fee-schedules/v3/service-line/#{service_line_id}/match/#{rate_id}"
    end
    CandidApiClient::FeeSchedules::V3::Types::MatchTestResult.from_json(json_object: response.body)
  end
end

#upload_fee_schedule(dry_run:, rates:, request_options: nil) ⇒ Array<CandidApiClient::FeeSchedules::V3::Types::Rate>

Uploads a new fee schedule.n Each rate may either be totally new as qualified

by it's dimensions or a new version for an existing rate.\n If adding a new
version to an existing rate, the rate must be posted with the next version
number (previous version + 1) or a EntityConflictError will be returned.\n Use
the dry run flag to discover already existing rates and to run validations.  If
validations for any rate fail, no rates will be saved to the system.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.fee_schedules.v_3.upload_fee_schedule(dry_run: true, rates: )

Parameters:

  • dry_run (Boolean)
  • rates (Array<Hash>)

    Request of type Array<CandidApiClient::FeeSchedules::V3::Types::RateUpload>, as a Hash

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

Returns:



566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
# File 'lib/candidhealth/fee_schedules/v_3/client.rb', line 566

def upload_fee_schedule(dry_run:, rates:, 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 || {}),
        dry_run: dry_run,
        rates: rates
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/fee-schedules/v3"
    end
    parsed_json = JSON.parse(response.body)
    parsed_json&.map do |item|
      item = item.to_json
      CandidApiClient::FeeSchedules::V3::Types::Rate.from_json(json_object: item)
    end
  end
end