Your User Friendly Name for MyContentIG Here
0.4.7 - CI Build International flag

Your User Friendly Name for MyContentIG Here, published by HL7 International - [Some] Work Group. This guide is not an authorized publication; it is the continuous build for version 0.4.7 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/sample-content-ig/ and changes regularly. See the Directory of published versions

Library: TJC Overall Example (Experimental)

Official URL: http://somewhere.org/fhir/uv/mycontentig/Library/TJCOverallExample Version: 0.4.7
Active as of 2024-12-09 Computable Name: TJCOverallExample

Common functions and definitions used by TJC measures

Knowledge Artifact Metadata
Name (machine-readable) TJCOverallExample
Title (human-readable) TJC Overall Example
Status Active
Experimental true
Description

Common functions and definitions used by TJC measures

Library Steward HL7 International - [Some] Work Group
Steward Contact Details http://hl7.org/Special/committees/[something]
Dependency Description: QICore model information
Resource: http://hl7.org/fhir/Library/QICore-ModelInfo
Canonical URL: http://hl7.org/fhir/Library/QICore-ModelInfo
Dependency Description: Library FHIRHelpers
Resource: http://hl7.org/fhir/Library/FHIRHelpers|4.0.1
Canonical URL: http://hl7.org/fhir/Library/FHIRHelpers|4.0.1
Dependency Description: Library CQMCommon
Resource: CQM Common Example
Canonical URL: http://somewhere.org/fhir/uv/mycontentig/Library/CQMCommonExample
Dependency Description: Library QICoreCommon
Resource: QICore Common Example
Canonical URL: http://somewhere.org/fhir/uv/mycontentig/Library/QICoreCommonExample
Dependency Description: Value set Comfort Measures
Resource: Comfort Measures
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45
Dependency Description: Value set Discharge To Acute Care Facility
Resource: Discharge To Acute Care Facility
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87
Dependency Description: Value set Discharged to Health Care Facility for Hospice Care
Resource: Discharged to Health Care Facility for Hospice Care
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207
Dependency Description: Value set Discharged to Home for Hospice Care
Resource: Discharged to Home for Hospice Care
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209
Dependency Description: Value set Hemorrhagic Stroke
Resource: Hemorrhagic Stroke
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212
Dependency Description: Value set Ischemic Stroke
Resource: Ischemic Stroke
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247
Dependency Description: Value set Left Against Medical Advice
Resource: Left Against Medical Advice
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308
Dependency Description: Value set Nonelective Inpatient Encounter
Resource: Non-Elective Inpatient Encounter
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424
Dependency Description: Value set Patient Expired
Resource: Patient Expired
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309
Dependency Description: Value set Observation Services
Resource: Observation Services
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143
Dependency Description: Value set Emergency Department Visit
Resource: Emergency Department Visit
Canonical URL: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292
Library Metadata
Version Number 0.4.7
Library Type Logic Library
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: Non Elective Inpatient Encounter
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: All Stroke Encounter
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Encounter with Principal Diagnosis and Age
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Ischemic Stroke Encounter
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Ischemic Stroke Encounters with Discharge Disposition
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Intervention Comfort Measures
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Comfort Measures during Hospitalization
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Parameter Name: Encounter with Comfort Measures during Hospitalization
Use: Out
Min Cardinality: 0
Max Cardinality: *
Type: Resource
Data Requirement Type: Patient
Profile(s): QICore Patient
Data Requirement Type: Encounter
Profile(s): QICore Encounter
Must Support Elements: type, period, rank, rank.value, condition, condition.reference, condition.reference.value, hospitalization, hospitalization.dischargeDisposition
Code Filter(s):
Path: type
ValueSet: Non-Elective Inpatient Encounter
Data Requirement Type: Encounter
Profile(s): QICore Encounter
Must Support Elements: type, status, status.value, period, rank, rank.value, condition, condition.reference, condition.reference.value, hospitalization, hospitalization.dischargeDisposition
Code Filter(s):
Path: type
ValueSet: Observation Services
Data Requirement Type: Encounter
Profile(s): QICore Encounter
Must Support Elements: type, status, status.value, period, rank, rank.value, condition, condition.reference, condition.reference.value, hospitalization, hospitalization.dischargeDisposition
Code Filter(s):
Path: type
ValueSet: Emergency Department Visit
Data Requirement Type: Condition
Profile(s): http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition
Must Support Elements: id, id.value
Data Requirement Type: ServiceRequest
Profile(s): QICore ServiceRequest
Must Support Elements: code, status, status.value, intent, intent.value, doNotPerform, doNotPerform.value
Code Filter(s):
Path: code
ValueSet: Comfort Measures
Data Requirement Type: Procedure
Profile(s): QICore Procedure
Must Support Elements: code, status, status.value
Code Filter(s):
Path: code
ValueSet: Comfort Measures
Library Content
CQL Content
library TJCOverallExample version '8.9.000'

using QICore version '4.1.1'

include FHIRHelpers version '4.0.1' called FHIRHelpers
include CQMCommonExample called CQMCommon
include QICoreCommonExample called QICoreCommon

valueset "Comfort Measures": 'http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45'
valueset "Discharge To Acute Care Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87'
valueset "Discharged to Health Care Facility for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207'
valueset "Discharged to Home for Hospice Care": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209'
valueset "Hemorrhagic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212'
valueset "Ischemic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247'
valueset "Left Against Medical Advice": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308'
valueset "Nonelective Inpatient Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424'
valueset "Patient Expired": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309'

parameter "Measurement Period" Interval<DateTime>
  default Interval[@2024-01-01T00:00:00.0, @2025-01-01T00:00:00.0)

context Patient

define "Non Elective Inpatient Encounter":
  ["Encounter": "Nonelective Inpatient Encounter"] NonElectiveEncounter
        where NonElectiveEncounter.period ends during day of "Measurement Period"

define "All Stroke Encounter":
  "Non Elective Inpatient Encounter" NonElectiveEncounter
  let ConditionCode: NonElectiveEncounter.principalDiagnosis().code
    where ( ConditionCode in "Hemorrhagic Stroke"
       or   ConditionCode in "Ischemic Stroke" )  

define "Ischemic Stroke Encounter":
  "Encounter with Principal Diagnosis and Age" EncounterWithAge
    where EncounterWithAge.principalDiagnosis().code in "Ischemic Stroke"

define "Ischemic Stroke Encounters with Discharge Disposition":
  "Ischemic Stroke Encounter" IschemicStrokeEncounter
  let DischDisp: IschemicStrokeEncounter.hospitalization.dischargeDisposition
  	where  DischDisp in "Discharge To Acute Care Facility"
		or DischDisp in "Left Against Medical Advice"
		or DischDisp in "Patient Expired"
		or DischDisp in "Discharged to Home for Hospice Care"
		or DischDisp in "Discharged to Health Care Facility for Hospice Care"			

define "Encounter with Principal Diagnosis and Age":
  "All Stroke Encounter" AllStrokeEncounter
    where AgeInYearsAt(date from start of AllStrokeEncounter.period ) >= 18

define "Comfort Measures during Hospitalization":
  "Ischemic Stroke Encounter" IschemicStrokeEncounter
    with "Intervention Comfort Measures" ComfortMeasure
     such that Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during IschemicStrokeEncounter.hospitalizationWithObservation()

define "Encounter with Comfort Measures during Hospitalization":
  "Ischemic Stroke Encounter" IschemicStrokeEncounter
    with "Intervention Comfort Measures" ComfortMeasure
     such that Coalesce(start of ComfortMeasure.performed.toInterval(), ComfortMeasure.authoredOn) during IschemicStrokeEncounter.hospitalizationWithObservation()

define "Intervention Comfort Measures":
  ( ["ServiceRequest": code in "Comfort Measures"] SR
    where SR.status in { 'active', 'completed', 'on-hold' }
      and SR.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
      and SR.doNotPerform is not true
  )  
  union ( ["Procedure": "Comfort Measures"] InterventionPerformed
        where InterventionPerformed.status in { 'completed', 'in-progress' }
  )
  
define fluent function "TruncateTime"(Value DateTime ):
  DateTime(year from Value, month from Value, day from Value, 0, 0, 0, 0, timezoneoffset from Value)

define fluent function CalendarDayOfOrDayAfter(StartValue DateTime ):
  Interval[StartValue.TruncateTime(), StartValue.TruncateTime() + 2 days )
ELM XML Content
Encoded data (87460 characters)
ELM JSON Content
Encoded data (164156 characters)
Generated using version 0.4.7 of the sample-content-ig Liquid templates