cqframework / clinical_quality_language

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.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
266 stars 124 forks source link

Namespace - Missing Library identifier.system #449

Closed JSRankins closed 4 years ago

JSRankins commented 5 years ago

CQL R1 STU4 added namespace capability. Based on a read of CQL, it appears that the library identifier in the ELM XML and JSON should have a property named system that is the URI for the namespace. For reference, see the RelatedContextRetrieve library example in CQL that uses an Example namespace. The identifier for the library in the ELM XML file has the following:

`

`

In fact, volume 2 of CQL-based HQMF IG R1 STU4 provides the following:

This example declares a library named Common in the CMS namespace. Per the CQL specification, the namespace for a library is included in the ELM, along with a URI that provides a globally unique, stable identifier for the namespace. For example, the URI for the CMS namespace would be https://ecqi.healthit.gov/ecqm/measures

However, when using the CQL-to-ELM Translator to transform a library containing a namespace, the system property is not provided in the ELM XML and JSON output. For example:

CMS.Common.1.0.000.cql

library CMS.Common version ‘1.0.000’ ...

ELM XML CMS.Common.1.0.000.xml

`

...

`

ELM JSON CMS.Common.1.0.000.json

  "identifier" : {
     "id" : "CMS.Common",
     "version": "1.0.000"
  }

In addition, there does not appear to be a way to provide the respective URI for the respective namespace.

Am I missing something?

brynrhodes commented 5 years ago

Because the namespace is broader than a library, CQL does not provide a namespace declaration. The translator needs the namespace uri to be provided as a parameter.

brynrhodes commented 4 years ago

Addressed in 1.4.9 release

lscott15 commented 4 years ago

Because the namespace is broader than a library, CQL does not provide a namespace declaration. The translator needs the namespace uri to be provided as a parameter.

I feel like I'm missing something, how would I actually specify a namespace in practice? It sounds like it's a parameter to the cql>elm translation but I don't see it as one of the parameters to the CLI client or as a setting in the Atom plugin.

brynrhodes commented 4 years ago

You're right, there is no command-line parameter for setting the namespace information, but it is a parameter to the translator component. If you need it exposed on the command-line, feel free to submit an issue request.

As of today, the only way to set the namespace is through the FHIR IG publisher, using the Adjunct Binary File loader and CQL processing: https://confluence.hl7.org/pages/viewpage.action?pageId=66938614#ImplementationGuideParameters-BinaryAdjunctFiles

Within a FHIR IG, the packageId of the IG is the namespaceName, and the canonicalBaseUrl of the IG is the namespaceUri. See the sample-ig and sample-content-ig for an example of referencing a CQL Library from a dependent IG.

We are currently working to expose this same capability to the Atom plugin, see CQF-Tooling issue 101.