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: CMS645FHIRBoneDensityPCADTherapy

Official URL: https://madie.cms.gov/Library/CMS645FHIRBoneDensityPCADTherapy Version: 1.0.000
Active as of 2025-08-22 Responsible: Oregon Urology Computable Name: CMS645FHIRBoneDensityPCADTherapy
Other Identifiers: https://madie.cms.gov/login#CMS645FHIRBoneDensityPCADTherapy (use: official, )

CMS645FHIRBoneDensityPCADTherapy

Metadata
Title CMS645FHIRBoneDensityPCADTherapy
Version 1.0.000
Identifier CMS645FHIRBoneDensityPCADTherapy
Steward (Publisher) Oregon Urology
Description CMS645FHIRBoneDensityPCADTherapy
Type [http://terminology.hl7.org/CodeSystem/library-type#logic-library]
Data Requirement Type: ServiceRequest
Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest
Must Support Elements: code, authoredOn, authoredOn.value, status, status.value, intent, intent.value
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.359
Data Requirement Type: MedicationRequest
Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest
Must Support Elements: medication
Code Filter(s):
Path: medication
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.352
Data Requirement Type: MedicationRequest
Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest
Must Support Elements: medication.reference.value
Data Requirement Type: Medication
Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medication
Must Support Elements: id.value, code
Data Requirement Type: Condition
Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-problems-health-concerns
Must Support Elements: code
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.319
Data Requirement Type: Condition
Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition-encounter-diagnosis
Must Support Elements: code
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.319
Data Requirement Type: Observation
Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation-clinical-result
Must Support Elements: code, effective, status, status.value
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.359
Data Requirement Type: ServiceRequest
Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicenotrequested
Must Support Elements: code
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.359
Data Requirement Type: Observation
Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observationcancelled
Must Support Elements: code
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.359
Library Content
CQL Content
library CMS645FHIRBoneDensityPCADTherapy version '1.0.000'

using QICore version '6.0.0'

include FHIRHelpers version '4.4.000' called FHIRHelpers
include SupplementalDataElements version '5.1.000' called SDE
include QICoreCommon version '4.0.000' called QICoreCommon

codesystem "SNOMEDCT": 'http://snomed.info/sct'

valueset "Androgen Deprivation Therapy for Urology Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.352'
valueset "DEXA Bone Density for Urology Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1248.359'
valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001'
valueset "Patient Declined": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1582'
valueset "Prostate Cancer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.319'

code "Injection of leuprolide acetate for twelve month period (regime/therapy)": '456381000124102' from "SNOMEDCT" display 'Injection of leuprolide acetate for twelve month period (regime/therapy)'

parameter "Measurement Period" Interval<DateTime>

context Patient

define "Initial Population":
  "Has Qualifying Encounter"
    and exists "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period"

define "Denominator":
  "Initial Population"

define "Numerator":
  "Has Baseline DEXA Scan Two Years Prior to the Start of or Less than Three Months After the Start of ADT"

define "Denominator Exception":
  exists ( "No Bone Density Scan Ordered Due to Patient Refusal" )
    or exists ( "No Bone Density Scan Performed Due to Patient Refusal" )

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 "Has Baseline DEXA Scan Two Years Prior to the Start of or Less than Three Months After the Start of ADT":
  exists ( ( [ServiceRequest: "DEXA Bone Density for Urology Care"] DEXAOrdered
        with "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period" OrderTwelveMonthsADT
          such that DEXAOrdered.authoredOn 3 months or less on or after day of OrderTwelveMonthsADT.authoredOn
            or DEXAOrdered.authoredOn 2 years or less before day of OrderTwelveMonthsADT.authoredOn
        where DEXAOrdered.status in { 'active', 'completed' }
          and DEXAOrdered.intent = 'order'
    )
      union ( [ObservationClinicalResult: "DEXA Bone Density for Urology Care"] DEXAPerformed
          with "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period" OrderTwelveMonthsADT
            such that DEXAPerformed.effective.toInterval ( ) 3 months or less on or after day of OrderTwelveMonthsADT.authoredOn
              or DEXAPerformed.effective.toInterval ( ) 2 years or less before day of OrderTwelveMonthsADT.authoredOn
          where DEXAPerformed.status in { 'final', 'amended', 'corrected' }
      )
  )

define "No Bone Density Scan Ordered Due to Patient Refusal":
  [ServiceNotRequested: "DEXA Bone Density for Urology Care"] DEXANotOrdered
    with "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period" OrderTwelveMonthsADT
      such that DEXANotOrdered.authoredOn 3 months or less on or after day of OrderTwelveMonthsADT.authoredOn
        and DEXANotOrdered.reasonRefused in "Patient Declined"

define "No Bone Density Scan Performed Due to Patient Refusal":
  [ObservationCancelled: "DEXA Bone Density for Urology Care"] DEXANotPerformed
    with "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period" OrderTwelveMonthsADT
      such that DEXANotPerformed.issued 3 months or less on or after day of OrderTwelveMonthsADT.authoredOn
        and DEXANotPerformed.notDoneReason in "Patient Declined"

define "First ADT in 3 Months Before to 9 Months After Start of Measurement Period":
  First(("Androgen Deprivation Therapy for Urology Care Medication Active Start Dates"
      union "Androgen Deprivation Therapy for Urology Care Medication Order Start Dates") ADTDateTime
      with "Prostate Cancer Diagnosis" ProstateCancer
        such that ADTDateTime during day of ProstateCancer.prevalenceInterval()
          and ADTDateTime during day of Interval[start of "Measurement Period" - 3 months, start of "Measurement Period" + 9 months]
      sort ascending
  )

define "Order for 12 Months of ADT in 3 Months Before to 9 Months After Start of Measurement Period":
  [ServiceRequest: "Injection of leuprolide acetate for twelve month period (regime/therapy)"] OrderTwelveMonthADT
    with "First ADT in 3 Months Before to 9 Months After Start of Measurement Period" FirstADTMP
      such that OrderTwelveMonthADT.authoredOn on or after day of FirstADTMP
        and OrderTwelveMonthADT.authoredOn during day of Interval[start of "Measurement Period" - 3 months, start of "Measurement Period" + 9 months]
        and OrderTwelveMonthADT.status in { 'active', 'completed' }
        and OrderTwelveMonthADT.intent = 'order'

define "Androgen Deprivation Therapy for Urology Care Medication Active Start Dates":
  [MedicationRequest: "Androgen Deprivation Therapy for Urology Care"] ADTActive
    let firstMedicationPeriod: First((collapse(ADTActive.dosageInstruction.timing.repeat.bounds DoseTime
          return DoseTime.toInterval()
      )) DrugPeriods
        sort by start of $this
    ),

    //get the very first event as interval
    
    firstMedicationEvent: First((ADTActive.dosageInstruction.timing dosageTiming
        //returns first event for the specific dosageTiming
        
        return First(dosageTiming.event dosageTimingEvents
            sort ascending
        )) firstEvents
        sort ascending
    ),
    medicationDateTime: Min({ firstMedicationEvent, start of firstMedicationPeriod, 
      end of firstMedicationPeriod }
    )
    where ADTActive.status in { 'active', 'completed' }
      and ADTActive.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
    return medicationDateTime

define "Androgen Deprivation Therapy for Urology Care Medication Order Start Dates":
  [MedicationRequest: "Androgen Deprivation Therapy for Urology Care"] ADTOrder
    let firstMedicationPeriod: First((collapse(ADTOrder.dosageInstruction.timing.repeat.bounds DoseTime
          return DoseTime.toInterval()
      )) DrugPeriods
        sort by start of $this
    ),
    medicationDateTime: Min({ ADTOrder.authoredOn, start of firstMedicationPeriod, 
      end of firstMedicationPeriod }
    )
    where ADTOrder.status in { 'active', 'completed' }
      and ADTOrder.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
    return medicationDateTime

define "Has Qualifying Encounter":
  exists ( ["Encounter": "Office Visit"] OfficeVisit
      where OfficeVisit.period during day of "Measurement Period"
        and OfficeVisit.status = 'finished'
  )

define "Prostate Cancer Diagnosis":
  ( [ConditionProblemsHealthConcerns: "Prostate Cancer"]
    union [ConditionEncounterDiagnosis: "Prostate Cancer"] ) ProstateCancer
    where ProstateCancer.prevalenceInterval ( ) overlaps day of "Measurement Period"
      and ProstateCancer.isVerified ( )

/*      
@description: Returns true if the given condition either has no verification status or has a verification status of confirmed, unconfirmed, provisional, or differential
*/


define fluent function isVerified(condition Choice<ConditionEncounterDiagnosis, ConditionProblemsHealthConcerns>):
  condition.verificationStatus is not null implies ( condition.verificationStatus ~ QICoreCommon."confirmed"
      or condition.verificationStatus ~ QICoreCommon."unconfirmed"
      or condition.verificationStatus ~ QICoreCommon."provisional"
      or condition.verificationStatus ~ QICoreCommon."differential"
  )
Generated using version 0.4.8 of the sample-content-ig Liquid templates