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

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

PCSBMIScreenAndFollowUpFHIR

Id: | PCSBMIScreenAndFollowUpFHIR
Url: | http://ecqi.healthit.gov/ecqms/Library/PCSBMIScreenAndFollowUpFHIR
Version: | 0.1.000
Identifier: | value: PCSBMIScreenAndFollowUpFHIR
Name: | PCSBMIScreenAndFollowUpFHIR
Title: | PCSBMIScreenAndFollowUpFHIR
Status: | active
Experimental: | false
Type: | system: http://terminology.hl7.org/CodeSystem/library-type code: logic-library
Date: | 2023-08-28T20:56:47+00:00
Description: | PCSBMIScreenAndFollowUpFHIR
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 | ;;;; |
Observation | http://hl7.org/fhir/StructureDefinition/bmi | ;;;; |
Observation | http://hl7.org/fhir/StructureDefinition/bmi | ;;;; |
Condition | http://hl7.org/fhir/Condition | ; |
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1525
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1527
MedicationRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest | ; | code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1561
MedicationRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest | ; | code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1561
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.113762.1.4.1047.502
Procedure | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure | ;;;;; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1525
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.113762.1.4.1047.502
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient |  |
Observation | http://hl7.org/fhir/StructureDefinition/bmi | ;;;; |
Observation | http://hl7.org/fhir/StructureDefinition/bmi | ;;;; |
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1528
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1527
MedicationRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest | ; | code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1562
MedicationRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest | ; | code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1562
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.1563
Procedure | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure | ;;;;; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1528
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.1563
Observation | http://hl7.org/fhir/StructureDefinition/bmi | ;;;; |
Observation | http://hl7.org/fhir/StructureDefinition/bmi | ;;;; |
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.600.1.1751
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-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.600.1.1751
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 | ;; |
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.666.5.307
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.666.5.307
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.1003
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.1003
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation | ; | code filter: path: code system: http://loinc.org code: 45755-6 display: Hospice care [Minimum Data Set]
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation | ;;; | code filter: path: code system: http://loinc.org code: 45755-6 display: Hospice care [Minimum Data Set]
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1584
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicerequest | ;;; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1584
Procedure | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1584
Procedure | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure | ;; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1584
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.1165
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation | ; | code filter: path: code system: http://loinc.org code: 71007-9 display: Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observation | ;; | code filter: path: code system: http://loinc.org code: 71007-9 display: Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)
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.1167
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.1090
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.1090
Procedure | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1135
Procedure | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-procedure | ;; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.198.12.1135
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.600.1.1623
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.600.1.1751
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient | ;; |
Patient | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-patient | ;; |
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicenotrequested | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1527
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicenotrequested | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1527
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicenotrequested | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1525
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicenotrequested | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1525
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicenotrequested | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1528
ServiceRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-servicenotrequested | ; | code filter: path: code value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1528
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.600.1.1751
MedicationRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-mednotrequested | ; | code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1561
MedicationRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-mednotrequested | ; | code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1561
MedicationRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-mednotrequested | ; | code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1562
MedicationRequest | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-mednotrequested | ; | code filter: path: medication value set: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1562
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.600.1.1751
Observation | http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-observationnotdone | ;;;;; | code filter: path: code system: http://loinc.org code: 39156-5 display: Body mass index (BMI) [Ratio]
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.600.1.1751
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.600.1.1751
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 PCSBMIScreenAndFollowUpFHIR version '0.1.000'

    using QICore version '4.1.1'

    include FHIRHelpers version '4.3.000' called FHIRHelpers
    include Hospice version '6.7.000' called Hospice
    include PalliativeCare version '1.7.000' called PalliativeCare
    include QICoreCommon version '1.5.000' called QICoreCommon
    include SupplementalDataElements version '3.4.000' called SDE

    codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'
    codesystem "ICD10CM": 'http://hl7.org/fhir/sid/icd-10-cm'
    codesystem "LOINC": 'http://loinc.org'
    codesystem "ObservationCategoryCodes": 'http://terminology.hl7.org/CodeSystem/observation-category'

    valueset "Encounter to Evaluate BMI": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1751'
    valueset "Follow Up for Above Normal BMI": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1525'
    valueset "Follow Up for Below Normal BMI": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1528'
    valueset "Medical Reason": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1007'
    valueset "Medications for Above Normal BMI": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1561'
    valueset "Medications for Below Normal BMI": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1562'
    valueset "Overweight or Obese": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1047.502'
    valueset "Patient Declined": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1582'
    valueset "Pregnancy or Other Related Diagnoses": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1623'
    valueset "Referrals Where Weight Assessment May Occur": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1.1527'
    valueset "Underweight": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1563'

    code "Body mass index (BMI) [Ratio]": '39156-5' from "LOINC" display 'Body mass index (BMI) [Ratio]'
    code "Encounter for palliative care": 'Z51.5' from "ICD10CM" display 'Encounter for palliative care'
    code "Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)": '71007-9' from "LOINC" display 'Functional Assessment of Chronic Illness Therapy - Palliative Care Questionnaire (FACIT-Pal)'
    code "virtual": 'VR' from "ActCode" display 'virtual'

    parameter "Measurement Period" Interval<DateTime>

    context Patient

    define "Initial Population":
      exists "Qualifying Encounter during Day of Measurement Period" QualifyingEncounter
        where "AgeInYearsAt"(date from start of QualifyingEncounter.period) >= 18

    define "Denominator":
      "Initial Population"

    define "Denominator Exclusions":
      Hospice."Has Hospice Services"
        or PalliativeCare."Has Palliative Care in the Measurement Period"
        or exists "Pregnancy"

    define "Numerator":
      exists "High BMI and Follow up Provided"
        or exists "Low BMI and Follow up Provided"
        or "Has Normal BMI"

    define "Denominator Exceptions":
      exists "Medical Reason for Not Documenting a Follow up Plan for Low or High BMI"
        or exists "Medical Reason or Patient Reason for Not Performing BMI Exam"

    define "BMI during Measurement Period":
      ["observation-bmi"] BMI
        where BMI.value > 0 'kg/m2'
          and BMI.status in { 'final', 'amended', 'corrected' }
          and BMI.effective.toInterval ( ) during day of "Measurement Period"

    define "Documented Low BMI during Measurement Period":
      "BMI during Measurement Period" BMI
        where BMI.effective.toInterval ( ) during day of "Measurement Period"
          and BMI.value < 18.5 'kg/m2'

    define "Documented High BMI during Measurement Period":
      "BMI during Measurement Period" BMI
        where BMI.effective.toInterval ( ) during day of "Measurement Period"
          and BMI.value >= 25 'kg/m2'

    define "Has Normal BMI":
      exists ( "BMI during Measurement Period" BMI
          where BMI.value in Interval[18.5 'kg/m2', 24.9 'kg/m2']
      )
        and not ( exists "Documented High BMI during Measurement Period"
            or exists "Documented Low BMI during Measurement Period"
        )

    define "High BMI and Follow up Provided":
      "Documented High BMI during Measurement Period" HighBMI
        with ( "High BMI Interventions Ordered"
          union "High BMI Interventions Performed" ) HighBMIInterventions
          such that Coalesce(HighBMIInterventions.performed.toInterval(), HighBMIInterventions.authoredOn.toInterval()) starts during day of "Measurement Period"

    define "High BMI Interventions Ordered":
      ( ( [ServiceRequest: "Follow Up for Above Normal BMI"]
          union [ServiceRequest: "Referrals Where Weight Assessment May Occur"]
          union [MedicationRequest: "Medications for Above Normal BMI"] ) HighInterventionsOrdered
          where HighInterventionsOrdered.reasonCode in "Overweight or Obese"
            or ( exists [Condition: "Overweight or Obese"] OverweightObese
                where ( OverweightObese.isProblemListItem ( )
                    or OverweightObese.isHealthConcern ( )
                )
                  and OverweightObese.isActive ( )
                  and OverweightObese.prevalenceInterval ( ) starts before or on day of HighInterventionsOrdered.authoredOn
                  and not ( OverweightObese.prevalenceInterval ( ) ends before day of HighInterventionsOrdered.authoredOn )
            )
      )

    define "High BMI Interventions Performed":
      ( [Procedure: "Follow Up for Above Normal BMI"] HighInterventionsPerformed
          where HighInterventionsPerformed.reasonCode in "Overweight or Obese"
            and HighInterventionsPerformed.status = 'completed'
            or ( exists [Condition: "Overweight or Obese"] OverweightObese
                where OverweightObese.isHealthConcern ( )
                  and OverweightObese.isActive ( )
                  and OverweightObese.prevalenceInterval ( ) starts before or on day of HighInterventionsPerformed.performed.toInterval ( )
                  and not ( OverweightObese.prevalenceInterval ( ) ends before day of HighInterventionsPerformed.performed.toInterval ( ) )
            )
      )

    define "Medical Reason or Patient Reason for Not Performing BMI Exam":
      [ObservationNotDone: code = "Body mass index (BMI) [Ratio]"] NoBMI
        with "Qualifying Encounter during Day of Measurement Period" QualifyingEncounter
          such that NoBMI.effective.toInterval ( ) ends same day as start of QualifyingEncounter.period
        where NoBMI.status = 'cancelled'
          and ( NoBMI.notDoneReason in "Patient Declined"
              or NoBMI.notDoneReason in "Medical Reason"
          )

    define "Low BMI Interventions Ordered":
      ( ( [ServiceRequest: "Follow Up for Below Normal BMI"]
          union [ServiceRequest: "Referrals Where Weight Assessment May Occur"]
          union [MedicationRequest: "Medications for Below Normal BMI"] ) LowInterventionsOrdered
          where LowInterventionsOrdered.reasonCode in "Underweight"
            or ( exists [Condition: "Underweight"] Underweight
                where ( Underweight.isHealthConcern ( ) )
                  and Underweight.isActive ( )
                  and Underweight.prevalenceInterval ( ) starts before or on day of LowInterventionsOrdered.authoredOn
                  and not ( Underweight.prevalenceInterval ( ) ends before day of LowInterventionsOrdered.authoredOn )
                  and LowInterventionsOrdered.authoredOn during day of "Measurement Period"
            )
      )

    define "Low BMI Interventions Performed":
      ( [Procedure: "Follow Up for Below Normal BMI"] LowInterventionsPerformed
          where LowInterventionsPerformed.reasonCode in "Underweight"
            and LowInterventionsPerformed.status = 'completed'
            or ( exists [Condition: "Underweight"] Underweight
                where ( Underweight.isHealthConcern ( ) )
                  and Underweight.isActive ( )
                  and Underweight.prevalenceInterval ( ) starts before or on day of LowInterventionsPerformed.performed.toInterval ( )
                  and not ( Underweight.prevalenceInterval ( ) ends before day of LowInterventionsPerformed.performed.toInterval ( )
                      and LowInterventionsPerformed.performed.toInterval ( ) during day of "Measurement Period"
                  )
            )
      )

    define "Low BMI and Follow up Provided":
      ( "Documented Low BMI during Measurement Period" LowBMI
          with ( "Low BMI Interventions Ordered"
            union "Low BMI Interventions Performed" ) LowBMIInterventions
            such that Coalesce(LowBMIInterventions.performed.toInterval(), LowBMIInterventions.authoredOn.toInterval()) starts during day of "Measurement Period"
      )

    define "Medical Reason for Not Documenting a Follow up Plan for Low or High BMI":
      ( ( [ServiceNotRequested: "Referrals Where Weight Assessment May Occur"]
          union [ServiceNotRequested: "Follow Up for Above Normal BMI"]
          union [ServiceNotRequested: "Follow Up for Below Normal BMI"] ) NoBMIFollowUp
          with "Qualifying Encounter during Day of Measurement Period" QualifyingEncounter
            such that NoBMIFollowUp.authoredOn same day as start of QualifyingEncounter.period
          where NoBMIFollowUp.status ~ 'completed'
            and NoBMIFollowUp.reasonRefused in "Medical Reason"
      )
        union ( ( [MedicationNotRequested: "Medications for Above Normal BMI"]
            union [MedicationNotRequested: "Medications for Below Normal BMI"] ) NoBMIFollowUp
            with "Qualifying Encounter during Day of Measurement Period" QualifyingEncounter
              such that NoBMIFollowUp.authoredOn same day as start of QualifyingEncounter.period
            where NoBMIFollowUp.status ~ 'completed'
              and NoBMIFollowUp.reasonCode in "Medical Reason"
        )

    define "Pregnancy":
      [Condition: "Pregnancy or Other Related Diagnoses"] PregnancyDiagnosis
        with "Qualifying Encounter during Day of Measurement Period" QualifyingEncounter
          such that PregnancyDiagnosis.clinicalStatus ~ QICoreCommon."active"
            and PregnancyDiagnosis.prevalenceInterval ( ) overlaps day of "Measurement Period"

    define "Qualifying Encounter during Day of Measurement Period":
      [Encounter: "Encounter to Evaluate BMI"] BMIEncounter
        where BMIEncounter.period during day of "Measurement Period"
          and BMIEncounter.class !~ "virtual"
          and BMIEncounter.status = 'finished'

    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 (342376 characters)
Content: application/elm+json
    Encoded data (488888 characters)