> For the complete documentation index, see [llms.txt](https://docs.snomed.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snomed.org/snomed-ct-specifications/snomed-ct-compositional-grammar-specification/introduction/2-use-cases/2.2-expressions-in-messages.md).

# Expressions In Messages

The SNOMED CT Compositional Grammar allows SNOMED CT expressions to be represented as a text string that can be carried in messages. For example, in HL7 version 3 messages SNOMED CT expressions can be placed in the 'code' property of the ConceptDescriptor (CD) data type (Release 2). The compositional grammar described in this document is intended to replace the qualifier mechanism that formerly was in the CD data type (Release 1), and which was removed in Release 2.

In September 2009, the HL7 Version 3 Standard "Data Types - Abstract Specification, Release 2" was published for its fourth normative membership ballot. This revised standard defined what can be carried in the 'code' property of the CD data type as shown.

> **Definition of the 'code' property of the Concept Descriptor (CD) data type from HL7 Data Types Release 2**\
> **Code (code)** : ST.SIMPLE\
> **Definition:** The plain code symbol defined by the code system, or *an expression in a syntax defined by the code system which describes the concept***.&#x20;*****(emphasis added)*** If provided, the code SHALL be an exact match to a plain code symbol or expression defined by the codeSystem. If the codeSystem defines a code or expression that includes whitespace, the code SHALL include the whitespace.
>
> ***An expression can only be used where the codeSystem either defines an expression*** ***syntax*****, or there is a generally accepted syntax for the codeSystem.** *(emphasis added)*

The syntax described in this document is intended to satisfy the need for a "syntax defined by the code system" as stated above, when the "code system" is SNOMED CT. For specific guidance on using SNOMED CT Compositional Grammar in the CD data type (Release 2), please refer to Appendix B.4 of "HL7 Version 3 Implementation Guide: TermInfo – Using SNOMED CT in CDA R2 Models, Release 1".

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=Compositional-Grammar-Specification&#x26;entry.670899847=Expressions%20In%20Messages" class="button primary">Provide Feedback</a>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snomed.org/snomed-ct-specifications/snomed-ct-compositional-grammar-specification/introduction/2-use-cases/2.2-expressions-in-messages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
