CMS FHIR Prototype Measure Calculation Tool IG
0.1.0 - CI Build

CMS FHIR Prototype Measure Calculation Tool IG, published by HL7 International - [Some] Work Group. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/mct-ig/ and changes regularly. See the Directory of published versions

## : Discharged on Antithrombotic Therapy QICore - XML Representation

Active as of 2021-08-24

Raw xml | Download

    <Library xmlns="http://hl7.org/fhir">
      <id value="DischargedonAntithromboticTherapyQICore4"/>
      <meta>
        <versionId value="24"/>
        <lastUpdated value="2021-08-24T13:12:30.000-06:00"/>
        <source value="#M4MHZMhmMYNUtjQP"/>
        <profile
                 value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-library-cqfm"/>
      </meta>
      <language value="en"/>
      <text>
        <status value="extensions"/>
        <div xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
        <table class="grid dict">

            <tr>
                <th scope="row"><b>Id: </b></th>
                <td style="padding-left: 4px;">DischargedonAntithromboticTherapyQICore4</td>
            </tr>

            <tr>
                <th scope="row"><b>Url: </b></th>
                <td style="padding-left: 4px;"><a href="Library-DischargedonAntithromboticTherapyQICore4.html">Discharged on Antithrombotic Therapy QICore</a></td>
            </tr>

            <tr>
                <th scope="row"><b>Version: </b></th>
                <td style="padding-left: 4px;">0.1.0</td>
            </tr>

            <tr>
                <th scope="row"><b>Name: </b></th>
                <td style="padding-left: 4px;">DischargedonAntithromboticTherapyQICore4</td>
            </tr>

            <tr>
                <th scope="row"><b>Title: </b></th>
                <td style="padding-left: 4px;">Discharged on Antithrombotic Therapy QICore</td>
            </tr>

            <tr>
                <th scope="row"><b>Status: </b></th>
                <td style="padding-left: 4px;">active</td>
            </tr>

            <tr>
                <th scope="row"><b>Experimental: </b></th>
                <td style="padding-left: 4px;">false</td>
            </tr>

            <tr>
                <th scope="row"><b>Type: </b></th>
                <td style="padding-left: 4px;">

                            <p style="margin-bottom: 5px;">
                                <b>system: </b> <span><a href="http://terminology.hl7.org/7.0.1/CodeSystem-library-type.html">http://terminology.hl7.org/CodeSystem/library-type</a></span>
                            </p>

                            <p style="margin-bottom: 5px;">
                                <b>code: </b> <span>logic-library</span>
                            </p>

                </td>
            </tr>

            <tr>
                <th scope="row"><b>Date: </b></th>
                <td style="padding-left: 4px;">2021-08-24 19:12:29+0000</td>
            </tr>

            <tr>
                <th scope="row"><b>Publisher: </b></th>
                <td style="padding-left: 4px;">HL7 International - [Some] Work Group</td>
            </tr>

            <tr>
                <th scope="row"><b>Description: </b></th>
                <td style="padding-left: 4px;">Discharged on Antithrombotic Therapy QICore</td>
            </tr>

            <tr>
                <th scope="row"><b>Jurisdiction: </b></th>
                <td style="padding-left: 4px;">US</td>
            </tr>

            <tr>
              <td colspan="2">
                <table>
                  <tr><th><a id="cql-content"><b>Content: </b></a> text/cql</th></tr>
                  <tr><td><pre><code class="language-cql">library DischargedonAntithromboticTherapyQICore4 version '0.0.010'

    /* based upon FHIR library DischargedonAntithromboticTherapyFHIR4 version '0.4.000'
    PJM - updated to QICore, shared libraries, valuesets, default Interval to 2022
    Definition names with 'DISPLAY' are used to display pertinent data
    */

    using QICore version '4.1.1'

    include FHIRHelpers version '4.0.013' called FHIRHelpers
    include MATGlobalCommonFunctionsQICore4 version '7.0.000' called Global
    include QICoreCommon version '1.0.000' called QICoreCommon
    include SupplementalDataElementsQICore4 version '3.0.000' called SDE
    //include TJCOverallQICore4 version '6.0.000' called TJC

    valueset &amp;quot;Antithrombotic Therapy&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.62'
    valueset &amp;quot;Medical Reason&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.473'
    valueset &amp;quot;Patient Refusal&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.93'
    valueset &amp;quot;Pharmacological Contraindications For Antithrombotic Therapy&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.52'

    //from TJCOverall
    valueset &amp;quot;Comfort Measures&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/1.3.6.1.4.1.33895.1.3.0.45'
    valueset &amp;quot;Discharge To Acute Care Facility&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.87'
    valueset &amp;quot;Discharged to Health Care Facility for Hospice Care&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.207'
    valueset &amp;quot;Discharged to Home for Hospice Care&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.209'
    valueset &amp;quot;Emergency Department Visit&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'
    valueset &amp;quot;Encounter Inpatient&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
    valueset &amp;quot;Hemorrhagic Stroke&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.212'
    valueset &amp;quot;Ischemic Stroke&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.247'
    valueset &amp;quot;Left Against Medical Advice&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.308'
    valueset &amp;quot;Non-Elective Inpatient Encounter&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.424'
    valueset &amp;quot;Observation Services&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'
    valueset &amp;quot;Patient Expired&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.309'
    valueset &amp;quot;Ticagrelor Therapy&amp;quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1110.39'

    parameter &amp;quot;Measurement Period&amp;quot; Interval&amp;lt;DateTime&amp;gt;
      default Interval[@2022-01-01T00:00:00.0, @2023-01-01T00:00:00.0)

    context Patient

    define &amp;quot;Initial Population&amp;quot;:
      &amp;quot;Encounter with Principal Diagnosis and Age&amp;quot;
    //ORIG TJC.&amp;quot;Encounter with Principal Diagnosis and Age&amp;quot;

    // PJM - fix for AgeInYearsAt issue
    //FIX current problem with AgeInYearsAt required a modified approach - refer to https://github.com/cqframework/ecqm-content-qicore-2022/issues/6
    define &amp;quot;Encounter with Principal Diagnosis and Age&amp;quot;:
      &amp;quot;All Stroke Encounter&amp;quot; AllStrokeEncounter
        where CalculateAgeInYearsAt ( Patient.birthDate, date from start of AllStrokeEncounter.period ) &amp;gt;= 18
    //ORIG    where AgeInYearsAt(date from(start of AllStrokeEncounter.period))&amp;gt;= 18

    //TJCOverall
    define &amp;quot;Non Elective Inpatient Encounter&amp;quot;:
      [&amp;quot;Encounter&amp;quot;: &amp;quot;Non-Elective Inpatient Encounter&amp;quot;] NonElectiveEncounter
    		where Global.&amp;quot;LengthInDays&amp;quot;(NonElectiveEncounter.period) &amp;lt;= 120
    			and NonElectiveEncounter.period ends during day of &amp;quot;Measurement Period&amp;quot;

    //TJCOverall
    define &amp;quot;All Stroke Encounter&amp;quot;:
      &amp;quot;Non Elective Inpatient Encounter&amp;quot; NonElectiveEncounter
        let EncPrincipalDx: Global.&amp;quot;PrincipalDiagnosis&amp;quot;(NonElectiveEncounter)
        where NonElectiveEncounter.status ~ 'finished'
          and EncPrincipalDx.verificationStatus ~ QICoreCommon.&amp;quot;confirmed&amp;quot;
          and (EncPrincipalDx.code in &amp;quot;Hemorrhagic Stroke&amp;quot;
            or EncPrincipalDx.code in &amp;quot;Ischemic Stroke&amp;quot;
          )

    define &amp;quot;Denominator&amp;quot;:
      &amp;quot;Ischemic Stroke Encounter&amp;quot;

    //TJCOverall
    define &amp;quot;Ischemic Stroke Encounter&amp;quot;:
      &amp;quot;Encounter with Principal Diagnosis and Age&amp;quot; EncounterWithAge
        let EncPrincipalDx: Global.&amp;quot;PrincipalDiagnosis&amp;quot;(EncounterWithAge)
         where EncounterWithAge.status = 'finished'
           and EncPrincipalDx.code in &amp;quot;Ischemic Stroke&amp;quot;

    //TJCOverall
    //See if can work old way after Bryn gets Coalesce to work
    define &amp;quot;Denominator Exclusions&amp;quot;:
      &amp;quot;Ischemic Stroke Encounters with Discharge Disposition&amp;quot;
        union &amp;quot;Encounter with Comfort Measure Procedure during Hospitalization&amp;quot;
        union &amp;quot;Encounter with Comfort Measure ServiceRequest during Hospitalization&amp;quot;
    /*Original before QICore
    define &amp;quot;Denominator Exclusions&amp;quot;:
      TJC.&amp;quot;Ischemic Stroke Encounters with Discharge Disposition&amp;quot;
        union TJC.&amp;quot;Encounter with Comfort Measures during Hospitalization&amp;quot;
    */

    //TJCOverall
    define &amp;quot;Ischemic Stroke Encounters with Discharge Disposition&amp;quot;:
      &amp;quot;Ischemic Stroke Encounter&amp;quot; IschemicStrokeEncounter
        let EncDischDisp: IschemicStrokeEncounter.hospitalization.dischargeDisposition
            where EncDischDisp in &amp;quot;Discharge To Acute Care Facility&amp;quot;
               or EncDischDisp in &amp;quot;Left Against Medical Advice&amp;quot;
               or EncDischDisp in &amp;quot;Patient Expired&amp;quot;
               or EncDischDisp in &amp;quot;Discharged to Home for Hospice Care&amp;quot;
               or EncDischDisp in &amp;quot;Discharged to Health Care Facility for Hospice Care&amp;quot;

    define &amp;quot;DISPLAY Comfort Measures during Hospitalization&amp;quot;:
      &amp;quot;Ischemic Stroke Encounter&amp;quot; IschemicStrokeEncounter
        let ComfortMeasure: &amp;quot;Intervention Comfort Measures&amp;quot; ComfortMeasure
           where Coalesce(ComfortMeasure.performed, ComfortMeasure.authoredOn) during Global.&amp;quot;HospitalizationWithObservation&amp;quot;(IschemicStrokeEncounter)
         return Tuple {
           comfMeasPerformed: ComfortMeasure.performed,
           comfmeasPerfToInt: QICoreCommon.&amp;quot;ToInterval&amp;quot;(ComfortMeasure.performed),
           comfMeasAuthoredOn: ComfortMeasure.authoredOn,
           comfMeasCoalesce: Coalesce((start of QICoreCommon.&amp;quot;ToInterval&amp;quot;(ComfortMeasure.performed)), ComfortMeasure.authoredOn),
           hospitalization: Global.&amp;quot;HospitalizationWithObservation&amp;quot; ( IschemicStrokeEncounter )
         }

    //TJCOverall - needs Coalesce fix
    define &amp;quot;Encounter with Comfort Measures during Hospitalization&amp;quot;:
      &amp;quot;Ischemic Stroke Encounter&amp;quot; IschemicStrokeEncounter
        with &amp;quot;Intervention Comfort Measures&amp;quot; ComfortMeasure
         such that Coalesce((start of QICoreCommon.&amp;quot;ToInterval&amp;quot;(ComfortMeasure.performed)), ComfortMeasure.authoredOn) during Global.&amp;quot;HospitalizationWithObservation&amp;quot; ( IschemicStrokeEncounter )
    /*Original before QICore...Note: This is not used, could not get coalesce to work...instead split (see below)
    define &amp;quot;Encounter with Comfort Measures during Hospitalization&amp;quot;:
      &amp;quot;Ischemic Stroke Encounter&amp;quot; IschemicStrokeEncounter
              with &amp;quot;Intervention Comfort Measures&amp;quot; ComfortMeasure
                  such that Coalesce((start of Global.&amp;quot;Normalize Interval&amp;quot;(ComfortMeasure.performed)), ComfortMeasure.authoredOn)during Global.&amp;quot;HospitalizationWithObservation&amp;quot; ( IschemicStrokeEncounter )
    */

    //Note: Below does not have 'as dateTime' after performed because it errored, and tried many variations
    define &amp;quot;Encounter with Comfort Measure Procedure during Hospitalization&amp;quot;:
      &amp;quot;Ischemic Stroke Encounter&amp;quot; IschemicStrokeEncounter
        with &amp;quot;Intervention Comfort Measures Procedure&amp;quot; ComfortMeasure
         such that start of QICoreCommon.&amp;quot;ToInterval&amp;quot;(ComfortMeasure.performed) during Global.&amp;quot;HospitalizationWithObservation&amp;quot; ( IschemicStrokeEncounter )

    define &amp;quot;Encounter with Comfort Measure ServiceRequest during Hospitalization&amp;quot;:
      &amp;quot;Ischemic Stroke Encounter&amp;quot; IschemicStrokeEncounter
        with &amp;quot;Intervention Comfort Measures ServiceRequest&amp;quot; ComfortMeasure
         such that ComfortMeasure.authoredOn during Global.&amp;quot;HospitalizationWithObservation&amp;quot; ( IschemicStrokeEncounter )

    //TJCOverall
    //Note: Below is not used because could not get coalesce to work in &amp;quot;Encounter with Comfort Measures during Hospitalization&amp;quot;
    define &amp;quot;Intervention Comfort Measures&amp;quot;:
      ( [&amp;quot;ServiceRequest&amp;quot;: &amp;quot;Comfort Measures&amp;quot;] P
          where P.intent = 'order'
           and P.status in { 'active', 'on-hold', 'completed'}
      )
        union ( [&amp;quot;Procedure&amp;quot;: &amp;quot;Comfort Measures&amp;quot;] InterventionPerformed
            where InterventionPerformed.status in { 'completed', 'in-progress' }
        )

    //Instead split ServiceRequest and Procedure into two different definitions
    define &amp;quot;Intervention Comfort Measures ServiceRequest&amp;quot;:
      ( [&amp;quot;ServiceRequest&amp;quot;: &amp;quot;Comfort Measures&amp;quot;] P
          where P.intent = 'order'
           and P.status in { 'active', 'on-hold', 'completed'}
      )

    define &amp;quot;Intervention Comfort Measures Procedure&amp;quot;:
      ( [&amp;quot;Procedure&amp;quot;: &amp;quot;Comfort Measures&amp;quot;] InterventionPerformed
            where InterventionPerformed.status in { 'completed', 'in-progress' }
      )

    define &amp;quot;Numerator&amp;quot;:
      &amp;quot;Ischemic Stroke Encounter&amp;quot; IschemicStrokeEncounter
        with &amp;quot;Antithrombotic Therapy at Discharge&amp;quot; DischargeAntithrombotic
          such that DischargeAntithrombotic.authoredOn during IschemicStrokeEncounter.period

    //Note: QICore manual says to constrain status to 'active' and category to 'Community' and does not mention intent.
    //      ask Yanyan if should follow that or what is below.
    define &amp;quot;Antithrombotic Therapy at Discharge&amp;quot;:
      [&amp;quot;MedicationRequest&amp;quot;: medication in &amp;quot;Antithrombotic Therapy&amp;quot;] Antithrombotic
          where Antithrombotic.doNotPerform is not true
            and Antithrombotic.status in { 'active', 'completed' }
            and Antithrombotic.intent = 'order'
            and exists (Antithrombotic.category C
              where C ~ QICoreCommon.&amp;quot;Discharge&amp;quot; or C ~ QICoreCommon.&amp;quot;Community&amp;quot;
            )

    define &amp;quot;Denominator Exceptions&amp;quot;:
      &amp;quot;Encounter with No Antithrombotic At Discharge&amp;quot;
      union &amp;quot;Encounter with Pharmacological Contraindications for Antithrombotic Therapy at Discharge&amp;quot;

    define &amp;quot;Reason for Not Giving Antithrombotic at Discharge&amp;quot;:
      [&amp;quot;MedicationRequest&amp;quot;: &amp;quot;Antithrombotic Therapy&amp;quot;] NoAntithromboticDischarge
          where NoAntithromboticDischarge.doNotPerform is true
            and ( NoAntithromboticDischarge.reasonCode in &amp;quot;Medical Reason&amp;quot;
                    or NoAntithromboticDischarge.reasonCode in &amp;quot;Patient Refusal&amp;quot;
                )
            and NoAntithromboticDischarge.status in { 'completed', 'cancelled' }
            and NoAntithromboticDischarge.intent = 'order'
            and exists (NoAntithromboticDischarge.category C where
                       C ~ QICoreCommon.Discharge or C ~ QICoreCommon.Community)
    //  [&amp;quot;MedicationRequest&amp;quot;: medication in &amp;quot;Antithrombotic Therapy&amp;quot;] NoAntithromboticDischarge

    define &amp;quot;zDISPLAY Medication Request&amp;quot;:
      [&amp;quot;MedicationRequest&amp;quot;: medication in &amp;quot;Antithrombotic Therapy&amp;quot;] NoAntithromboticDischarge
      return Tuple {
        doNotPerform: NoAntithromboticDischarge.doNotPerform,
        medication: NoAntithromboticDischarge.medication,
        reasonCode: NoAntithromboticDischarge.reasonCode,
        reasonInMed: ( NoAntithromboticDischarge.reasonCode in &amp;quot;Medical Reason&amp;quot;),
        reasonInPatRef: (NoAntithromboticDischarge.reasonCode in &amp;quot;Patient Refusal&amp;quot;),
        category: NoAntithromboticDischarge.category,
        dischargeStatus: NoAntithromboticDischarge.status,
        intent: NoAntithromboticDischarge.intent
      }

    define &amp;quot;Encounter with No Antithrombotic At Discharge&amp;quot;:
      &amp;quot;Ischemic Stroke Encounter&amp;quot; IschemicStrokeEncounter
      	with &amp;quot;Reason for Not Giving Antithrombotic at Discharge&amp;quot; NoDischargeAntithrombotic
      	such that NoDischargeAntithrombotic.authoredOn during IschemicStrokeEncounter.period

    define &amp;quot;Encounter with Pharmacological Contraindications for Antithrombotic Therapy at Discharge&amp;quot;:
      &amp;quot;Ischemic Stroke Encounter&amp;quot; IschemicStrokeEncounter
          with &amp;quot;Pharmacological Contraindications for Antithrombotic Therapy at Discharge&amp;quot; DischargePharmacological
            such that DischargePharmacological.authoredOn during IschemicStrokeEncounter.period

    define &amp;quot;Pharmacological Contraindications for Antithrombotic Therapy at Discharge&amp;quot;:
      [&amp;quot;MedicationRequest&amp;quot;: medication in &amp;quot;Pharmacological Contraindications For Antithrombotic Therapy&amp;quot;] Pharmacological
          where Pharmacological.doNotPerform is not true
            and exists (Pharmacological.category C where
                       C ~ QICoreCommon.Discharge or C ~ QICoreCommon.Community)
            and Pharmacological.status in { 'active', 'completed' }
            and Pharmacological.intent = 'order'

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

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

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

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

        </table>
    </div>
      </text>
      <extension
                 url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-softwaresystem">
        <valueReference>🔗
          <reference value="Device/cqf-tooling"/>
        </valueReference>
      </extension>
      <url
           value="http://cms.gov/fhir/mct/Library/DischargedonAntithromboticTherapyQICore4"/>
      <version value="0.1.0"/>
      <name value="DischargedonAntithromboticTherapyQICore4"/>
      <title value="Discharged on Antithrombotic Therapy QICore"/>
      <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="2021-08-24T19:12:29+00:00"/>
      <publisher value="HL7 International - [Some] Work Group"/>
      <contact>
        <telecom>
          <system value="url"/>
          <value value="http://hl7.org/Special/committees/[something]"/>
        </telecom>
      </contact>
      <description value="Discharged on Antithrombotic Therapy QICore"/>
      <jurisdiction>
        <coding>
          <system value="urn:iso:std:iso:3166"/>
          <code value="US"/>
        </coding>
      </jurisdiction>
      <content>
        <contentType value="text/cql"/>
        <data
              value=" "/>
      </content>
    </Library>