Class: CandidApiClient::InsuranceAdjudications::V1::AsyncV1Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/insurance_adjudications/v_1/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::InsuranceAdjudications::V1::AsyncV1Client

Parameters:



110
111
112
# File 'lib/candidhealth/insurance_adjudications/v_1/client.rb', line 110

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



106
107
108
# File 'lib/candidhealth/insurance_adjudications/v_1/client.rb', line 106

def request_client
  @request_client
end

Instance Method Details

#create(request:, request_options: nil) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication

Creates a new insurance adjudication record and returns the newly created

InsuranceAdjudication object.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.insurance_adjudications.v_1.create(request: { payee: { payee_name: "string" }, post_date: DateTime.parse(2023-01-15), check_number: "string", check_date: DateTime.parse(2023-01-15), note: "string", claims: { "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32": [{ claim_status_code: PROCESSED_AS_PRIMARY, service_lines: {  }, carcs:  }] }, remit_draft_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32" })

Parameters:

  • request (Hash)

    Request of type CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudicationCreate, as a Hash

    • :payer_identifier (Hash)

    • :payee (Hash)

      • :payee_name (String)

      • :payee_identifier (Hash)

    • :post_date (Date)

    • :check_number (String)

    • :check_date (Date)

    • :note (String)

    • :claims (Hash=> Array)

    • :remit_draft_id (String)

  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/candidhealth/insurance_adjudications/v_1/client.rb', line 159

def create(request:, 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 || {}), **(request_options&.additional_body_parameters || {}) }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/insurance-adjudications/v1"
    end
    CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication.from_json(json_object: response.body)
  end
end

#delete(insurance_adjudication_id:, request_options: nil) ⇒ Void

Deletes the insurance adjudication record matching the provided

insurance_adjudication_id.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.insurance_adjudications.v_1.delete(insurance_adjudication_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:

  • (Void)


186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/candidhealth/insurance_adjudications/v_1/client.rb', line 186

def delete(insurance_adjudication_id:, request_options: nil)
  Async do
    @request_client.conn.delete 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.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/insurance-adjudications/v1/#{insurance_adjudication_id}"
    end
  end
end

#get(insurance_adjudication_id:, request_options: nil) ⇒ CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication

Retrieves a previously created insurance adjudication by its

`insurance_adjudication_id`.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.insurance_adjudications.v_1.get(insurance_adjudication_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

Returns:



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/candidhealth/insurance_adjudications/v_1/client.rb', line 123

def get(insurance_adjudication_id:, request_options: nil)
  Async do
    response = @request_client.conn.get 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.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/insurance-adjudications/v1/#{insurance_adjudication_id}"
    end
    CandidApiClient::InsuranceAdjudications::V1::Types::InsuranceAdjudication.from_json(json_object: response.body)
  end
end