Class: CandidApiClient::PreEncounter::Lists::V1::AsyncV1Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::PreEncounter::Lists::V1::AsyncV1Client

Parameters:



115
116
117
# File 'lib/candidhealth/pre_encounter/lists/v_1/client.rb', line 115

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



111
112
113
# File 'lib/candidhealth/pre_encounter/lists/v_1/client.rb', line 111

def request_client
  @request_client
end

Instance Method Details

#get_appointment_list(sort_field: nil, sort_direction: nil, limit: nil, page_token: nil, filters: nil, request_options: nil) ⇒ CandidApiClient::PreEncounter::Lists::V1::Types::AppointmentListPage

Searches for appointments that match the query parameters.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.lists.v_1.get_appointment_list(
  sort_field: "string",
  sort_direction: ASC,
  limit: 1,
  page_token: "string",
  filters: "string"
)

Parameters:

Returns:



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/candidhealth/pre_encounter/lists/v_1/client.rb', line 182

def get_appointment_list(sort_field: nil, sort_direction: nil, limit: nil, page_token: nil, filters: nil,
                         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.params = {
        **(request_options&.additional_query_parameters || {}),
        "sort_field": sort_field,
        "sort_direction": sort_direction,
        "limit": limit,
        "page_token": page_token,
        "filters": filters
      }.compact
      req.url "#{@request_client.get_url(environment: PreEncounter,
                                         request_options: request_options)}/lists/v1/appointment"
    end
    CandidApiClient::PreEncounter::Lists::V1::Types::AppointmentListPage.from_json(json_object: response.body)
  end
end

#get_patient_list(page_token: nil, limit: nil, sort_field: nil, sort_direction: nil, filters: nil, request_options: nil) ⇒ CandidApiClient::PreEncounter::Lists::V1::Types::PatientListPage

Gets patients with dependent objects for patients that match the query

parameters.

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.pre_encounter.lists.v_1.get_patient_list(
  page_token: "string",
  limit: 1,
  sort_field: "string",
  sort_direction: ASC,
  filters: "string"
)

Parameters:

Returns:



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/candidhealth/pre_encounter/lists/v_1/client.rb', line 138

def get_patient_list(page_token: nil, limit: nil, sort_field: nil, sort_direction: nil, filters: nil,
                     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.params = {
        **(request_options&.additional_query_parameters || {}),
        "page_token": page_token,
        "limit": limit,
        "sort_field": sort_field,
        "sort_direction": sort_direction,
        "filters": filters
      }.compact
      req.url "#{@request_client.get_url(environment: PreEncounter,
                                         request_options: request_options)}/lists/v1/patient"
    end
    CandidApiClient::PreEncounter::Lists::V1::Types::PatientListPage.from_json(json_object: response.body)
  end
end