eCQM QICore Content Implementation Guide
2023.0.0 - CI Build

eCQM QICore Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2023.0.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/ecqm-content-qicore-2023/ and changes regularly. See the Directory of published versions

## Library: HIVScreeningFHIR

Official URL: http://ecqi.healthit.gov/ecqms/Library/HIVScreeningFHIR | Version: 0.0.001
Active as of 2023-08-14 | Computable Name: HIVScreeningFHIR
Other Identifiers: https://madie.cms.gov/login#HIVScreeningFHIR (use: official, )
Usage:Program: EP/EC

HIVScreeningFHIR

Id: | HIVScreeningFHIR
Url: | http://ecqi.healthit.gov/ecqms/Library/HIVScreeningFHIR
Version: | 0.0.001
Identifier: | value: HIVScreeningFHIR
Name: | HIVScreeningFHIR
Title: | HIVScreeningFHIR
Status: | active
Experimental: | false
Type: | system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library
Date: | 2023-08-14T15:19:44+00:00
Description: | HIVScreeningFHIR
Use Context: |
code | value | display
--- | --- | ---
program | ep-ec | EP/EC
Related Artifacts: | Dependencies
Data Requirements: |
Type | Profile | MS | Code Filter
--- | --- | --- | ---
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient |  |
Patient | http://hl7.org/fhir/Patient | ;;;; |
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient |  |
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient |  |
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1056.50
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation | ; | code filter: path: code system: http://loinc.org code: 75622-1 display: HIV 1 and 2 tests - Meaningful Use set
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.464.1003.101.12.1022
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.464.1003.101.12.1023
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.464.1003.101.12.1024
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.464.1003.101.12.1025
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.464.1003.101.12.1001
Coverage | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage | ;; | code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
uri | http://hl7.org/fhir/uri | ; |
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient | ;; |
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient | ;; |
Condition | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-condition | ;; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.120.12.1003
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient | ;; |
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient | ;; |
Coverage | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-coverage | ;; | code filter: path: type value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient | ;; |
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient | ;; |
Content: text/cql
    library HIVScreeningFHIR version '0.0.001'

    using QICore version '4.1.1'

    /*This spec aligns with AU2023/PY2024 QDM version*/

    include FHIRHelpers version '4.3.000' called FHIRHelpers
    include SupplementalDataElements version '3.4.000' called SDE
    include CQMCommon version '1.4.000' called CQMCommon
    include QICoreCommon version '1.5.000' called QICoreCommon

    codesystem "LOINC": 'http://loinc.org'
    codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'
    codesystem "ConditionClinicalStatusCodes": 'http://terminology.hl7.org/CodeSystem/condition-clinical'
    codesystem "ConditionVerificationStatus": 'http://terminology.hl7.org/CodeSystem/condition-ver-status'

    valueset "HIV": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.120.12.1003'
    valueset "Human Immunodeficiency Virus (HIV) Laboratory Test Codes (Ab and Ag)": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1056.50'
    valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001'
    valueset "Preventive Care Services - Established Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1025'
    valueset "Preventive Care Services, Initial Office Visit, 0 to 17": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1022'
    valueset "Preventive Care Services-Initial Office Visit, 18 and Up": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1023'
    valueset "Preventive Care, Established Office Visit, 0 to 17": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1024'

    code "Birth date": '21112-8' from "LOINC" display 'Birth date'
    code "HIV 1 and 2 tests - Meaningful Use set": '75622-1' from "LOINC" display 'HIV 1 and 2 tests - Meaningful Use set'
    code "AMB": 'AMB' from "ActCode" display 'Ambulatory'
    code "active": 'active' from "ConditionClinicalStatusCodes"
    code "refuted": 'refuted' from "ConditionVerificationStatus"

    parameter "Measurement Period" Interval<DateTime>

    context Patient

    define "Initial Population":
      AgeInYearsAt(date from start of "Measurement Period") in Interval[15, 65]
        and exists "Qualifying Encounters"

    define "Denominator":
      "Initial Population"

    define "Numerator":
      ( "Has HIV Test Performed" )

    define "Denominator Exclusions":
      exists ( ["Condition": "HIV"] HIV
          where QICoreCommon."ToPrevalenceInterval" ( HIV Indicators ) starts before start of "Measurement Period"
            and HIV.verificationStatus !~ "refuted"
      )

    define "Qualifying Encounters":
      ( ["Encounter": "Preventive Care Services, Initial Office Visit, 0 to 17"]
        union ["Encounter": "Preventive Care Services-Initial Office Visit, 18 and Up"]
        union ["Encounter": "Preventive Care, Established Office Visit, 0 to 17"]
        union ["Encounter": "Preventive Care Services - Established Office Visit, 18 and Up"]
        union ["Encounter": "Office Visit"] ) Encounter
        where Encounter.period during "Measurement Period"
          and Encounter.class ~ "AMB"
          and Encounter.status = 'finished'

    define "Has HIV Test Performed":
      exists ( ["Observation": "Human Immunodeficiency Virus (HIV) Laboratory Test Codes (Ab and Ag)"]
        union ["Observation": "HIV 1 and 2 tests - Meaningful Use set"] ) HIVTest
        where AgeInYearsAt(date from start of QICoreCommon."ToInterval"(HIVTest.effective)) in Interval[15, 65]
          and QICoreCommon."ToInterval" ( HIVTest.effective ) starts before end of "Measurement Period"
          and ( HIVTest.status = 'final'
              or HIVTest.status = 'amended'
              or HIVTest.status = 'corrected'
          )

    define "SDE Ethnicity":
      SDE."SDE Ethnicity"

    define "SDE Payer":
      SDE."SDE Payer"

    define "SDE Race":
      SDE."SDE Race"

    define "SDE Sex":
      SDE."SDE Sex"
Content: application/elm+xml
    Encoded data (113448 characters)
Content: application/elm+json
    Encoded data (163476 characters)