# Query Interface

When querying patient records containing SNOMED CT-enabled data, a variety of interfaces may be adopted to support the user in authoring queries. In this section we first consider user interfaces for querying SNOMED CT, and then look at user interfaces for querying SNOMED CT enabled patient records.

## Terminology Query Interfaces

When querying clinical data, it may be necessary to first define a subset of SNOMED CT concepts (e.g. disorders or procedures) that may then be compared against values in a patient record. A number of different options exist for creating these SNOMED CT subsets, including:

1. Selecting individual SNOMED CT concepts (i.e. extensional definition)
2. Authoring queries directly using a query language (i.e. intensional definition)
3. Authoring queries using a structured form (i.e. a form which generates an intensional definition)

### Selecting Individual Concepts

This approach uses a SNOMED CT browser to allow individual SNOMED CT concepts to be searched, selected and added to a subset. For large subsets this can be quite time consuming, however it is quite suitable for smaller subsets. A number of commercial tools are available which help to perform this task, including Apelon's Distributed Terminology System and B2i's Snow Owl terminology server. The figure below illustrates Snow Owl's authoring interface for Simple reference sets.

<figure><img src="/files/TwAH3t3izPOnh8yItBLv" alt=""><figcaption><p>B2i's Snow Owl interface for authoring Simple Reference Sets</p></figcaption></figure>

### Authoring Queries Using a Query Language

Other user interfaces allow a subset to be defined using a text-based query written using a predefined query language (e.g. SNOMED CT Expression Constraint Language, or SNOMED CT Query Language). These interfaces tend to be for the more technical user. However, some clinical users may be taught to use these interfaces if required.

Two examples of this style of interface are illustrated below.

<figure><img src="/files/WFyZKeYR3hBpvKHG1dSt" alt=""><figcaption><p>NHS Data Migration Workbench interface for authoring queries</p></figcaption></figure>

<figure><img src="/files/KNfjTxTp3zqQrON6eooy" alt=""><figcaption><p>B2i's Snow Owl interface for authoring text-based queries</p></figcaption></figure>

### Authoring Queries Using a Structured Form

A third style of user interfaces for authoring SNOMED CT subsets uses a structured form. A form-driven query tool may allow the user to select an operator (e.g. 'memberOf', 'descendantOf'), the concept or subset to which this operator is applied (e.g. 'Example problem list', 'Disorder'), and then one or more attribute values to limit the set of concepts returned. (Note: The attribute name may either be selected from a list, or hard coded on the form). Once the form is completed, a text-based query is automatically constructed from the selected values, and executed against SNOMED CT. This style of interface can be designed to allow users to exploit the rich semantics of SNOMED CT, while shielding them from the underlying technical details. The following figure illustrates how a generic form-driven interface for authoring SNOMED CT queries works. Vendor products which implement form-driven interfaces for authoring SNOMED CT queries include B2i's Meaningful Query web interface.

<figure><img src="/files/FSXCwRHVWhd5bYL9fEyM" alt=""><figcaption><p>A generic form-driven interface for authoring SNOMED CT queries</p></figcaption></figure>

<figure><img src="/files/TMbl8gbq002aRTbZfiQk" alt=""><figcaption><p>B2i Snow Owl's Meaningful Query web interface</p></figcaption></figure>

Patient Record Query Interfaces

When SNOMED CT queries are integrated (or embedded) into patient records queries, additional constraints are often added across demographic data (e.g. age, address) and episode of care data (e.g. healthcare provider, dates). These data items are often referred to as 'concrete values' and are typically not included in a terminology. A number of styles of interfaces are used to author patient record queries that include SNOMED CT content, including:

1. Free text semantic search
2. Queries using a predefined language (e.g. SQL, XQL, OQL or AQL)
3. Queries using a structured form (including both SNOMED CT and concrete value criteria)

The following figure shows an example of a search for 'diabetes' using Cerner's Semantic Search tool. This tool enables clinicians at the point of care to search in real time through a patient's multiple charts, pathology reports and other documents for topics such as 'heart disease' and 'diabetes', using SNOMED CT's hierarchical and non-hierarchical relationships.

<figure><img src="/files/2T2p0moEIz5q0ua4lb2z" alt=""><figcaption><p>User interface of Cerner's Chart Search/Semantic tool</p></figcaption></figure>

***

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=Data+Analytics+Guide&#x26;entry.670899847=Query%20Interface" class="button primary">Provide Feedback</a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-data-analytics-guide/10-user-interface-design/10.1-query-interface.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
