Building CDS queries

Building CDS queries

Building CDS queries can be a daunting task, call technical support to assist in building or editing any query if you are not comfortable.

The first thing to do is determine the criteria of patients to look for and identify how the criteria is noted in Healthquest.
  1. Click Setup > Charting Setup > CDS Query Setup.
  2. Click ‘New’ and name the query in the ‘desc’ box.

*Note there is no new line in the list of queries until a new Desc: has been entered and saved.

**Note the Notify on Chart and Notify on Appointments check boxes default to being checked-Uncheck these while in the build process.

  1. Once saved, click Edit Query, a new window will appear.

  1. Click “New Line” and a list of options will come up.
  2. Select the line type of choice and click ‘Ok’.
    1. Appointments: Look for appointment dates, times, types, statuses, doctor, and appt notes.
    2. Chart Data: Visit dates, fields within a visit note, doctor associated with visit note.
    3. Chart Metadata: Vitals data, values greater than or less than, doctor associated with visit note.
    4. Chart Notes: Select specific chart note template names, pick specific fields within that chart template.
    5. Chart Row Data: Same as Chart Data but specific to fields within row data added to chart templates.
    6. Claims: Billing criteria - diagnostic codes, service codes, dates, doctors.
    7. Clients: Patient demographic information from the client card.
    8. Forms: Form Name, dates, Doctor associated with form.
    9. Intake Forms: Intake forms, completed/not completed, specific questions on specific forms.
    10. Invoices: Private billing details, third party payer, amounts, dates, doctor associated with invoice.
    11. Lab Results: Lab names, values, dates, and doctors associated with results.
    12. Letters: Letter types, dates, doctor associated, notes.
    13. Medications: Medication names, dates, doctor associated with prescription, and whether it is active or not.
    14. Patient Portal: Dates of when invites were sent and date of when patient registers.
    15. Problems: Problem names, associated diagnostic codes, associated doctors, notes, status.
    16. Scans: Scan types, notes, dates, who it is assigned to, and status.
    17. SQL: Create a custom SQL to look for something another line cannot.
    18. Worklists: Description, notes, dates, assignee, status, tasks, and priority.
  3. Add as many new lines as necessary to capture all required criteria.

*Note: each new line will default to “AND” as well as level 1.

  1. Start with a client line to identify patients who meet the initial criteria.


  1. Build the criteria from the options in the bottom half, selecting from age numbers, free text fields, dropdowns, check the check box on the left to activate the option filled out.
  2. Click “Save Line”, the interpretation of the criteria will appear in the top left corner.
  3. Add another new line to add to the query, selecting the applicable category of line.
  4. Select applicable criteria and “Save Line”.

This example is looking for Male patients with Dr. Cooper as Default Doc on client card, are over 40, AND have a lab result labelled “Glucose, fasting” on their chart within the last 5 years.



Editing a query
To make edits to an existing line within a query, click the line to edit from the left top corner, you will see it will be highlighted. 
Make the changes in the bottom half of the window, or the and/or/NOT items in the top right, then click save line, at the top in the middle.

To look for patients in that client criteria without the lab result in the last 5 years, check the NOT checkbox in the top right and save line.


To look for patients of the same client criteria who have one lab or another, set the lab result lines to the next level, this places them within a set of brackets.


Patients who are Male, over the age of 40, and have Dr. Cooper as default doc on their client card

AND

Have Glucose fasting, OR Hemoglobin A1c within the last 5 years on their chart.

*Note: There are brackets around the lines that are on the same level.

To look for patients of the same client criteria that have NOT got “Glucose, fasting” and NOT got “Hemoglobin A1c”, use AND NOT for all lines after the client line.


Patients who are Male, over the age of 40, and have Dr. Cooper as default doc on their client card who don't have “Glucose, fasting” and don't have “Hemoglobin A1c” within the last 5 years on their chart.

 

Common misunderstandings

If the OR was used here in the query without using the levels:


The results of this query with give:

  1. Patients who are Male, over the age of 40, and have Dr. Cooper as default doc on their client card and do NOT have “Glucose, fasting”, but may have the “Hemoglobin A1c”.
  2. Patients who do not have “Hemoglobin A1c” in the last 5 years regardless of client card details

If using the OR, make sure to use the levels to organize the brackets within the query.

Click below to review some ASaP query examples.
*Note, these examples are looking for patients due for screening as these are the patients the notifications need to appear on, and if running a report for a list, these are the patients who require action.