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: POAGOpticNerveEvaluationFHIR

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

POAGOpticNerveEvaluationFHIR

Id: | POAGOpticNerveEvaluationFHIR
Url: | http://ecqi.healthit.gov/ecqms/Library/POAGOpticNerveEvaluationFHIR
Version: | 0.0.004
Identifier: | value: POAGOpticNerveEvaluationFHIR
Name: | POAGOpticNerveEvaluationFHIR
Title: | POAGOpticNerveEvaluationFHIR
Status: | active
Experimental: | false
Type: | system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library
Date: | 2023-08-14T15:35:13+00:00
Description: | POAGOpticNerveEvaluationFHIR
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 | ;;;; |
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
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.526.3.1285
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.1008
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.1012
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.1014
Condition | http://hl7.org/fhir/Condition | ; |
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.526.3.326
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.113883.3.526.3.1333
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.113883.3.526.3.1334
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
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 | ;; |
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-observationnotdone | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1333
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observationnotdone | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1333
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observationnotdone | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1334
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observationnotdone | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1334
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 POAGOpticNerveEvaluationFHIR version '0.0.004'

    using QICore version '4.1.1'

    /*This spec aligns with AU2022/PY2023 QDM version
    Notews 1. 8/09.2023: Per BonnieMat-1455 and ticket  https://github.com/cqframework/cql-execution/issues/296
    using valuesets with negation profiles does not work.
    */

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

    codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'

    valueset "Care Services in Long-Term Residential Facility": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1014'
    valueset "Cup to Disc Ratio": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1333'
    valueset "Face-to-Face Interaction": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1048'
    valueset "Medical Reason": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1007'
    valueset "Nursing Facility Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1012'
    valueset "Office Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1001'
    valueset "Ophthalmological Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1285'
    valueset "Optic Disc Exam for Structural Abnormalities": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1334'
    valueset "Outpatient Consultation": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1008'
    valueset "Primary Open-Angle Glaucoma": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.326'

    code "virtual": 'VR' from "ActCode" display 'virtual'
    code "AMB": 'AMB' from "ActCode" display 'Ambulatory'

    parameter "Measurement Period" Interval<DateTime>

    context Patient

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

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

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

    define "SDE Sex":
      SDE."SDE Sex"

    define "Denominator":
      "Initial Population"

    define "Denominator Exceptions":
      exists "Medical Reason for Not Performing Cup to Disc Ratio"
        or exists "Medical Reason for Not Performing Optic Disc Exam"

    define "Qualifying Encounter During Measurement Period":
      ( ["Encounter": "Office Visit"]
        union ["Encounter": "Ophthalmological Services"]
        union ["Encounter": "Outpatient Consultation"]
        union ["Encounter": "Nursing Facility Visit"]
        union ["Encounter": "Care Services in Long-Term Residential Facility"] ) QualifyingEncounter
        where QualifyingEncounter.period during "Measurement Period"
          and QualifyingEncounter.class !~ "virtual"
          and QualifyingEncounter.class ~ "AMB"
          and QualifyingEncounter.status = 'finished'

    define "Initial Population":
      AgeInYearsAt(date from start of "Measurement Period") >= 18
        and exists "Primary Open Angle Glaucoma Encounter"

    define "Primary Open Angle Glaucoma Encounter":
      "Qualifying Encounter During Measurement Period" ValidQualifyingEncounter
        with ["Condition": "Primary Open-Angle Glaucoma"] PrimaryOpenAngleGlaucoma
          such that PrimaryOpenAngleGlaucoma.prevalenceInterval ( ) overlaps ValidQualifyingEncounter.period
            and PrimaryOpenAngleGlaucoma.isActive ( )
            and not ( PrimaryOpenAngleGlaucoma.verificationStatus ~ QICoreCommon."unconfirmed"
                or PrimaryOpenAngleGlaucoma.verificationStatus ~ QICoreCommon."refuted"
                or PrimaryOpenAngleGlaucoma.verificationStatus ~ QICoreCommon."entered-in-error"
            )

    define "Cup to Disc Ratio Performed with Result":
      ["Observation": "Cup to Disc Ratio"] CupToDiscExamPerformed
        with "Primary Open Angle Glaucoma Encounter" EncounterWithPOAG
          such that CupToDiscExamPerformed.effective.toInterval ( ) during EncounterWithPOAG.period
        where CupToDiscExamPerformed.value is not null
          and CupToDiscExamPerformed.status in { 'final', 'amended', 'corrected' }

    define "Optic Disc Exam Performed with Result":
      ["Observation": "Optic Disc Exam for Structural Abnormalities"] OpticDiscExamPerformed
        with "Primary Open Angle Glaucoma Encounter" EncounterWithPOAG
          such that OpticDiscExamPerformed.effective.toInterval ( ) during EncounterWithPOAG.period
        where OpticDiscExamPerformed.value is not null
          and OpticDiscExamPerformed.status in { 'final', 'amended', 'corrected' }

    define "Numerator":
      exists "Cup to Disc Ratio Performed with Result"
        and exists "Optic Disc Exam Performed with Result"

    define "Medical Reason for Not Performing Cup to Disc Ratio":
      ["ObservationNotDone": "Cup to Disc Ratio"] CupToDiscExamNotPerformed
        with "Primary Open Angle Glaucoma Encounter" EncounterWithPOAG
          such that CupToDiscExamNotPerformed.issued.toInterval ( ) during EncounterWithPOAG.period
        where CupToDiscExamNotPerformed.status = 'cancelled'
          and CupToDiscExamNotPerformed.notDoneReason in "Medical Reason"

    define "Medical Reason for Not Performing Optic Disc Exam":
      ["ObservationNotDone": "Optic Disc Exam for Structural Abnormalities"] OpticDiscExamNotPerformed
        with "Primary Open Angle Glaucoma Encounter" EncounterWithPOAG
          such that OpticDiscExamNotPerformed.issued.toInterval ( ) during EncounterWithPOAG.period
        where OpticDiscExamNotPerformed.status = 'cancelled'
          and OpticDiscExamNotPerformed.notDoneReason in "Medical Reason"
Content: application/elm+xml
    Encoded data (157320 characters)
Content: application/elm+json
    Encoded data (225172 characters)