ViralLoadStatus
type: Library
node role: treeRoot
id:
  v: ViralLoadStatus
text:
  status:
    v: extensions
  div: Title: CQL - Most Recent Viral Load Status Id: ViralLoadStatus Version: 1.0.1 Url: CQL - Most Recent Viral Load Status 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: Checks for the most recent viral load and determines the suppression status. Jurisdiction: 001 Related Artifacts: Dependencies CQL - HIV Common CQL - Local Common Parameters: Name Type Min Max In/Out Measurement Period Period 0 1 In Patient Patient 0 1 Out Most Recent Viral Load Date dateTime 0 1 Out Total Viral Load Observations integer 0 1 Out Most Recent Viral Load Observation Observation 0 1 Out Most Recent Viral Load Indication string 0 1 Out Content: text/cql library ViralLoadStatus 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 include LocalCommon called LOCALC parameter "Measurement Period" Interval<DateTime> default Interval[@2023-12-01, @2023-12-31] //For testing only context Patient define "Most Recent Viral Load Date": LOCALC.ObservationDate(LOCALC.MostRecent ( HIVC.ViralLoadResult ( "Measurement Period" ) )) define "Total Viral Load Observations": Count ( HIVC.ViralLoadResult ( "Measurement Period" ) ) define "Most Recent Viral Load Observation": LOCALC.MostRecent ( HIVC.ViralLoadResult ( "Measurement Period" ) ) define "Most Recent Viral Load Indication": SuppressionStatus(LOCALC.MostRecent(HIVC.ViralLoadResult("Measurement Period"))) define function SuppressionStatus(obs FHIR.Observation): if ( obs.value as Quantity ).value > 1000 then 'Unsuppressed' else if ( obs.value as Quantity ).value <= 1000 then 'Suppressed' else null Content: application/elm+xml Encoded data (33400 characters) Content: application/elm+json Encoded data (64536 characters)
url:
  v: http://jembi.org/fhir/Library/ViralLoadStatus
version:
  v: 1.0.1
name:
  v: ViralLoadStatus
title:
  v: CQL - Most Recent Viral Load Status
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: Checks for the most recent viral load and determines the suppression status.
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: Library LOCALC
  resource:
    v: http://jembi.org/fhir/Library/LocalCommon
    link: http://jembi.org/fhir/Library/LocalCommon
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: Most Recent Viral Load Date
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: dateTime
parameter:
  name:
    v: Total Viral Load Observations
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: integer
parameter:
  name:
    v: Most Recent Viral Load Observation
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: Observation
parameter:
  name:
    v: Most Recent Viral Load Indication
  use:
    v: out
  min:
    v: 0
  max:
    v: 1
  type:
    v: string
content:
  content type:
    v: text/cql
content:
  content type:
    v: application/elm+xml
content:
  content type:
    v: application/elm+json