Starter FHIR Implementation Guide
1.0.1 - draft International flag

Starter FHIR Implementation Guide, published by Jembi Health Systems. This guide is not an authorized publication; it is the continuous build for version 1.0.1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/jembi/Starter-FHIR-IG/ and changes regularly. See the Directory of published versions

Library: CQL - HIV Common (Experimental)

Official URL: http://jembi.org/fhir/Library/HIVCommonLibrary Version: 1.0.1
Draft as of 2024-11-17 Computable Name: HIVCommonLibrary

Common CQL for HIV calculations.

Generated Narrative: Library HIVCommonLibrary

Related Artifacts

Depends OnLibrary FHIRHelpershttp://jembi.org/fhir/Library/FHIRHelpers|4.0.1
Depends OnLibrary FHIRCommonhttp://jembi.org/fhir/Library/FHIRCommon|4.0.1
Depends OnCode System Observation Category CodesObservation Category Codes
Depends OnCode System SNOMED CT CodesSNOMED CT (all versions)
Depends OnCode System LOINC CodesLogical Observation Identifiers, Names and Codes (LOINC)
Depends OnValue Set HIV Test TypesHIV Test Types
Depends OnValue Set ARV DrugsARV Drugs

Parameters

Patientout01Patient

Data Requirements

Type: Observation (Observation)
FilterValue
codeOne of these codes: SNOMED CT 315124004: HIV viral load
Type: Observation (Observation)
FilterValue
codeIn ValueSet HIV Test Types
Type: Observation (Observation)
FilterValue
codeOne of these codes: LOINC 47248-0: HIV Antiretroviral therapy Antiretroviral therapy status section

Contents

text/cql

library HIVCommon version '0.1.0'

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'
include FHIRCommon version '4.0.1'

valueset "HIV Test Types": 'http://jembi.org/fhir/ValueSet/hiv-test-type-value-set'
valueset "ARV Drugs": 'http://jembi.org/fhir/ValueSet/arv-treatment-value-set'

codesystem "Observation Category Codes": 'http://terminology.hl7.org/CodeSystem/observation-category'
codesystem "SNOMED CT Codes": 'http://snomed.info/sct'
codesystem "LOINC Codes": 'http://loinc.org'

code "Laboratory Observation Category": 'laboratory' from "Observation Category Codes"
code "HIV Viral Load Observation Code": '315124004' from "SNOMED CT Codes"
code "HIV+ Code": 'LA24955-9' from "LOINC Codes"
code "Initiated ART Code": '63936-9' from "LOINC Codes"
code "ART Status Code": '47248-0' from "LOINC Codes"

context Patient

define function ViralLoadResult(period Interval<DateTime>):
  [Observation: "HIV Viral Load Observation Code"] O
    where exists ( O.category C
        where C = "Laboratory Observation Category"
    )
      and O.status = 'final'
      and ( O.value as Quantity ).value is not null
      and ( ( O.effective as dateTime ).value during period
          or ( O.effective as Period ) starts during period
      )

define function HIVPostivePatients(period Interval<DateTime>):
  [Observation: code in "HIV Test Types"] O
    where ( O.value as CodeableConcept ) = "HIV+ Code"
      and ( ( O.effective as dateTime ).value during period
          or ( O.effective as Period ) starts during period
      )

define function InitiatedART(period Interval<DateTime>):
  [Observation: "ART Status Code"] O
    where ( O.value as CodeableConcept ) = "Initiated ART Code"
      and ( ( O.effective as dateTime ).value during period
          or ( O.effective as Period ) starts during period
      )

Content not shown - (application/elm+xml, size = 44Kb )

Content not shown - (application/elm+json, size = 81Kb )