Allscripts Analytics Searches

From Galen Healthcare Solutions - Allscripts TouchWorks EHR Wiki
Jump to navigation Jump to search


When running any reports - Worksheets, Analysis Crosstabs, etc - ensure that it's only pulling the data needed. When running a report to show all diabetics, check that it's only looking at active problems in the active problem view - if a patient's father had diabetes (problem in the Family History view), that may not be relevant to the search. Below is a list of common search criteria.

Analytics Terms

Fields will be defined in the way they are found in Analytics. The following field would be found by double clicking the highlighted folders or items in the MetaLayer tree.

  • Patient.Identification.patient-fullname


In a search, if there is a value defined for a field, it will appear as follows:

  • Problem.problem-problemstatusname = Active

In the Edit search window, the above field would appear as follows:

Problem.problem-problemstatusname search.png

Please note that some of the field values may differ depending on how they are entered; use the Distinct Values function if it is available.


There are two common approaches with patients - include patients only if they have had a recent appointment (e.g. last 2 years), or include all patients that have not been deactivated or merged.

Active Patients

This will return all patients who are alive, active, and are not test or fake. Keep in mind that there may be other test patient names to add to this list. Also beware of using wildcards as some legitimate patients may have part of a test name in their name. For example, Tester, John would be excluded from a search using (NOT LIKE test%).

  • Patient.Flags.patient-isdeceasedflag = N
  • Patient.Flags.patientisinactiveflag = N
  • Patient.Identification.patient-lastname <> Test (always check these patients before removing them all)
  • Patient.Identification.patient-lastname <> (put in one space to remove blank names)
  • Patient.Identification.patient-lastname <> Allscripts
  • Patient.Identification.patient-lastname NOT LIKE ZZ%
  • Patient.Identification.patient-fullname <> [Insert Disney character name here]
    • The last name filtering is client-dependent -- whatever is used for test patients, patients that have been "fired", etc.

Security settings for this search should be set to View, Modify, and Save. This allows all users to add names to this search when they come across test patients in reports. All users should be encouraged to use a single Active Patients search as to fully utilize any modifications made by others. For any reports looking at patient data, this search should be stacked as the first step.

When editing the lastname field, make sure AND is used between line functions to remove all listed names. AliveActive.lastname.png

Patients with Recent Appointments

Active Patients - w/recent appointments

This will return all patients who are alive, active, and are not test or fake and have had and completed an appointment in the past two years.

  • Stacked search:
    • Active Patients (existing - see above)
  • Nested search:
    • Recent Appointments (new)
      • Patient.Encounters.patientencounters-isappointmentencounterflag = Y
      • Patient.Encounters.patientencounters-encounterdttm > dateadd(yy, -2, getdate()) (Use the Search Expression and enter in the bold text)
      • Patient.Encounters.patientencounters-appointmentstatusname = Arrived


This will return problems that are relevant to this patient. Note that as Problem Category is not set to Active, this will return data from other fields as seen below. Family history and past problems may show up unless both Problem Status Name and Problem Category are set to Active.

  • Problem.problem-problemstatusname = Active
  • Problem.Flags.problem-problemincludeflags = see below

For Active:

    • ProblemIncludeFlags = 1, or
    • ProblemIncludeFlags = 3, or
    • ProblemIncludeFlags = 5, or
    • ProblemIncludeFlags = 9, or
    • ProblemIncludeFlags = 17

For others, use this legend:

    • 1 = Active
    • 2 = Past Medical History (PMH)
    • 3 = Active and PMH
    • 4 = Past Surgical History (PSH)
    • 5 = Active and PSH
    • 8 = Personal History (PHx)
    • 9 = Active and PHx
    • 10 = PHx and PMH
    • 16 = Family History (FHx)
    • 17 = Active and FHx

ProblemIncludeFlags may on occasion be above the value of 31. If this is the case, reduce it by 32 to get the actual value.


This will return all the active medications for a patient. This will include medications that have been completed unless marked otherwise.

  • Medication.medication-medicationstatusname = Active
  • Note: Click Show Distinct Values to ensure that all necessary values - such as Unauthorized or Need Information - are included.


This will return all results that were not rejected.

  • Result.result-resultstatusname <> Rejected


Filtering on Task Status is common, though with Tasks both completed and active are useful.

Active Only:

  • Task.Task_Status_DE-EntryName = Active

All tasks:

  • Task.tasktask_status_de-entryname <> Removed
  • Task.tasktask_status_de-entryname <> Deleted


For Clinical Findings (aka Vitals) we typically include all, or use MultiSearch to find the most-recent vitals. When using MultiSearch, remember to do a quick search on the Finding#; this tells the search what to look for. For example, right click on finding1-entrycode and select Quick Search; type in BP SYS under the Like field. This will return the Systolic Blood Pressure results that meet the other search criteria.

Patient List

For Patient List entries there is no need to filter, since there is no concept of status - a patient is either on a list or not.


This will return all properly entered orders for the patient.

  • Order.order-orderstatus <> Entered in Error

Other statuses can be filtered out if the search is only looking for specifics, e.g. active/outstanding orders.

Health Maintenance Plan

  • Health Maintenance Plan.hmp-status <> Entered in Error, or
  • Health Maintenance Plan.hmp-status <> Discontinued


This will return all current charges for the patient.

  • Charge.charge-billingstatus <> Removed


For mTempalte (aka Medcin Findings -- and these are finding entered in a Note, or through a flow sheet), we usually include all.


For any Chart Viewer items (includes everything in ChartViewer except Results), we filter out invalidated notes primarily.

  • Chart.chart-invalidatedbyname = (blank)

We commonly filter by status as well: Chart.chart-docstatus


For Immunizations we usually include all.


This will return all active allergies for the patient.

  • Allergy.allergy-status = Active


For Audit we usually include all that meet the other criteria that we have set.

Patient Access Log

For Patient Access Log we usually include all that meet the other criteria we have set.

Medication Action

  • MedicationAction.medicationaction-medicationstatusname = Active


Many sections have multiple date types and this can be confusing for the beginning user. Some date types are self-explanatory, like Resolved or Recorded. Created refers to the time when the record was entered into the system. For results, performed date is when the actual test was performed.

Types of Searches

Stacked Searches

A stacked search gives equal weight to all searches included and will return only the subset of data that pertains to all of the stacked searches. It can be thought of as the portion of a Venn diagram where the circles (searches) overlap. The searches shown above would typically be stacked as they are often broad and meant to weed out specific sections of data.

Stacked searches are typically used to narrow patients down by category. Common categories include #Patients, user-defined age categories, or insurance class.

Nested Searches

Nested searches offer several important pieces of functionality in the Analytics program. They return a subset of data from a larger pool, but other information besides what was searched for can be retrieved. Nested searches return a unique list of patients, though other data about those patients can be included in a worksheet. If both patient.patient-fullname and problem-problem were included in a worksheet, multiple records would return for each of the unique patients. While the patient list would still be unique, the number of records returned will grow significantly. Users should be aware of this as it will greatly affect the results that they see.

Nested searches have a Have or Have-Not operator, so individual groups can be excluded as well as included. It will use the defined search and operator to determine which patients to return. The How Many function allows patients to be returned on the basis of meeting any specific or operator-defined number of records. For example, patients who had more than 3 appointments during the past year could be excluded. The How Many function can be applied to any field in the meta-layer tree.

A nested search is usually used to return a list of patients that have or don't have a specific problem, medication, or order. An example would be returning a list of patients who have diabetes and have not had a specific medication prescribed in the past three years; from there, the user can add other fields to the worksheet in order to find out more details about those patients.


Multisearch is a specialized option for the Result and Finding categories only. It allows searching for the most recent result of a test or vital as well as being able to search for up to six different tests. When using multisearch, the entrycode must be defined; this is where the test or vital name will be used. It's recommended to use Distinct Values to determine the proper code or codes. Multisearch can also search based on the numericresult field if the entrycode is defined. For example, a search could return patients who have their latest Triglycerides result above 200.