Class: Candid::PatientAr::V1::Client
- Inherits:
-
Object
- Object
- Candid::PatientAr::V1::Client
- Defined in:
- lib/candid/patient_ar/v_1/client.rb
Instance Method Summary collapse
- #initialize(client:, base_url: nil, environment: nil) ⇒ void constructor
-
#itemize(request_options: {}, **params) ⇒ Candid::PatientAr::V1::Types::InvoiceItemizationResponse
Provides detailed itemization of invoice data for a specific claim.
-
#list_inventory(request_options: {}, **params) ⇒ Candid::PatientAr::V1::Types::ListInventoryPagedResponse
Retrieve a list of inventory records based on the provided filters.
Constructor Details
#initialize(client:, base_url: nil, environment: nil) ⇒ void
12 13 14 15 16 |
# File 'lib/candid/patient_ar/v_1/client.rb', line 12 def initialize(client:, base_url: nil, environment: nil) @client = client @base_url = base_url @environment = environment end |
Instance Method Details
#itemize(request_options: {}, **params) ⇒ Candid::PatientAr::V1::Types::InvoiceItemizationResponse
Provides detailed itemization of invoice data for a specific claim.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/candid/patient_ar/v_1/client.rb', line 77 def itemize(request_options: {}, **params) params = Candid::Internal::Types::Utils.normalize_keys(params) request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || @base_url || @environment&.dig(:candid_api), method: "GET", path: "/api/patient-ar/v1/invoice-itemization/#{params[:claim_id]}", request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Candid::PatientAr::V1::Types::InvoiceItemizationResponse.load(response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |
#list_inventory(request_options: {}, **params) ⇒ Candid::PatientAr::V1::Types::ListInventoryPagedResponse
Retrieve a list of inventory records based on the provided filters. Each inventory record provides the latest invoiceable status of the associated claim. The response is paginated, and the ‘page_token` can be used to retrieve subsequent pages. Initial requests should not include `page_token`.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/candid/patient_ar/v_1/client.rb', line 35 def list_inventory(request_options: {}, **params) params = Candid::Internal::Types::Utils.normalize_keys(params) query_param_names = %i[since limit page_token] query_params = {} query_params["since"] = params[:since] if params.key?(:since) query_params["limit"] = params[:limit] if params.key?(:limit) query_params["page_token"] = params[:page_token] if params.key?(:page_token) params.except(*query_param_names) request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || @base_url || @environment&.dig(:candid_api), method: "GET", path: "/api/patient-ar/v1/inventory", query: query_params, request_options: ) begin response = @client.send(request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = response.code.to_i if code.between?(200, 299) Candid::PatientAr::V1::Types::ListInventoryPagedResponse.load(response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(response.body, code: code) end end |