OutpatientViralLoad
type: Library
node role: treeRoot
id:
  v: OutpatientViralLoad
text:
  status:
    v: extensions
  div: 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" ) …
url:
  v: http://jembi.org/fhir/Library/OutpatientViralLoad
version:
  v: 1.0.1
name:
  v: OutpatientViralLoad
title:
  v: CQL - Viral Load (Outpatients only)
status:
  v: active
experimental:
  v: true
type:
  coding:
    system:
      v: http://terminology.hl7.org/CodeSystem/library-type
    code:
      v: logic-library
date:
  v: 2025-09-26T07:23:41+00:00
publisher:
  v: Jembi Health Systems
contact:
  name:
    v: Jembi Health Systems
  telecom:
    system:
      v: url
    value:
      v: https://www.jembi.org/
  telecom:
    system:
      v: email
contact:
  name:
    v: Richard Langford
  telecom:
    system:
      v: email
    use:
      v: work
description:
  v: 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:
  coding:
    system:
      v: http://unstats.un.org/unsd/methods/m49/m49.htm
    code:
      v: 001
    display:
      v: World
related artifact:
  type:
    v: depends-on
  display:
    v: Library HIVC
  resource:
    v: http://jembi.org/fhir/Library/HIVCommon
    link: http://jembi.org/fhir/Library/HIVCommon
related artifact:
  type:
    v: depends-on
  display:
    v: Code System Encounter Class Codes
  resource:
    v: http://terminology.hl7.org/CodeSystem/v3-ActCode
    link: http://terminology.hl7.org/CodeSystem/v3-ActCode
parameter:
  name:
    v: Measurement Period
  use:
    v: in
  min:
    v: 0
  max:
    v: 1
  type:
    v: Period
parameter:
  name:
    v: Patient
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: Patient
parameter:
  name:
    v: Outpatient
  use:
    v: out
  min:
    v: 0
  max:
    v: *
  type:
    v: Encounter
parameter:
  name:
    v: Initial Population
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: boolean
parameter:
  name:
    v: Denominator
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: boolean
parameter:
  name:
    v: Viral Load Results
  use:
    v: out
  min:
    v: 0
  max:
    v: *
  type:
    v: Observation
parameter:
  name:
    v: Numerator
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: boolean
data requirement:
  type:
    v: Encounter
  profile:
    v: http://hl7.org/fhir/StructureDefinition/Encounter
    link: http://hl7.org/fhir/StructureDefinition/Encounter
  code filter:
    path:
      v: class
    code:
      system:
        v: http://terminology.hl7.org/CodeSystem/v3-ActCode
      code:
        v: AMB
content:
  content type:
    v: text/cql
content:
  content type:
    v: application/elm+xml
content:
  content type:
    v: application/elm+json