Class: CandidApiClient::ExpectedNetworkStatus::V1::V1Client
- Inherits:
-
Object
- Object
- CandidApiClient::ExpectedNetworkStatus::V1::V1Client
- 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::V1Client constructor
Constructor Details
#initialize(request_client:) ⇒ CandidApiClient::ExpectedNetworkStatus::V1::V1Client
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_client ⇒ CandidApiClient::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.
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..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 |