Id: GMCSAU2024FHIR Url: http://ecqi.healthit.gov/ecqms/Library/GMCSAU2024FHIR Version: 0.1.000 Identifier: value: GMCSAU2024FHIR Name: GMCSAU2024FHIR Title: GMCSAU2024FHIR Status: active Experimental: false Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2023-09-06T20:02:05+00:00 Description: GMCSAU2024FHIR Related Artifacts: Dependencies Data Requirements: Type Profile MS Code Filter 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.113883.3.666.5.307 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 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 Content: text/cql library GMCSAU2024FHIR version '0.1.000'#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 QICoreCommon version '1.5.000' called QICoreCommon#xD; include CQMCommon version '1.4.000' called CQMCommon#xD; #xD; codesystem "LOINC": 'http://loinc.org'#xD; codesystem "SNOMEDCT": 'http://snomed.info/sct'#xD; codesystem "ICD10CM": 'http://hl7.org/fhir/sid/icd-10-cm'#xD; #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 "Hospital Dietitian Referral": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.91'#xD; valueset "Malnutrition Diagnosis": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.55'#xD; valueset "Malnutrition Risk Screening": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.92'#xD; valueset "Malnutrition Screening At Risk Result": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.38'#xD; valueset "Malnutrition Screening Not At Risk Result": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.34'#xD; valueset "Nutrition Assessment": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.21'#xD; valueset "Nutrition Assessment Status Moderately Malnourished": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.44'#xD; valueset "Nutrition Assessment Status Not or Mildly Malnourished": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.48'#xD; valueset "Nutrition Assessment Status Severely Malnourished": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.42'#xD; valueset "Nutrition Care Plan": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1095.93'#xD; valueset "ONC Administrative Sex": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1'#xD; valueset "Payer": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591'#xD; valueset "Race": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836'#xD; #xD; code "Birth date": '21112-8' from "LOINC" display 'Birth date'#xD; #xD; parameter "Measurement Period" Interval<DateTime>default Interval[@2021-01-01T00:00:00.0, @2022-01-01T00:00:00.0 )#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 "Qualifying Encounter":#xD; [Encounter: "Encounter Inpatient"] EncounterInpatient#xD; where EncounterInpatient.period ends during day of "Measurement Period"#xD; and AgeInYearsAt(date from start of EncounterInpatient.period) >= 65#xD; and ( duration in hours of EncounterInpatient.period >= 24 )#xD; and EncounterInpatient.status = 'finished'#xD; #xD; define "Initial Population":#xD; "Qualifying Encounter"#xD; #xD; define "Measure Population":#xD; "Initial Population"#xD; #xD; define "Encounter with Hospital Dietitian Referral":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter,#xD; ["Procedure": "Hospital Dietitian Referral"] HospitalDietitianReferral#xD; where "Hospital Dietitian Referral" contains HospitalDietitianReferral.code as Concept#xD; and HospitalDietitianReferral.status in { 'active', 'completed', 'in-progress' }#xD; and HospitalDietitianReferral.performed.earliest ( ) during QualifyingEncounter.hospitalizationWithObservation ( )#xD; return QualifyingEncounter#xD; #xD; define "Encounter with Malnutrition Risk Screening":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter,#xD; ["Observation": "Malnutrition Risk Screening"] MalnutritionRiskScreening#xD; where ( "Malnutrition Risk Screening" contains MalnutritionRiskScreening.code as Concept#xD; and MalnutritionRiskScreening.status in { 'final', 'amended', 'corrected' }#xD; and MalnutritionRiskScreening.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )#xD; and ( "Malnutrition Screening Not At Risk Result" contains MalnutritionRiskScreening.value as Concept#xD; or "Malnutrition Screening At Risk Result" contains MalnutritionRiskScreening.value as Concept#xD; )#xD; )#xD; return QualifyingEncounter#xD; #xD; define "Encounter with Malnutrition Risk Screening or with Hospital Dietitian Referral":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter#xD; where "Encounter with Malnutrition Risk Screening" contains QualifyingEncounter#xD; or "Encounter with Hospital Dietitian Referral" contains QualifyingEncounter#xD; return QualifyingEncounter#xD; #xD; define "Encounter with Malnutrition Risk Screening Not at Risk":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter,#xD; ["Observation": "Malnutrition Risk Screening"] MalnutritionRiskScreening#xD; where "Malnutrition Risk Screening" contains MalnutritionRiskScreening.code as Concept#xD; and MalnutritionRiskScreening.status in { 'final', 'amended', 'corrected' }#xD; and MalnutritionRiskScreening.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )#xD; and ( "Malnutrition Screening Not At Risk Result" contains MalnutritionRiskScreening.value as Concept )#xD; return QualifyingEncounter#xD; #xD; define "Encounter with Malnutrition Risk Screening at Risk":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter,#xD; ["Observation": "Malnutrition Risk Screening"] MalnutritionRiskScreening#xD; where "Malnutrition Risk Screening" contains MalnutritionRiskScreening.code as Concept#xD; and MalnutritionRiskScreening.status in { 'final', 'amended', 'corrected' }#xD; and MalnutritionRiskScreening.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )#xD; and ( "Malnutrition Screening At Risk Result" contains MalnutritionRiskScreening.value as Concept )#xD; return QualifyingEncounter#xD; #xD; define "Encounter with Malnutrition Risk Screening at Risk or with Hospital Dietitian Referral":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter#xD; where "Encounter with Malnutrition Risk Screening at Risk" contains QualifyingEncounter#xD; or "Encounter with Hospital Dietitian Referral" contains QualifyingEncounter#xD; return QualifyingEncounter#xD; #xD; define "Encounter with Nutrition Assessment and Identified Status":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter,#xD; ["Observation": "Nutrition Assessment"] NutritionAssessment#xD; where "Nutrition Assessment" contains NutritionAssessment.code as Concept#xD; and NutritionAssessment.status in { 'final', 'amended', 'corrected' }#xD; and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )#xD; and ( "Nutrition Assessment Status Moderately Malnourished" contains NutritionAssessment.value as Concept#xD; or "Nutrition Assessment Status Not or Mildly Malnourished" contains NutritionAssessment.value as Concept#xD; or "Nutrition Assessment Status Severely Malnourished" contains NutritionAssessment.value as Concept#xD; )#xD; return QualifyingEncounter#xD; #xD; define "Encounter with Nutrition Assessment Status Moderately Or Severely Malnourished":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter,#xD; ["Observation": "Nutrition Assessment"] NutritionAssessment#xD; where ( "Nutrition Assessment" contains NutritionAssessment.code as Concept#xD; and NutritionAssessment.status in { 'final', 'amended', 'corrected' }#xD; and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )#xD; and ( "Nutrition Assessment Status Moderately Malnourished" contains NutritionAssessment.value as Concept#xD; or "Nutrition Assessment Status Severely Malnourished" contains NutritionAssessment.value as Concept#xD; )#xD; )#xD; return QualifyingEncounter#xD; #xD; define "Encounter with Nutrition Assessment Not or Mildly Malnourished":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter,#xD; ["Observation": "Nutrition Assessment"] NutritionAssessment#xD; where "Nutrition Assessment" contains NutritionAssessment.code as Concept#xD; and NutritionAssessment.status in { 'final', 'amended', 'corrected' }#xD; and NutritionAssessment.effective.toInterval ( ) during QualifyingEncounter.hospitalizationWithObservation ( )#xD; and ( "Nutrition Assessment Status Not or Mildly Malnourished" contains NutritionAssessment.value as Concept )#xD; return QualifyingEncounter#xD; #xD; define "Encounter with Malnutrition Diagnosis":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter,#xD; ["Condition": "Malnutrition Diagnosis"] MalnutritionDiagnosis#xD; where "Malnutrition Diagnosis" contains MalnutritionDiagnosis.code as Concept //and MalnutritionDiagnosis.prevalenceInterval() starts during QualifyingEncounter.hospitalizationWithObservation() /* and ( NutritionAssessment.value as Concept in "Nutrition Assessment Status Moderately Malnourished" or NutritionAssessment.value as Concept in "Nutrition Assessment Status Severely Malnourished" ) */#xD; #xD; #xD; return QualifyingEncounter#xD; #xD; define "Encounter with Nutrition Care Plan":#xD; from#xD; "Qualifying Encounter" QualifyingEncounter,#xD; ["Procedure": "Nutrition Care Plan"] NutritionCarePlan#xD; where "Nutrition Care Plan" contains NutritionCarePlan.code as Concept#xD; and NutritionCarePlan.status in { 'completed', 'in-progress' }#xD; and NutritionCarePlan.performed.earliest ( ) during QualifyingEncounter.hospitalizationWithObservation ( ) /* and ( NutritionAssessment.value as Concept in "Nutrition Assessment Status Moderately Malnourished" or NutritionAssessment.value as Concept in "Nutrition Assessment Status Severely Malnourished" ) */#xD; #xD; return QualifyingEncounter#xD; #xD; define function "Measure Observation 1"(MalnutritionRiskScreening Encounter):#xD; if "Encounter with Malnutrition Risk Screening or with Hospital Dietitian Referral" contains MalnutritionRiskScreening then 1 #xD; else 0#xD; #xD; define function "Measure Observation 2"(NutritionAssessment Encounter):#xD; if "Encounter with Malnutrition Risk Screening at Risk or with Hospital Dietitian Referral" contains NutritionAssessment then if "Encounter with Nutrition Assessment and Identified Status" contains NutritionAssessment then 1 #xD; else 0 #xD; else 0#xD; #xD; define function "Measure Observation 3"(MalnutritionDiagonsis Encounter):#xD; if "Encounter with Malnutrition Risk Screening at Risk or with Hospital Dietitian Referral" contains MalnutritionDiagonsis then if "Encounter with Malnutrition Diagnosis" contains MalnutritionDiagonsis then if "Encounter with Nutrition Assessment Status Moderately Or Severely Malnourished" contains MalnutritionDiagonsis then 1 #xD; else 0 #xD; else 0 #xD; else 0#xD; #xD; define function "Measure Observation 4"(NutritionCarePlan Encounter):#xD; if "Encounter with Malnutrition Risk Screening at Risk or with Hospital Dietitian Referral" contains NutritionCarePlan then if "Encounter with Nutrition Care Plan" contains NutritionCarePlan then if "Encounter with Nutrition Assessment Status Moderately Or Severely Malnourished" contains NutritionCarePlan then 1 #xD; else 0 #xD; else 0 #xD; else 0#xD; #xD; define function "Measure Observation TotalMalnutritionComponentsScore"(QualifyingEncounter Encounter):#xD; Sum({ "Measure Observation 1"(QualifyingEncounter), "Measure Observation 2"(QualifyingEncounter), "Measure Observation 3"(QualifyingEncounter), "Measure Observation 4"(QualifyingEncounter) })#xD; #xD; define function "TotalMalnutritionCompositeScore Eligible Denominators"(QualifyingEncounter Encounter):#xD; if ( ( "Encounter with Malnutrition Risk Screening or with Hospital Dietitian Referral" contains QualifyingEncounter )#xD; and ( "Encounter with Malnutrition Risk Screening Not at Risk" contains QualifyingEncounter )#xD; )#xD; and not ( "Encounter with Hospital Dietitian Referral" contains QualifyingEncounter ) then 1 #xD; else if ( ( ( "Encounter with Malnutrition Risk Screening or with Hospital Dietitian Referral" contains QualifyingEncounter )#xD; and ( "Encounter with Malnutrition Risk Screening at Risk" contains QualifyingEncounter )#xD; )#xD; or ( "Encounter with Hospital Dietitian Referral" contains QualifyingEncounter )#xD; )#xD; and ( "Encounter with Nutrition Assessment Not or Mildly Malnourished" contains QualifyingEncounter )#xD; or not ( "Encounter with Nutrition Assessment and Identified Status" contains QualifyingEncounter ) then 2 #xD; else 4#xD; #xD; define function "Measure Observation TotalMalnutritionCompositeScore as Percentage"(QualifyingEncounter Encounter): //("Measure Observation TotalMalnutritionComponentsScore"(QualifyingEncounter)) #xD; #xD; 100 * ( "Measure Observation TotalMalnutritionComponentsScore"(QualifyingEncounter) / "TotalMalnutritionCompositeScore Eligible Denominators"(QualifyingEncounter) ) Content: application/elm+json Encoded data (240508 characters)
Value set Malnutrition Screening At Risk Result
Value set Malnutrition Screening Not At Risk Result
Value set Nutrition Assessment Status Moderately Malnourished
Value set Nutrition Assessment Status Not or Mildly Malnourished
Value set Nutrition Assessment Status Severely Malnourished
Encounter with Hospital Dietitian Referral
Encounter with Malnutrition Risk Screening
Encounter with Malnutrition Risk Screening or with Hospital Dietitian Referral
Encounter with Malnutrition Risk Screening Not at Risk
Encounter with Malnutrition Risk Screening at Risk
Encounter with Malnutrition Risk Screening at Risk or with Hospital Dietitian Referral
Encounter with Nutrition Assessment and Identified Status
Encounter with Nutrition Assessment Status Moderately Or Severely Malnourished
Encounter with Nutrition Assessment Not or Mildly Malnourished
Error attempting to determine filter value: toFhirValue not implemented for Subtract