Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
The retrieve operation supports both value sets and direct-reference codes as the terminology target for a retrieve. However, if the path for that terminology target results in a multi-cardinality element, value sets work, but direct-reference codes do not, resulting in an error that the terminology target cannot be resolved:
library EncounterTest
using QICore version '4.1.1'
include FHIRHelpers version '4.2.000'
codesystem "Concept Codes": 'http://example.org/fhir/CodeSystem/concept-codes'
valueset "Inpatient Encounters": 'http://hl7.org/fhir/ValueSet/inpatient-encounters'
code "Inpatient": 'inpatient' from "Concept Codes"
context Patient
define "Encounters By ValueSet":
["Encounter": "Inpatient Encounters"]
define "Encounters By Code":
["Encounter": "Inpatient"]
The issue is that the retrieve would require the following:
define "Encounters By Code":
["Encounter"] E
where exists ((E.type) T where T ~ "Inpatient")
Alternatively, an overload of the equivalent operation:
Note this is related to CQLIT-368. The workaround is to use a ValueSet (i.e. create a value set with the direct-reference code required and use that value set).
The retrieve operation supports both value sets and direct-reference codes as the terminology target for a retrieve. However, if the path for that terminology target results in a multi-cardinality element, value sets work, but direct-reference codes do not, resulting in an error that the terminology target cannot be resolved:
The issue is that the retrieve would require the following:
Alternatively, an overload of the equivalent operation: