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

## Library: CMS165FHIRControllingHighBP

Official URL: https://madie.cms.gov/Library/CMS165FHIRControllingHighBP | Version: 1.1.000
Active as of 2025-07-25 | Responsible: National Committee for Quality Assurance | Computable Name: CMS165FHIRControllingHighBP

CMS165FHIRControllingHighBP

Metadata
Title | CMS165FHIRControllingHighBP
Version | 1.1.000
Topic | FHIR
Topic | CQL
Steward (Publisher) | National Committee for Quality Assurance
Description | CMS165FHIRControllingHighBP
Type | logic-library from http://terminology.hl7.org/CodeSystem/library-type
Dependency | Description: Model USQualityCore Resource: `https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild` Canonical URL: `https://madie.cms.gov/Library/USQualityCore-ModelInfo|0.1.0-cibuild`
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 USCoreCommon Resource: http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot Canonical URL: `http://hl7.org/fhir/us/cql/Library/USCoreCommon|2.0.0-ballot`
Dependency | Description: Library USCoreElements Resource: http://hl7.org/fhir/us/cql/Library/USCoreElements|2.0.0-ballot Canonical URL: `http://hl7.org/fhir/us/cql/Library/USCoreElements|2.0.0-ballot`
Dependency | Description: Library USQualityCoreCommon Resource: US Quality Core Commonversion: null0.1.0-cibuild) Canonical URL: `https://madie.cms.gov/Library/USQualityCoreCommon|0.1.0-cibuild`
Dependency | Description: Library SDE Resource: SupplementalDataElementsversion: null6.1.000) Canonical URL: `https://madie.cms.gov/Library/SupplementalDataElements|6.1.000`
Dependency | Description: Library Status Resource: Statusversion: null2.1.000) Canonical URL: `https://madie.cms.gov/Library/Status|2.1.000`
Dependency | Description: Library AdultOutpatientEncounters Resource: AdultOutpatientEncountersversion: null5.1.000) Canonical URL: `https://madie.cms.gov/Library/AdultOutpatientEncounters|5.1.000`
Dependency | Description: Library AIFrailLTCF Resource: AdvancedIllnessandFrailtyversion: null2.1.000) Canonical URL: `https://madie.cms.gov/Library/AdvancedIllnessandFrailty|2.1.000`
Dependency | Description: Library Hospice Resource: Hospiceversion: null7.1.000) Canonical URL: `https://madie.cms.gov/Library/Hospice|7.1.000`
Dependency | Description: Library PalliativeCare Resource: PalliativeCareversion: null2.1.000) Canonical URL: `https://madie.cms.gov/Library/PalliativeCare|2.1.000`
Dependency | Description: Code System LOINC Resource: Logical Observation Identifiers, Names and Codes (LOINC) Canonical URL: `http://loinc.org`
Dependency | Description: Value Set Chronic Kidney Disease, Stage 5 Resource: Chronic Kidney Disease, Stage 5 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1002`
Dependency | Description: Value Set Dialysis Services Resource: Dialysis Services Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.109.12.1013`
Dependency | Description: Value Set Emergency Department Evaluation and Management Visit Resource: Emergency Department Evaluation and Management Visit Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010`
Dependency | Description: Value Set Encounter Inpatient Resource: Encounter Inpatient Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307`
Dependency | Description: Value Set End Stage Renal Disease Resource: End Stage Renal Disease Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.353`
Dependency | Description: Value Set ESRD Monthly Outpatient Services Resource: ESRD Monthly Outpatient Services Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.109.12.1014`
Dependency | Description: Value Set Essential Hypertension Resource: Essential Hypertension Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.104.12.1011`
Dependency | Description: Value Set Kidney Transplant Resource: Kidney Transplant Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.109.12.1012`
Dependency | Description: Value Set Kidney Transplant Recipient Resource: Kidney Transplant Recipient Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.109.12.1029`
Dependency | Description: Value Set Pregnancy Resource: Pregnancy Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.378`
Data Requirement | Type: Condition Profile(s): Condition Code Filter(s): Path: code ValueSet: Essential Hypertension
Data Requirement | Type: Condition Profile(s): Condition Code Filter(s): Path: code ValueSet: Pregnancy
Data Requirement | Type: Condition Profile(s): Condition Code Filter(s): Path: code ValueSet: End Stage Renal Disease
Data Requirement | Type: Condition Profile(s): Condition Code Filter(s): Path: code ValueSet: Kidney Transplant Recipient
Data Requirement | Type: Condition Profile(s): Condition Code Filter(s): Path: code ValueSet: Chronic Kidney Disease, Stage 5
Data Requirement | Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Kidney Transplant
Data Requirement | Type: Procedure Profile(s): Procedure Code Filter(s): Path: code ValueSet: Dialysis Services
Data Requirement | Type: Observation Profile(s): US Core Blood Pressure Profile
Data Requirement | Type: Encounter Profile(s): Encounter
Parameters
Name | Use | Card. | Type | Documentation
Measurement Period | In | 0..1 | Period |
Patient | Out | 0..1 | Resource |
Essential Hypertension Diagnosis | Out | 0..* | Condition |
Initial Population | Out | 0..1 | boolean |
Denominator | Out | 0..1 | boolean |
Pregnancy or Renal Diagnosis | Out | 0..* | Condition |
End Stage Renal Disease Procedures | Out | 0..* | Procedure |
End Stage Renal Disease Encounter | Out | 0..* | Encounter |
Denominator Exclusions | Out | 0..1 | boolean |
Qualifying Blood Pressure Reading | Out | 0..* | Resource |
Blood Pressure Days | Out | 0..* | date |
Most Recent Blood Pressure Day | Out | 0..1 | date |
Lowest Systolic Reading on Most Recent Blood Pressure Day | Out | 0..1 | Quantity |
Has Systolic Blood Pressure Less Than 140 | Out | 0..1 | boolean |
Lowest Diastolic Reading on Most Recent Blood Pressure Day | Out | 0..1 | Quantity |
Has Diastolic Blood Pressure Less Than 90 | Out | 0..1 | boolean |
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 |
Library Content
CQL Content |
    /*
    NOTE: For use by March 2026 US Realm Connectathon participants for internal use only. Not for use or distribution in commercial products.
    */
    library CMS165FHIRControllingHighBP version '1.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.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
    include SupplementalDataElements version '6.1.000' called SDE
    include Status version '2.1.000' called Status
    include AdultOutpatientEncounters version '5.1.000' called AdultOutpatientEncounters
    include AdvancedIllnessandFrailty version '2.1.000' called AIFrailLTCF
    include Hospice version '7.1.000' called Hospice
    include PalliativeCare version '2.1.000' called PalliativeCare

    codesystem "LOINC": 'http://loinc.org'

    valueset "Chronic Kidney Disease, Stage 5": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1002'
    valueset "Dialysis Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.109.12.1013'
    valueset "Emergency Department Evaluation and Management Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010'
    valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
    valueset "End Stage Renal Disease": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.353'
    valueset "ESRD Monthly Outpatient Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.109.12.1014'
    valueset "Essential Hypertension": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.104.12.1011'
    valueset "Kidney Transplant": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.109.12.1012'
    valueset "Kidney Transplant Recipient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.109.12.1029'
    valueset "Pregnancy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.378'

    code "Diastolic blood pressure": '8462-4' from "LOINC" display 'Diastolic blood pressure'
    code "Systolic blood pressure": '8480-6' from "LOINC" display 'Systolic blood pressure'

    parameter "Measurement Period" Interval<DateTime>
      default Interval[@2026-01-01T00:00:00.000Z, @2027-01-01T00:00:00.000Z)

    context Patient

    define "Initial Population":
      AgeInYearsAt(date from
        end of "Measurement Period"
      ) in Interval[18, 85]
        and exists "Essential Hypertension Diagnosis"
        and exists AdultOutpatientEncounters."Qualifying Encounters"

    define "Essential Hypertension Diagnosis":
      ( ( [Condition: "Essential Hypertension"] ).verified ( ) ) Hypertension
        where Hypertension.prevalenceInterval ( ) overlaps Interval[start of "Measurement Period", start of "Measurement Period" + 6 months )

    define "Denominator":
      "Initial Population"

    define "Denominator Exclusions":
      Hospice."Has Hospice Services"
        or exists ( "Pregnancy or Renal Diagnosis" )
        or exists ( "End Stage Renal Disease Procedures" )
        or exists ( "End Stage Renal Disease Encounter" )
        or AIFrailLTCF."Is Age 66 to 80 with Advanced Illness and Frailty or Is Age 81 or Older with 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 "Pregnancy or Renal Diagnosis":
      ( ( [Condition: "Pregnancy"]
          union [Condition: "End Stage Renal Disease"]
          union [Condition: "Kidney Transplant Recipient"]
          union [Condition: "Chronic Kidney Disease, Stage 5"]
      ).verified ( ) ) PregnancyESRDDiagnosis
        where PregnancyESRDDiagnosis.prevalenceInterval ( ) overlaps "Measurement Period"

    define "End Stage Renal Disease Procedures":
      ( ( [Procedure: "Kidney Transplant"]
          union [Procedure: "Dialysis Services"]
      ).isProcedurePerformed ( ) ) ESRDProcedure
        where ESRDProcedure.performed.toInterval ( ) ends on or before end of "Measurement Period"

    define "End Stage Renal Disease Encounter":
      ( ( [Encounter: "ESRD Monthly Outpatient Services"] ).isEncounterPerformed ( ) ) ESRDEncounter
        where ESRDEncounter.period starts on or before end of "Measurement Period"

    define "Numerator":
      "Has Systolic Blood Pressure Less Than 140"
        and "Has Diastolic Blood Pressure Less Than 90"

    define "Has Systolic Blood Pressure Less Than 140":
      "Lowest Systolic Reading on Most Recent Blood Pressure Day" < 140 'mm[Hg]'

    define "Has Diastolic Blood Pressure Less Than 90":
      "Lowest Diastolic Reading on Most Recent Blood Pressure Day" < 90 'mm[Hg]'

    define "Lowest Systolic Reading on Most Recent Blood Pressure Day":
      First("Qualifying Blood Pressure Reading" BPReading
          where BPReading.effective.latest() same day as "Most Recent Blood Pressure Day"
          return singleton from(BPReading.component BPComponent
              where BPComponent.code ~ "Systolic blood pressure"
              return BPComponent.value as Quantity
          )
          sort asc
      )

    define "Lowest Diastolic Reading on Most Recent Blood Pressure Day":
      First("Qualifying Blood Pressure Reading" BPReading
          where BPReading.effective.latest() same day as "Most Recent Blood Pressure Day"
          return singleton from(BPReading.component BPComponent
              where BPComponent.code ~ "Diastolic blood pressure"
              return BPComponent.value as Quantity
          )
          sort asc
      )

    define "Qualifying Blood Pressure Reading":
      ( ( ( [USCore.BloodPressureProfile] ).isObservationBP ( ) ) BloodPressure
          without ( ( [Encounter: "Encounter Inpatient"]
              union [Encounter: "Emergency Department Evaluation and Management Visit"]
          ).isEncounterPerformed ( ) ) DisqualifyingEncounter
            such that BloodPressure.effective.latest ( ) during day of DisqualifyingEncounter.period
          where BloodPressure.effective.latest ( ) during day of "Measurement Period"
      )
        union ( ( ( [USCore.BloodPressureProfile] ).isObservationBP ( ) ) BloodPressure
            where ( not ( ( BloodPressure.encounter.getEncounter ( ) ).class.code in { 'EMER', 'IMP', 'ACUTE', 'NONAC', 'PRENC', 'SS' } ) )
              and BloodPressure.effective.latest ( ) during day of "Measurement Period"
        )

    define fluent function getEncounter(reference Reference):
      singleton from ( [Encounter] E
        where reference.references(E)
      )

    define "Most Recent Blood Pressure Day":
      Last("Blood Pressure Days" BPDays
          sort asc
      )

    define "Blood Pressure Days":
      "Qualifying Blood Pressure Reading" BPExam
        return date from BPExam.effective.latest ( )

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

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

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

    define "SDE Sex":
      SDE."SDE Sex"
ELM XML Content |
    Encoded data
ELM JSON Content |
    Encoded data
Generated using version 0.5.4 of the sample-content-ig Liquid templates