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

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

Hospice logic.

Metadata
Title | Hospice
Version | 2026.0.0
Topic | FHIR
Topic | CQL
Description | Hospice logic.
Type | logic-library from http://terminology.hl7.org/CodeSystem/library-type
Parameter | Name: Measurement Period Use: In Min Cardinality: 0 Max Cardinality: 1 Type: Period
Parameter | Name: Patient Use: Out Min Cardinality: 0 Max Cardinality: 1 Type: Resource
Parameter | Name: Has Hospice Services Use: Out Min Cardinality: 0 Max Cardinality: 1 Type: boolean
Data Requirement | Type: Encounter Profile(s): QICore Encounter Code Filter(s): Path: type ValueSet: Encounter Inpatient
Data Requirement | Type: Encounter Profile(s): QICore Encounter Code Filter(s): Path: type ValueSet: Hospice Encounter
Data Requirement | Type: Observation Profile(s): QICore Observation Screening Assessment Code Filter(s): Path: code Code(s): LOINC: 45755-6 (Hospice care [Minimum Data Set])
Data Requirement | Type: ServiceRequest Profile(s): QICore ServiceRequest Code Filter(s): Path: code ValueSet: Hospice Care Ambulatory
Data Requirement | Type: Procedure Profile(s): QICore 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
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 Hospice version '7.0.000'

    using QICore version '7.0.2'
    using USCore version '7.0.0'
    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.0.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 ((([QICore.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 ((([QICore.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 ((([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 ((([QICore.ServiceRequest: "Hospice Care Ambulatory"]).isInterventionOrder()) HospiceOrder
            where HospiceOrder.authoredOn during day of "Measurement Period"
        )
        or exists ((([QICore.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 ((([Condition: "Hospice Diagnosis"]).verified()) HospiceCareDiagnosis
            where HospiceCareDiagnosis.prevalenceInterval() overlaps day of "Measurement Period"
        )
ELM XML Content |
    Encoded data (78672 characters)
ELM JSON Content |
    Encoded data (151088 characters)
Generated using version 0.5.0 of the sample-content-ig Liquid templates