Module: AllscriptsApi::NamedMagicMethods
- Included in:
- Client
- Defined in:
- lib/allscripts_api/named_magic_methods.rb
Overview
A collection of named convenience methods that map to Allscripts magic actions. These methods are included in ‘AllscriptsApi::Client` and can be accessed from instances of that class.
Instance Method Summary collapse
- #get_delegates ⇒ Object
-
#get_dictionary(dictionary_name) ⇒ Array<Hash>, ...
a wrapper around GetDictionary, which returnsentries from a specific dictionary.
-
#get_encounter_list(patient_id = "", encounter_type = "", when_or_limit = "", nostradamus = 0, show_past_flag = "Y", billing_provider_user_name = "") ⇒ Array<Hash>, ...
a wrapper around GetEncounterList.
-
#get_list_of_dictionaries ⇒ Array<Hash>, ...
a wrapper around GetListOfDictionaries, which returns list of all dictionaries.
- #get_patient_pharmacies(patient_id = "", show_patient_favorites_only = "Y") ⇒ Object
-
#get_patient_problems(patient_id, show_by_encounter = "N", assessed = nil, encounter_id = nil, filter_on_id = nil, display_in_progress = nil) ⇒ Array<Hash>, ...
a wrapper around GetPatientProblems.
-
#get_provider(provider_id = nil, user_name = nil) ⇒ Array<Hash>, ...
a wrapper around GetProvider.
-
#get_providers(security_filter = nil, name_filter = nil, show_only_providers_flag = "Y", internal_external = "I", ordering_authority = nil, real_provider = "N") ⇒ Array<Hash>, ...
a wrapper around GetProviders.
-
#get_results(patient_id, since = nil) ⇒ Array<Hash>, ...
a wrapper around GetResults.
-
#get_schedule(start_date, end_date, other_username = nil) ⇒ Array<Hash>, ...
a wrapper around GetSchedule, returns appointments scheduled under the the user for a given date range.
-
#get_server_info ⇒ Array<Hash>, ...
a wrapper around GetServerInfo, which returns the time zone of the server, unity version and date and license key.
- #last_logs(errors_only = "N", show_wand = "N", how_many = 10, start_time = "", end_time = "") ⇒ Object
-
#save_task(task_type, target_user, work_object_id = 0, comments = "", subject = "Other") ⇒ Object
ViewNote client.get_dictionary(“IDX_TASK_ACTION_DE”) “ViewNote” target_user “jmedici”.
- #search_delegates(username) ⇒ Object
Instance Method Details
#get_delegates ⇒ Object
203 204 205 206 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 203 def get_delegates results = magic("GetDelegates") results["getdelegatesinfo"] end |
#get_dictionary(dictionary_name) ⇒ Array<Hash>, ...
a wrapper around GetDictionary, which returnsentries from a specific dictionary.
a “TableName” value from ‘get_list_of_dictionaries` an empty array, or an error
161 162 163 164 165 166 167 168 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 161 def get_dictionary(dictionary_name) params = MagicParams.format( user_id: @allscripts_username, parameter1: dictionary_name ) results = magic("GetDictionary", magic_params: params) results["getdictionaryinfo"] end |
#get_encounter_list(patient_id = "", encounter_type = "", when_or_limit = "", nostradamus = 0, show_past_flag = "Y", billing_provider_user_name = "") ⇒ Array<Hash>, ...
a wrapper around GetEncounterList
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 125 def get_encounter_list(patient_id = "", encounter_type = "", when_or_limit = "", nostradamus = 0, show_past_flag = "Y", billing_provider_user_name = "") params = MagicParams.format( user_id: @allscripts_username, patient_id: patient_id, parameter1: encounter_type, # from Encounter_Type_DE parameter2: when_or_limit, parameter3: nostradamus, parameter4: show_past_flag, parameter5: billing_provider_user_name, ) results = magic("GetEncounterList", magic_params: params) results["getencounterlistinfo"] end |
#get_list_of_dictionaries ⇒ Array<Hash>, ...
a wrapper around GetListOfDictionaries, which returns list of all dictionaries
an empty array, or an error
148 149 150 151 152 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 148 def get_list_of_dictionaries params = MagicParams.format(user_id: @allscripts_username) results = magic("GetListOfDictionaries", magic_params: params) results["getlistofdictionariesinfo"] end |
#get_patient_pharmacies(patient_id = "", show_patient_favorites_only = "Y") ⇒ Object
208 209 210 211 212 213 214 215 216 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 208 def get_patient_pharmacies(patient_id = "", show_patient_favorites_only = "Y") params = MagicParams.format( patient_id: patient_id, parameter1: show_patient_favorites_only ) results = magic("GetPatientPharmacies", magic_params: params) results["getpatientpharmaciesinfo"] end |
#get_patient_problems(patient_id, show_by_encounter = "N", assessed = nil, encounter_id = nil, filter_on_id = nil, display_in_progress = nil) ⇒ Array<Hash>, ...
a wrapper around GetPatientProblems
an empty array, or an error
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 62 def get_patient_problems(patient_id, show_by_encounter = "N", assessed = nil, encounter_id = nil, filter_on_id = nil, display_in_progress = nil) params = MagicParams.format( user_id: @allscripts_username, patient_id: patient_id, parameter1: show_by_encounter, parameter2: assessed, parameter3: encounter_id, parameter4: filter_on_id, parameter5: display_in_progress ) results = magic("GetPatientProblems", magic_params: params) results["getpatientproblemsinfo"] end |
#get_provider(provider_id = nil, user_name = nil) ⇒ Array<Hash>, ...
a wrapper around GetProvider
14 15 16 17 18 19 20 21 22 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 14 def get_provider(provider_id = nil, user_name = nil) params = MagicParams.format( parameter1: provider_id, parameter2: user_name ) results = magic("GetProvider", magic_params: params) results["getproviderinfo"] end |
#get_providers(security_filter = nil, name_filter = nil, show_only_providers_flag = "Y", internal_external = "I", ordering_authority = nil, real_provider = "N") ⇒ Array<Hash>, ...
a wrapper around GetProviders
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 33 def get_providers(security_filter = nil, name_filter = nil, show_only_providers_flag = "Y", internal_external = "I", = nil, real_provider = "N") params = MagicParams.format( parameter1: security_filter, parameter2: name_filter, parameter3: show_only_providers_flag, parameter4: internal_external, parameter5: , parameter6: real_provider ) results = magic("GetProviders", magic_params: params) results["getprovidersinfo"] end |
#get_results(patient_id, since = nil) ⇒ Array<Hash>, ...
a wrapper around GetResults
an empty array, or an error
88 89 90 91 92 93 94 95 96 97 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 88 def get_results(patient_id, since = nil) params = MagicParams.format( user_id: @allscripts_username, patient_id: patient_id, parameter1: since ) results = magic("GetResults", magic_params: params) results["getresultsinfo"] end |
#get_schedule(start_date, end_date, other_username = nil) ⇒ Array<Hash>, ...
a wrapper around GetSchedule, returns appointments scheduled under the the user for a given date range
105 106 107 108 109 110 111 112 113 114 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 105 def get_schedule(start_date, end_date, other_username = nil) params = MagicParams.format( user_id: @allscripts_username, parameter1: format_date_range(start_date, end_date), parameter4: other_username ) results = magic("GetSchedule", magic_params: params) results["getscheduleinfo"] end |
#get_server_info ⇒ Array<Hash>, ...
a wrapper around GetServerInfo, which returns the time zone of the server, unity version and date and license key
server hosting the Unity webservice.
176 177 178 179 180 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 176 def get_server_info params = MagicParams.format(user_id: @allscripts_username) results = magic("GetServerInfo", magic_params: params) results["getserverinfoinfo"][0] # infoinfo is an Allscript typo end |
#last_logs(errors_only = "N", show_wand = "N", how_many = 10, start_time = "", end_time = "") ⇒ Object
182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 182 def last_logs(errors_only = "N", show_wand = "N", how_many = 10, start_time = "", end_time = "") params = MagicParams.format( parameter1: errors_only, parameter2: show_wand, parameter3: how_many, parameter4: start_time, parameter5: end_time ) results = magic("LastLogs", magic_params: params) end |
#save_task(task_type, target_user, work_object_id = 0, comments = "", subject = "Other") ⇒ Object
ViewNote client.get_dictionary(“IDX_TASK_ACTION_DE”) “ViewNote” target_user “jmedici”
221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 221 def save_task(task_type, target_user, work_object_id = 0, comments = "", subject = "Other") params = MagicParams.format( user_id: @allscripts_username, parameter1: task_type, parameter2: target_user, parameter3: work_object_id, parameter4: comments, parameter5: subject ) results = magic("SaveTask", magic_params: params) results["savetaskinfo"] end |
#search_delegates(username) ⇒ Object
194 195 196 197 198 199 200 201 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 194 def search_delegates(username) params = MagicParams.format( parameter1: username, ) results = magic("SearchDelegates", magic_params: params) results["searchdelegatesinfo"] end |