Module: AllscriptsApi::OrderingMethods

Included in:
Client
Defined in:
lib/allscripts_api/ordering_methods.rb

Overview

A collection convenience methods for ordering that map to Allscripts magic actions. Some of these methods wrap multiple actions. These methods are included in Client and can be accessed from instances of that class.

Instance Method Summary collapse

Instance Method Details

#save_order(patient_id, xml, order_category, dictionary_id, problem_id = nil, trans_id = nil) ⇒ Hash|MagicError

a wrapper around SaveOrder, which save and order of the sepcified category, among: AdministeredMedication, Immunization, InstructionOrder, ProcedureOrder, Referral, SuppliesOrder.

xml can be constructed with AllscriptsApi::Order.build_xml

Immunization, InstructionOrder, ProcedureOrder, Referral, SuppliesOrder. may be passed in as part of the xml necessary when updating a past order

Parameters:

  • patient_id (String)
  • xml (String)

    xml containing saveorderxml fields and values

  • order_category (String)

    one of AdministeredMedication,

  • dictionary_id (String)

    id of the dictionary from SearchOrder TODO: look into how to doc this better

  • problem_id (String|Nil) (defaults to: nil)

    problem to associate with the order,

  • trans_id (String|Nil) (defaults to: nil)

    the original OrderID,

Returns:

  • (Hash|MagicError)

    order confirmation or error



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/allscripts_api/ordering_methods.rb', line 28

def save_order(patient_id, xml, order_category, dictionary_id,
               problem_id = nil, trans_id = nil)
  params = MagicParams.format(
    user_id: @allscripts_username,
    patient_id: patient_id,
    parameter1: xml,
    parameter2: order_category,
    parameter3: dictionary_id,
    parameter4: problem_id,
    parameter5: trans_id
  )
  magic("SaveOrder", magic_params: params)
end