Title: CQL - Viral Load (Outpatients only) Id: OutpatientViralLoad Version: 1.0.1 Url: CQL - Viral Load (Outpatients only) Experimental: true Type: system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library Date: 2025-09-26 07:23:41+0000 Publisher: Jembi Health Systems Description: CQL Measure that reports on all outpatients who have a HIV viral load date within the reporting period. Numerator: Count all outpatients who have an HIV viral load result within the reporting period. Denominator: Count all patients where the encounter class is for outpatient and the encounter date is within the reporting period. Jurisdiction: 001 Related Artifacts: Dependencies CQL - HIV Common ActCode Parameters: Name Type Min Max In/Out Measurement Period Period 0 1 In Patient Patient 0 1 Out Outpatient Encounter 0 * Out Initial Population boolean 0 1 Out Denominator boolean 0 1 Out Viral Load Results Observation 0 * Out Numerator boolean 0 1 Out Data Requirements: Type Profile MS Code Filter Encounter http://hl7.org/fhir/StructureDefinition/Encounter code filter: path: class system: http://terminology.hl7.org/CodeSystem/v3-ActCode code: AMB Content: text/cql library OutpatientViralLoad using FHIR version '4.0.1' include FHIRHelpers version '4.0.1' //include fhir.cqf.common.FHIRCommon version '4.0.1' include HIVCommon called HIVC codesystem "Encounter Class Codes": 'http://terminology.hl7.org/CodeSystem/v3-ActCode' code "Outpatient Encounter Class": 'AMB' from "Encounter Class Codes" parameter "Measurement Period" Interval<DateTime> default Interval[@2023-12-01, @2023-12-31] //For testing only context Patient define "Outpatient": [Encounter: class = "Outpatient Encounter Class"] E where E.period during "Measurement Period" and E.status = 'finished' define "Initial Population": exists ( "Outpatient" ) define "Denominator": "Initial Population" define "Viral Load Results": HIVC.ViralLoadResult ( "Measurement Period") define "Numerator": exists ( "Viral Load Results" ) Content: application/elm+xml Encoded data (24888 characters) Content: application/elm+json Encoded data (47664 characters)
CQL Measure that reports on all outpatients who have a HIV viral load date within the reporting period. Numerator: Count all outpatients who have an HIV viral load result within the reporting period. Denominator: Count all patients where the encounter class is for outpatient and the encounter date is within the reporting period.