Skip to main content
Create, save, and run a query
Updated over 4 months ago

The Reporting Queries features allows users to return a desired set of data from their instance after specifying to the platform how to retrieve the data. In the Queries feature, one query corresponds to one set of data that usually answers one question (e.g., Who are the students with asthma that have a current action plan on file?).

To specify the retrieval of this data (or, in other words, ask the platform the question), users add rules to the query. This article shows you how to create the query, save, and run a query.

Step One: First, navigate to the Reporting > Queries page.

Step Two: Select one of the blue '+ New query' buttons.

Step Three: Choose the appropriate query model.

The query dictates what type of data will be returned in the results when you have finished creating your query. The currently available query models are:

  • DynamoEncounters: returns lists of encounters that meet your query rules.

  • MedicationAdministrations: returns list of medication administrations that meet your query rules.

  • MedicationInventories: returns lists of student medications or clinic medications whose inventories are tracked in the platform and that meet your query rules.

  • Screenings: returns lists of screenings that meet your query rules.

  • Students: returns lists of students that meet your query rules.

Step Four: Click into the Query Builder to add a rule or group template.

You can either add a single rule or, if you know you will use more than one rule that pertains to the same data type, add a group to fill out.

Make sure to click either the 'Add rule' or 'Add group' button to add the template for it.

Step Five: Select the type of data on the model that the rule/group pertains to.

Doing so begins to tell the platform what type of data you are going to ask it about. For example, if the rule is "Students with asthma as a condition," you are telling the platform that you are about to ask it something about student conditions.

Step Six: Add a sub-rule to the rule.

After specifying the type of data, you can now tell what about that data type to look for.

To do, first select a the appropriate field from the dropdown menu that further specifies the subset of data you want the platform to look at. For example, using the rule "Students with asthma as a condition," you will want to select "Condition type" because "Condition type" is that subset of "Conditions" data that designates whether the condition is "Asthma."

Note: You are now able to reference an existing query as a rule!

  1. Click the three dots above the 'Select field' dropdown.

  2. Toggle the 'Select source' field from 'Field' to 'Function.'

  3. Select the 'Existing query' function

  4. Choose the appropriate query from the dropdown menu.

Step Seven: Specify your desired values and how the platform should look for your them in the sub-rule.

After specifying the subtype, you will want to tell the platform how to look for your desired value(s).

To do so, choose for the available methods in the dropdown menu to the right of the subtype, then pass your desired values in the rightmost field. For example, using the rule "Students with asthma as a condition," you will want to select "included in" and then pass in "Asthma" to make sure that the platform is looking for students whose list of conditions types have at least one of the conditions types in your desired list of values, which in this case just consists of "Asthma."

From here, you can can repeat steps four to seven to make sure your query rule(s) and/or group(s) reflect your question!

Step Eight: Select the 'Save changes' button.

When you have added all the rules/groups to your query to appropriately reflect your question, you will then just save this information to the query so that you may view (and, more importantly, use) it again at a later time.

Step Nine: Select the 'Calculate' button.

Now that your query is set, you will now tell the platform that it can run the complete query and return the desired results.

The process of running a query is not instantaneous; therefore, at the top right of the results table, you will see a designation of where the query is queued for running, currently running, or has finished running.

Did this answer your question?