Class: Candid::PreEncounter::EligibilityChecks::V1::Client
- Inherits:
-
Object
- Object
- Candid::PreEncounter::EligibilityChecks::V1::Client
- Defined in:
- lib/candid/pre_encounter/eligibility_checks/v_1/client.rb
Instance Method Summary collapse
-
#batch(request_options: {}, **params) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse
Sends a batch of eligibility checks to payers through Stedi.
-
#create_recommendation(request_options: {}, **params) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation
Create an eligibiilty recommendation based on the request.
- #initialize(client:) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Client constructor
-
#payer_search(request_options: {}, **params) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Types::PayerSearchResponse
Searches for payers that match the query parameters.
-
#poll_batch(request_options: {}, **params) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage
Polls the status of a batch eligibility check.
-
#post(request_options: {}, **params) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck
Sends real-time eligibility checks to payers through Stedi.
-
#recommendation(request_options: {}, **params) ⇒ Array[Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation]
Gets recommendation for eligibility checks based on the request.
Constructor Details
#initialize(client:) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Client
9 10 11 |
# File 'lib/candid/pre_encounter/eligibility_checks/v_1/client.rb', line 9 def initialize(client:) @client = client end |
Instance Method Details
#batch(request_options: {}, **params) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse
Sends a batch of eligibility checks to payers through Stedi.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/candid/pre_encounter/eligibility_checks/v_1/client.rb', line 40 def batch(request_options: {}, **params) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "POST", path: "/eligibility-checks/v1/batch", body: params ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i if code.between?(200, 299) Candid::PreEncounter::EligibilityChecks::V1::Types::BatchEligibilityResponse.load(_response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end end |
#create_recommendation(request_options: {}, **params) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation
Create an eligibiilty recommendation based on the request.
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/candid/pre_encounter/eligibility_checks/v_1/client.rb', line 149 def create_recommendation(request_options: {}, **params) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "POST", path: "/eligibility-checks/v1/recommendation", body: Candid::PreEncounter::EligibilityChecks::V1::Types::PostEligibilityRecommendationRequest.new(params).to_h ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i if code.between?(200, 299) Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation.load(_response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end end |
#payer_search(request_options: {}, **params) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Types::PayerSearchResponse
Searches for payers that match the query parameters.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/candid/pre_encounter/eligibility_checks/v_1/client.rb', line 93 def payer_search(request_options: {}, **params) params = Candid::Internal::Types::Utils.symbolize_keys(params) _query_param_names = %i[page_size page_token query] _query = params.slice(*_query_param_names) params.except(*_query_param_names) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "GET", path: "/eligibility-checks/v1/payer/search", query: _query ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i if code.between?(200, 299) Candid::PreEncounter::EligibilityChecks::V1::Types::PayerSearchResponse.load(_response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end end |
#poll_batch(request_options: {}, **params) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage
Polls the status of a batch eligibility check.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/candid/pre_encounter/eligibility_checks/v_1/client.rb', line 64 def poll_batch(request_options: {}, **params) params = Candid::Internal::Types::Utils.symbolize_keys(params) _query_param_names = %i[page_token] _query = params.slice(*_query_param_names) params = params.except(*_query_param_names) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "GET", path: "/eligibility-checks/v1/batch/#{params[:batch_id]}", query: _query ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i if code.between?(200, 299) Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheckPage.load(_response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end end |
#post(request_options: {}, **params) ⇒ Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityCheck
Sends real-time eligibility checks to payers through Stedi.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/candid/pre_encounter/eligibility_checks/v_1/client.rb', line 16 def post(request_options: {}, **params) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "POST", path: "/eligibility-checks/v1", body: Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityRequest.new(params).to_h ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i if code.between?(200, 299) Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityResponse.load(_response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end end |
#recommendation(request_options: {}, **params) ⇒ Array[Candid::PreEncounter::EligibilityChecks::V1::Types::EligibilityRecommendation]
Gets recommendation for eligibility checks based on the request.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/candid/pre_encounter/eligibility_checks/v_1/client.rb', line 122 def recommendation(request_options: {}, **params) params = Candid::Internal::Types::Utils.symbolize_keys(params) _query_param_names = %i[filters] _query = params.slice(*_query_param_names) params.except(*_query_param_names) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "GET", path: "/eligibility-checks/v1/recommendation", query: _query ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i return if code.between?(200, 299) error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end |