In some circumstances, it may be desirable to embed search criteria into the query itself. This feature will force the query to run with a certain set of criteria layered on top of any base search criteria defined on the “Criteria” tab.
For example, you may create a query that returns important data regarding cases where the outcome is “Major” or “Death” and that is the sole purpose of the query and the reason certain data fields where chosen. In this scenario, you could then embed search criteria into the query to always show cases where the medical outcome is “Major” or “Death”. This will eliminate the need to define this piece of search criteria any time you use this query as it will always apply.
Listed below are the steps to perform the above referenced example:
1. Create a new query or open and existing query you would like to embed criteria into.
2. Locate the “Query Conditions” area below the “Query Columns” area.
3. Use the green [Click here to add a new condition] link to select the first data field. This process is the same as building base search criteria referenced in the portion of this documentation. In this example we are interested in the “Medical Outcome” data field.
Keep in mind when building search criteria, typically using the NON “_Text” version of a data field is best unless you have a specific reason otherwise. Please refer to the section of documentation for more details.
4. Update the [Select Value] link to reflect “Major Effect” and “Death” as the Medical Outcomes we are interested in viewing.
5. The “Query Condition” is now updated. Save the changes and the query is now ready for use.
Please keep in mind, this criteria will ALWAYS apply in addition to any criteria built on the “Criteria” tab of the application. Also, Query Conditions are not defining data fields to be returned from the database, only filtering the cases included in the search.