dQM QICore Content Implementation Guide
2026.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 2026.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-2026/ and changes regularly. See the Directory of published versions

Library: Breast Cancer Screening DQM Draft

Official URL: https://madie.cms.gov/Library/BreastCancerScreeningDQMDraft Version: 2026.0.0
Standards status: Informative Maturity Level: 1 Computable Name: BreastCancerScreeningDQMDraft

BreastCancerScreeningDQMDraft logic.

Metadata
Title Breast Cancer Screening DQM Draft
Version 2026.0.0
Topic FHIR
Topic CQL
Description

BreastCancerScreeningDQMDraft logic.

Type http://terminology.hl7.org/CodeSystem/library-type#logic-library
Data Requirement Type: Condition
Profile(s): Condition
Code Filter(s):
Path: code
ValueSet: Status Post Right Mastectomy
Data Requirement Type: Procedure
Profile(s): QICore Procedure
Code Filter(s):
Path: code
ValueSet: Unilateral Mastectomy Right
Data Requirement Type: Condition
Profile(s): Condition
Code Filter(s):
Path: code
ValueSet: Status Post Left Mastectomy
Data Requirement Type: Procedure
Profile(s): QICore Procedure
Code Filter(s):
Path: code
ValueSet: Unilateral Mastectomy Left
Data Requirement Type: Procedure
Profile(s): QICore Procedure
Code Filter(s):
Path: code
ValueSet: Unilateral Mastectomy
Data Requirement Type: Condition
Profile(s): Condition
Code Filter(s):
Path: code
ValueSet: History of bilateral mastectomy
Data Requirement Type: Procedure
Profile(s): QICore Procedure
Code Filter(s):
Path: code
ValueSet: Bilateral Mastectomy
Data Requirement Type: Observation
Profile(s): QICore Observation Clinical Result
Code Filter(s):
Path: code
ValueSet: Mammography
Data Requirement Type: Claim
Profile(s): QICore Claim
Data Requirement Type: ExplanationOfBenefit
Profile(s): ExplanationOfBenefit
Parameters
Name Use Card. Type Documentation
Measurement Period In 0..1 Period
Patient Out 0..1 Resource
Initial Population Out 0..1 boolean
Denominator Out 0..1 boolean
Is deceased during measurement period Out 0..1 boolean
Right Mastectomy Diagnosis Out 0..* Condition
Right Mastectomy Procedure Out 0..* Procedure
Left Mastectomy Diagnosis Out 0..* Condition
Left Mastectomy Procedure Out 0..* Procedure
Bilateral Mastectomy Diagnosis Out 0..* Condition
Bilateral Mastectomy Procedure Out 0..* Procedure
Denominator Exclusions Out 0..1 boolean
October 1 Two Years Prior to the Measurement Period Out 0..1 dateTime
Mammography Observation Out 0..* Resource
Mammography Claim Out 0..* Claim
Mammography EOB Out 0..* ExplanationOfBenefit
Numerator Out 0..1 boolean
SDE Ethnicity Out 0..1 Resource
SDE Payer Out 0..* Resource
SDE Race Out 0..1 Resource
SDE Sex Out 0..1 Coding
Stratification 1 Out 0..1 boolean
Stratification 2 Out 0..1 boolean
Library Content
CQL Content
/*
NOTE: For use by January 2026 Connectathon participants for internal use only. Not for use or distribution in commercial products.
*/
library BreastCancerScreeningDQMDraft version '1.0.000'

using QICore version '7.0.2'
using USCore version '7.0.0'
using C4BB version '2.1.1'
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.USCoreCommon called USCommon
include QICoreCommon

include SupplementalDataElements version '6.0.000' called SDE
include AdultOutpatientEncounters version '5.0.000' called AdultOutpatientEncounters
include Hospice version '7.0.000' called Hospice
include Status version '2.0.000' called Status
include PalliativeCare version '2.0.000' called PalliativeCare
include AdvancedIllnessandFrailty version '2.0.000' called AIFrailLTCF

codesystem "ClaimTypeCodes": 'http://terminology.hl7.org/CodeSystem/claim-type'
codesystem "SNOMEDCT": 'http://snomed.info/sct'

valueset "Bilateral Mastectomy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1005'
valueset "History of bilateral mastectomy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1068'
valueset "Mammography": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1018'
valueset "Status Post Left Mastectomy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1069'
valueset "Status Post Right Mastectomy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1070'
valueset "Unilateral Mastectomy Left": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1133'
valueset "Unilateral Mastectomy Right": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1134'
valueset "Unilateral Mastectomy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1285'
valueset "HCPCS Mammogram Codes": 'https://cms.madie.gov/ValueSet/HCPCS-Mammogram-Codes'

code "Female (finding)": '248152002' from "SNOMEDCT" display 'Female (finding)'
code "Entire left breast (body structure)": '361716006' from "SNOMEDCT" display 'Entire left breast (body structure)'
code "Entire right breast (body structure)": '361715005' from "SNOMEDCT" display 'Entire right breast (body structure)'
code "institutional": 'Institutional' from "ClaimTypeCodes"
code "professional": 'Professional' from "ClaimTypeCodes"

parameter "Measurement Period" Interval<DateTime>
  default Interval[@2026-01-01T00:00:00, @2026-12-31T23:59:59]

context Patient

define "Initial Population":
  AgeInYearsAt(date from 
    end of "Measurement Period"
  ) in Interval[42, 74]
    and Patient.sex().value = '248152002'
    and exists AdultOutpatientEncounters."Qualifying Encounters"

define "Denominator":
  "Initial Population"

define "Denominator Exclusions":
  "Is deceased during measurement period"
    or Hospice."Has Hospice Services"
    or ( ( exists ( "Right Mastectomy Diagnosis" )
          or exists ( "Right Mastectomy Procedure" )
      )
        and ( exists ( "Left Mastectomy Diagnosis" )
            or exists ( "Left Mastectomy Procedure" )
        )
    )
    or exists "Bilateral Mastectomy Diagnosis"
    or exists "Bilateral Mastectomy Procedure"
    or AIFrailLTCF."Is Age 66 or Older with Advanced Illness and Frailty"
    or AIFrailLTCF."Is Age 66 or Older Living Long Term in a Nursing Home"
    or PalliativeCare."Has Palliative Care in the Measurement Period"

 define "Is deceased during measurement period":
     Patient."Deceased during"("Measurement Period")

 define fluent function "Deceased during"(patient FHIR.Patient, duringPeriod Interval<System.DateTime>):
     if patient is null or duringPeriod is null or patient.deceased is null then false
     else 
         patient."Deceased date"() during day of duringPeriod

define fluent function "Deceased date"(patient FHIR.Patient):
     if patient is null then null
     else 
         if patient.deceased is null then null
         else
             case 
                 when patient.deceased is FHIR.dateTime then 
                     date from (patient.deceased as FHIR.dateTime)
                 else Message(null, true, 'BreastCancerScreeningDQMDraft.DeceasedDate.NotSupported', 'Error', 'Cannot determine deceased date because deceased is specified as a boolean')
             end

define "Right Mastectomy Diagnosis":
  ( ([Condition: "Status Post Right Mastectomy"]).verified ( ) ) RightMastectomy
    where RightMastectomy.prevalenceInterval ( ) starts on or before end of "Measurement Period"

define "Right Mastectomy Procedure":
  ( ( [QICore.Procedure: "Unilateral Mastectomy Right"]
  union [QICore.Procedure: "Unilateral Mastectomy"] UnilateralMastectomyProcedure 
  where exists UnilateralMastectomyProcedure.bodySite S where S ~ "Entire right breast (body structure)" 
  ).isProcedurePerformed ( ) ) UnilateralMastectomyRightPerformed
    where UnilateralMastectomyRightPerformed.performed.toInterval ( ) ends on or before end of "Measurement Period"

define "Left Mastectomy Diagnosis":
  ( ( [Condition: "Status Post Left Mastectomy"] ).verified ( ) ) LeftMastectomy
    where LeftMastectomy.prevalenceInterval ( ) starts on or before end of "Measurement Period"

define "Left Mastectomy Procedure":
  ( ( [QICore.Procedure: "Unilateral Mastectomy Left"] 
        union [QICore.Procedure: "Unilateral Mastectomy"] UnilateralMastectomyProcedure
        where exists UnilateralMastectomyProcedure.bodySite S where S ~ "Entire left breast (body structure)"
  ).isProcedurePerformed ( ) ) UnilateralMastectomyLeftPerformed
    where UnilateralMastectomyLeftPerformed.performed.toInterval ( ) ends on or before end of "Measurement Period"

define "Bilateral Mastectomy Diagnosis":
  ( ( [Condition: "History of bilateral mastectomy"] ).verified ( ) ) BilateralMastectomyHistory
    where BilateralMastectomyHistory.prevalenceInterval ( ) starts on or before end of "Measurement Period"

define "Bilateral Mastectomy Procedure":
  ( ( [QICore.Procedure: "Bilateral Mastectomy"] ).isProcedurePerformed ( ) ) BilateralMastectomyPerformed
    where BilateralMastectomyPerformed.performed.toInterval ( ) ends on or before end of "Measurement Period"

define "Numerator":
exists "Mammography Observation"
  or exists "Mammography Claim"
  or exists "Mammography EOB"
    
//Mammography Observation
define "Mammography Observation":
     ( ( [ObservationClinicalResult: code in "Mammography"] ).isDiagnosticStudyPerformed ( ) ) Mammogram
    where Mammogram.effective.toInterval ( ) ends during day of Interval["October 1 Two Years Prior to the Measurement Period", end of "Measurement Period"] 

define "October 1 Two Years Prior to the Measurement Period":
  DateTime((year from start of "Measurement Period" - 2), 10, 1, 0, 0, 0, 0, 0)

//Mammography Claim
define "Mammography Claim":
([QICore.Claim])."With mammography during"(
        Interval[date from "October 1 Two Years Prior to the Measurement Period", date from end of "Measurement Period"])

define fluent function "With mammography during"(
    claims List<FHIR.Claim>,
    duringPeriod Interval<System.Date>
):
    if duringPeriod is null then null
    else
        claims
            ."With product or service during"(
                "HCPCS Mammogram Codes",
                duringPeriod
            )

define fluent function "With product or service during"(
    claims List<FHIR.Claim>, 
    productOrServiceCodes System.ValueSet, 
    duringPeriod Interval<Date>
):
    if duringPeriod is null then null
    else 
        (claims."Professional or institutional"()) singleClaim
        with (
            singleClaim.item
                ."Starts during"(duringPeriod)
        ) item
        such that item."Has product or service"(productOrServiceCodes)

define fluent function "Has product or service"(item FHIR.Claim.Item, codes System.ValueSet):
    if item is null or item.productOrService is null then false
    else 
        item.productOrService in codes

define fluent function "Professional or institutional"(claims List<FHIR.Claim>):
    (claims) claim
      where claim.type ~ "institutional"
        or claim.type ~ "professional"

define fluent function "Starts during"(items List<FHIR.Claim.Item>, interval Interval<Date>):
    if interval is null then null
    else 
        (items) item
        where item."Serviced"() starts during interval

define fluent function "Serviced"(item FHIR.Claim.Item):
    if item is null or item.serviced is null then null
    else 
        case 
            when item.serviced is FHIR.date then 
                (item.serviced as FHIR.date)."Serviced internal"()
            when item.serviced is FHIR.Period then 
                (item.serviced as FHIR.Period)."To date interval"()
            else null
        end

define fluent function "Serviced internal"(serviced FHIR.date):
    if serviced is null then null
    else 
        Interval[FHIRHelpers.ToDate(serviced), FHIRHelpers.ToDate(serviced)]

define fluent function "To date interval"(period FHIR.Period):
    if period is null then null
    else 
        Interval[date from period.start, date from period.end]

//Mammography EOB
define "Mammography EOB":
([ExplanationOfBenefit])."With mammography during"(
        Interval[date from "October 1 Two Years Prior to the Measurement Period", date from end of "Measurement Period"])

define fluent function "With mammography during"(
    eobs List<FHIR.ExplanationOfBenefit>,
    duringPeriod Interval<System.Date>
):
    if duringPeriod is null then null
    else
        eobs
            ."With product or service during"(
                "HCPCS Mammogram Codes",
                duringPeriod
            )

define fluent function "With product or service during"(
    eobs List<FHIR.ExplanationOfBenefit>, 
    productOrServiceCodes System.ValueSet, 
    duringPeriod Interval<Date>
):
    if duringPeriod is null then null
    else 
        ( eobs."Professional or institutional"() ) singleEob
        with (
            singleEob.item
                ."During"(duringPeriod)
        ) item
        such that item."Has product or service"(productOrServiceCodes)

define fluent function "During"(items List<FHIR.ExplanationOfBenefit.Item>, interval Interval<Date>):
    if interval is null then null
    else 
        (items) item
        where item."Serviced"() overlaps interval 

define fluent function "Serviced"(item FHIR.ExplanationOfBenefit.Item):
    if item is null or item.serviced is null then null
    else 
        case 
            when item.serviced is FHIR.date then 
                (item.serviced as FHIR.date)."Serviced internal"()
            when item.serviced is FHIR.Period then 
                (item.serviced as FHIR.Period)."To date interval"()
            else null
        end

define fluent function "Has product or service"(item FHIR.ExplanationOfBenefit.Item, codes System.ValueSet):
    if item is null or item.productOrService is null then false
    else 
        item.productOrService in codes

define fluent function "Professional or institutional"(eobs List<FHIR.ExplanationOfBenefit>): 
    (eobs) eob
      where eob.type ~ "institutional"
        or eob.type ~ "professional"

define "SDE Ethnicity":
  SDE."SDE Ethnicity"

define "SDE Payer":
  SDE."SDE Payer"

define "SDE Race":
  SDE."SDE Race"

define "SDE Sex":
  SDE."SDE Sex"

define "Stratification 1":
  AgeInYearsAt(date from 
    end of "Measurement Period"
  ) in Interval[42, 51]

define "Stratification 2":
  AgeInYearsAt(date from 
    end of "Measurement Period"
  ) in Interval[52, 74]
ELM XML Content
Encoded data 
ELM JSON Content
Encoded data 
Citations and References
Dependency Description: Model QICore
Resource: http://hl7.org/fhir/us/qicore/Library/QICore-ModelInfo|7.0.2
Canonical URL: http://hl7.org/fhir/us/qicore/Library/QICore-ModelInfo|7.0.2
Dependency Description: Model USCore
Resource: http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|7.0.0
Canonical URL: http://hl7.org/fhir/us/cql/Library/USCore-ModelInfo|7.0.0
Dependency Description: Model C4BB
Resource: https://madie.cms.gov/Library/C4BB-ModelInfo|2.1.1
Canonical URL: https://madie.cms.gov/Library/C4BB-ModelInfo|2.1.1
Dependency Description: Library FHIRHelpers
Resource: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1
Dependency Description: Library FHIRCommon
Resource: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
Canonical URL: http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0
Dependency Description: Library USCommon
Resource: http://hl7.org/fhir/us/cql/Library/USCoreCommon
Canonical URL: http://hl7.org/fhir/us/cql/Library/USCoreCommon
Dependency Description: Library QICoreCommon
Resource: QI Core Common
Canonical URL: https://madie.cms.gov/Library/QICoreCommon
Dependency Description: Library SDE
Resource: https://madie.cms.gov/Library/SupplementalDataElements|6.0.000
Canonical URL: https://madie.cms.gov/Library/SupplementalDataElements|6.0.000
Dependency Description: Library AdultOutpatientEncounters
Resource: https://madie.cms.gov/Library/AdultOutpatientEncounters|5.0.000
Canonical URL: https://madie.cms.gov/Library/AdultOutpatientEncounters|5.0.000
Dependency Description: Library Hospice
Resource: https://madie.cms.gov/Library/Hospice|7.0.000
Canonical URL: https://madie.cms.gov/Library/Hospice|7.0.000
Dependency Description: Library Status
Resource: https://madie.cms.gov/Library/Status|2.0.000
Canonical URL: https://madie.cms.gov/Library/Status|2.0.000
Dependency Description: Library PalliativeCare
Resource: https://madie.cms.gov/Library/PalliativeCare|2.0.000
Canonical URL: https://madie.cms.gov/Library/PalliativeCare|2.0.000
Dependency Description: Library AIFrailLTCF
Resource: https://madie.cms.gov/Library/AdvancedIllnessandFrailty|2.0.000
Canonical URL: https://madie.cms.gov/Library/AdvancedIllnessandFrailty|2.0.000
Dependency Description: Code System ClaimTypeCodes
Resource: Claim Type Codes
Canonical URL: http://terminology.hl7.org/CodeSystem/claim-type
Dependency Description: Code System SNOMEDCT
Resource: SNOMED CT (all versions)
Canonical URL: http://snomed.info/sct
Dependency Description: Value Set Bilateral Mastectomy
Resource: Bilateral Mastectomy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1005
Dependency Description: Value Set History of bilateral mastectomy
Resource: History of bilateral mastectomy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1068
Dependency Description: Value Set Mammography
Resource: Mammography
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.108.12.1018
Dependency Description: Value Set Status Post Left Mastectomy
Resource: Status Post Left Mastectomy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1069
Dependency Description: Value Set Status Post Right Mastectomy
Resource: Status Post Right Mastectomy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1070
Dependency Description: Value Set Unilateral Mastectomy Left
Resource: Unilateral Mastectomy Left
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1133
Dependency Description: Value Set Unilateral Mastectomy Right
Resource: Unilateral Mastectomy Right
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1134
Dependency Description: Value Set Unilateral Mastectomy
Resource: Unilateral Mastectomy
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1285
Dependency Description: Value Set HCPCS Mammogram Codes
Resource: https://cms.madie.gov/ValueSet/HCPCS-Mammogram-Codes
Canonical URL: https://cms.madie.gov/ValueSet/HCPCS-Mammogram-Codes
Generated using version 0.5.6 of the sample-content-ig Liquid templates