eCQM QICore Content Implementation Guide
2025.0.0 - CI Build

eCQM QICore Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2025.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/ecqm-content-qicore-2025/ and changes regularly. See the Directory of published versions

: Antibiotic - XML Representation

Active as of 2025-04-15

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">
    <table class="grid dict">
        
        
        <tr>
            <th scope="row"><b>Title: </b></th>
            <td style="padding-left: 4px;">Antibiotic</td>
        </tr>
        

        
        
        <tr>
            <th scope="row"><b>Id: </b></th>
            <td style="padding-left: 4px;">Antibiotic</td>
        </tr>
        

        
        
        <tr>
            <th scope="row"><b>Version: </b></th>
            <td style="padding-left: 4px;">1.9.000</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Url: </b></th>
            <td style="padding-left: 4px;">https://madie.cms.gov/Library/Antibiotic</td>
        </tr>
        

        
        <tr>
            <th scope="row">
                <b>
                    
                        official
                    
                </b>
            </th>
            <td style="padding-left: 4px;">
                
                <p style="margin-bottom: 5px;">
                    <span>67fd69295291b0360f7fbac8</span>
                </p>
                
            </td>
        </tr>
        

        

        

        

        
        <tr>
            <th scope="row"><b>Type: </b></th>
            <td style="padding-left: 4px;">
                
                    
                        
                        <p style="margin-bottom: 5px;">
                            <b>system: </b> <span>http://terminology.hl7.org/CodeSystem/library-type</span>
                        </p>
                        
                        
                        <p style="margin-bottom: 5px;">
                            <b>code: </b> <span>logic-library</span>
                        </p>
                        
                        
                    
                
                
            </td>
        </tr>
        

        

        
        <tr>
            <th scope="row"><b>Date: </b></th>
            <td style="padding-left: 4px;">2025-04-15T20:44:04+00:00</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Publisher: </b></th>
            <td style="padding-left: 4px;">National Committee for Quality Assurance</td>
        </tr>
        

        
        <tr>
            <th scope="row"><b>Description: </b></th>
            <td style="padding-left: 4px;">This library contains functions used to exclude patients with a history of comorbid conditions, competing diagnoses, or antibiotic medications.</td>
        </tr>
        

        

        

        

        

        

        

        

        

        

        

        
        <tr>
            <th scope="row"><b>Related Artifacts: </b></th>
            <td style="padding-left: 4px;">
                
                
                
                <p><b>Dependencies</b></p>
                <ul>
                  
                    <li>https://madie.cms.gov/Library/QICoreCommon|4.0.000</li>
                  
                    <li>https://madie.cms.gov/Library/FHIRHelpers|4.4.000</li>
                  
                    <li>https://madie.cms.gov/Library/CumulativeMedicationDuration|6.0.000</li>
                  
                </ul>
                
                
                
                
                
            </td>
        </tr>
        

        

        

        
        
        <tr>
          <td colspan="2">
            <table>
              <tr><th><a id="cql-content"><b>Content: </b></a> text/cql</th></tr>
              <tr><td><pre><code class="language-cql">library Antibiotic version '1.9.000'

using QICore version '6.0.0'

include FHIRHelpers version '4.4.000' called FHIRHelpers
include QICoreCommon version '4.0.000' called QICoreCommon
include CumulativeMedicationDuration version '6.0.000' called CMD

parameter &quot;Measurement Period&quot; Interval&lt;DateTime&gt;

context Patient

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

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

define function &quot;Has Antibiotic Medication History&quot;(episodeDate List&lt;Encounter&gt;, antibioticMedications List&lt;MedicationRequest&gt;):
   episodeDate DateOfEpisode
    with antibioticMedications ActiveMedication
      such that ActiveMedication.medicationRequestPeriod() overlaps day of Interval[date from start of DateOfEpisode.period.toInterval()  - 30 days, date from start of DateOfEpisode.period.toInterval() - 1 day]</code></pre></td></tr>
            </table>
          </td>
        </tr>
        
        
        
    </table>
</div>
  </text>
  <contained>
    <Parameters>
      <id value="options"/>
      <parameter>
        <name value="translatorVersion"/>
        <valueString value="3.25.0"/>
      </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="format"/>
        <valueString value="JSON"/>
      </parameter>
      <parameter>
        <name value="format"/>
        <valueString value="XML"/>
      </parameter>
      <parameter>
        <name value="analyzeDataRequirements"/>
        <valueBoolean value="false"/>
      </parameter>
      <parameter>
        <name value="collapseDataRequirements"/>
        <valueBoolean value="false"/>
      </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="https://madie.cms.gov/Library/Antibiotic"/>
  <identifier>
    <use value="official"/>
    <system value="https://madie.cms.gov/login"/>
    <value value="67fd69295291b0360f7fbac8"/>
  </identifier>
  <version value="1.9.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-04-15T20:44:04+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."/>
  <content>
    <contentType value="text/cql"/>
    <data
          value="bGlicmFyeSBBbnRpYmlvdGljIHZlcnNpb24gJzEuOS4wMDAnCgp1c2luZyBRSUNvcmUgdmVyc2lvbiAnNi4wLjAnCgppbmNsdWRlIEZISVJIZWxwZXJzIHZlcnNpb24gJzQuNC4wMDAnIGNhbGxlZCBGSElSSGVscGVycwppbmNsdWRlIFFJQ29yZUNvbW1vbiB2ZXJzaW9uICc0LjAuMDAwJyBjYWxsZWQgUUlDb3JlQ29tbW9uCmluY2x1ZGUgQ3VtdWxhdGl2ZU1lZGljYXRpb25EdXJhdGlvbiB2ZXJzaW9uICc2LjAuMDAwJyBjYWxsZWQgQ01ECgpwYXJhbWV0ZXIgIk1lYXN1cmVtZW50IFBlcmlvZCIgSW50ZXJ2YWw8RGF0ZVRpbWU+Cgpjb250ZXh0IFBhdGllbnQKCmRlZmluZSBmdW5jdGlvbiAiSGFzIENvbW9yYmlkIENvbmRpdGlvbiBIaXN0b3J5IihlcGlzb2RlRGF0ZSBMaXN0PE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