Id: HybridHospitalWideMortalityFHIR Url: http://ecqi.healthit.gov/ecqms/Library/HybridHospitalWideMortalityFHIR Version: 0.0.001 Identifier: value: HybridHospitalWideMortalityFHIR Name: HybridHospitalWideMortalityFHIR Title: HybridHospitalWideMortalityFHIR Status: active Experimental: false Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2023-08-14T15:24:17+00:00 Description: HybridHospitalWideMortalityFHIR Related Artifacts: Dependencies Data Requirements: Type Profile MS Code Filter Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Patient http://hl7.org/fhir/Patient ;;;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292 Encounter http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-encounter ;;;;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307 Coverage http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage ; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1104.10 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.149 Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.163 Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.152 Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.151 Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114 Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.127 Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129 Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.119 Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.139 Observation http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.2363 Coverage http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591 uri http://hl7.org/fhir/uri ; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Coverage http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591 Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Patient http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient ;; Content: text/cql library HybridHospitalWideMortalityFHIR version '0.0.001' /*This FHIR-based measure has been derived from CMS844v4.0.0 - QDM 5.6 Specifications*/#xD; #xD; #xD; using QICore version '4.1.1'#xD; #xD; include FHIRHelpers version '4.3.000' called FHIRHelpers#xD; include SupplementalDataElements version '3.4.000' called SDE#xD; include CQMCommon version '1.4.000' called CQMCommon#xD; include QICoreCommon version '1.5.000' called QICoreCommon#xD; #xD; codesystem "LOINC": 'http://loinc.org'#xD; codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'#xD; codesystem "Source of Payment Typology": 'https://nahdo.org/sopt'#xD; #xD; valueset "Bicarbonate lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.139'#xD; valueset "birth date": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.560.100.4'#xD; valueset "Body temperature": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.152'#xD; valueset "Creatinine lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.2363'#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 "Ethnicity": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837'#xD; valueset "Heart Rate": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.149'#xD; valueset "Hematocrit lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.114'#xD; valueset "Medicare payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1104.10'#xD; valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'#xD; valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1'#xD; valueset "Oxygen Saturation by Pulse Oximetry": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.151'#xD; valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591'#xD; valueset "Platelet count lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.127'#xD; valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836'#xD; valueset "Sodium lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.119'#xD; valueset "Systolic Blood Pressure": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.163'#xD; valueset "White blood cells count lab test": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1045.129'#xD; #xD; code "Birthdate": '21112-8' from "LOINC" display 'Birthdate'#xD; code "IMP": 'IMP' from "ActCode" display 'Inpatient'#xD; code "ACUTE": 'ACUTE' from "ActCode" display 'Acute'#xD; code "NONAC": 'NONAC' from "ActCode" display 'Nonacute'#xD; code "OBSENC": 'OBSENC' from "ActCode" display 'Observation Encounter'#xD; #xD; parameter "Measurement Period" Interval<DateTime>#xD; #xD; context Patient#xD; #xD; define "SDE Ethnicity":#xD; SDE."SDE Ethnicity"#xD; #xD; define "SDE Payer":#xD; SDE."SDE Payer"#xD; #xD; define "SDE Race":#xD; SDE."SDE Race"#xD; #xD; define "SDE Sex":#xD; SDE."SDE Sex"#xD; #xD; define "Initial Population":#xD; "Inpatient Encounters"#xD; #xD; define "Inpatient Encounters":#xD; from#xD; ["Encounter": "Encounter Inpatient"] InpatientEncounter,#xD; ["Coverage": "Medicare payer"] Payer#xD; where InpatientEncounter.status = 'finished'#xD; and ( InpatientEncounter.class ~ "IMP"#xD; or InpatientEncounter.class ~ "ACUTE"#xD; or InpatientEncounter.class ~ "NONAC"#xD; or InpatientEncounter.class ~ "OBSENC"#xD; )#xD; and AgeInYearsAt(date from start of InpatientEncounter.period) in Interval[65, 94]#xD; and InpatientEncounter.hospitalizationWithObservationLengthofStay ( ) < 365#xD; and InpatientEncounter.period ends during day of "Measurement Period"#xD; return InpatientEncounter /*Inpatient encounter initially listed as AMB class; changed this to inpatient classes as discussed with CORE team- AM*/#xD; #xD; #xD; define "Results":#xD; flatten { //First physical exams (vital signs) #xD; "FirstPhysicalExamWithEncounterId"([Observation: "Heart Rate"], 'FirstHeartRate'), "FirstPhysicalExamWithEncounterId"([Observation: "Systolic Blood Pressure"], 'FirstSystolicBP'), "FirstPhysicalExamWithEncounterId"([Observation: "Body temperature"], 'FirstTemperature'), "FirstPhysicalExamWithEncounterId"([Observation: "Oxygen Saturation by Pulse Oximetry"], 'FirstO2Saturation'), //First lab tests#xD; "FirstLabTestWithEncounterId"([Observation: "Hematocrit lab test"], 'FirstHematocrit'), "FirstLabTestWithEncounterId"([Observation: "Platelet count lab test"], 'FirstPlateletCount'), "FirstLabTestWithEncounterId"([Observation: "White blood cells count lab test"], 'FirstWhiteBloodCell'), "FirstLabTestWithEncounterId"([Observation: "Sodium lab test"], 'FirstSodium'), "FirstLabTestWithEncounterId"([Observation: "Bicarbonate lab test"], 'FirstBicarbonate'), "FirstLabTestWithEncounterId"([Observation: "Creatinine lab test"], 'FirstCreatinine') }#xD; #xD; define function "FirstLabTestWithEncounterId"(LabList List<Observation>, CCDE String):#xD; "Inpatient Encounters" Encounter#xD; let firstlab: First(LabList Lab#xD; where Lab.issued is not null#xD; and Lab.issued during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 1440 minutes]#xD; and Lab.status in { 'final', 'amended', 'preliminary' }#xD; and Lab.value is not null#xD; sort by issued#xD; )#xD; return '\r\n' & CCDE & ',' & Encounter.id & ',' & ( ToString(firstlab.value as Quantity) ) & ',' & ToString(firstlab.issued)#xD; #xD; define function "FirstPhysicalExamWithEncounterId"(ExamList List<Observation>, CCDE String):#xD; "Inpatient Encounters" Encounter#xD; let firstexam: First(ExamList Exam#xD; where start of QICoreCommon."ToInterval"(Exam.effective) is not null#xD; and start of QICoreCommon."ToInterval"(Exam.effective) during Interval[start of Encounter.period - 1440 minutes, start of Encounter.period + 120 minutes]#xD; and Exam.status in { 'final', 'amended', 'preliminary' }#xD; and Exam.value is not null#xD; sort by start of QICoreCommon."ToInterval"(effective)#xD; )#xD; return '\r\n' & CCDE & ',' & Encounter.id & ' , ' & ( ToString(firstexam.value as Quantity) ) & ',' & ToString(start of QICoreCommon."ToInterval"(firstexam.effective)) Content: application/elm+xml Encoded data (250680 characters) Content: application/elm+json Encoded data (370548 characters)
Value set Oxygen Saturation by Pulse Oximetry
Value set White blood cells count lab test
Error attempting to determine filter value: toFhirValue not implemented for Subtract