Class: CandidApiClient::ExpectedNetworkStatus::V1::V1Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::ExpectedNetworkStatus::V1::V1Client

Parameters:



18
19
20
# File 'lib/candidhealth/expected_network_status/v_1/client.rb', line 18

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::RequestClient (readonly)



14
15
16
# File 'lib/candidhealth/expected_network_status/v_1/client.rb', line 14

def request_client
  @request_client
end

Instance Method Details

#compute(subscriber_payer_id:, subscriber_payer_name:, billing_provider_npi:, billing_provider_tin:, rendering_provider_npi:, contracted_state:, date_of_service:, external_patient_id: nil, subscriber_insurance_type: nil, subscriber_plan_name: nil, request_options: nil) ⇒ CandidApiClient::ExpectedNetworkStatus::V1::Types::ExpectedNetworkStatusResponse

Computes the expected network status given the provided information.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.expected_network_status.v_1.compute(
  external_patient_id: "string",
  subscriber_payer_id: "string",
  subscriber_payer_name: "string",
  subscriber_insurance_type: C_01,
  subscriber_plan_name: "string",
  billing_provider_npi: "string",
  billing_provider_tin: "string",
  rendering_provider_npi: "string",
  contracted_state: AA,
  date_of_service: "string"
)

Parameters:

  • external_patient_id (String) (defaults to: nil)
  • subscriber_payer_id (String)
  • subscriber_payer_name (String)
  • subscriber_insurance_type (CandidApiClient::Commons::Types::InsuranceTypeCode) (defaults to: nil)
  • subscriber_plan_name (String) (defaults to: nil)

    The descriptive name of the insurance plan selected by the subscriber, often indicating coverage specifics or tier.

  • billing_provider_npi (String)

    The National Provider Identifier (NPI) of the healthcare provider responsible for billing. A unique 10-digit identification number.

  • billing_provider_tin (String)

    Follow the 9-digit format of the Taxpayer Identification Number (TIN).

  • rendering_provider_npi (String)

    The National Provider Identifier (NPI) of the healthcare provider who delivered the services. A unique 10-digit identification number.

  • contracted_state (CandidApiClient::Commons::Types::State)

    The state in which the healthcare provider has a contractual agreement with the insurance payer.

  • date_of_service (String)

    Date formatted as YYYY-MM-DD; eg: 2019-08-25.

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

Returns:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/candidhealth/expected_network_status/v_1/client.rb', line 54

def compute(subscriber_payer_id:, subscriber_payer_name:, billing_provider_npi:, billing_provider_tin:, rendering_provider_npi:, contracted_state:, date_of_service:, external_patient_id: nil,
            subscriber_insurance_type: nil, subscriber_plan_name: nil, 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_options&.additional_body_parameters || {}),
      external_patient_id: external_patient_id,
      subscriber_payer_id: subscriber_payer_id,
      subscriber_payer_name: subscriber_payer_name,
      subscriber_insurance_type: subscriber_insurance_type,
      subscriber_plan_name: subscriber_plan_name,
      billing_provider_npi: billing_provider_npi,
      billing_provider_tin: billing_provider_tin,
      rendering_provider_npi: rendering_provider_npi,
      contracted_state: contracted_state,
      date_of_service: date_of_service
    }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/expected-network-status/v1"
  end
  CandidApiClient::ExpectedNetworkStatus::V1::Types::ExpectedNetworkStatusResponse.from_json(json_object: response.body)
end