Class: CandidApiClient::BillingNotes::V2::V2Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/billing_notes/v_2/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::BillingNotes::V2::V2Client

Parameters:



17
18
19
# File 'lib/candidhealth/billing_notes/v_2/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/billing_notes/v_2/client.rb', line 13

def request_client
  @request_client
end

Instance Method Details

#create(text:, encounter_id:, additional_properties: nil, _field_set: nil, request_options: nil) ⇒ CandidApiClient::BillingNotes::V2::Types::BillingNote

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.billing_notes.v_2.create(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

  • text (String)

    Empty string not allowed.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition

  • _field_set (Object) (defaults to: nil)
  • encounter_id (String)
  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/candidhealth/billing_notes/v_2/client.rb', line 30

def create(text:, encounter_id:, additional_properties: nil, _field_set: nil, 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_options&.additional_body_parameters || {}),
      text: text,
      additional_properties: additional_properties,
      _field_set: _field_set,
      encounter_id: encounter_id
    }.compact
    req.url "#{@request_client.get_url(environment: CandidApi,
                                       request_options: request_options)}/api/billing_notes/v2"
  end
  CandidApiClient::BillingNotes::V2::Types::BillingNote.from_json(json_object: response.body)
end