Chronic Disease Surveillance
0.1.0 - CI Build International flag

Chronic Disease Surveillance, published by Clinical Quality Framework. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/aphl-chronic-ig/ and changes regularly. See the Directory of published versions

Library: HospiceFHIR4

Official URL: http://fhir.org/guides/cqf/aphl/chronic-ds/Library/HospiceFHIR4 Version: 0.1.0
Active as of 2021-01-08 Computable Name: HospiceFHIR4

HospiceFHIR4

Metadata
Version 0.1.0
Jurisdiction 001 from http://unstats.un.org/unsd/methods/m49/m49.htm
Steward (Publisher) Clinical Quality Framework
Description

HospiceFHIR4

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: Patient
Parameter Name: Has Hospice
Use: Out
Min Cardinality: 0
Max Cardinality: 1
Type: boolean
Data Requirement Type: Patient
Profile(s): Patient
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, hospitalization, hospitalization.dischargeDisposition, period
Code Filter(s):
Path: type
ValueSet: Encounter Inpatient
Data Requirement Type: Encounter
Profile(s): Encounter
Must Support Elements: type, period
Code Filter(s):
Path: type
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1003
Data Requirement Type: Observation
Profile(s): Observation
Must Support Elements: code, value, effective
Code Filter(s):
Path: code
Code(s): LOINC 45755-6: Hospice care [Minimum Data Set]
Data Requirement Type: ServiceRequest
Profile(s): ServiceRequest
Must Support Elements: code, authoredOn
Code Filter(s):
Path: code
ValueSet: Hospice care ambulatory
Data Requirement Type: Procedure
Profile(s): Procedure
Must Support Elements: code, performed
Code Filter(s):
Path: code
ValueSet: Hospice care ambulatory
Data Requirement Type: Condition
Profile(s): Condition
Must Support Elements: code
Code Filter(s):
Path: code
ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.1165
Library Content
CQL Content
library HospiceFHIR4 version '2.0.000' //Should this be updated

/*This example is a work in progress and should not be considered a final specification
or recommendation for guidance. This example will help guide and direct the process
of finding conventions and usage patterns that meet the needs of the various stakeholders
in the measure development community.*/

using FHIR version '4.0.1'

include MATGlobalCommonFunctionsFHIR4 version '6.0.000' called Global
include FHIRHelpers version '4.1.000' called FHIRHelpers
include AlphoraCommon called AC
include FHIRCommon version '1.1.000' called FC 

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

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.113762.1.4.1108.15' 
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" default Interval[@2025-01-01T00:00:00.0, @2026-01-01T00:00:00.0)

context Patient

define "Has Hospice":
  exists(
    (AC.QualifiedEncounters([Encounter: "Encounter Inpatient"])) HospiceInp
      where (HospiceInp.hospitalization.dischargeDisposition ~ "Discharge to home for hospice care (procedure)"
        or HospiceInp.hospitalization.dischargeDisposition ~ "Discharge to healthcare facility for hospice care (procedure)")
      and FC.ToInterval(HospiceInp.period) ends during "Measurement Period"
  ) or exists(
    (AC.QualifiedEncounters([Encounter: "Hospice Encounter"])) HospiceEnc
      where FC.ToInterval(HospiceEnc.period) overlaps "Measurement Period"
  ) or exists(
    (AC.QualifiedObservations([Observation: "Hospice care [Minimum Data Set]"])) HospiceObs
      where HospiceObs.value ~ ToConcept("Yes (qualifier value)")
        and FC.ToInterval(HospiceObs.effective) overlaps "Measurement Period"
  ) or exists(
    (AC.QualifiedServiceRequests([ServiceRequest: "Hospice Care Ambulatory"])) HospiceSR
      where FC.ToInterval(HospiceSR.authoredOn) during "Measurement Period"
  ) or exists(
    (AC.QualifiedProcedures([Procedure: "Hospice Care Ambulatory"])) HospiceProc
      where FC.ToInterval(HospiceProc.performed) overlaps "Measurement Period"
  ) or exists(
    (AC.QualifiedConditions([Condition: "Hospice Diagnosis"])) HospiceCareDiagnosis
      where FC.ToPrevalenceInterval(HospiceCareDiagnosis) overlaps "Measurement Period"
  )
/*

  or exists ( ["Intervention, Order": "Hospice Care Ambulatory"] HospiceOrder
      where HospiceOrder.authorDatetime during day of "Measurement Period"
  )
  or exists ( ["Intervention, Performed": "Hospice Care Ambulatory"] HospicePerformed
      where Global."NormalizeInterval" ( HospicePerformed.relevantDatetime, HospicePerformed.relevantPeriod ) overlaps day of "Measurement Period"
  )
or exists ( ["Diagnosis": "Hospice Diagnosis"] HospiceCareDiagnosis
      where HospiceCareDiagnosis.prevalencePeriod overlaps day of "Measurement Period"
  )

*/
ELM XML Content
Encoded data (74076 characters)
ELM JSON Content
Encoded data (143708 characters)
Generated using version 0.5.1-cibuild of the sample-content-ig Liquid templates