Parameterizing queries

Introduction

Often you need to create queries where some of the fields will be entered by the users when running it. E.g. show specimens collected for a certain date range. Here the collection date will be entered by the user during executing the query. 

This is achieved by "parameterizing' the query filters. Using the parameterized filters, users can create a single query, save it and use the filters runtime to query for data. 

Steps to create a parameterized filter:

  1. Select filter from any form. E.g. 'Clinical Diagnosis' from the visit form.
  2. Add 'Operator' as 'All' or use "is one of" if you want to select specific fields.
  3. Select the checkbox on the filter besides 'Parameterized Filter' and click on 'Add'
  4. Once done, the fields that are added as parameterized will be displayed on the results page. 
  5. User can query for various data on executing the saved query. E.g. 'Clinical Diagnosis' filter, user can search for any diagnosis value and the results grid will be filtered based on the selection.

Example:

Return all samples for a particular "SPR number" (here SPR number is to be parameterized)

  1. Create a filter for 'Path. Number' with operator 'All' and add this as a parameterized filter.

2. Add another filter for clinical diagnosis with "is one of" for 5 fields as in the screenshot below

The filters that are parameterized are now available in the left side. Users can now select one or more values and results on the right grid is displayed accordingly.

On expanding the filter, users can type in the path number they are looking for at that particular time.

Same for the clinical diagnosis field