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

Official URL: https://madie.cms.gov/Library/Hospice | Version: 7.1.000
Active as of 2025-08-20 | Responsible: National Committee for Quality Assurance | Computable Name: Hospice

This library contains a definition used to exclude patients who are in hospice care for any part of the measurement period.

Metadata
Title | Hospice
Version | 7.1.000
Topic | FHIR
Topic | CQL
Steward (Publisher) | National Committee for Quality Assurance
Description | This library contains a definition used to exclude patients who are in hospice care for any part of the measurement period.
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 Status Resource: Statusversion: null2.1.000) Canonical URL: `https://madie.cms.gov/Library/Status|2.1.000`
Dependency | Description: Code System LOINC Resource: Logical Observation Identifiers, Names and Codes (LOINC) Canonical URL: `http://loinc.org`
Dependency | Description: Code System SNOMEDCT Resource: SNOMED CT (all versions) Canonical URL: `http://snomed.info/sct`
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 Hospice Care Ambulatory Resource: Hospice Care Ambulatory Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1584`
Dependency | Description: Value Set Hospice Encounter Resource: Hospice Encounter Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1003`
Dependency | Description: Value Set Hospice Diagnosis Resource: Hospice Diagnosis Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165`
Data Requirement | Type: Encounter Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-encounter` Code Filter(s): Path: type ValueSet: Encounter Inpatient
Data Requirement | Type: Encounter Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-encounter` Code Filter(s): Path: type ValueSet: Hospice Encounter
Data Requirement | Type: Observation Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-observation-screening-assessment` Code Filter(s): Path: code Code(s): LOINC: 45755-6 (Hospice care [Minimum Data Set])
Data Requirement | Type: ServiceRequest Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-servicerequest` Code Filter(s): Path: code ValueSet: Hospice Care Ambulatory
Data Requirement | Type: Procedure Profile(s): `http://fhir.org/guides/astp/us-quality-core/StructureDefinition/us-quality-core-procedure` Code Filter(s): Path: code ValueSet: Hospice Care Ambulatory
Data Requirement | Type: Condition Profile(s): Condition Code Filter(s): Path: code ValueSet: Hospice Diagnosis
Parameters
Name | Use | Card. | Type | Documentation
Measurement Period | In | 0..1 | Period |
Patient | Out | 0..1 | Resource |
Has Hospice Services | Out | 0..1 | boolean |
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 Hospice version '7.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 Status version '2.1.000' called Status

    codesystem "LOINC": 'http://loinc.org'
    codesystem "SNOMEDCT": 'http://snomed.info/sct'

    valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
    valueset "Hospice Care Ambulatory": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1584'
    valueset "Hospice Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1003'
    valueset "Hospice Diagnosis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165'

    code "Discharge to healthcare facility for hospice care (procedure)": '428371000124100' from "SNOMEDCT" display 'Discharge to healthcare facility for hospice care (procedure)'
    code "Discharge to home for hospice care (procedure)": '428361000124107' from "SNOMEDCT" display 'Discharge to home for hospice care (procedure)'
    code "Hospice care [Minimum Data Set]": '45755-6' from "LOINC" display 'Hospice care [Minimum Data Set]'
    code "Yes (qualifier value)": '373066001' from "SNOMEDCT" display 'Yes (qualifier value)'

    parameter "Measurement Period" Interval<DateTime>

    context Patient

    define "Has Hospice Services":
      exists ((([USQualityCore.Encounter: "Encounter Inpatient"]).isEncounterPerformed()) InpatientEncounter
          where (InpatientEncounter.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)"
              or InpatientEncounter.hospitalization.dischargeDisposition ~ "Discharge to healthcare facility for hospice care (procedure)"
          )
            and InpatientEncounter.period ends during day of "Measurement Period"
      )
        or exists ((([USQualityCore.Encounter: "Hospice Encounter"]).isEncounterPerformed()) HospiceEncounter
            where HospiceEncounter.period overlaps day of "Measurement Period"
        )
        // TODO: Shouldn't need to specify a code path here (see https://jira.hl7.org/browse/FHIR-53941)
        or exists ((([USQualityCore.ObservationScreeningAssessment: code ~ "Hospice care [Minimum Data Set]"]).isAssessmentPerformed()) HospiceAssessment
            where HospiceAssessment.value ~ "Yes (qualifier value)"
              and HospiceAssessment.effective.toInterval() overlaps day of "Measurement Period"
        )
        or exists ((([USQualityCore.ServiceRequest: "Hospice Care Ambulatory"]).isInterventionOrder()) HospiceOrder
            where HospiceOrder.authoredOn during day of "Measurement Period"
        )
        or exists ((([USQualityCore.Procedure: "Hospice Care Ambulatory"]).isInterventionPerformed()) HospicePerformed
            where HospicePerformed.performed.toInterval() overlaps day of "Measurement Period"
        )
        // TODO: Consider whether to keep this as the union of Problems and EncounterDiagnosis
        or exists ((([FHIR.Condition: "Hospice Diagnosis"]).verified()) HospiceCareDiagnosis
            where HospiceCareDiagnosis.prevalenceInterval() overlaps day of "Measurement Period"
        )
ELM XML Content |
    Encoded data
ELM JSON Content |
    Encoded data
Generated using version 0.5.4 of the sample-content-ig Liquid templates