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

: Antibiotic - XML Representation

Active as of 2025-07-25

Raw xml | Download


<Library xmlns="http://hl7.org/fhir">
  <id value="Antibiotic"/>
  <meta>
    <profile
             value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary"/>
    <profile
             value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablelibrary"/>
    <profile
             value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary"/>
    <profile
             value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-executablelibrary"/>
    <profile
             value="http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library"/>
    <profile
             value="http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library"/>
    <profile
             value="http://hl7.org/fhir/uv/cql/StructureDefinition/elm-xml-library"/>
  </meta>
  <language value="en"/>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <table class="narrative-table">
    <tbody>
<tr>


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


</tr>

<tr>


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



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


</tr>





<tr>


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



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


</tr>



























<tr>


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



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


</tr>

<tr>


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



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


</tr>








<tr>


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



<td class="content-container">National Committee for Quality Assurance</td>


</tr>







<tr>


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



<td class="content-container"><div><p>This library contains functions used to exclude patients with a history of comorbid conditions, competing diagnoses, or antibiotic medications.</p>
</div></td>


</tr>









<tr>


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



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


</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">Parameter</th>



<td class="content-container">None</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">/*
NOTE: For use by March 2026 US Realm Connectathon participants for internal use only. Not for use or distribution in commercial products.
*/
library Antibiotic version '2.1.000'

using USQualityCore version '0.1.0-cibuild'
using USCore version '6.1.0-derived'
using FHIR version '4.0.1'

include hl7.fhir.uv.cql.FHIRHelpers version '4.0.1' called FHIRHelpers
include hl7.fhir.uv.cql.FHIRCommon version '2.0.0' called FHIRCommon
include hl7.fhir.us.cql.CumulativeMedicationDuration version '2.0.0-ballot' called CMD
include hl7.fhir.us.cql.USCoreCommon version '2.0.0-ballot' called USCoreCommon
include hl7.fhir.us.cql.USCoreElements version '2.0.0-ballot' called USCoreElements

include USQualityCoreCommon version '0.1.0-cibuild' called USQualityCoreCommon

parameter &quot;Measurement Period&quot; Interval&lt;DateTime&gt;
  default Interval[@2026-01-01T00:00:00.000Z, @2027-01-01T00:00:00.000Z)

context Patient

define function &quot;Encounter with Comorbid Condition History&quot;(episodes List&lt;Encounter&gt;, comorbidConditions List&lt;Condition&gt;):
  episodes episode
      with comorbidConditions comcondition
        such that date from start of comcondition.prevalenceInterval() during Interval[date from start of episode.period - 1 year, date from start of episode.period]
      return episode

define function &quot;Encounter with Competing Diagnosis History&quot;(episodes List&lt;Encounter&gt;, competingConditions List&lt;Condition&gt;):
  episodes episode
      with competingConditions competcondition
        such that competcondition.prevalenceInterval() starts 3 days or less on or after day of start of episode.period
      return episode

define function &quot;Encounter with Antibiotic Medication History&quot;(episodes List&lt;Encounter&gt;, antibioticMedications List&lt;MedicationRequest&gt;):
   episodes episode
    with antibioticMedications ActiveMedication
      such that ActiveMedication.medicationRequestPeriod() overlaps day of Interval[date from start of episode.period  - 30 days, date from start of episode.period - 1 day]</code></pre>
      </td>
    </tr>
    
  



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

    </tbody>
  </table>
</div>
  </text>
  <extension
             url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-softwaresystem">
    <valueReference>
      <reference value="Device/cqf-tooling"/>
    </valueReference>
  </extension>
  <url value="https://madie.cms.gov/Library/Antibiotic"/>
  <version value="2.1.000"/>
  <name value="Antibiotic"/>
  <title value="Antibiotic"/>
  <status value="active"/>
  <experimental value="false"/>
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
      <code value="logic-library"/>
    </coding>
  </type>
  <date value="2025-07-25T21:04:34+00:00"/>
  <publisher value="National Committee for Quality Assurance"/>
  <description
               value="This library contains functions used to exclude patients with a history of comorbid conditions, competing diagnoses, or antibiotic medications."/>
  <topic>
    <text value="FHIR"/>
  </topic>
  <topic>
    <text value="CQL"/>
  </topic>
  <content>
    <contentType value="text/cql"/>
    <data
          value="LyoKTk9URTogRm9yIHVzZSBieSBNYXJjaCAyMDI2IFVTIFJlYWxtIENvbm5lY3RhdGhvbiBwYXJ0aWNpcGFudHMgZm9yIGludGVybmFsIHVzZSBvbmx5LiBOb3QgZm9yIHVzZSBvciBkaXN0cmlidXRpb24gaW4gY29tbWVyY2lhbCBwcm9kdWN0cy4KKi8KbGlicmFyeSBBbnRpYmlvdGljIHZlcnNpb24gJzIuMS4wMDAnCgp1c2luZyBVU1F1YWxpdHlDb3JlIHZlcnNpb24gJzAuMS4wLWNpYnVpbGQnCnVzaW5nIFVTQ29yZSB2ZXJzaW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