Module: AllscriptsApi::Patients::PatientMethods

Included in:
Client
Defined in:
lib/allscripts_api/patients/patient_methods.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#get_changed_patients(patient_id, since, clinical_data_only = "Y", verbose = "Y", quick_scan = "N") ⇒ String, AllscriptsApi::MagicError

Returns a list of Patient IDs whose information has been

modified since a timestamp

Parameters:

  • patient_id (String)

    patient id

  • since (DateTime)

    DateTime indicating how far back to query for changed patients.

  • clinical_data_only (String) (defaults to: "Y")

    Indicates whether to look at only changes in clinical data. Y or N

  • verbose (String) (defaults to: "Y")

    Do you want to see the specific areas that have changed

  • quick_scan (String) (defaults to: "N")

    Set to Y to enable new change patient scanning functionality.

Returns:



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/allscripts_api/patients/patient_methods.rb', line 49

def get_changed_patients(patient_id, since,
                         clinical_data_only = "Y",
                         verbose = "Y", quick_scan = "N")
  params =
    MagicParams.format(
      user_id: @allscripts_username,
      patient_id: patient_id,
      parameter1: since.strftime("%m/%d/%Y"),
      parameter2: clinical_data_only,
      parameter3: verbose,
      parameter4: quick_scan
    )

  results = magic("GetChangedPatients", magic_params: params)
  results["getchangedpatientsinfo"]
end

#get_clinical_summary(patient_id, section = nil, encounter_id = nil, verbose = nil) ⇒ String, AllscriptsApi::MagicError

gets data elements of a patient’s history

Parameters:

  • patient_id (String)

    patient id

  • section (String) (defaults to: nil)

    section if no section is specified than all sections wt data are returned list multiple sections by using a pipe-delimited list ex. “Vitals|Alerts”

  • encounter_id (String) (defaults to: nil)

    internal identifier for the encounter the EncounterID can be acquired with GetEncounterList

  • verbose (String) (defaults to: nil)

    XMLDetail 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

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/allscripts_api/patients/patient_methods.rb', line 22

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