dQM QICore Content Implementation Guide
2025.0.0 - CI Build

dQM 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/dqm-content-qicore-2025/ and changes regularly. See the Directory of published versions

Library: Antibiotic

Official URL: https://madie.cms.gov/Library/Antibiotic Version: 1.11.000
Active as of 2025-07-25 Responsible: National Committee for Quality Assurance Computable Name: Antibiotic
Other Identifiers: https://madie.cms.gov/login#682e298d83d89c53880d2fcb (use: official, )

This library contains functions used to exclude patients with a history of comorbid conditions, competing diagnoses, or antibiotic medications.

Metadata
Title Antibiotic
Version 1.11.000
Identifier 682e298d83d89c53880d2fcb
Steward (Publisher) National Committee for Quality Assurance
Description This library contains functions used to exclude patients with a history of comorbid conditions, competing diagnoses, or antibiotic medications.
Type [http://terminology.hl7.org/CodeSystem/library-type#logic-library]
Library Content
CQL Content
library Antibiotic version '1.11.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 "Measurement Period" Interval<DateTime>

context Patient

define function "Encounter with Comorbid Condition History"(episodes List<Encounter>, comorbidConditions List<ConditionEncounterDiagnosis>):
  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 "Encounter with Competing Diagnosis History"(episodes List<Encounter>, competingConditions List<ConditionEncounterDiagnosis>):
  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 "Encounter with Antibiotic Medication History"(episodes List<Encounter>, antibioticMedications List<MedicationRequest>):
   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]
Generated using version 0.4.8 of the sample-content-ig Liquid templates