Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FHIR-27517 #59

Merged
merged 20 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e671f92
FHIR-27517 - Changed the wording to suggested
abdullah-git1 Jun 15, 2020
84771fc
FHIR-27516 - Changed wording as suggested
abdullah-git1 Jun 15, 2020
3a53bd1
FHIR-27515 - Changed wording as suggested
abdullah-git1 Jun 15, 2020
cbd6585
FHIR-27511 - Changed wording to suggested
abdullah-git1 Jun 15, 2020
2abd0bf
FHIR-27497 - Changed wording to suggested
abdullah-git1 Jun 15, 2020
1379aaf
FHIR-27488 - Changed wording to suggested
abdullah-git1 Jun 15, 2020
317d731
FHIR-27484 - Changed wording to suggested
abdullah-git1 Jun 15, 2020
879af89
FHIR-27518 - Changed wording to suggested
abdullah-git1 Jun 15, 2020
9313123
FHIR-27481 - Added references to Table 1-A
abdullah-git1 Jun 16, 2020
5992a75
FHIR-27478 - Corrected chapter references
abdullah-git1 Jun 16, 2020
8771e7c
FHIR-27477 - Corrected references
abdullah-git1 Jun 16, 2020
10d5c66
FHIR-27475 - Fixed Hyperlinks
abdullah-git1 Jun 16, 2020
b1d8506
FHIR-27081 - Updated test reference spec to 1.5
abdullah-git1 Jun 16, 2020
2dc7090
FHIR-27080 - Changed v1.5 change log title to "Normative/Trial-Use Ba…
abdullah-git1 Jun 16, 2020
d8c695e
FHIR-27076 - Updated order of declarations in Grammar
abdullah-git1 Jun 23, 2020
cc078b9
FHIR-27439 - Updated the spec reference implementation page with the …
abdullah-git1 Jun 23, 2020
e2b8ff6
FHIR-27447 - Added links for Arithmetic operators
abdullah-git1 Jun 23, 2020
191640b
FHIR-27492 - Example (Data Model) with version added
abdullah-git1 Jun 23, 2020
9f10228
FHIR-27519 - Added a hyperlink to the QUICK data model diagram
abdullah-git1 Jun 29, 2020
4b01c9f
Merge branch 'master' into master
brynrhodes Jun 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions spec/01-introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Considering each of these components separately, the next step involves identify
[cols=",,,,",options="header"]
|========================================================================================================================================================================================
| | Model Type | Quality Information | Computable Expression Logic | Metadata
| *Clinical Decision Support (CDS)* |Physical and logical |Virtual Medical Record (vMR) |CDS Knowledge Artifact Specification |CDS Knowledge Artifact Specification/Decision Support Service
1.2+| *Electronic Clinical Quality Measurement (eCQM)* |Physical |Quality Reporting Document Architecture (QRDA) |Health Quality Measure Format (HQMF) |Health Quality Measure Format (HQMF)
1.1+|Logical |Quality Data Model (QDM) |Quality Data Model (QDM)|
| *Clinical Decision Support (CDS)* |<<Approach, Physical and Logical>> |https://www.hl7.org/implement/standards/product_brief.cfm?product_id=338[Virtual Medical Record (vMR)] |http://www.hl7.org/implement/standards/product_brief.cfm?product_id=337[CDS Knowledge Artifact Specification] |http://www.hl7.org/implement/standards/product_brief.cfm?product_id=337[CDS Knowledge Artifact Specification] / http://www.hl7.org/implement/standards/product_brief.cfm?product_id=12[Decision Support Service]
1.2+| *Electronic Clinical Quality Measurement (eCQM)* |<<Approach, Physical>> |http://www.hl7.org/implement/standards/product_brief.cfm?product_id=35[Quality Reporting Document Architecture (QRDA)] |<<Health Quality Measure Format (HQMF),Health Quality Measure Format (HQMF)>> |<<Health Quality Measure Format (HQMF),Health Quality Measure Format (HQMF)>>
1.1+|<<Approach, Logical>> |http://www.hl7.org/implement/standards/product_brief.cfm?product_id=346[Quality Data Model (QDM)] |http://www.hl7.org/implement/standards/product_brief.cfm?product_id=346[Quality Data Model (QDM)]|
|========================================================================================================================================================================================
Table 1‑A - Relationship of the current specifications to each component

Expand Down Expand Up @@ -61,7 +61,7 @@ The Clinical Quality Framework (CQF) was initially a collaborative community of
[[approach]]
== Approach

As discussed in Section 1, one key principle underlying the current harmonization efforts is the separation of responsibilities within an artifact into _metadata_, _clinical information_, and _expression logic_. Focusing on the expression logic component and identifying the requirements common to both quality measurement and decision support, the Clinical Decision Support HL7 Work Group produced a harmonized conceptual requirements document: _HL7 Domain Analysis Model: Harmonization of Health Quality Artifact Reasoning and Expression Logic._ To view this document, refer to the link:11-d-references.html[References] section. These requirements form the basis for the reasoning capabilities that this specification provides.
As discussed in <<Background, Section 1>>, one key principle underlying the current harmonization efforts is the separation of responsibilities within an artifact into _metadata_, _clinical information_, and _expression logic_. Focusing on the expression logic component and identifying the requirements common to both quality measurement and decision support, the Clinical Decision Support HL7 Work Group produced a harmonized conceptual requirements document: _HL7 Domain Analysis Model: Harmonization of Health Quality Artifact Reasoning and Expression Logic._ To view this document, refer to the link:11-d-references.html[References] section. These requirements form the basis for the reasoning capabilities that this specification provides.

Building on those conceptual requirements, this specification defines the logical and physical layers necessary to achieve the goal of a unified specification for expression logic for use by both the clinical quality and decision support domains.

Expand Down Expand Up @@ -124,9 +124,9 @@ The specification is written with the following major roles in mind:

Table 1‑B - Major roles that this specification was written for

Note that although Chapter 2 is intended for a non-technical audience, the material is still somewhat technical in nature, and that readers will benefit from some familiarity with and/or training in basic computer language and database language topics.
Note that although the <<2. Author’s Guide, Author's Guide (Chapter 2)>> is intended for a non-technical audience, the material is still somewhat technical in nature, and that readers will benefit from some familiarity with and/or training in basic computer language and database language topics.

In general, each of these roles will benefit from focusing on different aspects of the specification. In particular, the Author role will be primarily interested in Chapter 2, the Language Guide for the high-level CQL syntax; the Developer role will be primarily interested in Chapters 2 & 3; the Integrator role will be primarily interested in Chapter 4, the formal description of the logical model; and the Implementer role will be primarily interested in Chapters 5, 6, and 7, which discuss the intended execution semantics, translation semantics, and physical representation, respectively, as well as Appendix B, and ELM UML model artifacts.
In general, each of these roles will benefit from focusing on different aspects of the specification. In particular, the Author role will be primarily interested in <<2. Author’s Guide, Chapter 2>>, the Language Guide for the high-level CQL syntax; the Developer role will be primarily interested in Chapter <<2. Author’s Guide, 2>> & <<3. Developer’s Guide, 3>>; the Integrator role will be primarily interested in <<4. Logical Specification, Chapter 4>>, the formal description of the logical model; and the Implementer role will be primarily interested in Chapters <<5. Language Semantics, 5>>, <<6. Translation Semantics, 6>>, and <<7. Physical Representation, 7>>, which discuss the intended execution semantics, translation semantics, and physical representation, respectively, along with additional reference materials in Appendix A-K.

[[scope-of-the-specification]]
== Scope of the Specification
Expand Down Expand Up @@ -156,7 +156,7 @@ Figure 1‑C - How the CQL and ELM specifications will be used in the sharing us
[[use-case-assumptions-and-conditions]]
=== Use Case Assumptions and Conditions

It is important for implementers to clearly understand the underlying environmental assumptions, defined in Section 5 of the CQF Use Case document referenced in the previous section, to ensure that these assumptions align to the implementation environment in which content will be exchanged using a knowledge artifact. Failure to meet any of these assumptions could impact implementation of the knowledge artifact.
It is important for implementers to clearly understand the underlying environmental assumptions, defined in https://oncprojectracking.healthit.gov/wiki/display/TechLabSC/CQF+Use+Cases+-+Discovery[Section 5 of the CQF Use Case document] referenced in the previous section, to ensure that these assumptions align to the implementation environment in which content will be exchanged using a knowledge artifact. Failure to meet any of these assumptions could impact implementation of the knowledge artifact.

[[relationship-to-other-hl7-specifications]]
== Relationship to Other HL7 Specifications
Expand Down
15 changes: 10 additions & 5 deletions spec/02-authorsguide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,14 @@ The following example illustrates the using declaration:
using QUICK
----

The above declaration specifies that the [.id]#QUICK# model will be used as the data model within the library.
The above declaration specifies that the [.id]#QUICK# model will be used as the data model within the library. The http://hl7.org/fhir/us/qicore/quick/QUICK-index.html[QUICK data model] will be used for the examples in this section unless specified otherwise.

If necessary, a version specifier can be provided to indicate which version of the data model should be used.
If necessary, a version specifier can be provided to indicate which version of the data model should be used as shown below:

[source,cql]
----
using QUICK version '0.3.0'
----

[[libraries]]
=== Libraries
Expand Down Expand Up @@ -506,7 +511,7 @@ The condition of a [.kw]#where# clause is allowed to contain any arbitrary combi
and C.indication in "Fever"
----

Note that because CQL uses three-valued logic, the result of evaluating any given boolean-valued condition may be _unknown_ ([.kw]#null#). For example, if the list of inpatient encounters from the first example contains some elements whose [.id]#period# attribute is [.kw]#null#, the result of the condition for that element will not be [.kw]#false#, but [.kw]#null#, indicating that it is not known whether or not the duration of the encounter was at least 120 days. For the purposes of evaluating a filter, only elements where the condition evaluates to [.kw]#true# are included in the result, effectively treating the unknown results as [.kw]#false#. For more discussion on three-valued logic, see the section on <<Missing Information>> in the Author's Guide, as well as the section on <<03-developersguide.adoc#nullological-operators,Nullological Operators>> in the Developer's guide.
Note that because CQL uses three-valued logic, the result of evaluating any given boolean-valued condition may be _unknown_ ([.kw]#null#). For example, if the list of inpatient encounters from the first example contains some elements whose [.id]#period# attribute is [.kw]#null#, the result of the condition for that element will not be [.kw]#false#, but [.kw]#null#, indicating that it is not known whether or not the duration of the encounter was at least 120 days. For the purposes of evaluating a filter, only elements where the condition evaluates to [.kw]#true# are included in the result, effectively ignoring the entries for which the logical expression evaluates to [.kw]#null#. For more discussion on three-valued logic, see the section on <<Missing Information>> in the Author's Guide, as well as the section on <<03-developersguide.adoc#nullological-operators,Nullological Operators>> in the Developer's guide.

[[shaping]]
=== Shaping
Expand Down Expand Up @@ -571,7 +576,7 @@ Calculated values can also be used to determine the sort:

Note that the properties that can be specified within the [.kw]#sort# clause are determined by the result type of the query. In the above example, [id]#lengthOfStay# can be referenced because it is introduced in the [.kw]#return# clause. Because the sort applies after the query results have been determined, alias references are neither required nor allowed in the sort.

If no [.kw]#sort# clause is provided, the order of the result is undefined and may vary by implementation.
If no [.kw]#sort# clause is provided, the order of the result is unprescribed and is implementation specific.

The [.kw]#sort# clause may include multiple attributes, each with their own sort order:

Expand All @@ -586,7 +591,7 @@ When the sort elements do not provide a unique ordering (i.e. there is a possibi

A query may only contain a single [.kw]#sort# clause, and it must always appear last in the query.

When the data being sorted includes [.kw]#nulls#, they are sorted first, meaning they will appear at the beginning of the list when the data is sorted ascending, and at the end of the list when the data is sorted descending.
When the data being sorted includes [.kw]#nulls#, they are considered lower than any non-null value, meaning they will appear at the beginning of the list when the data is sorted ascending, and at the end of the list when the data is sorted descending.

[[relationships]]
=== Relationships
Expand Down
63 changes: 63 additions & 0 deletions spec/10-c-referenceimplementations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,67 @@ Other CQL-related tools such as a graphical CQL grammar parsetree viewer, a Mode

https://github.com/cqframework/clinical_quality_language/wiki/Community-Projects

[[cql-to-elm-translator-and-formatter]]
=== CQL-to-ELM Translator and Formatter

* https://github.com/cqframework/clinical_quality_language: CQL-to-ELM Translator

[[javascript-execution-engine]]
=== JavaScript Execution Engine

* https://github.com/cqframework/cql-execution: Java-Script Execution Engine
* https://github.com/cqframework/cql-exec-fhir: A FHIR data source provider for the CQL Execution framework
* https://github.com/cqframework/cql-exec-vsac: A VSAC-enabled value set provider for the CQL Execution framework
* https://github.com/cqframework/cql-exec-examples: Simple examples demonstrating how to use cql-execution, cql-exec-fhir, and cql-exec-vasc

[[cql-translation-service]]
=== CQL Translation Service

* https://github.com/cqframework/cql-translation-service: RESTful service for translating CQL to ELM

[[java-execution-engine]]
=== Java Execution Engine

* https://github.com/dbcg/cql_engine

[[cql-execution-service]]
=== CQL Execution Service

* https://github.com/dbcg/cql_execution_service
* https://github.com/AHRQ-CDS/AHRQ-CDS-Connect-CQL-SERVICES: Expose CQL via Custom-API or CDS Hooks interface (built on JavaScript CQL Execution Engine)

[[atom-plugin]]
=== Atom Plugin

* https://github.com/cqframework/atom-cql-support

[[cds-connect]]
=== CDS Connect

* https://cds.ahrq.gov/: Repository of CDS including CQL-based artifacts
* https://cds.ahrq.gov/authoring/: CDS Authoring Tool capable of exporting FHIR-based CQL logic
* https://github.com/AHRQ-CDS/AHRQ-CDS-Connect-Authoring-Tool: CDS Authoring Tool Source Code

[[cql-testing]]
=== CQL Testing

* https://github.com/AHRQ-CDS/CQL-Testing-Framework

[[cql-server-side-functionality]]
=== CQL Server-side Functionality

* https://github.com/samply/blaze: A FHIR® server with internal, fast CQL Evaluation Engine
* https://github.com/dbcg/cqf-ruler: HAPI FHIR server plugin to enable CQL evaluation and Clinical Reasoning functionality
* https://github.com/PheMA/cql-on-omop: Translates CQL (ELM) to OMOP for evaluation against an OHDSI repository

[[cql-tooling]]
=== CQL Tooling

* https://github.com/cqframework/cqf-tooling: Tooling to support CQL library tooling and other handy utilities related to CQL-based FHIR content

[[formatting-and-usage]]
== Formatting and Usage

Because of the flexibility and broad applicability of CQL, it necessarily covers a breadth of topics. The Clinical Quality Framework Initiative provides recommendations and guidance to ensure consistent and appropriate use of CQL in the following wiki:

* https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/wiki/Formatting-and-Usage-Topics
10 changes: 7 additions & 3 deletions spec/cql/cql.g4
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ import fhirpath;
/*
* Parser Rules
*/

library
definition
:
libraryDefinition?
usingDefinition*
includeDefinition*
codesystemDefinition*
valuesetDefinition*
codeDefinition*
conceptDefinition*
parameterDefinition*
;

library
:
libraryDefinition?
statement*
EOF
;
Expand Down
4 changes: 2 additions & 2 deletions spec/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ link:license.html[License]

http://cql.hl7.org/history.html[Version History]

link:00-executivesummary.html[0. Executive Summary]
link:00-executivesummary.html[Executive Summary]

[[organization-of-this-specification]]
== Organization of this Specification
Expand All @@ -45,7 +45,7 @@ link:06-translationsemantics.html[Chapter 6] – Translation Semantics describes

link:07-physicalrepresentation.html[Chapter 7] – Physical Representation is reference documentation for the XML schema used to persist ELM.

link:08-a-cqlsyntax.html[Appendix A – CQL Syntax Formal Specification] discusses the ANTLR4 grammar for the Clinical Quality Language.
link:08-a-cqlsyntax.html[Appendix A] – CQL Syntax Formal Specification discusses the ANTLR4 grammar for the Clinical Quality Language.

link:09-b-cqlreference.html[Appendix B] – CQL Reference provides a complete reference for the types and operators available in CQL, and is intended to be used by authors and developers alike.

Expand Down
4 changes: 1 addition & 3 deletions spec/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This is the same test format used by the FHIRPath specification.

<a href="tests.zip">Test Source</a>.

Note that these tests have not been fully updated to the 1.4 specification.
Note that these tests have not been fully updated to the 1.5 specification.

At this point, the tests cover the following sections of the specification:

Expand All @@ -35,5 +35,3 @@ At this point, the tests cover the following sections of the specification:

The tests defined here are informative, not normative aspects of the specification. If there is a discrepancy between the behavior of a test and the specification, the specification should be considered the source of truth.
{:.note-info}


2 changes: 1 addition & 1 deletion spec/v1.5-changelog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:backend: xhtml
:toc:

== Normative Ballot Changes
== Normative/Trial-Use Ballot Changes

=== Compatible, Substantive

Expand Down