Skip to content
Bryn Rhodes edited this page Jun 20, 2016 · 25 revisions

Terminology in CQL

Clinical Quality Language is designed to support a broad range of terminology use cases. In particular, the language defines first class constructs for the definition of code systems, value sets, concepts, and codes. However, CQL does not define the actual contents of these constructs, relying instead on external terminology systems to provide terminological content. Instead, each of these constructs provides a mechanism for defining a logical versioned identifier, and then allows CQL logic to reference these constructs by their local names.

The following guidance is proposed for the use of these terminology constructs in CQL libraries references by HQMF artifacts. In general, the guidance recommends the use of URIs as the representation format for all the logical identifiers (including versions) used for terminology constructs.

Code Systems

When code systems are referenced within CQL, the OID of the code system should be specified as a URN for the code system. For example:

codesystem "SNOMED-CT": 'urn:oid:2.16.840.1.113883.6.96' version 'urn:version:March%202016'    

The URN for the version part of the identifier uses the namespace version to indicate that this is the logical identifier of a version.

Note the use of URN syntax as defined by RFC 2141 requires that names be escaped (hence the use of %20 rather than a space).

Value Sets

When value sets are referenced within CQL, the OID of the value set should be specified as a URN for the value set:

valueset "Face-to-Face Interaction": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1048' 

Note that the because the Value Set Authority Center (VSAC) supports different approaches to retrieving the expansion of a valueset through its Sharing Value Sets (SVS) API. For the purposes of this guidance, two approaches are described: 1) by version, and 2) by profile.

By Version

When retrieving the expansion of a value set by version, the version identifier attribute should be a URN defining the version:

valueset "Face-to-Face Interaction": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1048' 
    version 'urn:version:2016-04-01'

As with code systems, the version namespace is used to indicate that the identifier is a version.

By Profile

When retrieving expansions by profile, the version identifier attribute should be a URN defining the profile:

valueset "Face-to-Face Interaction": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1048'
    version 'urn:profile:MU2%20Update%202016-04-01'

Here, the profile namespace is used to indicate that the identifier is a profile.

Codes

When single codes are represented within CQL, the logical identifier is not recommended to be a URN. Instead, the logical identifier is the code from the code system:

code "Assessment of breastfeeding": '709261005' system "SNOMED-CT" display 'Assessment of breastfeeding'

Note that for single code usage, the local identifier "Assessment of breastfeeding" must be the same as the description of the code within the terminology in order to avoid conflicting with any usage or license agreements with the referenced terminologies.

Representation in HQMF

When single codes are used within CQL-Based HQMF measures, they would show up in the HQMF HTML (Human-readable) as:

"Risk Assessment, Performed: Assessment of breastfeeding" 
    using "Assessment of breastfeeding SNOMED-CT version March 2016 Code (709261005)"

And they would be represented in the underlying HQMF XML as:

<entry typeCode="DRIV">
   <localVariableName value="RiskAssessment_Performed_Assessment_of_breastfeeding"/>
   <encounterCriteria classCode="ENC" moodCode="EVN">
      <templateId>
         <item extension="2015-09-30" root="2.16.840.1.113883.10.20.28.3.5"/>
      </templateId>
      <id extension="RiskAssessment_Performed_Assessment"
          root="ea6be543-6718-4a29-a928-c4acc1b20fca"/>
      <code code="709261005" 
            codeSystem="2.16.840.1.113883.6.96" 
            codeSystemName="SNOMED-CT" 
            codeSystemVersion="March 2016">
         <displayName value="Assessment of breastfeeding"/>
      </code>
      <title value="Risk Assessment, Performed"/>
      <statusCode code="COMPLETED"/>
   </encounterCriteria>
</entry>

Concepts

In addition to codes, CQL supports a concept construct, which is defined as a set of codes that are all semantically equivalent. This structure allows codes from multiple code systems to be represented as a single concept within CQL:

code "Disorder of breast associated with childbirth": '86196005' system "SNOMED-CT"
code "Other disorders of lactation": 'O92.79' system "ICD-10"
concept "Breastfeeding disorders": { "Disorder of breast associated with childbirth", "Other disorders of lactation" }

NOTE: The equivalence described here has not been clinically or terminologically validated, it is presented only as an example of the intent of a concept within CQL.

Wiki Index

Home

Authoring Patterns - QICore v4.1.1

Authoring Patterns - QICore v5.0.0

Authoring Patterns - QICore v6.0.0

Authoring Measures in CQL

Composite Measure Development

Cooking with CQL Examples

Cooking with CQL Q&A All Categories
Additional Q&A Examples

CQL 1.3 Impact Guidance

CQL Error Messages

Developers Introduction to CQL

Discussion Items

Example Measures

Formatting and Usage Topics

Formatting Conventions

Library Versioning

Negation in QDM

QDM Known Issues

Specific Occurrences

Specifying Population Criteria

Supplemental Data Elements

Terminology in CQL

Translator Options For Measure Development

Unions in CQL

Clone this wiki locally