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_ccda(patient_id, encounter_id, org_id = nil, app_group = nil, referral_text = nil, site_id = nil, document_type = "CCDACCD") ⇒ String, AllscriptsApi::MagicError
gets the CCDA documents for the specified patient and encounter.
-
#get_clinical_summary(patient_id, section = nil, encounter_id = nil, verbose = nil) ⇒ String, AllscriptsApi::MagicError
gets data elements of a patient’s history.
-
#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(patient_id, patient_number = nil) ⇒ String, AllscriptsApi::MagicError
gets patient’s demographic info, insurance, guarantor, and PCP info.
-
#get_patient_full(patient_id, mrn = nil, order_id = nil) ⇒ String, AllscriptsApi::MagicError
gets patient’s demographic info, insurance, guarantor, and PCP info Note that this method is litely to return blank data sets for invalid IDs rather than raising an error.
-
#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_schedule(start_date, end_date) ⇒ Array<Hash>, ...
a wrapper around GetSchedule, returns appointments scheduled under the the user for a given date range.
-
#search_patients(search_string) ⇒ Array<Hash>, ...
a wrapper around SearchPatients.
Instance Method Details
#get_ccda(patient_id, encounter_id, org_id = nil, app_group = nil, referral_text = nil, site_id = nil, document_type = "CCDACCD") ⇒ String, AllscriptsApi::MagicError
gets the CCDA documents for the specified patient and encounter
uses the organization for the specified user CCDACCD (Default) - Returns the Continuity of Care Document. This is the default behavior if nothing is passed in. CCDASOC - Returns the Summary of Care Document CCDACS - Returns the Clinical Summary Document (Visit Summary).
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 55 def get_ccda(patient_id, encounter_id, org_id = nil, app_group = nil, referral_text = nil, site_id = nil, document_type = "CCDACCD") params = MagicParams.format( user_id: @allscripts_username, patient_id: patient_id, parameter1: encounter_id, parameter2: org_id, parameter3: app_group, parameter4: referral_text, parameter5: site_id, parameter6: document_type ) results = magic("GetCCDA", magic_params: params) results["getccdainfo"][0]["ccdaxml"] end |
#get_clinical_summary(patient_id, section = nil, encounter_id = nil, verbose = nil) ⇒ String, AllscriptsApi::MagicError
gets data elements of a patient’s history
if no section is specified than all sections wt data are returned list multiple sections by using a pipe-delimited list ex. “Vitals|Alerts” the EncounterID can be acquired with GetEncounterList verbose column will be Y or blank, when Y is provided there will be a piece of XML data that is specific to that element of the patient’s chart
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 89 def get_clinical_summary(patient_id, section = nil, encounter_id = nil, verbose = nil) params = MagicParams.format( user_id: @allscripts_username, patient_id: patient_id, parameter1: section, parameter2: encounter_id, parameter3: verbose ) results = magic("GetClinicalSummary", magic_params: params) results["getclinicalsummaryinfo"] 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
233 234 235 236 237 238 239 240 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 233 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
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 197 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
220 221 222 223 224 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 220 def get_list_of_dictionaries params = MagicParams.format(user_id: @allscripts_username) results = magic("GetListOfDictionaries", magic_params: params) results["getlistofdictionariesinfo"] end |
#get_patient(patient_id, patient_number = nil) ⇒ String, AllscriptsApi::MagicError
gets patient’s demographic info, insurance, guarantor, and PCP info
110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 110 def get_patient(patient_id, patient_number = nil) params = MagicParams.format( user_id: @allscripts_username, patient_id: patient_id, parameter1: patient_number ) results = magic("GetPatient", magic_params: params) results["getpatientinfo"] end |
#get_patient_full(patient_id, mrn = nil, order_id = nil) ⇒ String, AllscriptsApi::MagicError
gets patient’s demographic info, insurance, guarantor, and PCP info Note that this method is litely to return blank data sets for invalid IDs rather than raising an error
patient order
131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 131 def get_patient_full(patient_id, mrn = nil, order_id = nil) params = MagicParams.format( user_id: @allscripts_username, patient_id: patient_id, parameter1: mrn, parameter2: order_id ) results = magic("GetPatientFull", magic_params: params) results["getpatientfullinfo"] 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
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 153 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
30 31 32 33 34 35 36 37 38 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 30 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_schedule(start_date, end_date) ⇒ Array<Hash>, ...
a wrapper around GetSchedule, returns appointments scheduled under the the user for a given date range
178 179 180 181 182 183 184 185 186 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 178 def get_schedule(start_date, end_date) params = MagicParams.format( user_id: @allscripts_username, parameter1: format_date_range(start_date, end_date) ) results = magic("GetSchedule", magic_params: params) results["getscheduleinfo"] end |
#search_patients(search_string) ⇒ Array<Hash>, ...
a wrapper around SearchPatients
15 16 17 18 19 20 21 22 23 |
# File 'lib/allscripts_api/named_magic_methods.rb', line 15 def search_patients(search_string) params = MagicParams.format( user_id: @allscripts_username, parameter1: search_string ) results = magic("SearchPatients", magic_params: params) results["searchpatientsinfo"] end |