class CasemanagerClient::DefaultApi
Attributes
Public Class Methods
# File lib/casemanager_client/api/default_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Creates or updates case items @param v Version of the CaseManager API. Required to be `v=root_v1` @param source_type The type of item being updated or created @param source_identifier The ID or key of the item @param [Hash] opts the optional parameters @option opts [String] :case_key If this item is known to belong to a case, the case key can be provided @return [nil]
# File lib/casemanager_client/api/default_api.rb, line 29 def case_items_post(v, source_type, source_identifier, opts = {}) case_items_post_with_http_info(v, source_type, source_identifier, opts) nil end
Creates or updates case items @param v Version of the CaseManager API. Required to be `v=root_v1` @param source_type The type of item being updated or created @param source_identifier The ID or key of the item @param [Hash] opts the optional parameters @option opts [String] :case_key If this item is known to belong to a case, the case key can be provided @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/casemanager_client/api/default_api.rb, line 41 def case_items_post_with_http_info(v, source_type, source_identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.case_items_post ...' end # verify the required parameter 'v' is set if @api_client.config.client_side_validation && v.nil? fail ArgumentError, "Missing the required parameter 'v' when calling DefaultApi.case_items_post" end # verify the required parameter 'source_type' is set if @api_client.config.client_side_validation && source_type.nil? fail ArgumentError, "Missing the required parameter 'source_type' when calling DefaultApi.case_items_post" end # verify the required parameter 'source_identifier' is set if @api_client.config.client_side_validation && source_identifier.nil? fail ArgumentError, "Missing the required parameter 'source_identifier' when calling DefaultApi.case_items_post" end # resource path local_var_path = '/case_items' # query parameters query_params = {} query_params[:'v'] = v query_params[:'source_type'] = source_type query_params[:'source_identifier'] = source_identifier query_params[:'case_key'] = opts[:'case_key'] if !opts[:'case_key'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#case_items_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Apply an event to a case. @param v Version of the CaseManager API. Required to be `v=sudo_v1` @param user_id the CMM2 T_Users ID @param event_type The type of event to be applied to the case @param key The key of the case that the event applies to @param [Hash] opts the optional parameters @return [nil]
# File lib/casemanager_client/api/default_api.rb, line 95 def cases_key_events_post(v, user_id, event_type, key, opts = {}) cases_key_events_post_with_http_info(v, user_id, event_type, key, opts) nil end
Apply an event to a case. @param v Version of the CaseManager API. Required to be `v=sudo_v1` @param user_id the CMM2 T_Users ID @param event_type The type of event to be applied to the case @param key The key of the case that the event applies to @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/casemanager_client/api/default_api.rb, line 107 def cases_key_events_post_with_http_info(v, user_id, event_type, key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.cases_key_events_post ...' end # verify the required parameter 'v' is set if @api_client.config.client_side_validation && v.nil? fail ArgumentError, "Missing the required parameter 'v' when calling DefaultApi.cases_key_events_post" end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling DefaultApi.cases_key_events_post" end # verify the required parameter 'event_type' is set if @api_client.config.client_side_validation && event_type.nil? fail ArgumentError, "Missing the required parameter 'event_type' when calling DefaultApi.cases_key_events_post" end # verify enum value if @api_client.config.client_side_validation && !['cleared_for_therapy'].include?(event_type) fail ArgumentError, "invalid value for 'event_type', must be one of cleared_for_therapy" end # verify the required parameter 'key' is set if @api_client.config.client_side_validation && key.nil? fail ArgumentError, "Missing the required parameter 'key' when calling DefaultApi.cases_key_events_post" end # resource path local_var_path = '/cases/{key}/events'.sub('{' + 'key' + '}', key.to_s) # query parameters query_params = {} query_params[:'v'] = v query_params[:'user_id'] = user_id query_params[:'event_type'] = event_type # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#cases_key_events_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List all Patients
with Cases. Allows optional search parameters; search parameters are ANDed together. @param user_id the CMM2 T_Users ID @param v Version of the CaseManager API. Required to be `v=sudo_v1` @param [Hash] opts the optional parameters @option opts [String] :first_name Search by patient's first name (substring search) @option opts [String] :middle_name Search by patient's middle name (substring search) @option opts [String] :last_name Search by patient's last name (substring search) @option opts [String] :date_of_birth Search by patient's date of birth (exact match) @option opts [String] :zipcode Search by patient's zipcode (exact match) @return [Array<PatientWithCases>]
# File lib/casemanager_client/api/default_api.rb, line 171 def list_patients(user_id, v, opts = {}) data, _status_code, _headers = list_patients_with_http_info(user_id, v, opts) data end
List all Patients
with Cases. Allows optional search parameters; search parameters are ANDed together. @param user_id the CMM2 T_Users ID @param v Version of the CaseManager API. Required to be `v=sudo_v1` @param [Hash] opts the optional parameters @option opts [String] :first_name Search by patient's first name (substring search) @option opts [String] :middle_name Search by patient's middle name (substring search) @option opts [String] :last_name Search by patient's last name (substring search) @option opts [String] :date_of_birth Search by patient's date of birth (exact match) @option opts [String] :zipcode Search by patient's zipcode (exact match) @return [Array<(Array<PatientWithCases>, Fixnum, Hash)>] Array<PatientWithCases> data, response status code and response headers
# File lib/casemanager_client/api/default_api.rb, line 186 def list_patients_with_http_info(user_id, v, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.list_patients ...' end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling DefaultApi.list_patients" end # verify the required parameter 'v' is set if @api_client.config.client_side_validation && v.nil? fail ArgumentError, "Missing the required parameter 'v' when calling DefaultApi.list_patients" end # resource path local_var_path = '/patients' # query parameters query_params = {} query_params[:'user_id'] = user_id query_params[:'v'] = v query_params[:'first_name'] = opts[:'first_name'] if !opts[:'first_name'].nil? query_params[:'middle_name'] = opts[:'middle_name'] if !opts[:'middle_name'].nil? query_params[:'last_name'] = opts[:'last_name'] if !opts[:'last_name'].nil? query_params[:'date_of_birth'] = opts[:'date_of_birth'] if !opts[:'date_of_birth'].nil? query_params[:'zipcode'] = opts[:'zipcode'] if !opts[:'zipcode'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<PatientWithCases>') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#list_patients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get the details of a specific case @param key @param user_id the CMM2 T_Users ID @param v Version of the CaseManager API. Required to be `v=sudo_v1` @param [Hash] opts the optional parameters @return [CaseWithPatient]
# File lib/casemanager_client/api/default_api.rb, line 241 def show_case(key, user_id, v, opts = {}) data, _status_code, _headers = show_case_with_http_info(key, user_id, v, opts) data end
Get the details of a specific case @param key @param user_id the CMM2 T_Users ID @param v Version of the CaseManager API. Required to be `v=sudo_v1` @param [Hash] opts the optional parameters @return [Array<(CaseWithPatient
, Fixnum, Hash)>] CaseWithPatient
data, response status code and response headers
# File lib/casemanager_client/api/default_api.rb, line 252 def show_case_with_http_info(key, user_id, v, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.show_case ...' end # verify the required parameter 'key' is set if @api_client.config.client_side_validation && key.nil? fail ArgumentError, "Missing the required parameter 'key' when calling DefaultApi.show_case" end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling DefaultApi.show_case" end # verify the required parameter 'v' is set if @api_client.config.client_side_validation && v.nil? fail ArgumentError, "Missing the required parameter 'v' when calling DefaultApi.show_case" end # resource path local_var_path = '/cases/{key}'.sub('{' + 'key' + '}', key.to_s) # query parameters query_params = {} query_params[:'user_id'] = user_id query_params[:'v'] = v # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CaseWithPatient') if @api_client.config.debugging @api_client.config.logger.debug "API called: DefaultApi#show_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end