Class: CandidApiClient::ExpectedNetworkStatus::V1::AsyncV1Client

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

Parameters:



90
91
92
# File 'lib/candidhealth/expected_network_status/v_1/client.rb', line 90

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



86
87
88
# File 'lib/candidhealth/expected_network_status/v_1/client.rb', line 86

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:



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/candidhealth/expected_network_status/v_1/client.rb', line 126

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)
  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 || {}),
        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
end