Class: CandidApiClient::PreEncounter::Lists::V1::V1Client

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

Parameters:



19
20
21
# File 'lib/candidhealth/pre_encounter/lists/v_1/client.rb', line 19

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::RequestClient (readonly)



15
16
17
# File 'lib/candidhealth/pre_encounter/lists/v_1/client.rb', line 15

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:



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/candidhealth/pre_encounter/lists/v_1/client.rb', line 84

def get_appointment_list(sort_field: nil, sort_direction: nil, limit: nil, page_token: nil, filters: nil,
                         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.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

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



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/candidhealth/pre_encounter/lists/v_1/client.rb', line 42

def get_patient_list(page_token: nil, limit: nil, sort_field: nil, sort_direction: nil, filters: nil,
                     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.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