Hl7.Cql.Iso8601 2.19.0

dotnet add package Hl7.Cql.Iso8601 --version 2.19.0
                    
NuGet\Install-Package Hl7.Cql.Iso8601 -Version 2.19.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hl7.Cql.Iso8601" Version="2.19.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Hl7.Cql.Iso8601" Version="2.19.0" />
                    
Directory.Packages.props
<PackageReference Include="Hl7.Cql.Iso8601" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Hl7.Cql.Iso8601 --version 2.19.0
                    
#r "nuget: Hl7.Cql.Iso8601, 2.19.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Hl7.Cql.Iso8601@2.19.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Hl7.Cql.Iso8601&version=2.19.0
                    
Install as a Cake Addin
#tool nuget:?package=Hl7.Cql.Iso8601&version=2.19.0
                    
Install as a Cake Tool

Build Status

Introduction

This is NCQA's and Firely's official support SDK for working with CQL on the Microsoft .NET (dotnet) platform. It contains an engine for executing ELM, and/or turning the contents of an ELM file into a .NET assembly so it can be called statically.

The engine has been tested by running it against the current NCQA HEDIS measures and CMS measures. There is quite some variation in how CQL is written and interpreted, so it is likely at this early stage that there will be deviations from other engines currently available.

Target Frameworks

The SDK targets .NET 10 (LTS), for the performance of its runtime and BCL (especially in LINQ, which CQL relies on heavily). All SDK packages (Hl7.Cql.*) ship a single net10.0 asset.

Applications running on a later .NET version can consume that asset as usual; applications on .NET 8 or earlier cannot, and must upgrade.

Release Notes

This is release version 2.19.0 of the engine.

The release notes at firely-cql-sdk/releases for each major version document changes and known issues.

Versioning

This SDK uses EffVer (Intended Effort Versioning), not Semantic Versioning. Version numbers tell you how much work an upgrade will cost, not what kind of change it contains:

MACRO.MESO.MICRO What it means for you
MACRO A new engine generation, or an upgrade needing significant time — the release notes say which.
MESO Some small effort may be required — check the release notes' migration steps.
MICRO Nothing to do; upgrade the package reference.

Notably, a MESO bump can carry a change that SemVer would call a patch — a corrected calculation whose results move, or a code-generator change requiring you to regenerate *.g.cs. Conversely, API additions on their own never raise the digit, since they cost existing consumers nothing; a release that adds API may still be MESO for some other reason.

Pre-release packages keep standard SemVer 2.0 suffixes — 2.15.0-alpha.1, -beta.1, -rc.1 — so NuGet orders them below the final release and will not install them unless you ask for them explicitly (--prerelease).

Full rules, including where this deviates from EffVer as published: docs/versioning.md.

1.x releases are maintained with hotfixes only and do not receive new features.

Getting Started

Quick Start: Invoking CQL

The recommended way to execute CQL from .NET is through the Invocation Toolkit (Hl7.Cql.Invocation). It handles compiling CQL through ELM to .NET assemblies and exposes a clean API for invoking definitions. Never call generated library classes directly — doing so bypasses caching, version checking, and context management.

using Hl7.Cql.CqlToElm.Toolkit;
using Hl7.Cql.CqlToElm.Toolkit.Extensions;
using Hl7.Cql.Fhir;
using Hl7.Cql.Invocation.Toolkit.Extensions;
using Microsoft.Extensions.Logging;

var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());

// Define inline CQL (or load from files/FHIR resources)
var cql = (CqlLibraryString)"""
    library HelloWorldLib version '1.0.0'
    define "HelloWorld" : 'Hello from CQL!'
    """;

// Compile and create an invoker
using var invoker = new CqlToolkit(loggerFactory)
    .AddCqlLibraries(cql)
    .CreateLibrarySetInvoker();

// Execute a CQL definition
var context = FhirCqlContext.WithDataSource();
var result = invoker.InvokeLibraryDefinition(context, cql.LibraryIdentifier, "HelloWorld");
Console.WriteLine(result); // Hello from CQL!

See the Examples project for more complete samples including parameters, function arguments, FHIR resource loading, and caching.

SDK Packages

This SDK consists of the following packages:

Core Packages

  • Hl7.Cql: The main package providing complete CQL engine functionality
  • Hl7.Cql.Abstractions: Core interfaces and abstractions used throughout the SDK
  • Hl7.Cql.Runtime: Runtime execution engine for CQL expressions
  • Hl7.Cql.Compiler: ELM to .NET compilation
  • Hl7.Cql.Invocation: High-level APIs for invoking CQL libraries and expressions. This is the recommended entry point for applications that need to execute CQL — it manages assembly loading, version checking, context lifecycle, and result enumeration. Always use this package instead of calling generated library classes directly.

Integration & Data Packages

  • Hl7.Cql.Firely: FHIR integration layer
  • Hl7.Cql.Model: Model definitions and metadata
  • Hl7.Cql.Packaging: CQL packaging functionality

Conversion & Code Generation

  • Hl7.Cql.CqlToElm: CQL to ELM conversion (early development, not production-ready)
  • CodeGeneration.NET: .NET code generation utilities
  • Elm: ELM abstractions and utilities

Support Packages

  • Hl7.Cql.Grammar: CQL grammar definitions using ANTLR4
  • Iso8601: ISO 8601 date/time handling

Tools

  • PackagerCLI (cql-package): Command-line tool for packaging CQL/ELM into FHIR resources and .NET assemblies

External Dependencies

Every external package this SDK depends on, and the exact version it is pinned to, is listed in one place: Directory.Packages.props in the repository root. Consult that file rather than this README — it is what the build actually uses, so it cannot be out of date.

The dependency most likely to matter to you is the Firely .NET SDK (Hl7.Fhir.Base and Hl7.Fhir.R4), since a host that references it directly needs a version at or above the one we pin. It is held in the FirelyNetVersion property at the top of that file.

Pre-release NuGet Packages

During development, pre-releases will appear on Firely's GitHub Package feed. To use these packages you must add https://nuget.pkg.github.com/FirelyTeam/index.json to your NuGet sources:

  • Get a Personal Access token (PAT) from github.com with scope read:packages

  • Next open a console on your machine and run dotnet nuget add source --name github --username <USERNAME> --password <PAT> https://nuget.pkg.github.com/FirelyTeam/index.json

USERNAME: your username on GitHub PAT: your Personal access token with at least the scope read:packages

Further information can be found in docs/getting-started.md.

Testing

Running the tests

Test Categories:

  • Unit tests: CoreTests and CqlToElmTests
  • Integration tests: IntegrationRunner and Hedis2025.GoldenTests (both in the Firely.Cql.Sdk.Integration.Runner submodule)
  • Excluded: XsdToCSharpConverterTests (internal tooling)
# Unit tests
dotnet test Cql/CoreTests/CoreTests.csproj -c Debug
dotnet test Cql/CqlToElmTests/CqlToElmTests.csproj -c Debug

CI/CD Testing: Testing is fully integrated into the Azure Pipelines CI/CD workflow. A single Build stage compiles the solution once, then the Test stage runs three jobs in parallel against the build artifacts:

  • TestNet10: CoreTests and CqlToElmTests
  • TestIntegrationNet10: IntegrationRunner
  • TestHedisNet10: Hedis2025.GoldenTests

See build/README.md for complete CI/CD testing documentation and configuration details.

Support

We actively monitor the issues coming in through the GitHub repository at https://github.com/FirelyTeam/firely-cql-sdk/issues. You are welcome to register your bugs and feature suggestions there. For questions and broader discussions, we use the .NET FHIR Implementers chat and CQL chat on Zulip.

Contributing

We are welcoming contributions!

If you want to participate in this project, we're using Git Flow for our branch management. Please submit PRs with changes against the develop branch.

Current 2.x development is done against the develop branch, while hotfixes are done under the support/1.x branch. Please refer to our Git Branching and Workflow Guidelines on the wiki for detailed guidelines on git branching and naming conventions.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Hl7.Cql.Iso8601:

Package Downloads
HL7.Cql.Abstractions

Support package for Hl7.Cql. Contains shared interfaces and abstractions for CQL.

Hl7.Cql.CqlToElm

Support package for Hl7.Cql. Unit conversion for CQL. Contains functionality to convert CQL to ELM.

Hl7.Cql

A platform for evaluating logic in the HL7 CQL language.

Hl7.Cql.Primitives

Support package for Hl7.Cql. Contains .NET types that model the System namespace in CQL.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.19.0 0 11/24/2026
2.18.0 2,002 10/23/2026
2.17.0 1,004 10/20/2026
2.16.0 702 10/1/2026
2.15.0 1,170 9/22/2026
2.14.0 3,018 8/20/2026
2.13.0 1,366 8/13/2026
2.12.0 385 8/5/2026
2.11.0 418 7/30/2026
2.10.0 524 7/21/2026
2.9.2 1,042 7/8/2026
2.9.1 359 7/7/2026
2.9.0 2,214 6/12/2026
2.8.2 524 6/10/2026
2.8.1 382 6/4/2026
2.8.0 5,659 6/3/2026
2.7.0 679 5/21/2026
2.6.0 4,865 3/17/2026
2.5.0 651 2/20/2026
2.4.0 4,022 1/15/2026
Loading failed