Draft dQM CMS Content Implementation Guide
2025.1.0 - CI Build

Draft dQM CMS Content Implementation Guide, published by cqframework. This guide is not an authorized publication; it is the continuous build for version 2025.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/dqm-content-cms-2025/ and changes regularly. See the Directory of published versions

## : CMS2FHIRPCSDepScreenAndFollowUp - XML Representation

Active as of 2025-08-22

Raw xml | Download

    <Library xmlns="http://hl7.org/fhir">
      <id value="CMS2FHIRPCSDepScreenAndFollowUp"/>
      <meta>
        <profile
                 value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablelibrary"/>
        <profile
                 value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-computablelibrary"/>
        <profile
                 value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablelibrary"/>
        <profile
                 value="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-executablelibrary"/>
        <profile
                 value="http://hl7.org/fhir/uv/cql/StructureDefinition/cql-library"/>
        <profile
                 value="http://hl7.org/fhir/uv/cql/StructureDefinition/elm-json-library"/>
        <profile
                 value="http://hl7.org/fhir/uv/cql/StructureDefinition/elm-xml-library"/>
      </meta>
      <text>
        <status value="extensions"/>
        <div xmlns="http://www.w3.org/1999/xhtml">
      <table class="narrative-table">
        <tbody>
    <tr>

    <th colspan="2" scope="row" class="row-header">Metadata</th>

    </tr>

    <tr>

    <th scope="row" class="row-header">Title</th>

    <td class="content-container">CMS2FHIRPCSDepScreenAndFollowUp</td>

    </tr>

    <tr>

    <th scope="row" class="row-header">Version</th>

    <td class="content-container">1.1.000</td>

    </tr>

    <tr>

    <th scope="row" class="row-header">Topic</th>

    <td class="content-container">FHIR
    </td>

    </tr>

    <tr>

    <th scope="row" class="row-header">Topic</th>

    <td class="content-container">CQL
    </td>

    </tr>

    <tr>

    <th scope="row" class="row-header">Steward (Publisher)</th>

    <td class="content-container">Centers for Medicare &amp; Medicaid Services (CMS)</td>

    </tr>

    <tr>

    <th scope="row" class="row-header">Description</th>

    <td class="content-container"><div><p>CMS2FHIRPCSDepScreenAndFollowUp</p>
    </div></td>

    </tr>

    <tr>

    <th scope="row" class="row-header">Type</th>

    <td class="content-container">
        logic-library from <a href="http://terminology.hl7.org/7.1.0/CodeSystem-library-type.html">http://terminology.hl7.org/CodeSystem/library-type</a>

    </td>

    </tr>

    <tr>

    <th colspan="2" scope="row" class="row-header"><a name="parameters"> </a>Parameters</th>

    </tr>

    <tr>

    <th scope="row" class="row-header">Parameter</th>

    <td class="content-container">None</td>

    </tr>

      <tr>

    <th colspan="2" scope="row" class="row-header">Library Content</th>

    </tr>

        <tr>
          <th scope="row" class="row-header">CQL Content</th>
          <td>
            <a name="cql-content"> </a>
            <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/*
    NOTE: For use by March 2026 US Realm Connectathon participants for internal use only. Not for use or distribution in commercial products.
    */
    library CMS2FHIRPCSDepScreenAndFollowUp version '1.1.000'

    using USQualityCore version '0.1.0-cibuild'
    using USCore version '6.1.0-derived'
    using FHIR version '4.0.1'

    include hl7.fhir.uv.cql.FHIRHelpers version '4.0.1' called FHIRHelpers
    include hl7.fhir.uv.cql.FHIRCommon version '2.0.0' called FHIRCommon
    include hl7.fhir.us.cql.CumulativeMedicationDuration version '2.0.0-ballot' called CMD
    include hl7.fhir.us.cql.USCoreCommon version '2.0.0-ballot' called USCoreCommon
    include hl7.fhir.us.cql.USCoreElements version '2.0.0-ballot' called USCoreElements

    include USQualityCoreCommon version '0.1.0-cibuild' called USQualityCoreCommon
    include SupplementalDataElements version '6.1.000' called SDE

    codesystem &quot;LOINC&quot;: 'http://loinc.org'
    codesystem &quot;SNOMEDCT&quot;: 'http://snomed.info/sct'

    valueset &quot;Adolescent Depression Medications&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1567'
    valueset &quot;Adult Depression Medications&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1566'
    valueset &quot;Bipolar Disorder&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.67.1.101.1.128'
    valueset &quot;Encounter to Screen for Depression&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.600.1916'
    valueset &quot;Follow Up for Adolescent Depression&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1569'
    valueset &quot;Follow Up for Adult Depression&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1568'
    valueset &quot;Medical Reason&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1007'
    valueset &quot;Physical Therapy Evaluation&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1022'
    valueset &quot;Referral for Adolescent Depression&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1570'
    valueset &quot;Referral for Adult Depression&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.526.3.1571'
    valueset &quot;Telephone Visits&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.464.1003.101.12.1080'

    code &quot;Adolescent depression screening assessment&quot;: '73831-0' from &quot;LOINC&quot; display 'Adolescent depression screening assessment'
    code &quot;Adult depression screening assessment&quot;: '73832-8' from &quot;LOINC&quot; display 'Adult depression screening assessment'
    code &quot;Depression screening declined (situation)&quot;: '720834000' from &quot;SNOMEDCT&quot; display 'Depression screening declined (situation)'
    code &quot;Depression screening negative (finding)&quot;: '428171000124102' from &quot;SNOMEDCT&quot; display 'Depression screening negative (finding)'
    code &quot;Depression screening positive (finding)&quot;: '428181000124104' from &quot;SNOMEDCT&quot; display 'Depression screening positive (finding)'

    parameter &quot;Measurement Period&quot; Interval&lt;DateTime&gt;
      default Interval[@2026-01-01T00:00:00.000Z, @2027-01-01T00:00:00.000Z)

    context Patient

    define &quot;Initial Population&quot;:
      &quot;Patient Age 12 Years or Older at Start of Measurement Period&quot;
        and exists ( &quot;Qualifying Encounter During Measurement Period&quot; )

    define &quot;Denominator&quot;:
      &quot;Initial Population&quot;

    define &quot;Denominator Exclusions&quot;:
      exists &quot;History of Bipolar Diagnosis Before Qualifying Encounter&quot;

    define &quot;Numerator&quot;:
      ( &quot;Patient Age 12 to 16 Years at Start of Measurement Period&quot;
          and ( &quot;Has Most Recent Adolescent Screening Negative&quot;
              or exists &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot;
          )
      )
        or ( &quot;Patient Age 17 Years at Start of Measurement Period&quot;
            and ( &quot;Has Most Recent Adolescent Screening Negative&quot;
                or exists &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot;
                or &quot;Has Most Recent Adult Screening Negative&quot;
                or exists &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot;
            )
        )
        or ( &quot;Patient Age 18 Years or Older at Start of Measurement Period&quot;
            and ( &quot;Has Most Recent Adult Screening Negative&quot;
                or exists &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot;
            )
        )

    define &quot;Denominator Exceptions&quot;:
      false
    /*
    TODO: Need to reassess how we are representing given no ObservationCancelled profile
      ( exists &quot;Medical or Patient Reason for Not Screening Adolescent for Depression&quot;
          and not &quot;Has Adolescent Depression Screening&quot;
      )
        or ( exists &quot;Medical or Patient Reason for Not Screening Adult for Depression&quot;
            and not &quot;Has Adult Depression Screening&quot;
        )
    */

    define &quot;Follow Up Intervention for Positive Adolescent Depression Screening&quot;:
      ( ( [USQualityCore.MedicationRequest: &quot;Adolescent Depression Medications&quot;] AdolescentMed
            with &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
              such that &quot;Most Recent Adolescent Depression Screening&quot;.effective.toInterval ( ) starts 14 days or less on or before day of start of QualifyingEncounter.period
                and AdolescentMed.medicationRequestPeriod ( ) overlaps after day of QualifyingEncounter.period
                and &quot;Most Recent Adolescent Depression Screening&quot;.value ~ &quot;Depression screening positive (finding)&quot;
                and AdolescentMed.status in { 'active', 'completed' }
                and AdolescentMed.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
        )
          union ( [USQualityCore.ServiceRequest: &quot;Referral for Adolescent Depression&quot;] AdolescentReferral
              where AdolescentReferral.status in { 'active', 'completed' }
          )
          union ( [USQualityCore.Procedure: &quot;Follow Up for Adolescent Depression&quot;] AdolescentFollowUp
              where AdolescentFollowUp.status = 'completed'
          )
      )

    define &quot;Follow Up Intervention for Positive Adult Depression Screening&quot;:
      ( ( [USQualityCore.MedicationRequest: &quot;Adult Depression Medications&quot;] AdultMed
            with &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
              such that &quot;Most Recent Adult Depression Screening&quot;.effective.toInterval ( ) starts 14 days or less on or before day of start of QualifyingEncounter.period
                and AdultMed.medicationRequestPeriod ( ) overlaps after day of QualifyingEncounter.period
                and &quot;Most Recent Adult Depression Screening&quot;.value ~ &quot;Depression screening positive (finding)&quot;
                and AdultMed.status in { 'active', 'completed' }
                and AdultMed.intent in { 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order' }
        )
          union ( [USQualityCore.ServiceRequest: &quot;Referral for Adult Depression&quot;] AdultReferral
              where AdultReferral.status in { 'active', 'completed' }
          )
          union ( [USQualityCore.Procedure: &quot;Follow Up for Adult Depression&quot;] AdultFollowUp
              where AdultFollowUp.status = 'completed'
          )
      )

    define &quot;Has Adolescent Depression Screening&quot;:
      exists ( [USQualityCore.ObservationScreeningAssessment: &quot;Adolescent depression screening assessment&quot;] AdolescentScreening
          with &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
            such that AdolescentScreening.effective.toInterval ( ) 14 days or less on or before day of start of QualifyingEncounter.period
              and AdolescentScreening.value is not null
              and AdolescentScreening.status in { 'final', 'amended', 'corrected' }
      )

    define &quot;Has Adult Depression Screening&quot;:
      exists ( [USQualityCore.ObservationScreeningAssessment: &quot;Adult depression screening assessment&quot;] AdultScreening
          with &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
            such that AdultScreening.effective.toInterval ( ) 14 days or less on or before day of start of QualifyingEncounter.period
              and AdultScreening.value is not null
              and AdultScreening.status in { 'final', 'amended', 'corrected' }
      )

    define &quot;Has Most Recent Adolescent Screening Negative&quot;:
      ( &quot;Most Recent Adolescent Depression Screening&quot; AdolescentScreen
          where AdolescentScreen.value ~ &quot;Depression screening negative (finding)&quot;
      ) is not null

    define &quot;Has Most Recent Adult Screening Negative&quot;:
      ( &quot;Most Recent Adult Depression Screening&quot; AdultScreen
          where AdultScreen.value ~ &quot;Depression screening negative (finding)&quot;
      ) is not null

    define &quot;History of Bipolar Diagnosis Before Qualifying Encounter&quot;:
      [USQualityCore.ConditionProblemsHealthConcerns: &quot;Bipolar Disorder&quot;] BipolarDiagnosis
        with &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
          such that BipolarDiagnosis.prevalenceInterval ( ) starts before day of start of QualifyingEncounter.period

    /*
    TODO: Needs to be reassessed given the pattern change for ObservationCancelled, this should really be a ServiceRequest with a TaskRejected, yes?
    define &quot;Medical or Patient Reason for Not Screening Adolescent for Depression&quot;:
      [USQualityCore.ObservationCancelled: code ~ &quot;Adolescent depression screening assessment&quot;] NoAdolescentScreen
        with &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
          such that NoAdolescentScreen.issued during day of QualifyingEncounter.period
        where ( NoAdolescentScreen.notDoneReason ~ &quot;Depression screening declined (situation)&quot;
            or NoAdolescentScreen.notDoneReason in &quot;Medical Reason&quot;
        )

    define &quot;Medical or Patient Reason for Not Screening Adult for Depression&quot;:
      [USQualityCore.ObservationCancelled: code ~ &quot;Adult depression screening assessment&quot;] NoAdultScreen
        with &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
          such that NoAdultScreen.issued during day of QualifyingEncounter.period
        where ( NoAdultScreen.notDoneReason ~ &quot;Depression screening declined (situation)&quot;
            or NoAdultScreen.notDoneReason in &quot;Medical Reason&quot;
        )
    */

    define &quot;Most Recent Adolescent Depression Screening&quot;:
      Last([USQualityCore.ObservationScreeningAssessment: &quot;Adolescent depression screening assessment&quot;] AdolescentDepressionScreening
          with &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
            such that AdolescentDepressionScreening.effective.toInterval() 14 days or less on or before day of start of QualifyingEncounter.period
              and AdolescentDepressionScreening.value is not null
              and AdolescentDepressionScreening.status in { 'final', 'amended', 'corrected' }
          sort by start of effective.toInterval()
      )

    define &quot;Most Recent Adolescent Depression Screening Positive and Follow Up Provided&quot;:
      from
        &quot;Most Recent Adolescent Depression Screening&quot; LastAdolescentScreen,
        &quot;Follow Up Intervention for Positive Adolescent Depression Screening&quot; FollowUpPositiveAdolescentScreen,
        &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
        where LastAdolescentScreen.effective.toInterval ( ) starts 14 days or less on or before day of start of QualifyingEncounter.period
          and LastAdolescentScreen.value ~ &quot;Depression screening positive (finding)&quot;
          and ( start of FollowUpPositiveAdolescentScreen.performed.toInterval ( ) during QualifyingEncounter.period
              or FollowUpPositiveAdolescentScreen.authoredOn 2 days or less on or after day of end of QualifyingEncounter.period
          )
          and ( Coalesce(start of FollowUpPositiveAdolescentScreen.performed.toInterval(), FollowUpPositiveAdolescentScreen.authoredOn) during day of &quot;Measurement Period&quot; )

    define &quot;Most Recent Adult Depression Screening&quot;:
      Last([USQualityCore.ObservationScreeningAssessment: &quot;Adult depression screening assessment&quot;] AdultDepressionScreening
          with &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
            such that AdultDepressionScreening.effective.toInterval() 14 days or less on or before day of start of QualifyingEncounter.period
              and AdultDepressionScreening.value is not null
              and AdultDepressionScreening.status in { 'final', 'amended', 'corrected' }
          sort by start of effective.toInterval()
      )

    define &quot;Most Recent Adult Depression Screening Positive and Follow Up Provided&quot;:
      from
        &quot;Most Recent Adult Depression Screening&quot; LastAdultScreen,
        &quot;Follow Up Intervention for Positive Adult Depression Screening&quot; FollowUpPositiveAdultScreen,
        &quot;Qualifying Encounter During Measurement Period&quot; QualifyingEncounter
        where LastAdultScreen.effective.toInterval ( ) starts 14 days or less on or before day of start of QualifyingEncounter.period
          and LastAdultScreen.value ~ &quot;Depression screening positive (finding)&quot;
          and ( start of FollowUpPositiveAdultScreen.performed.toInterval ( ) during QualifyingEncounter.period
              or FollowUpPositiveAdultScreen.authoredOn 2 days or less on or after day of end of QualifyingEncounter.period
          )
          and ( Coalesce(start of FollowUpPositiveAdultScreen.performed.toInterval(), FollowUpPositiveAdultScreen.authoredOn) during day of &quot;Measurement Period&quot; )

    define &quot;Patient Age 12 to 16 Years at Start of Measurement Period&quot;:
      AgeInYearsAt(date from start of &quot;Measurement Period&quot;) in Interval[12, 16]

    define &quot;Patient Age 12 Years or Older at Start of Measurement Period&quot;:
      AgeInYearsAt(date from start of &quot;Measurement Period&quot;) &gt;= 12

    define &quot;Patient Age 17 Years at Start of Measurement Period&quot;:
      AgeInYearsAt(date from start of &quot;Measurement Period&quot;) = 17

    define &quot;Patient Age 18 Years or Older at Start of Measurement Period&quot;:
      AgeInYearsAt(date from start of &quot;Measurement Period&quot;) &gt;= 18

    define &quot;Qualifying Encounter During Measurement Period&quot;:
      ( [USQualityCore.Encounter: &quot;Encounter to Screen for Depression&quot;]
        union [USQualityCore.Encounter: &quot;Physical Therapy Evaluation&quot;]
        union [USQualityCore.Encounter: &quot;Telephone Visits&quot;] ) QualifyingEncounter
        where QualifyingEncounter.period during day of &quot;Measurement Period&quot;
          and QualifyingEncounter.status = 'finished'

    define &quot;SDE Ethnicity&quot;:
      SDE.&quot;SDE Ethnicity&quot;

    define &quot;SDE Payer&quot;:
      SDE.&quot;SDE Payer&quot;

    define &quot;SDE Race&quot;:
      SDE.&quot;SDE Race&quot;

    define &quot;SDE Sex&quot;:
      SDE.&quot;SDE Sex&quot;</code></pre>
          </td>
        </tr>

    <tr>
      <th colspan="2" scope="row" class="row-header">Generated using version 0.5.4 of the sample-content-ig Liquid templates</th>
    </tr>

        </tbody>
      </table>
    </div>
      </text>
      <url value="https://madie.cms.gov/Library/CMS2FHIRPCSDepScreenAndFollowUp"/>
      <version value="1.1.000"/>
      <name value="CMS2FHIRPCSDepScreenAndFollowUp"/>
      <title value="CMS2FHIRPCSDepScreenAndFollowUp"/>
      <status value="active"/>
      <experimental value="false"/>
      <type>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
          <code value="logic-library"/>
        </coding>
      </type>
      <date value="2025-08-22T19:33:33+00:00"/>
      <publisher value="Centers for Medicare &amp; Medicaid Services (CMS)"/>
      <description value="CMS2FHIRPCSDepScreenAndFollowUp"/>
      <topic>
        <text value="FHIR"/>
      </topic>
      <topic>
        <text value="CQL"/>
      </topic>
      <content>
        <contentType value="text/cql"/>
        <data
              value=" "/>
      </content>
    </Library>