Clinical Quality Language Specification, published by Clinical Decision Support WG. This guide is not an authorized publication; it is the continuous build for version 1.5.3 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/cql/ and changes regularly. See the Directory of published versions
<?xml version="1.0" encoding="UTF-8"?>
<library xmlns="urn:hl7-org:elm:r1" xmlns:t="urn:hl7-org:elm-types:r1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:fhir="http://hl7.org/fhir" xmlns:a="urn:hl7-org:cql-annotations:r1">
<identifier id="CMS135_QDM"/>
<schemaIdentifier id="urn:hl7-org:elm" version="r1"/>
<usings>
<def localIdentifier="System" uri="urn:hl7-org:elm-types:r1"/>
<def localIdentifier="QDM" uri="urn:healthit-gov:qdm:v5_0_1_draft" version="5.0.2"/>
</usings>
<parameters>
<def name="Measurement Period" accessLevel="Public">
<default lowClosed="true" highClosed="false" xsi:type="Interval">
<low xsi:type="DateTime">
<year valueType="t:Integer" value="2014" xsi:type="Literal"/>
<month valueType="t:Integer" value="1" xsi:type="Literal"/>
<day valueType="t:Integer" value="1" xsi:type="Literal"/>
<hour valueType="t:Integer" value="0" xsi:type="Literal"/>
<minute valueType="t:Integer" value="0" xsi:type="Literal"/>
<second valueType="t:Integer" value="0" xsi:type="Literal"/>
<millisecond valueType="t:Integer" value="0" xsi:type="Literal"/>
</low>
<high xsi:type="DateTime">
<year valueType="t:Integer" value="2015" xsi:type="Literal"/>
<month valueType="t:Integer" value="1" xsi:type="Literal"/>
<day valueType="t:Integer" value="1" xsi:type="Literal"/>
<hour valueType="t:Integer" value="0" xsi:type="Literal"/>
<minute valueType="t:Integer" value="0" xsi:type="Literal"/>
<second valueType="t:Integer" value="0" xsi:type="Literal"/>
<millisecond valueType="t:Integer" value="0" xsi:type="Literal"/>
</high>
</default>
</def>
</parameters>
<valueSets>
<def name="Care Services in Long-Term Residential Facility" id="..." accessLevel="Public"/>
<def name="Heart Failure" id="..." accessLevel="Public"/>
</valueSets>
<statements>
<def name="Long-Term Residential Facility Encounters" context="Patient" accessLevel="Public">
<expression xsi:type="Query">
<source alias="E">
<expression xmlns:ns0="urn:healthit-gov:qdm:v5_0_1_draft" dataType="ns0:EncounterPerformed" templateId="PositiveEncounterPerformed" codeProperty="code" xsi:type="Retrieve">
<codes name="Care Services in Long-Term Residential Facility" xsi:type="ValueSetRef"/>
</expression>
</source>
<relationship alias="D" xsi:type="With">
<expression xmlns:ns1="urn:healthit-gov:qdm:v5_0_1_draft" dataType="ns1:Diagnosis" codeProperty="code" xsi:type="Retrieve">
<codes name="Heart Failure" xsi:type="ValueSetRef"/>
</expression>
<suchThat xsi:type="OverlapsBefore">
<operand path="prevalencePeriod" scope="D" xsi:type="Property"/>
<operand path="relevantPeriod" scope="E" xsi:type="Property"/>
</suchThat>
</relationship>
<where xsi:type="IncludedIn">
<operand path="relevantPeriod" scope="E" xsi:type="Property"/>
<operand name="Measurement Period" xsi:type="ParameterRef"/>
</where>
</expression>
</def>
<def name="Relevant Encounters" context="Patient" accessLevel="Public">
<expression name="Long-Term Residential Facility Encounters" xsi:type="ExpressionRef"/>
</def>
</statements>
</library>