Id: AdvancedIllnessandFrailtyExclusionECQMFHIR4 Version: 0.1.0 Url: AdvancedIllnessandFrailtyExclusionECQMFHIR4 Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2021-01-08 13:45:35+0000 Publisher: Clinical Quality Framework Description: Frailty Exclusion Jurisdiction: 001 Related Artifacts: Dependencies http://fhir.org/guides/cqf/aphl/chronic-ds/Library/FHIRHelpers|4.1.000 http://fhir.org/guides/cqf/aphl/chronic-ds/Library/MATGlobalCommonFunctionsFHIR4|6.0.000 http://fhir.org/guides/cqf/aphl/chronic-ds/Library/FHIRCommon|1.1.000 AlphoraCommon LOINC SNOMED CT (all versions) Acute Inpatient Advanced Illness Care Services in Long-Term Residential Facility Dementia Medications Emergency Department Visit Frailty Device Frailty Diagnosis Frailty Encounter Frailty Symptom Nonacute Inpatient Nursing Facility Visit Observation Outpatient Parameters: Name Type Min Max In/Out Measurement Period Period 0 1 In Patient Patient 0 1 Out Up To One Year Prior Including Measurement Period Period 0 1 Out Has Criteria Indicating Frailty boolean 0 1 Out Outpatient Encounters With Advanced Illness Encounter 0 * Out Has Two Outpatient Encounters With Advanced Illness on Different Dates of Service Encounter 0 * Out Has Inpatient Encounter With Advanced Illness Encounter 0 * Out Has Dementia Medications In Year Before or During Measurement Period MedicationRequest 0 * Out Is Age 66 or Older with Advanced Illness and Frailty boolean 0 1 Out Is Age 66 to 80 with Advanced Illness and Frailty or Is Age 81 or Older with Frailty boolean 0 1 Out Lives In A Nursing Home boolean 0 1 Out Is Age 66 or Older Living Long Term in a Nursing Home boolean 0 1 Out Data Requirements: Type Profile MS Code Filter Patient http://hl7.org/fhir/StructureDefinition/Patient DeviceRequest http://hl7.org/fhir/StructureDefinition/DeviceRequest ;; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.118.12.1300 Observation http://hl7.org/fhir/StructureDefinition/Observation ;;; code filter: path: code system: http://loinc.org code: 98181-1 display: Medical equipment used Observation http://hl7.org/fhir/StructureDefinition/Observation ;; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1075 Observation http://hl7.org/fhir/StructureDefinition/Observation ;;; code filter: path: code system: http://loinc.org code: 71802-3 display: Housing status Condition http://hl7.org/fhir/StructureDefinition/Condition ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1074 Condition http://hl7.org/fhir/StructureDefinition/Condition ; code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1082 Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1088 Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1087 Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1086 Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010 Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1084 Encounter http://hl7.org/fhir/StructureDefinition/Encounter ;; code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1083 MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest ;; code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1510 MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest ;; Medication http://hl7.org/fhir/StructureDefinition/Medication ;; Content: text/cql library AdvancedIllnessandFrailtyExclusionECQMFHIR4 version '5.12.000'#xD; #xD; using FHIR version '4.0.1'#xD; #xD; include FHIRHelpers version '4.1.000' called FHIRHelpers#xD; include MATGlobalCommonFunctionsFHIR4 version '6.0.000' called Global#xD; include FHIRCommon version '1.1.000' called FC #xD; include AlphoraCommon called AC#xD; #xD; codesystem "LOINC": 'http://loinc.org'#xD; codesystem "SNOMEDCT": 'http://snomed.info/sct' #xD; #xD; valueset "Acute Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1083' #xD; valueset "Advanced Illness": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.110.12.1082' #xD; valueset "Care Services in Long-Term Residential Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014' #xD; valueset "Dementia Medications": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.196.12.1510' #xD; valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010' #xD; valueset "Emergency Department Evaluation and Management Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1010'#xD; valueset "Frailty Device": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.118.12.1300' #xD; valueset "Frailty Diagnosis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1074' #xD; valueset "Frailty Encounter": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1088' #xD; valueset "Frailty Symptom": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.113.12.1075' #xD; valueset "Nonacute Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1084' #xD; valueset "Nursing Facility Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012' #xD; valueset "Observation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1086' #xD; valueset "Outpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1087' #xD; #xD; code "Housing Status": '71802-3' from "LOINC" display 'Housing status'#xD; code "Lives In A Nursing Home (finding)": '160734000' from "SNOMEDCT" display 'Lives in a nursing home (finding)'#xD; code "Medical Equipment Used": '98181-1' from "LOINC" display 'Medical equipment used'#xD; #xD; parameter "Measurement Period" default Interval[@2025-01-01T00:00:00.0, @2026-01-01T00:00:00.0)#xD; #xD; context Patient#xD; #xD; define "Up To One Year Prior Including Measurement Period":#xD; Interval[start of "Measurement Period" - 1 year, end of "Measurement Period"]#xD; #xD; define "Is Age 66 or Older with Advanced Illness and Frailty":#xD; AgeInYearsAt(date from end of "Measurement Period") >= 66#xD; and "Has Criteria Indicating Frailty"#xD; and (#xD; exists("Has Two Outpatient Encounters With Advanced Illness on Different Dates of Service")#xD; or exists("Has Inpatient Encounter With Advanced Illness")#xD; or exists("Has Dementia Medications In Year Before or During Measurement Period")#xD; )#xD; #xD; define "Is Age 66 to 80 with Advanced Illness and Frailty or Is Age 81 or Older with Frailty":#xD; (#xD; AgeInYearsAt(date from end of "Measurement Period") in Interval[66, 80]#xD; and "Has Criteria Indicating Frailty"#xD; and (#xD; exists("Has Two Outpatient Encounters With Advanced Illness on Different Dates of Service")#xD; or exists("Has Inpatient Encounter With Advanced Illness")#xD; or exists("Has Dementia Medications In Year Before or During Measurement Period")#xD; )#xD; ) #xD; or (#xD; AgeInYearsAt(date from end of "Measurement Period") >= 81#xD; and "Has Criteria Indicating Frailty"#xD; )#xD; #xD; define "Is Age 66 or Older Living Long Term in a Nursing Home":#xD; AgeInYearsAt(date from end of "Measurement Period") >= 66#xD; and "Lives In A Nursing Home"#xD; #xD; define "Has Criteria Indicating Frailty":#xD; exists(#xD; (AC.QualifiedDeviceRequests([DeviceRequest: "Frailty Device"])) FrailtyDeviceOrder#xD; where FrailtyDeviceOrder.authoredOn during day of "Measurement Period"#xD; ) #xD; or exists(#xD; (AC.QualifiedObservations([Observation: "Medical Equipment Used"])) EquipmentUsed#xD; where EquipmentUsed.value in "Frailty Device"#xD; and FC.ToInterval(EquipmentUsed.effective) ends during day of "Measurement Period"#xD; )#xD; or exists(#xD; (AC.QualifiedConditions([Condition: "Frailty Diagnosis"])) FrailtyDiagnosis#xD; where FC.ToPrevalenceInterval(FrailtyDiagnosis) overlaps "Measurement Period"#xD; )#xD; or exists(#xD; (AC.QualifiedEncounters([Encounter: "Frailty Encounter"])) FrailtyEnc#xD; where FC.ToInterval(FrailtyEnc.period) overlaps "Measurement Period"#xD; )#xD; or exists(#xD; (AC.QualifiedObservations([Observation: "Frailty Symptom"])) FrailtySymptom#xD; where FC.ToInterval(FrailtySymptom.effective) overlaps "Measurement Period"#xD; )#xD; #xD; define "Has Inpatient Encounter With Advanced Illness": #xD; (AC.QualifiedEncounters([Encounter: "Acute Inpatient"])) InpatientEnc#xD; with (AC.QualifiedConditions([Condition: "Advanced Illness"])) AdvanIll#xD; such that FC.ToPrevalenceInterval(AdvanIll) overlaps InpatientEnc.period#xD; and FC.ToInterval(InpatientEnc.period) overlaps "Up To One Year Prior Including Measurement Period"#xD; #xD; define "Outpatient Encounters With Advanced Illness":#xD; ((AC.QualifiedEncounters([Encounter: "Outpatient"]))#xD; union (AC.QualifiedEncounters([Encounter: "Observation"]))#xD; union (AC.QualifiedEncounters([Encounter: "Emergency Department Visit"]))#xD; union (AC.QualifiedEncounters([Encounter: "Nonacute Inpatient"]))) OutpatientEnc#xD; with (AC.QualifiedConditions([Condition: "Advanced Illness"])) AdvanIll#xD; such that FC.ToPrevalenceInterval(AdvanIll) overlaps "Measurement Period"#xD; and FC.ToInterval(OutpatientEnc.period) overlaps "Up To One Year Prior Including Measurement Period" #xD; #xD; define "Has Two Outpatient Encounters With Advanced Illness on Different Dates of Service":#xD; from#xD; "Outpatient Encounters With Advanced Illness" OutpatientEncounter1,#xD; "Outpatient Encounters With Advanced Illness" OutpatientEncounter2#xD; where OutpatientEncounter2.period ends 1 day or more after day of end of OutpatientEncounter1.period#xD; return OutpatientEncounter1 #xD; #xD; define "Has Dementia Medications In Year Before or During Measurement Period":#xD; (AC.QualifiedMedicationRequests([MedicationRequest: "Dementia Medications"])) DementiaMed#xD; where exists(#xD; DementiaMed.dosageInstruction dosage#xD; where exists(#xD; FC.ToTimingInterval(dosage.timing)) timing#xD; where timing overlaps "Up To One Year Prior Including Measurement Period")#xD; #xD; define "Lives In A Nursing Home":#xD; Last(#xD; (AC.QualifiedObservations([Observation: "Housing Status"])) HousingStatus#xD; where FC.ToInterval(HousingStatus.effective) ends on or before end of "Measurement Period"#xD; and HousingStatus.value ~ ToConcept("Lives In A Nursing Home (finding)")#xD; sort by issued ascending#xD; ) is not null#xD; #xD; #xD; Content: application/elm+xml Encoded data (154028 characters) Content: application/elm+json Encoded data (291220 characters)
Value set Care Services in Long-Term Residential Facility
Up To One Year Prior Including Measurement Period
Outpatient Encounters With Advanced Illness
Has Two Outpatient Encounters With Advanced Illness on Different Dates of Service
Has Inpatient Encounter With Advanced Illness
Has Dementia Medications In Year Before or During Measurement Period
Is Age 66 or Older with Advanced Illness and Frailty
Is Age 66 to 80 with Advanced Illness and Frailty or Is Age 81 or Older with Frailty
Is Age 66 or Older Living Long Term in a Nursing Home