Class: AllscriptsUnityClient::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/allscripts_unity_client/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_driver) ⇒ Client

Returns a new instance of Client.

Raises:

  • (ArgumentError)


7
8
9
10
11
# File 'lib/allscripts_unity_client/client.rb', line 7

def initialize(client_driver)
  raise ArgumentError, "client_driver can not be nil" if client_driver.nil?

  @client_driver = client_driver
end

Instance Attribute Details

#client_driverObject

Returns the value of attribute client_driver.



5
6
7
# File 'lib/allscripts_unity_client/client.rb', line 5

def client_driver
  @client_driver
end

Instance Method Details

#client_typeObject



29
30
31
# File 'lib/allscripts_unity_client/client.rb', line 29

def client_type
  return @client_driver.client_type
end

#commit_chargesObject

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/allscripts_unity_client/client.rb', line 33

def commit_charges
  raise NotImplementedError, "CommitCharges magic action not implemented"
end

#echo(echo_text) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/allscripts_unity_client/client.rb', line 37

def echo(echo_text)
  magic_parameters = {
    :action => "Echo",
    :userid => echo_text,
    :appname => echo_text,
    :patientid => echo_text,
    :parameter1 => echo_text,
    :parameter2 => echo_text,
    :parameter3 => echo_text,
    :parameter4 => echo_text,
    :parameter5 => echo_text,
    :parameter6 => echo_text
  }
  response = magic(magic_parameters)
  response[:userid]
end

#get_accountObject

Raises:

  • (NotImplementedError)


54
55
56
# File 'lib/allscripts_unity_client/client.rb', line 54

def 
  raise NotImplementedError, "GetAccount magic action not implemented"
end

#get_changed_patients(since = nil) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/allscripts_unity_client/client.rb', line 58

def get_changed_patients(since = nil)
  magic_parameters = {
    :action => "GetChangedPatients",
    :parameter1 => since
  }
  magic(magic_parameters)
end

#get_charge_info_by_usernameObject

Raises:

  • (NotImplementedError)


66
67
68
# File 'lib/allscripts_unity_client/client.rb', line 66

def get_charge_info_by_username
  raise NotImplementedError, "GetChargeInfoByUsername magic action not implemented"
end

#get_chargesObject

Raises:

  • (NotImplementedError)


70
71
72
# File 'lib/allscripts_unity_client/client.rb', line 70

def get_charges
  raise NotImplementedError, "GetCharges magic action not implemented"
end

#get_chart_item_details(userid, patientid, section) ⇒ Object



74
75
76
77
78
79
80
81
82
# File 'lib/allscripts_unity_client/client.rb', line 74

def get_chart_item_details(userid, patientid, section)
  magic_parameters = {
    :action => "GetChartItemDetails",
    :userid => userid,
    :patientid => patientid,
    :parameter1 => section
  }
  magic(magic_parameters)
end

#get_clinical_summary(userid, patientid) ⇒ Object



84
85
86
87
88
89
90
91
# File 'lib/allscripts_unity_client/client.rb', line 84

def get_clinical_summary(userid, patientid)
  magic_parameters = {
    :action => "GetClinicalSummary",
    :userid => userid,
    :patientid => patientid
  }
  magic(magic_parameters)
end

#get_delegatesObject

Raises:

  • (NotImplementedError)


93
94
95
# File 'lib/allscripts_unity_client/client.rb', line 93

def get_delegates
  raise NotImplementedError, "GetDelegates magic action not implemented"
end

#get_dictionary(dictionary_name, userid = nil, site = nil) ⇒ Object



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/allscripts_unity_client/client.rb', line 97

def get_dictionary(dictionary_name, userid = nil, site = nil)
  magic_parameters = {
    :action => "GetDictionary",
    :userid => userid,
    :parameter1 => dictionary_name,
    :parameter2 => site
  }
  response = magic(magic_parameters)

  unless response.is_a?(Array)
    response = [ response ]
  end

  response
end

#get_dictionary_setsObject

Raises:

  • (NotImplementedError)


113
114
115
# File 'lib/allscripts_unity_client/client.rb', line 113

def get_dictionary_sets
  raise NotImplementedError, "GetDictionarySets magic action not implemented"
end

#get_doc_templateObject

Raises:

  • (NotImplementedError)


117
118
119
# File 'lib/allscripts_unity_client/client.rb', line 117

def get_doc_template
  raise NotImplementedError, "GetDocTemplate magic action not implemented"
end

#get_document_by_accessionObject

Raises:

  • (NotImplementedError)


121
122
123
# File 'lib/allscripts_unity_client/client.rb', line 121

def get_document_by_accession
  raise NotImplementedError, "GetDocumentByAccession magic action not implemented"
end

#get_document_imageObject

Raises:

  • (NotImplementedError)


125
126
127
# File 'lib/allscripts_unity_client/client.rb', line 125

def get_document_image
  raise NotImplementedError, "GetDocumentImage magic action not implemented"
end

#get_document_typeObject

Raises:

  • (NotImplementedError)


133
134
135
# File 'lib/allscripts_unity_client/client.rb', line 133

def get_document_type
  raise NotImplementedError, "GetDocumentType magic action not implemented"
end

#get_documentsObject

Raises:

  • (NotImplementedError)


129
130
131
# File 'lib/allscripts_unity_client/client.rb', line 129

def get_documents
  raise NotImplementedError, "GetDocuments magic action not implemented"
end

#get_durObject

Raises:

  • (NotImplementedError)


137
138
139
# File 'lib/allscripts_unity_client/client.rb', line 137

def get_dur
  raise NotImplementedError, "GetDUR magic action not implemented"
end

#get_encounterObject

Raises:

  • (NotImplementedError)


141
142
143
# File 'lib/allscripts_unity_client/client.rb', line 141

def get_encounter
  raise NotImplementedError, "GetEncounter magic action not implemented"
end

#get_encounter_dateObject

Raises:

  • (NotImplementedError)


145
146
147
# File 'lib/allscripts_unity_client/client.rb', line 145

def get_encounter_date
  raise NotImplementedError, "GetEncounterDate magic action not implemented"
end

#get_encounter_list(userid, patientid, encounter_type, when_param = nil, nostradamus = nil, show_past_flag = nil, billing_provider_user_name = nil) ⇒ Object



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/allscripts_unity_client/client.rb', line 149

def get_encounter_list(userid, patientid, encounter_type, when_param = nil, nostradamus = nil, show_past_flag = nil, billing_provider_user_name = nil)
  magic_parameters = {
    :action => "GetEncounterList",
    :userid => userid,
    :patientid => patientid,
    :parameter1 => encounter_type,
    :parameter2 => when_param,
    :parameter3 => nostradamus,
    :parameter4 => show_past_flag,
    :parameter5 => billing_provider_user_name
  }
  response = magic(magic_parameters)

  unless response.is_a?(Array)
    response = [ response ]
  end

  # Remove nil encounters
  response.delete_if do |value|
    value[:id] == "0" && value[:patientid] == "0"
  end
end

#get_hie_documentObject

Raises:

  • (NotImplementedError)


172
173
174
# File 'lib/allscripts_unity_client/client.rb', line 172

def get_hie_document
  raise NotImplementedError, "GetHIEDocument magic action not implemented"
end

#get_last_patientObject

Raises:

  • (NotImplementedError)


176
177
178
# File 'lib/allscripts_unity_client/client.rb', line 176

def get_last_patient
  raise NotImplementedError, "GetLastPatient magic action not implemented"
end

#get_list_of_dictionariesObject

Raises:

  • (NotImplementedError)


180
181
182
# File 'lib/allscripts_unity_client/client.rb', line 180

def get_list_of_dictionaries
  raise NotImplementedError, "GetListOfDictionaries magic action not implemented"
end

#get_medication_by_trans_id(userid, patientid, transaction_id) ⇒ Object



184
185
186
187
188
189
190
191
192
# File 'lib/allscripts_unity_client/client.rb', line 184

def get_medication_by_trans_id(userid, patientid, transaction_id)
  magic_parameters = {
    :action => "GetMedicationByTransID",
    :userid => userid,
    :patientid => patientid,
    :parameter1 => transaction_id
  }
  magic(magic_parameters)
end

#get_medication_info(userid, ddid, patientid = nil) ⇒ Object



194
195
196
197
198
199
200
201
202
# File 'lib/allscripts_unity_client/client.rb', line 194

def get_medication_info(userid, ddid, patientid = nil)
  magic_parameters = {
    :action => "GetMedicationInfo",
    :userid => userid,
    :patientid => patientid,
    :parameter1 => ddid
  }
  magic(magic_parameters)
end

#get_order_historyObject

Raises:

  • (NotImplementedError)


204
205
206
# File 'lib/allscripts_unity_client/client.rb', line 204

def get_order_history
  raise NotImplementedError, "GetOrderHistory magic action not implemented"
end

#get_organization_idObject

Raises:

  • (NotImplementedError)


208
209
210
# File 'lib/allscripts_unity_client/client.rb', line 208

def get_organization_id
  raise NotImplementedError, "GetOrganizationID magic action not implemented"
end

#get_packagesObject

Raises:

  • (NotImplementedError)


212
213
214
# File 'lib/allscripts_unity_client/client.rb', line 212

def get_packages
  raise NotImplementedError, "GetPackages magic action not implemented"
end

#get_patient(userid, patientid, includepix = nil) ⇒ Object



216
217
218
219
220
221
222
223
224
# File 'lib/allscripts_unity_client/client.rb', line 216

def get_patient(userid, patientid, includepix = nil)
  magic_parameters = {
    :action => "GetPatient",
    :userid => userid,
    :patientid => patientid,
    :parameter1 => includepix
  }
  magic(magic_parameters)
end

#get_patient_activity(userid, patientid) ⇒ Object



226
227
228
229
230
231
232
233
# File 'lib/allscripts_unity_client/client.rb', line 226

def get_patient_activity(userid, patientid)
  magic_parameters = {
    :action => "GetPatientActivity",
    :userid => userid,
    :patientid => patientid
  }
  magic(magic_parameters)
end

#get_patient_by_mrnObject

Raises:

  • (NotImplementedError)


235
236
237
# File 'lib/allscripts_unity_client/client.rb', line 235

def get_patient_by_mrn
  raise NotImplementedError, "GetPatientByMRN magic action not implemented"
end

#get_patient_cdaObject

Raises:

  • (NotImplementedError)


239
240
241
# File 'lib/allscripts_unity_client/client.rb', line 239

def get_patient_cda
  raise NotImplementedError, "GetPatientCDA magic action not implemented"
end

#get_patient_diagnosisObject

Raises:

  • (NotImplementedError)


243
244
245
# File 'lib/allscripts_unity_client/client.rb', line 243

def get_patient_diagnosis
  raise NotImplementedError, "GetPatientDiagnosis magic action not implemented"
end

#get_patient_fullObject

Raises:

  • (NotImplementedError)


247
248
249
# File 'lib/allscripts_unity_client/client.rb', line 247

def get_patient_full
  raise NotImplementedError, "GetPatientFull magic action not implemented"
end

#get_patient_idsObject

Raises:

  • (NotImplementedError)


251
252
253
# File 'lib/allscripts_unity_client/client.rb', line 251

def get_patient_ids
  raise NotImplementedError, "GetPatientIDs magic action not implemented"
end

#get_patient_listObject

Raises:

  • (NotImplementedError)


255
256
257
# File 'lib/allscripts_unity_client/client.rb', line 255

def get_patient_list
  raise NotImplementedError, "GetPatientList magic action not implemented"
end

#get_patient_locationsObject

Raises:

  • (NotImplementedError)


259
260
261
# File 'lib/allscripts_unity_client/client.rb', line 259

def get_patient_locations
  raise NotImplementedError, "GetPatientLocations magic action not implemented"
end

#get_patient_pharmaciesObject

Raises:

  • (NotImplementedError)


263
264
265
# File 'lib/allscripts_unity_client/client.rb', line 263

def get_patient_pharmacies
  raise NotImplementedError, "GetPatientPharmacies magic action not implemented"
end

#get_patient_problems(patientid, show_by_encounter_flag = nil, assessed = nil, encounter_id = nil, medcin_id = nil) ⇒ Object



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/allscripts_unity_client/client.rb', line 267

def get_patient_problems(patientid, show_by_encounter_flag = nil, assessed = nil, encounter_id = nil, medcin_id = nil)
  magic_parameters = {
    :action => "GetPatientProblems",
    :patientid => patientid,
    :parameter1 => show_by_encounter_flag,
    :parameter2 => assessed,
    :parameter3 => encounter_id,
    :parameter4 => medcin_id
  }
  response = magic(magic_parameters)

  unless response.is_a?(Array)
    response = [ response ]
  end

  response
end

#get_patient_sectionsObject

Raises:

  • (NotImplementedError)


295
296
297
# File 'lib/allscripts_unity_client/client.rb', line 295

def get_patient_sections
  raise NotImplementedError, "GetPatientSections magic action not implemented"
end

#get_patients_by_icd9(icd9, start = nil, end_param = nil) ⇒ Object



285
286
287
288
289
290
291
292
293
# File 'lib/allscripts_unity_client/client.rb', line 285

def get_patients_by_icd9(icd9, start = nil, end_param = nil)
  magic_parameters = {
    :action => "GetPatientsByICD9",
    :parameter1 => icd9,
    :parameter2 => start,
    :parameter3 => end_param
  }
  magic(magic_parameters)
end

#get_proceduresObject

Raises:

  • (NotImplementedError)


299
300
301
# File 'lib/allscripts_unity_client/client.rb', line 299

def get_procedures
  raise NotImplementedError, "GetProcedures magic action not implemented"
end

#get_provider(provider_id = nil, user_name = nil) ⇒ Object



303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/allscripts_unity_client/client.rb', line 303

def get_provider(provider_id = nil, user_name = nil)
  if provider_id.nil? && user_name.nil?
    raise ArgumentError, "provider_id or user_name must be given"
  end

  magic_parameters = {
    :action => "GetProvider",
    :parameter1 => provider_id,
    :parameter2 => user_name
  }
  magic(magic_parameters)
end

#get_providers(security_filter = nil, name_filter = nil) ⇒ Object



316
317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/allscripts_unity_client/client.rb', line 316

def get_providers(security_filter = nil, name_filter = nil)
  magic_parameters = {
    :action => "GetProviders",
    :parameter1 => security_filter,
    :parameter2 => name_filter
  }
  response = magic(magic_parameters)

  unless response.is_a?(Array)
    response = [ response ]
  end

  response
end

#get_ref_providers_by_specialtyObject

Raises:

  • (NotImplementedError)


331
332
333
# File 'lib/allscripts_unity_client/client.rb', line 331

def get_ref_providers_by_specialty
  raise NotImplementedError, "GetRefProvidersBySpecialty magic action not implemented"
end

#get_rounding_list_entriesObject

Raises:

  • (NotImplementedError)


335
336
337
# File 'lib/allscripts_unity_client/client.rb', line 335

def get_rounding_list_entries
  raise NotImplementedError, "GetRoundingListEntries magic action not implemented"
end

#get_rounding_listsObject

Raises:

  • (NotImplementedError)


339
340
341
# File 'lib/allscripts_unity_client/client.rb', line 339

def get_rounding_lists
  raise NotImplementedError, "GetRoundingLists magic action not implemented"
end

#get_rx_favsObject

Raises:

  • (NotImplementedError)


343
344
345
# File 'lib/allscripts_unity_client/client.rb', line 343

def get_rx_favs
  raise NotImplementedError, "GetRXFavs magic action not implemented"
end

#get_scheduleObject

Raises:

  • (NotImplementedError)


347
348
349
# File 'lib/allscripts_unity_client/client.rb', line 347

def get_schedule
  raise NotImplementedError, "GetSchedule magic action not implemented"
end

#get_security_token!(parameters = {}) ⇒ Object



17
18
19
# File 'lib/allscripts_unity_client/client.rb', line 17

def get_security_token!(parameters = {})
  @client_driver.get_security_token!(parameters)
end

#get_server_infoObject



351
352
353
354
355
356
# File 'lib/allscripts_unity_client/client.rb', line 351

def get_server_info
  magic_parameters = {
    :action => "GetServerInfo"
  }
  magic(magic_parameters)
end

#get_sigsObject

Raises:

  • (NotImplementedError)


358
359
360
# File 'lib/allscripts_unity_client/client.rb', line 358

def get_sigs
  raise NotImplementedError, "GetSigs magic action not implemented"
end

#get_task(userid, transaction_id) ⇒ Object



362
363
364
365
366
367
368
369
# File 'lib/allscripts_unity_client/client.rb', line 362

def get_task(userid, transaction_id)
  magic_parameters = {
    :action => "GetTask",
    :userid => userid,
    :parameter1 => transaction_id
  }
  magic(magic_parameters)
end

#get_task_list(userid = nil, since = nil) ⇒ Object



371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/allscripts_unity_client/client.rb', line 371

def get_task_list(userid = nil, since = nil)
  magic_parameters = {
    :action => "GetTaskList",
    :userid => userid,
    :parameter1 => since
  }
  response = magic(magic_parameters)

  unless response.is_a?(Array)
    response = [ response ]
  end

  response
end

#get_user_authenticationObject

Raises:

  • (NotImplementedError)


386
387
388
# File 'lib/allscripts_unity_client/client.rb', line 386

def get_user_authentication
  raise NotImplementedError, "GetUserAuthentication magic action not implemented"
end

#get_user_idObject

Raises:

  • (NotImplementedError)


390
391
392
# File 'lib/allscripts_unity_client/client.rb', line 390

def get_user_id
  raise NotImplementedError, "GetUserID magic action not implemented"
end

#get_user_securityObject

Raises:

  • (NotImplementedError)


394
395
396
# File 'lib/allscripts_unity_client/client.rb', line 394

def get_user_security
  raise NotImplementedError, "GetUserSecurity magic action not implemented"
end

#get_vaccine_manufacturersObject

Raises:

  • (NotImplementedError)


398
399
400
# File 'lib/allscripts_unity_client/client.rb', line 398

def get_vaccine_manufacturers
  raise NotImplementedError, "GetVaccineManufacturers magic action not implemented"
end

#get_vitalsObject

Raises:

  • (NotImplementedError)


402
403
404
# File 'lib/allscripts_unity_client/client.rb', line 402

def get_vitals
  raise NotImplementedError, "GetVitals magic action not implemented"
end

#magic(parameters = {}) ⇒ Object



13
14
15
# File 'lib/allscripts_unity_client/client.rb', line 13

def magic(parameters = {})
  @client_driver.magic(parameters)
end

#make_taskObject

Raises:

  • (NotImplementedError)


406
407
408
# File 'lib/allscripts_unity_client/client.rb', line 406

def make_task
  raise NotImplementedError, "MakeTask magic action not implemented"
end

#retire_security_token!(parameters = {}) ⇒ Object



21
22
23
# File 'lib/allscripts_unity_client/client.rb', line 21

def retire_security_token!(parameters = {})
  @client_driver.retire_security_token!(parameters)
end

#save_admin_taskObject

Raises:

  • (NotImplementedError)


410
411
412
# File 'lib/allscripts_unity_client/client.rb', line 410

def save_admin_task
  raise NotImplementedError, "SaveAdminTask magic action not implemented"
end

#save_allergyObject

Raises:

  • (NotImplementedError)


414
415
416
# File 'lib/allscripts_unity_client/client.rb', line 414

def save_allergy
  raise NotImplementedError, "SaveAllergy magic action not implemented"
end

#save_cedObject

Raises:

  • (NotImplementedError)


418
419
420
# File 'lib/allscripts_unity_client/client.rb', line 418

def save_ced
  raise NotImplementedError, "SaveCED magic action not implemented"
end

#save_chargeObject

Raises:

  • (NotImplementedError)


422
423
424
# File 'lib/allscripts_unity_client/client.rb', line 422

def save_charge
  raise NotImplementedError, "SaveCharge magic action not implemented"
end

#save_chart_view_auditObject

Raises:

  • (NotImplementedError)


426
427
428
# File 'lib/allscripts_unity_client/client.rb', line 426

def save_chart_view_audit
  raise NotImplementedError, "SaveChartViewAudit magic action not implemented"
end

#save_diagnosisObject

Raises:

  • (NotImplementedError)


430
431
432
# File 'lib/allscripts_unity_client/client.rb', line 430

def save_diagnosis
  raise NotImplementedError, "SaveDiagnosis magic action not implemented"
end

#save_document_imageObject

Raises:

  • (NotImplementedError)


434
435
436
# File 'lib/allscripts_unity_client/client.rb', line 434

def save_document_image
  raise NotImplementedError, "SaveDocumentImage magic action not implemented"
end

#save_er_noteObject

Raises:

  • (NotImplementedError)


438
439
440
# File 'lib/allscripts_unity_client/client.rb', line 438

def save_er_note
  raise NotImplementedError, "SaveERNote magic action not implemented"
end

#save_hie_documentObject

Raises:

  • (NotImplementedError)


442
443
444
# File 'lib/allscripts_unity_client/client.rb', line 442

def save_hie_document
  raise NotImplementedError, "SaveHIEDocument magic action not implemented"
end

#save_historyObject

Raises:

  • (NotImplementedError)


446
447
448
# File 'lib/allscripts_unity_client/client.rb', line 446

def save_history
  raise NotImplementedError, "SaveHistory magic action not implemented"
end

#save_immunizationObject

Raises:

  • (NotImplementedError)


450
451
452
# File 'lib/allscripts_unity_client/client.rb', line 450

def save_immunization
  raise NotImplementedError, "SaveImmunization magic action not implemented"
end

#save_noteObject

Raises:

  • (NotImplementedError)


454
455
456
# File 'lib/allscripts_unity_client/client.rb', line 454

def save_note
  raise NotImplementedError, "SaveNote magic action not implemented"
end

#save_patientObject

Raises:

  • (NotImplementedError)


458
459
460
# File 'lib/allscripts_unity_client/client.rb', line 458

def save_patient
  raise NotImplementedError, "SavePatient magic action not implemented"
end

#save_patient_locationObject

Raises:

  • (NotImplementedError)


462
463
464
# File 'lib/allscripts_unity_client/client.rb', line 462

def save_patient_location
  raise NotImplementedError, "SavePatientLocation magic action not implemented"
end

#save_problemObject

Raises:

  • (NotImplementedError)


466
467
468
# File 'lib/allscripts_unity_client/client.rb', line 466

def save_problem
  raise NotImplementedError, "SaveProblem magic action not implemented"
end

#save_problems_dataObject

Raises:

  • (NotImplementedError)


470
471
472
# File 'lib/allscripts_unity_client/client.rb', line 470

def save_problems_data
  raise NotImplementedError, "SaveProblemsData magic action not implemented"
end

#save_ref_providerObject

Raises:

  • (NotImplementedError)


474
475
476
# File 'lib/allscripts_unity_client/client.rb', line 474

def save_ref_provider
  raise NotImplementedError, "SaveRefProvider magic action not implemented"
end

#save_resultObject

Raises:

  • (NotImplementedError)


478
479
480
# File 'lib/allscripts_unity_client/client.rb', line 478

def save_result
  raise NotImplementedError, "SaveResult magic action not implemented"
end

#save_rx(userid, patientid, rxxml) ⇒ Object



482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/allscripts_unity_client/client.rb', line 482

def save_rx(userid, patientid, rxxml)
  # Generate XML structure for rxxml
  builder = Nokogiri::XML::Builder.new do |xml|
    xml.saverx {
      xml.field("name" => "transid", "value" => rxxml[:transid]) unless rxxml[:transid].nil?
      xml.field("name" => "PharmID", "value" => rxxml[:pharmid]) unless rxxml[:pharmid].nil?
      xml.field("name" => "DDI", "value" => rxxml[:ddi]) unless rxxml[:ddi].nil?
      xml.field("name" => "GPPCCode", "value" => rxxml[:gppccode]) unless rxxml[:gppccode].nil?
      xml.field("name" => "GPPCText", "value" => rxxml[:gppctext]) unless rxxml[:gppctext].nil?
      xml.field("name" => "GPPCCustom", "value" => rxxml[:gppccustom]) unless rxxml[:gppccustom].nil?
      xml.field("name" => "Sig", "value" => rxxml[:sig]) unless rxxml[:sig].nil?
      xml.field("name" => "QuanPresc", "value" => rxxml[:quanpresc]) unless rxxml[:quanpresc].nil?
      xml.field("name" => "Refills", "value" => rxxml[:refills]) unless rxxml[:refills].nil?
      xml.field("name" => "DAW", "value" => rxxml[:daw]) unless rxxml[:daw].nil?
      xml.field("name" => "DaysSupply", "value" => rxxml[:dayssupply]) unless rxxml[:dayssupply].nil?
      xml.field("name" => "startdate", "value" => utc_to_local(Date.parse(rxxml[:startdate].to_s))) unless rxxml[:startdate].nil?
      xml.field("name" => "historicalflag", "value" => rxxml[:historicalflag]) unless rxxml[:historicalflag].nil?
      xml.field("name" => "rxaction", "value" => rxxml[:rxaction]) unless rxxml[:rxaction].nil?
      xml.field("name" => "delivery", "value" => rxxml[:delivery]) unless rxxml[:delivery].nil?
      xml.field("name" => "ignorepharmzero", "value" => rxxml[:ignorepharmzero]) unless rxxml[:ignorepharmzero].nil?
      xml.field("name" => "orderedbyid", "value" => rxxml[:orderedbyid]) unless rxxml[:orderedbyid].nil?
      xml.field("name" => "newqty", "value" => rxxml[:newqty]) unless rxxml[:newqty].nil?
      xml.field("name" => "newrefills", "value" => rxxml[:newrefills]) unless rxxml[:newrefills].nil?
    }
  end

  magic_parameters = {
    :action => "SaveRX",
    :userid => userid,
    :patientid => patientid,
    :parameter1 => nokogiri_to_string(builder)
  }
  magic(magic_parameters)
end

#save_simple_encounterObject

Raises:

  • (NotImplementedError)


517
518
519
# File 'lib/allscripts_unity_client/client.rb', line 517

def save_simple_encounter
  raise NotImplementedError, "SaveSimpleEncounter magic action not implemented"
end

#save_simple_rxObject

Raises:

  • (NotImplementedError)


521
522
523
# File 'lib/allscripts_unity_client/client.rb', line 521

def save_simple_rx
  raise NotImplementedError, "SaveSimpleRX magic action not implemented"
end

#save_specialistObject

Raises:

  • (NotImplementedError)


525
526
527
# File 'lib/allscripts_unity_client/client.rb', line 525

def save_specialist
  raise NotImplementedError, "SaveSpecialist magic action not implemented"
end

#save_task(userid, patientid, task_type = nil, target_user = nil, work_object_id = nil, comments = nil) ⇒ Object



529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
# File 'lib/allscripts_unity_client/client.rb', line 529

def save_task(userid, patientid, task_type = nil, target_user = nil, work_object_id = nil, comments = nil)
  if task_type.nil? && target_user.nil? && work_object_id.nil? && comments.nil?
    raise ArugmentError, "task_type, target_user, work_object_id, and comments can not all be nil"
  end

  magic_parameters = {
    :action => "SaveTask",
    :userid => userid,
    :patientid => patientid,
    :parameter1 => task_type,
    :parameter2 => target_user,
    :parameter3 => work_object_id,
    :parameter4 => comments
  }
  magic(magic_parameters)
end

#save_task_status(userid, transaction_id = nil, status = nil, delegate_id = nil, comment = nil, taskchanges = nil) ⇒ Object



546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
# File 'lib/allscripts_unity_client/client.rb', line 546

def save_task_status(userid, transaction_id = nil, status = nil, delegate_id = nil, comment = nil, taskchanges = nil)
  if transaction_id.nil? && param.nil? && delegate_id.nil? && comment.nil?
    raise ArugmentError, "task_type, target_user, work_object_id, and comments can not all be nil"
  end

  # Generate XML structure for rxxml
  builder = Nokogiri::XML::Builder.new do |xml|
    xml.taskchanges {
      xml.refills("value" => taskchanges[:refills]) unless taskchanges.nil? || taskchanges[:refills].nil?
      xml.days("value" => taskchanges[:days]) unless taskchanges.nil? || taskchanges[:days].nil?
      xml.qty("value" => taskchanges[:qty]) unless taskchanges.nil? || taskchanges[:qty].nil?
    }
  end

  magic_parameters = {
    :action => "SaveTaskStatus",
    :userid => userid,
    :parameter1 => transaction_id,
    :parameter2 => status,
    :parameter3 => delegate_id,
    :parameter4 => comment,
    :parameter6 => nokogiri_to_string(builder)
  }
  magic(magic_parameters)
end

#save_tiffObject

Raises:

  • (NotImplementedError)


572
573
574
# File 'lib/allscripts_unity_client/client.rb', line 572

def save_tiff
  raise NotImplementedError, "SaveTiff magic action not implemented"
end

#save_unstructured_documentObject

Raises:

  • (NotImplementedError)


576
577
578
# File 'lib/allscripts_unity_client/client.rb', line 576

def save_unstructured_document
  raise NotImplementedError, "SaveUnstructuredDocument magic action not implemented"
end

#save_v10_doc_signatureObject

Raises:

  • (NotImplementedError)


580
581
582
# File 'lib/allscripts_unity_client/client.rb', line 580

def save_v10_doc_signature
  raise NotImplementedError, "SaveV10DocSignature magic action not implemented"
end

#save_v11_noteObject

Raises:

  • (NotImplementedError)


584
585
586
# File 'lib/allscripts_unity_client/client.rb', line 584

def save_v11_note
  raise NotImplementedError, "SaveV11Note magic action not implemented"
end

#save_vitalsObject

Raises:

  • (NotImplementedError)


588
589
590
# File 'lib/allscripts_unity_client/client.rb', line 588

def save_vitals
  raise NotImplementedError, "SaveVitals magic action not implemented"
end

#save_vitals_dataObject

Raises:

  • (NotImplementedError)


592
593
594
# File 'lib/allscripts_unity_client/client.rb', line 592

def save_vitals_data
  raise NotImplementedError, "SaveVitalsData magic action not implemented"
end

#search_charge_codesObject

Raises:

  • (NotImplementedError)


596
597
598
# File 'lib/allscripts_unity_client/client.rb', line 596

def search_charge_codes
  raise NotImplementedError, "SearchChargeCodes magic action not implemented"
end

#search_diagnosis_codesObject

Raises:

  • (NotImplementedError)


600
601
602
# File 'lib/allscripts_unity_client/client.rb', line 600

def search_diagnosis_codes
  raise NotImplementedError, "SearchDiagnosisCodes magic action not implemented"
end

#search_meds(userid, patientid, search = nil) ⇒ Object



604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
# File 'lib/allscripts_unity_client/client.rb', line 604

def search_meds(userid, patientid, search = nil)
  magic_parameters = {
    :action => "SearchMeds",
    :userid => userid,
    :patientid => patientid,
    :parameter1 => search
  }

  response = magic(magic_parameters)

  unless response.is_a?(Array)
    response = [ response ]
  end

  response
end

#search_patients(search) ⇒ Object



621
622
623
624
625
626
627
# File 'lib/allscripts_unity_client/client.rb', line 621

def search_patients(search)
  magic_parameters = {
    :action => "SearchPatients",
    :parameter1 => search
  }
  magic(magic_parameters)
end

#search_patients_rxhub5Object

Raises:

  • (NotImplementedError)


629
630
631
# File 'lib/allscripts_unity_client/client.rb', line 629

def search_patients_rxhub5
  raise NotImplementedError, "SearchPatientsRXHub5 magic action not implemented"
end

#search_pharmacies(search) ⇒ Object



633
634
635
636
637
638
639
# File 'lib/allscripts_unity_client/client.rb', line 633

def search_pharmacies(search)
  magic_parameters = {
    :action => "SearchPharmacies",
    :parameter1 => search
  }
  magic(magic_parameters)
end

#search_problem_codesObject

Raises:

  • (NotImplementedError)


641
642
643
# File 'lib/allscripts_unity_client/client.rb', line 641

def search_problem_codes
  raise NotImplementedError, "SearchProblemCodes magic action not implemented"
end

#security_token?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/allscripts_unity_client/client.rb', line 25

def security_token?
  @client_driver.security_token?
end

#update_encounterObject

Raises:

  • (NotImplementedError)


645
646
647
# File 'lib/allscripts_unity_client/client.rb', line 645

def update_encounter
  raise NotImplementedError, "UpdateEncounter magic action not implemented"
end

#update_orderObject

Raises:

  • (NotImplementedError)


649
650
651
# File 'lib/allscripts_unity_client/client.rb', line 649

def update_order
  raise NotImplementedError, "UpdateOrder magic action not implemented"
end

#update_referral_order_statusObject

Raises:

  • (NotImplementedError)


653
654
655
# File 'lib/allscripts_unity_client/client.rb', line 653

def update_referral_order_status
  raise NotImplementedError, "UpdateReferralOrderStatus magic action not implemented"
end