Metadata Title TJC Overall Library Version 4.0.000 Identifier TJCOverall Identifier urn:oid:2.16.840.1.113883.4.642.40.61.28.33 Approval Date 2019-08-03 Last Review Date 2019-08-03 Experimental true Jurisdiction Global (Whole world) Steward (Publisher) HL7 International / Clinical Quality Information Description This library is used as an example in the FHIR Quality Measure Implementation Guide 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: Patient Parameter Name: Intervention Comfort Measures Use: Out Min Cardinality: 0 Max Cardinality: * Type: Resource Parameter Name: Non Elective Inpatient Encounter Use: Out Min Cardinality: 0 Max Cardinality: * Type: Encounter Parameter Name: All Stroke Encounter Use: Out Min Cardinality: 0 Max Cardinality: * Type: Encounter Parameter Name: Encounter with Principal Diagnosis and Age Use: Out Min Cardinality: 0 Max Cardinality: * Type: Encounter Parameter Name: Ischemic Stroke Encounter Use: Out Min Cardinality: 0 Max Cardinality: * Type: Encounter Parameter Name: Ischemic Stroke Encounters with Discharge Disposition Use: Out Min Cardinality: 0 Max Cardinality: * Type: Encounter Parameter Name: Comfort Measures during Hospitalization Use: Out Min Cardinality: 0 Max Cardinality: * Type: Encounter Data Requirement Type: Patient Profile(s): Patient Must Support Elements: birthDate Data Requirement Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, intent Code Filter(s): Path: code ValueSet: Comfort Measures Data Requirement Type: Procedure Profile(s): Procedure Must Support Elements: code, status Code Filter(s): Path: code ValueSet: Comfort Measures Data Requirement Type: Encounter Profile(s): Encounter Must Support Elements: type, period, hospitalization, hospitalization.dischargeDisposition Code Filter(s): Path: type ValueSet: Nonelective Inpatient Encounter Library Content CQL Content /*#xD; This example is a work in progress and should not be considered a final specification#xD; or recommendation for guidance. This example will help guide and direct the process#xD; of finding conventions and usage patterns that meet the needs of the various stakeholders#xD; in the measure development community.#xD; */#xD; library TJCOverall version '4.0.000'#xD; #xD; using FHIR version '4.0.1'#xD; #xD; include hl7.fhir.uv.cql.FHIRHelpers version '4.0.1' called FHIRHelpers#xD; #xD; include MATGlobalCommonFunctions version '5.0.000' called Global#xD; include SupplementalDataElements version '2.0.000' called SDE#xD; #xD; codesystem "SNOMEDCT": 'http://snomed.info/sct'#xD; codesystem "LOINC": 'http://loinc.org'#xD; #xD; valueset "Comfort Measures": 'http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45'#xD; valueset "Discharge To Acute Care Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87'#xD; 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'#xD; 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'#xD; valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'#xD; valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'#xD; valueset "Hemorrhagic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212'#xD; valueset "Ischemic Stroke": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247'#xD; valueset "Left Against Medical Advice": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308'#xD; valueset "Non-Elective Inpatient Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424'#xD; valueset "Patient Expired": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309'#xD; valueset "Ticagrelor Therapy": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.39'#xD; valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'#xD; #xD; code "Birth date": '21112-8' from "LOINC" display 'Birth date'#xD; #xD; parameter "Measurement Period" Interval<DateTime>#xD; default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0)#xD; #xD; context Patient#xD; #xD; define "Intervention Comfort Measures":#xD; (["ServiceRequest": "Comfort Measures"] P#xD; where P.intent = 'order')#xD; union#xD; (["Procedure": "Comfort Measures"] InterventionPerformed#xD; where InterventionPerformed.status = 'completed')#xD; #xD; define "All Stroke Encounter":#xD; "Non Elective Inpatient Encounter" NonElectiveEncounter#xD; where Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Hemorrhagic Stroke"#xD; or Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Ischemic Stroke"#xD; #xD; define "Ischemic Stroke Encounter":#xD; "Encounter with Principal Diagnosis and Age" EncounterWithAge#xD; where Global.PrincipalDiagnosis(EncounterWithAge).code in "Ischemic Stroke"#xD; #xD; define "Non Elective Inpatient Encounter":#xD; ["Encounter": "Non-Elective Inpatient Encounter"] NonElectiveEncounter#xD; where Global."LengthInDays"(NonElectiveEncounter.period) <= 120#xD; and NonElectiveEncounter.period ends during "Measurement Period"#xD; #xD; define "Ischemic Stroke Encounters with Discharge Disposition":#xD; "Ischemic Stroke Encounter" IschemicStrokeEncounter#xD; where IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharge To Acute Care Facility"#xD; or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Left Against Medical Advice"#xD; or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Patient Expired"#xD; or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Home for Hospice Care"#xD; or IschemicStrokeEncounter.hospitalization.dischargeDisposition in "Discharged to Health Care Facility for Hospice Care"#xD; #xD; define "Comfort Measures during Hospitalization":#xD; "Ischemic Stroke Encounter" IschemicStrokeEncounter#xD; with "Intervention Comfort Measures" ComfortMeasure#xD; such that FHIRHelpers.ToDateTime(Coalesce(ComfortMeasure.performed as dateTime,ComfortMeasure.authoredOn)) during Global."HospitalizationWithObservation"(IschemicStrokeEncounter)#xD; #xD; define "Encounter with Principal Diagnosis and Age":#xD; "All Stroke Encounter" AllStrokeEncounter#xD; with ["Patient"] BirthDate#xD; such that Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of FHIRHelpers.ToInterval(AllStrokeEncounter.period)) >= 18#xD; #xD; define function "CalendarDayOfOrDayAfter"(StartValue DateTime ):#xD; Interval(Global."ToDate"(StartValue), Global."ToDate"(StartValue + 2 days))#xD; ELM XML Content Encoded data (83532 characters) ELM JSON Content Encoded data (151272 characters) Generated using version 0.4.9 of the sample-content-ig Liquid templates
HL7 International / Clinical Quality Information
This library is used as an example in the FHIR Quality Measure Implementation Guide
Value set Discharge To Acute Care Facility
Value set Discharged to Health Care Facility for Hospice Care
Value set Discharged to Home for Hospice Care
Value set Non-Elective Inpatient Encounter
Encounter with Principal Diagnosis and Age
Ischemic Stroke Encounters with Discharge Disposition