Class: CandidApiClient::ExpectedNetworkStatus::V1::AsyncV1Client
- Inherits:
-
Object
- Object
- CandidApiClient::ExpectedNetworkStatus::V1::AsyncV1Client
- Defined in:
- lib/candidhealth/expected_network_status/v_1/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#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.
- #initialize(request_client:) ⇒ CandidApiClient::ExpectedNetworkStatus::V1::AsyncV1Client constructor
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::ExpectedNetworkStatus::V1::AsyncV1Client
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_client ⇒ CandidApiClient::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.
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..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .token unless &.token.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.body = { **(&.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: )}/api/expected-network-status/v1" end CandidApiClient::ExpectedNetworkStatus::V1::Types::ExpectedNetworkStatusResponse.from_json(json_object: response.body) end end |