Both extensionally and intensionally defined subsets of SNOMED CT components are useful for specifying clinical queries. For example, subsets of SNOMED CT concepts can be used to categorize patient data by testing for membership in a predefined subset, which is represented as a reference set.
The SNOMED CT Expression Constraint Language (ECL) enables simple queries over SNOMED CT content to be expressed. While the language itself does not support querying over the full EHR content, the ECL could be embedded within record-based query languages (such as SQL) to represent the terminological aspects of these queries.
Related to reference sets, the ECL includes the ability to refer to a set of concepts that are referenced by members of a reference set. Additionally, it includes a range of features, such as refinements, disjunction, and conjunction, which support specialized queries. The memberOf function evaluates to the set of concepts that are referenced by the given reference set. For example, the following expression constraint is satisfied by the set of concepts which are members of 649999999104 |Example problem list simple reference set| :
The diagram below illustrate how reference sets can be for specifying queries.
Figure 22.214.171.124-1: Using reference sets for specifying queries