Module: AllscriptsApi::Documents::DocumentMethods

Included in:
Client
Defined in:
lib/allscripts_api/documents/document_methods.rb

Overview

A collection of named convenience methods that map to Allscripts magic actions related to documents. These methods are included in Client and can be accessed from instances of that class.

Instance Method Summary collapse

Instance Method Details

#save_document_image(patient_id, document_params, document_buffer = nil, base_64_data = nil) ⇒ Hash, MagicError

rubocop:disable LineLength a wrapper around SaveDocumentImage, which saves pdfs to Allscripts

rubocop:Enable LineLength

Parameters:

  • patient_id (String)

    patient id

  • document_params (String)
  • document_buffer (String) (defaults to: nil)

    a byte array of document data for the current chunk.

  • base_64_data (String) (defaults to: nil)

    Alternative to using the Data parameter. If Data parameter is empty/null, Unity will check for presence of content in Base64Data. Note: In the Parameter1 XML, bytesRead is still the number of document bytes and not the base-64 string length.

Returns:



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/allscripts_api/documents/document_methods.rb', line 19

def save_document_image(patient_id, document_params,
                        document_buffer = nil, base_64_data = nil)
  params =
    MagicParams.format(
      user_id: @allscripts_username,
      patient_id: patient_id,
      parameter1: document_params,
      parameter6: base_64_data,
      data: document_buffer
    )
  results = magic("SaveDocumentImage", magic_params: params)
  results["savedocumentimageinfo"]
end