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.
When two models have a type with the same unqualified name, and that name is referenced in CQL logic, the specification indicates that an ambiguous error should be raised:
library Test version '1.0.0'
using FHIR version '4.0.1'
using System version '1.0.0'
define function f(q Quantity): q
There is a nuance that if the ambiguity is with the System model, and the System model declaration is implicit, the explicit model is preferred. However, if the system model declaration is explicit, this should be an error. (JIRA tracker to document this nuance: https://jira.hl7.org/browse/FHIR-46435)
So the following library is fine:
library Test version '1.0.0'
using FHIR version '4.0.1'
define function f(q Quantity): q
But the first one should give an ambiguous type reference.
When two models have a type with the same unqualified name, and that name is referenced in CQL logic, the specification indicates that an ambiguous error should be raised:
Specification link: https://cql.hl7.org/03-developersguide.html#multiple-data-models
There is a nuance that if the ambiguity is with the System model, and the System model declaration is implicit, the explicit model is preferred. However, if the system model declaration is explicit, this should be an error. (JIRA tracker to document this nuance: https://jira.hl7.org/browse/FHIR-46435)
So the following library is fine:
But the first one should give an ambiguous type reference.