CDC National Healthcare Safety Network (NHSN) Digital Quality Measures (dQM) Content Package IG
3.0.0 - Release 3 - draft United States of America flag

CDC National Healthcare Safety Network (NHSN) Digital Quality Measures (dQM) Content Package IG - Local Development build (v3.0.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

: NHSN Helpers - XML Representation

Page standards status: Trial-use Maturity Level: 2

Raw xml | Download


<Library xmlns="http://hl7.org/fhir">
  <id value="NHSNHelpers"/>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
  <table class="narrative-table">
    <tbody>
<tr>


<th colspan="2" scope="row" class="row-header">Metadata</th>


</tr>



<tr>


<th scope="row" class="row-header">Version</th>



<td class="content-container">3.0.0</td>


</tr>












<tr>


<th scope="row" class="row-header">Status</th>



<td class="content-container">Draft</td>


</tr>






<tr>


<th scope="row" class="row-header">Jurisdiction</th>



<td class="content-container">
    US from <a href="https://en.wikipedia.org/wiki/ISO_3166-2">urn:iso:std:iso:3166</a> 


</td>


</tr>








<tr>


<th scope="row" class="row-header">Steward (Publisher)</th>



<td class="content-container">CDC National Healthcare Safety Network (NHSN)</td>


</tr>



<tr>


<th scope="row" class="row-header">Steward Contact</th>



<td class="content-container">CDC National Healthcare Safety Network (NHSN)</td>


</tr>












<tr>


<th scope="row" class="row-header">Type</th>



<td class="content-container">
    logic-library from <a href="http://terminology.hl7.org/7.1.0/CodeSystem-library-type.html">http://terminology.hl7.org/CodeSystem/library-type</a> 


</td>


</tr>



<tr>
  
  
  
  
  

<th scope="row" class="row-header">Dependency</th>


  
  
  <td class="content-container">
    
    <em>Description</em>: Library FHIRHelpers
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2</code>
    <br/>
    <em>Canonical URL</em>: <tt>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2</tt>
    
    
    
  </td>
</tr>








<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Patient
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/patient.html">Patient</a>
    <br/>        
  
   
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Location
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/location.html">Location</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: id
    <br/>
   
   
  </td>
</tr>

<tr>


<th colspan="2" scope="row" class="row-header"><a name="parameters"> </a>Parameters</th>


</tr>

<tr>
  

<th scope="row" class="row-header"/>


  <td class="content-container">
    <table>
      <thead>
        <tr>
          <td><em>Name</em></td>
          <td><em>Use</em></td>
          <td><em>Card.</em></td>
          <td><em>Type</em></td>
          <td><em>Documentation</em></td>
        </tr>
      </thead>
      <tbody>
      
        <tr>
          <td>Patient</td>
          <td>Out</td>
          <td>0..1</td>
          <td>Patient</td>
          <td/>
        </tr>
      
      </tbody>
    </table>
  </td>
</tr>








  <tr>


<th colspan="2" scope="row" class="row-header">Library Content</th>


</tr>
  
    
    <tr>
      <th scope="row" class="row-header">CQL Content</th>
      <td>
        <a name="cql-content"> </a>
        <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">library NHSNHelpers version '0.0.002'

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.2'

context Patient

define function &quot;Normalize Interval&quot;(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt;):
  case
	  when choice is FHIR.dateTime then
    	Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]
		when choice is FHIR.Period then
  		FHIRHelpers.ToInterval(choice as FHIR.Period)
		when choice is FHIR.instant then
			Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]
		when choice is FHIR.Age then
		  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),
			  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)
		when choice is FHIR.Range then
		  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),
			  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)
		when choice is FHIR.Timing then
		  Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute a single interval from a Timing type')
    when choice is FHIR.string then
      Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute an interval from a String value')
		else
			null as Interval&lt;DateTime&gt;
	end

define function &quot;ToDateInterval&quot;(period FHIR.Period):
  Interval[date from period.start, date from period.end]

define function &quot;GetLocation&quot;(reference Reference ):
  singleton from (
	[Location] Locations
		where Locations.id = GetId(reference.reference)
  )

define function &quot;GetId&quot;(uri String ):
  Last(Split(uri, '/'))</code></pre>
      </td>
    </tr>
    
  

<tr>
  <th colspan="2" scope="row" class="row-header">Generated using version 0.5.6-cibuild of the sample-content-ig Liquid templates</th>
</tr>

    </tbody>
  </table>
</div>
  </text>
  <contained>
    <Parameters>
      <id value="options"/>
      <parameter>
        <name value="translatorVersion"/>
        <valueString value="3.27.0"/>
      </parameter>
      <parameter>
        <name value="option"/>
        <valueString value="EnableDateRangeOptimization"/>
      </parameter>
      <parameter>
        <name value="option"/>
        <valueString value="EnableAnnotations"/>
      </parameter>
      <parameter>
        <name value="option"/>
        <valueString value="EnableLocators"/>
      </parameter>
      <parameter>
        <name value="option"/>
        <valueString value="DisableListDemotion"/>
      </parameter>
      <parameter>
        <name value="option"/>
        <valueString value="DisableListPromotion"/>
      </parameter>
      <parameter>
        <name value="analyzeDataRequirements"/>
        <valueBoolean value="false"/>
      </parameter>
      <parameter>
        <name value="collapseDataRequirements"/>
        <valueBoolean value="true"/>
      </parameter>
      <parameter>
        <name value="compatibilityLevel"/>
        <valueString value="1.5"/>
      </parameter>
      <parameter>
        <name value="enableCqlOnly"/>
        <valueBoolean value="false"/>
      </parameter>
      <parameter>
        <name value="errorLevel"/>
        <valueString value="Info"/>
      </parameter>
      <parameter>
        <name value="signatureLevel"/>
        <valueString value="Overloads"/>
      </parameter>
      <parameter>
        <name value="validateUnits"/>
        <valueBoolean value="true"/>
      </parameter>
      <parameter>
        <name value="verifyOnly"/>
        <valueBoolean value="false"/>
      </parameter>
    </Parameters>
  </contained>
  <extension url="http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions">
    <valueReference>
      <reference value="#options"/>
    </valueReference>
  </extension>
  <url value="http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNHelpers"/>
  <version value="3.0.0"/>
  <name value="NHSNHelpers"/>
  <status value="draft"/>
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
      <code value="logic-library"/>
    </coding>
  </type>
  <date value="2026-08-14T18:33:45+00:00"/>
  <publisher value="CDC National Healthcare Safety Network (NHSN)"/>
  <contact>
    <name value="CDC National Healthcare Safety Network (NHSN)"/>
    <telecom>
      <system value="url"/>
      <value value="http://www.cdc.gov/nhsn"/>
    </telecom>
    <telecom>
      <system value="email"/>
      <value value="nhsn@cdc.gov"/>
    </telecom>
  </contact>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="US"/>
    </coding>
  </jurisdiction>
  <relatedArtifact>
    <type value="depends-on"/>
    <display value="Library FHIRHelpers"/>
    <resource
              value="http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2"/>
  </relatedArtifact>
  <parameter>
    <name value="Patient"/>
    <use value="out"/>
    <min value="0"/>
    <max value="1"/>
    <type value="Patient"/>
  </parameter>
  <dataRequirement>
    <type value="Patient"/>
    <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
  </dataRequirement>
  <dataRequirement>
    <type value="Location"/>
    <profile value="http://hl7.org/fhir/StructureDefinition/Location"/>
    <mustSupport value="id"/>
  </dataRequirement>
  <content>
    <contentType value="text/cql"/>
    <data
          value="bGlicmFyeSBOSFNOSGVscGVycyB2ZXJzaW9uICcwLjAuMDAyJwoKdXNpbmcgRkhJUiB2ZXJzaW9uICc0LjAuMScKCmluY2x1ZGUgRkhJUkhlbHBlcnMgdmVyc2lvbiAnNC4wLjInCgpjb250ZXh0IFBhdGllbnQKCmRlZmluZSBmdW5jdGlvbiAiTm9ybWFsaXplIEludGVydmFsIihjaG9pY2UgQ2hvaWNlPEZISVIuZGF0ZVRpbWUsIEZISVIuUGVyaW9kLCBGSElSLlRpbWluZywgRkhJUi5pbnN0YW50LCBGSElSLnN0cmluZywgRkhJUi5BZ2UsIEZISVIuUmFuZ2U+KToKICBjYXNlCgkgIHdoZW4gY2hvaWNlIGlzIEZISVIuZGF0ZVRpbWUgdGhlbgogICAgCUludGVydmFsW0ZISVJIZWxwZXJzLlRvRGF0ZVRpbWUoY2hvaWNlIGFzIEZISVIuZGF0ZVRpbWUpLCBGSElSSGVscGVycy5Ub0RhdGVUaW1lKGNob2ljZSBhcyBGSElSLmRhdGVUaW1lKV0KCQl3aGVuIGNob2ljZSBpcyBGSElSLlBlcmlvZCB0aGVuCiAgCQlGSElSSGVscGVycy5Ub0ludGVydmFsKGNob2ljZSBhcyBGSElSLlBlcmlvZCkKCQl3aGVuIGNob2ljZSBpcyBGSElSLmluc3RhbnQgdGhlbgoJCQlJbnRlcnZhbFtGSElSSGVscGVycy5Ub0RhdGVUaW1lKGNob2ljZSBhcyBGSElSLmluc3RhbnQpLCBGSElSSGVscGVycy5Ub0RhdGVUaW1lKGNob2ljZSBhcyBGSElSLmluc3RhbnQpXQoJCXdoZW4gY2hvaWNlIGlzIEZISVIuQWdlIHRoZW4KCQkgIEludGVydmFsW0ZISVJIZWxwZXJzLlRvRGF0ZShQYXRp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