Class: CandidApiClient::InsuranceAdjudications::V1::V1Client

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::V1Client

Parameters:



17
18
19
# File 'lib/candidhealth/insurance_adjudications/v_1/client.rb', line 17

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::RequestClient (readonly)



13
14
15
# File 'lib/candidhealth/insurance_adjudications/v_1/client.rb', line 13

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:



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/candidhealth/insurance_adjudications/v_1/client.rb', line 64

def create(request:, request_options: nil)
  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

#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)


89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/candidhealth/insurance_adjudications/v_1/client.rb', line 89

def delete(insurance_adjudication_id:, request_options: nil)
  @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

#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:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/candidhealth/insurance_adjudications/v_1/client.rb', line 30

def get(insurance_adjudication_id:, request_options: nil)
  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