-
Enhancement
-
Resolution: Done
-
Major
-
None
QDM data elements (e.g., "Diagnosis: Diabetes") consist of a data type and a value set. The value set is not associated to an attribute, but rather, is associated directly to the QDM data type. For each QDM data type, the meaning of the related value set is implicit (e.g., the value set on a "Diagnosis" represents the coded diagnosis – not the status, certainty, or anything else that might also be represented as a code in the same data type).
CQL does not support such implicit references. Whenever a value set is used with a data type in CQL, that value set must be associated with a specific attribute of the data type – it can't be associated directly to the data type itself.
That said, the authors of CQL understood the value of succinctly specifying the main concept of the data type – so rather than requiring the author to explicitly specify the attribute to which the value set should be associated, CQL allows a shorthand that looks very similar to QDM's data element:
[Diagnosis: "Diabetes"]
The above CQL "retrieve" specifies diagnoses for whom their primary code attribute is in the "Diabetes" value set. The data model definition determines what attribute is the primary code attribute. This is described in section 2.2.2 of the CQL specification.
This matters to CQL-based QDM because this means that each QDM data type must have an attribute that can be identified as the primary code attribute. Even though it is not visible to authors, there must be an underlying attribute that the value set is actually associated to (which turns out to be more explicit in the ELM translation).
For this reason, every QDM data type should have a "code" attribute added to represent the main concept of the data type (and therefore be the primary code attribute). This is the attribute that is tested for membership in the value set of the retrieve. For simplicity's sake, it may make sense to always call this attribute "code"-- but if more specificity is desired, the name of the attribute could vary from data type to data type. In this case, the QDM specification would need to tag the primary code attribute in each data type.