Draft dQM CMS Content Implementation Guide
2025.1.0 - CI Build
Draft dQM CMS Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2025.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/dqm-content-cms-2025/ and changes regularly. See the Directory of published versions
| Draft as of 2026-09-19 |
{
"resourceType" : "Library",
"id" : "NHSNHelpers",
"text" : {
"status" : "extensions",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <table class=\"narrative-table\">\n <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"metadata\"> </a>Metadata</th>\n\n\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">1.1.000</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Status</th>\n\n\n\n<td class=\"content-container\">Draft</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n\n<td class=\"content-container\">\n <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-library-type.html\">http://terminology.hl7.org/CodeSystem/library-type</a>#logic-library\n\n\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"parameters\"> </a>Parameters</th>\n\n\n</tr>\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n\n\n<td class=\"content-container\">None</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n \n \n <tr>\n <th scope=\"row\" class=\"row-header\">CQL Content</th>\n <td>\n <a name=\"cql-content\"> </a>\n <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\nNOTE: For use by March 2026 US Realm Connectathon participants for internal use only. Not for use or distribution in commercial products.\n*/\nlibrary NHSNHelpers version '1.1.000'\n\nusing FHIR version '4.0.1'\n\ninclude hl7.fhir.uv.cql.FHIRHelpers version '4.0.1' called FHIRHelpers\n\ncontext Patient\n\n/* NOTE: Available in FHIRCommon already\ndefine function "Normalize Interval"(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):\n case\n\t when choice is FHIR.dateTime then\n \tInterval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]\n\t\twhen choice is FHIR.Period then\n \t\tFHIRHelpers.ToInterval(choice as FHIR.Period)\n\t\twhen choice is FHIR.instant then\n\t\t\tInterval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]\n\t\twhen choice is FHIR.Age then\n\t\t Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),\n\t\t\t FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)\n\t\twhen choice is FHIR.Range then\n\t\t Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),\n\t\t\t FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)\n\t\twhen choice is FHIR.Timing then\n\t\t Message(null as Interval<DateTime>, true, '1', 'Error', 'Cannot compute a single interval from a Timing type')\n when choice is FHIR.string then\n Message(null as Interval<DateTime>, true, '1', 'Error', 'Cannot compute an interval from a String value')\n\t\telse\n\t\t\tnull as Interval<DateTime>\n\tend\n \ndefine function "ToDateInterval"(period FHIR.Period):\n Interval[date from period.start, date from period.end]\n*/\n\n/* NOTE: Moved to USQualityCoreCommon\ndefine function "GetLocation"(reference Reference ):\nsingleton from ([Location] Locations\nwhere Locations.id = GetId(reference.reference)\n)\n\ndefine function "GetId"(uri String ):\nLast(Split(uri, '/'))\n*/</code></pre>\n </td>\n </tr>\n \n \n\n\n\n<tr>\n <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.6 of the sample-content-ig Liquid templates</th>\n</tr>\n\n </tbody>\n </table>\n</div>"
},
"extension" : [
{
"url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem",
"valueReference" : {
"reference" : "Device/cqf-tooling"
}
}
],
"url" : "https://madie.cms.gov/Library/NHSNHelpers",
"version" : "1.1.000",
"name" : "NHSNHelpers",
"status" : "draft",
"type" : {
"coding" : [
{
"system" : "http://terminology.hl7.org/CodeSystem/library-type",
"code" : "logic-library"
}
]
},
"date" : "2026-09-19T16:31:14+00:00",
"content" : [
{
"contentType" : "text/cql",
"data" : "LyoKTk9URTogRm9yIHVzZSBieSBNYXJjaCAyMDI2IFVTIFJlYWxtIENvbm5lY3RhdGhvbiBwYXJ0aWNpcGFudHMgZm9yIGludGVybmFsIHVzZSBvbmx5LiBOb3QgZm9yIHVzZSBvciBkaXN0cmlidXRpb24gaW4gY29tbWVyY2lhbCBwcm9kdWN0cy4KKi8KbGlicmFyeSBOSFNOSGVscGVycyB2ZXJzaW9uICcxLjEuMDAwJwoKdXNpbmcgRkhJUiB2ZXJzaW9uICc0LjAuMScKCmluY2x1ZGUgaGw3LmZoaXIudXYuY3FsLkZISVJIZWxwZXJzIHZlcnNpb24gJzQuMC4xJyBjYWxsZWQgRkhJUkhlbHBlcnMKCmNvbnRleHQgUGF0aWVudAoKLyogTk9URTogQXZhaWxhYmxlIGluIEZISVJDb21tb24gYWxyZWFkeQpkZWZpbmUgZnVuY3Rpb24gIk5vcm1hbGl6ZSBJbnRlcnZhbC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