Quality Measure Implementation Guide
2.0.0-ballot - STU 2 Ballot

Quality Measure Implementation Guide - Downloaded Version null See the Directory of published versions

## : Example Catheter-Associated Urinary Tract Infection Rate

Page standards status: Informative

Raw json | Download

    {
      "resourceType" : "Measure",
      "id" : "CAUTIRateExample",
      "language" : "en",
      "text" : {
        "status" : "extensions",
        "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n\n<td class=\"content-container\">Example Catheter-Associated Urinary Tract Infection Rate</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">2.0.0-ballot</td>\n\n\n</tr>\n\n\n\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n\n<td class=\"content-container\">urn:oid:2.16.840.1.113883.4.642.40.61.29.26</td>\n\n\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Status</th>\n\n\n\n<td class=\"content-container\">Draft</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Experimental</th>\n\n\n\n<td class=\"content-container\">true</td>\n\n\n</tr>\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Jurisdiction</th>\n\n\n\n<td class=\"content-container\">\n    001 from <a href=\"http://unstats.un.org/unsd/methods/m49/m49.htm\">http://unstats.un.org/unsd/methods/m49/m49.htm</a> \n\n\n</td>\n\n\n</tr>\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Topic</th>\n\n\n\n<td class=\"content-container\">\n    Health Quality Measure Document\n\n\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n\n<td class=\"content-container\">HL7 International / Clinical Quality Information</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n\n<td class=\"content-container\"><div><p>Example measure illustrating an approach to representing the Catheter-Associated Urinary Tract Infection (CAUTI) Rate per 1000 indwelling urinary catheter (IUC) days. See https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/blob/master/Source/Cooking%20With%20CQL/93/CAUTI.md for more detailed discussion of the example.</p>\n</div></td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: group-1)</th>\n\n\n</tr>\n  \n  \n  \n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Basis</th>\n\n\n\n<td class=\"content-container\">Location</td>\n\n\n</tr>\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Scoring</th>\n\n\n\n<td class=\"content-container\">\n    Ratio\n\n\n</td>\n\n\n</tr>\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Scoring Unit</th>\n\n\n\n<td class=\"content-container\">per 1000 catheter days\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n  \n  \n\n    \n      \n        \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: denominator-initial-population\n        <br/>\n        \n        \n          \n          <em>Description</em>: No description provided\n          \n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#group-1-denominator-initial-population\">Denominator Initial Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n      \n        \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Initial Population</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: numerator-initial-population\n        <br/>\n        \n        \n          \n          <em>Description</em>: No description provided\n          \n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#group-1-numerator-initial-population\">Numerator Initial Population</a> \n            \n          \n          \n        \n        \n        \n      </td>\n    </tr>\n  \n\n      \n    \n\n    \n      \n        \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Denominator</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: denominator\n        <br/>\n        \n        \n          \n          <em>Description</em>: No description provided\n          \n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#group-1-denominator\">Denominator</a> \n            \n          \n          \n        \n        \n          <br/><em>Input Population</em>: denominator-initial-population\n        \n        \n      </td>\n    </tr>\n  \n\n      \n    \n\n    \n      \n    \n\n    \n      \n        \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Numerator</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: numerator\n        <br/>\n        \n        \n          \n          <em>Description</em>: No description provided\n          \n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#group-1-numerator\">Numerator</a> \n            \n          \n          \n        \n        \n          <br/><em>Input Population</em>: numerator-initial-population\n        \n        \n      </td>\n    </tr>\n  \n\n      \n    \n\n    \n      \n    \n\n    \n      \n        \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: denominator-observation\n        <br/>\n        \n        \n          \n          <em>Description</em>: No description provided\n          \n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#group-1-denominator-observation\">Denominator Observation</a> \n            \n          \n          \n        \n        \n          <br/><em>Input Population</em>: denominator\n        \n        \n          <em>AggregateMethod</em>: sum\n        \n      </td>\n    </tr>\n  \n\n      \n        \n  \n    \n    \n    <tr>\n      \n        \n\n<th scope=\"row\" class=\"row-header\">Measure Observation</th>\n\n\n      \n      <td class=\"content-container\">\n        \n        <em>ID</em>: numerator-observation\n        <br/>\n        \n        \n          \n          <em>Description</em>: No description provided\n          \n        \n        \n          \n            \n              \n              <em>Criteria</em>: <a href=\"#group-1-numerator-observation\">Numerator Observation</a> \n            \n          \n          \n        \n        \n          <br/><em>Input Population</em>: numerator\n        \n        \n          <em>AggregateMethod</em>: sum\n        \n      </td>\n    </tr>\n  \n\n      \n    \n\n  \n\n\n  \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Logic</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Primary Library</th>\n\n\n\n<td class=\"content-container\"><a href=\"Library-CAUTIRate.html\">CAUTI Rate</a></td>\n\n\n</tr>\n\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Contents</th>\n  <td class=\"content-container\">\n    <em><a href=\"#population-criteria\">Population Criteria</a></em>\n    <br/>\n    <em><a href=\"#definitions\">Logic Definitions</a></em>\n    <br/>\n    <em><a href=\"#terminology\">Terminology</a></em>\n    <br/>\n    <em><a href=\"#dependencies\">Dependencies</a></em>\n    <br/>\n    <em><a href=\"#data-requirements\">Data Requirements</a></em>\n    <br/>\n    <em><a href=\"#parameters\">Parameters</a></em>\n    <br/>\n  </td>\n</tr>\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"population-criteria\"> </a>Population Criteria</th>\n\n\n</tr>\n  \n  \n  \n\n  \n  \n  \n    \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate) (ID: group-1)</th>\n\n\n</tr>\n  \n  \n  \n  \n\n    \n      \n          \n    \n      \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Initial Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"group-1-denominator-initial-population\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Denominator Initial Population&quot;:\n  [Location] L\n    with Elements.&quot;Encounter During Measurement Period&quot; E\n     such that E.location.location.references(L)</code></pre>\n    \n      \n      <a href=\"#cautirate-denominator-initial-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n      \n          \n    \n      \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Initial Population\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"group-1-numerator-initial-population\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Numerator Initial Population&quot;:\n  exists (Elements.&quot;Encounter During Measurement Period&quot;)</code></pre>\n    \n      \n      <a href=\"#cautirate-numerator-initial-population\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n      \n    \n\n    \n      \n          \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Denominator\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"group-1-denominator\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Denominator&quot;:\n  &quot;Denominator Initial Population&quot;</code></pre>\n    \n      \n      <a href=\"#cautirate-denominator\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n      \n    \n\n    \n      \n    \n\n    \n      \n          \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Numerator\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"group-1-numerator\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Numerator&quot;:\n  &quot;Numerator Initial Population&quot;</code></pre>\n    \n      \n      <a href=\"#cautirate-numerator\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n      \n    \n\n    \n      \n    \n\n    \n      \n          \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Observation\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"group-1-denominator-observation\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Denominator Observation&quot;():\n  Sum(\n    Elements.&quot;Catheter Usage During Measurement Period&quot; Usage\n      return all duration in days of Usage\n  )</code></pre>\n    \n      \n      <a href=\"#cautirate-denominator-observation\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n      \n          \n    \n      \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n        \n          \n            \n              \n            \n            \n            \n            <tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    \n    Measure Observation\n    \n  </th>\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      \n      <a name=\"group-1-numerator-observation\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Numerator Observation&quot;():\n  Count(Elements.&quot;Catheter-Associated UTI&quot;)</code></pre>\n    \n      \n      <a href=\"#cautirate-numerator-observation\"><em>Definition</em></a>\n    \n  </td>\n\n</tr>\n\n          \n        \n          \n        \n          \n        \n          \n        \n      \n    \n  \n\n      \n    \n\n  \n\n\n  \n\n\n  \n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"definitions\"> </a>Logic Definitions</th>\n\n\n</tr>\n  \n  \n          \n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautielements-encounter-during-measurement-period\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Encounter During Measurement Period&quot;:\n  [Encounter] E\n    where E.period during &quot;Measurement Period&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautielements-catheter-inserted-procedure\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Catheter Inserted Procedure&quot;:\n  [Procedure: &quot;Catheter Inserted&quot;] P\n    where P.status = 'completed'</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautielements-catheter-removed-procedure\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Catheter Removed Procedure&quot;:\n  [Procedure: &quot;Catheter Removed&quot;] P\n    where P.status = 'completed'</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautielements-catheter-usage\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Catheter Usage&quot;:\n  &quot;Catheter Inserted Procedure&quot; I\n    let catheterRemoved: \n      First(\n        &quot;Catheter Removed Procedure&quot; R\n          where R.performed.toInterval() starts after I.performed.toInterval()\n          sort by start of performed.toInterval()\n      )\n    return Interval[\n      date from start of I.performed.toInterval(), \n      date from start of catheterRemoved.performed.toInterval()\n    ]</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautielements-catheter-usage-during-measurement-period\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Catheter Usage During Measurement Period&quot;:\n  collapse (\n    &quot;Catheter Usage&quot; Usage\n        where Usage overlaps &quot;Measurement Period&quot;\n        return Interval[\n            Max({start of Usage, start of &quot;Measurement Period&quot;}),\n            Min({end of Usage, end of &quot;Measurement Period&quot;})\n        ]\n  )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautielements-urine-culture-with-bacterium\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Urine Culture With Bacterium&quot;:\n  [Observation: &quot;Urine Culture&quot;] O\n    where O.status = 'final'\n      and exists (\n        O.component C\n          where C.code in &quot;Bacterium Presence&quot;\n            and C.value &gt;= 10000 '[CFU]/mL'\n      )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautielements-uti\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;UTI&quot;:\n  &quot;Urine Culture With Bacterium&quot; U\n    let \n      DOE: date from start of U.effective.toInterval(),\n      IWP: Interval[DOE - 3 days, DOE + 3 days]\n    where start of U.effective.toInterval() during &quot;Measurement Period&quot;\n    return {\n      urineCultureResult: U,\n      dateOfEvent: DOE,\n      infectionWindowPeriod: IWP\n    }</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIElements</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautielements-catheter-associated-uti\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Catheter-Associated UTI&quot;:\n  &quot;UTI&quot; U\n    where exists (\n        &quot;Catheter Usage&quot; Usage\n          where start of Usage before U.dateOfEvent\n            and end of Usage on or after U.dateOfEvent - 1 day\n            and duration in days of Usage &gt; 2\n    )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n\n        \n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRCommon</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhircommon-references\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Returns true if any of the given references are to the given resource\n@comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(references List&lt;FHIR.Reference&gt;, resource FHIR.Resource):\n  exists (references R where R.references(resource))</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRCommon</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhircommon-references\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Returns true if the given reference is to the given resource\n@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(reference FHIR.Reference, resource FHIR.Resource):\n  resource.id = Last(Split(reference.reference, '/'))</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRCommon</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhircommon-tointerval\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval\n@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types\nto an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible\nrepresentations for timing-valued elements in FHIR, allowing this function to be used across any resource.\n\nThe input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.\nThe intent of this function is to provide a clear and concise mechanism to treat single\nelements that have multiple possible representations as intervals so that logic doesn't have to account\nfor the variability. More complex calculations (such as medication request period or dispense period\ncalculation) need specific guidance and consideration. That guidance may make use of this function, but\nthe focus of this function is on single element calculations where the semantics are unambiguous.\nIf the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.\nIf the input is a Period, the result is a DateTime Interval.\nIf the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.\nIf the input is an instant, the result is a DateTime Interval beginning and ending on that instant.\nIf the input is a string, an error is raised indicating a single interval cannot be computed from a string.\nIf the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,\nand ending immediately prior to when the patient was the given Age plus one year.\nIf the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given\nby the low end of the Range, and ending immediately prior to when the patient was the Age given by the\nhigh end of the Range plus one year.\n\nNOTE: Due to the\ncomplexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used\nwith a Timing or String.\n*/\ndefine fluent function toInterval(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt;):\n  case\n    when choice is FHIR.dateTime then\n      Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]\n    when choice is FHIR.Period then\n      FHIRHelpers.ToInterval(choice as FHIR.Period)\n    when choice is FHIR.instant then\n      Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]\n    when choice is FHIR.Age then\n      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),\n        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)\n    when choice is FHIR.Range then\n      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),\n        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)\n    when choice is FHIR.Timing then\n      Message(null as Interval&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')\n    when choice is FHIR.string then\n      Message(null as Interval&lt;DateTime&gt;, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')\n    else\n      null as Interval&lt;DateTime&gt;\n  end</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n\n        \n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIRate</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautirate-denominator-initial-population\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Denominator Initial Population&quot;:\n  [Location] L\n    with Elements.&quot;Encounter During Measurement Period&quot; E\n     such that E.location.location.references(L)</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIRate</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautirate-numerator-initial-population\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Numerator Initial Population&quot;:\n  exists (Elements.&quot;Encounter During Measurement Period&quot;)</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIRate</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautirate-numerator\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Numerator&quot;:\n  &quot;Numerator Initial Population&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIRate</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautirate-denominator\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define &quot;Denominator&quot;:\n  &quot;Denominator Initial Population&quot;</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIRate</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautirate-denominator-observation\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Denominator Observation&quot;():\n  Sum(\n    Elements.&quot;Catheter Usage During Measurement Period&quot; Usage\n      return all duration in days of Usage\n  )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> CAUTIRate</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"cautirate-numerator-observation\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function &quot;Numerator Observation&quot;():\n  Count(Elements.&quot;Catheter-Associated UTI&quot;)</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n\n        \n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-tointerval\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)\nvalue to a CQL DateTime Interval\n@comment: If the start value of the given period is unspecified, the starting\nboundary of the resulting interval will be open (meaning the start of the interval\nis unknown, as opposed to interpreted as the beginning of time).\n*/\ndefine function ToInterval(period FHIR.Period):\n    if period is null then\n        null\n    else\n        if period.&quot;start&quot; is null then\n            Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]\n        else\n            Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-tostring\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToString(value string): value.value</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-tostring\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToString(value ProcedureStatus): value.value</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-todatetime\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToDateTime(value dateTime): value.value</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-todatetime\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToDateTime(value instant): value.value</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-todate\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToDate(value date): value.value</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-toquantity\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) \nvalue to a CQL Quantity\n@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity\nhas a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)\nan error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.\n@seealso: ToCalendarUnit\n*/\ndefine function ToQuantity(quantity FHIR.Quantity):\n    case\n        when quantity is null then null\n        when quantity.value is null then null\n        when quantity.comparator is not null then\n            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')\n        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'\n              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then\n            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }\n        else\n            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')\n    end</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-tocalendarunit\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts a UCUM definite duration unit to a CQL calendar duration\nunit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) \ntopic of the CQL specification.\n@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate\n*/\ndefine function ToCalendarUnit(unit System.String):\n    case unit\n        when 'ms' then 'millisecond'\n        when 's' then 'second'\n        when 'min' then 'minute'\n        when 'h' then 'hour'\n        when 'd' then 'day'\n        when 'wk' then 'week'\n        when 'mo' then 'month'\n        when 'a' then 'year'\n        else unit\n    end</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-tostring\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define function ToString(value ObservationStatus): value.value</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-toconcept\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.\n*/\ndefine function ToConcept(concept FHIR.CodeableConcept):\n    if concept is null then\n        null\n    else\n        System.Concept {\n            codes: concept.coding C return ToCode(C),\n            display: concept.text.value\n        }</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> FHIRHelpers</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"fhirhelpers-tocode\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*\n@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.\n*/\ndefine function ToCode(coding FHIR.Coding):\n    if coding is null then\n        null\n    else\n        System.Code {\n          code: coding.code.value,\n          system: coding.system.value,\n          version: coding.version.value,\n          display: coding.display.value\n        }</code></pre>\n  </td>\n\n</tr>\n\n\n\n\n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"terminology\"> </a>Terminology</th>\n\n\n</tr>\n  \n  \n  \n\n \n\n \n\n \n\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Catheter Inserted\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <code>http://example.org/ValueSet/catheter-inserted</code>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://example.org/ValueSet/catheter-inserted</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Catheter Removed\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <code>http://example.org/ValueSet/catheter-removed</code>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://example.org/ValueSet/catheter-removed</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Urine Culture\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <code>http://example.org/ValueSet/urine-culture</code>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://example.org/ValueSet/urine-culture</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Bacterium Presence\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <code>http://example.org/ValueSet/bacterium-presence</code>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://example.org/ValueSet/bacterium-presence</tt>\n    \n  </td>\n</tr>\n \n\n\n  \n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"dependencies\"> </a>Dependencies</th>\n\n\n</tr>\n  \n  \n  \n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  <td class=\"content-container\">\n    \n    <em>Description</em>: FHIR model information\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://hl7.org/fhir/uv/cql/STU2/Library-FHIR-ModelInfo.html\">http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library Elements\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"Library-CAUTIElements.html\">CAUTI Elements</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cqm/Library/CAUTIElements</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library FHIRHelpers\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://hl7.org/fhir/uv/cql/STU2/Library-FHIRHelpers.html\">http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library FHIRCommon\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://hl7.org/fhir/uv/cql/STU2/Library-FHIRCommon.html\">http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0</tt>\n    \n  </td>\n</tr>\n \n\n \n\n \n\n \n\n \n\n\n  \n  \n\n\n\n\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"data-requirements\"> </a>Data Requirements</th>\n\n\n</tr>\n  \n  \n  \n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: period, location\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Location\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/location.html\">Location</a>\n    <br/>        \n  \n   \n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Procedure\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/procedure.html\">Procedure</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, performed\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: code</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <code>http://example.org/ValueSet/catheter-removed</code>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Procedure\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/procedure.html\">Procedure</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, performed\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: code</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <code>http://example.org/ValueSet/catheter-inserted</code>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Patient\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/patient.html\">Patient</a>\n    <br/>        \n  \n   \n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Observation\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/observation.html\">Observation</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, status, component, effective\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: code</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <code>http://example.org/ValueSet/urine-culture</code>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"parameters\"> </a>Parameters</th>\n\n\n</tr>\n  \n  \n  <tr>\n  \n\n<th scope=\"row\" class=\"row-header\"/>\n\n\n  <td class=\"content-container\">\n    <table>\n      <thead>\n        <tr>\n          <td><em>Name</em></td>\n          <td><em>Use</em></td>\n          <td><em>Card.</em></td>\n          <td><em>Type</em></td>\n          <td><em>Documentation</em></td>\n        </tr>\n      </thead>\n      <tbody>\n      \n        <tr>\n          <td>Measurement Period</td>\n          <td>In</td>\n          <td>0..1</td>\n          <td>Period</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Denominator Initial Population</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Location</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Numerator</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>boolean</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Denominator</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Location</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Numerator Initial Population</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>boolean</td>\n          <td/>\n        </tr>\n      \n      </tbody>\n    </table>\n  </td>\n</tr>\n\n  \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.4 of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"
      },
      "contained" : [
        {
          "resourceType" : "Library",
          "id" : "effective-data-requirements",
          "extension" : [
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIElements"
                },
                {
                  "url" : "name",
                  "valueString" : "Encounter During Measurement Period"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Encounter During Measurement Period\":\n  [Encounter] E\n    where E.period during \"Measurement Period\""
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 0
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIRate"
                },
                {
                  "url" : "name",
                  "valueString" : "Denominator Initial Population"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Denominator Initial Population\":\n  [Location] L\n    with Elements.\"Encounter During Measurement Period\" E\n     such that E.location.location.references(L)"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 1
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIRate"
                },
                {
                  "url" : "name",
                  "valueString" : "Numerator Initial Population"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Numerator Initial Population\":\n  exists (Elements.\"Encounter During Measurement Period\")"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 2
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIRate"
                },
                {
                  "url" : "name",
                  "valueString" : "Numerator"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Numerator\":\n  \"Numerator Initial Population\""
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 3
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIElements"
                },
                {
                  "url" : "name",
                  "valueString" : "Catheter Inserted Procedure"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Catheter Inserted Procedure\":\n  [Procedure: \"Catheter Inserted\"] P\n    where P.status = 'completed'"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 4
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIElements"
                },
                {
                  "url" : "name",
                  "valueString" : "Catheter Removed Procedure"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Catheter Removed Procedure\":\n  [Procedure: \"Catheter Removed\"] P\n    where P.status = 'completed'"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 5
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIElements"
                },
                {
                  "url" : "name",
                  "valueString" : "Catheter Usage"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Catheter Usage\":\n  \"Catheter Inserted Procedure\" I\n    let catheterRemoved: \n      First(\n        \"Catheter Removed Procedure\" R\n          where R.performed.toInterval() starts after I.performed.toInterval()\n          sort by start of performed.toInterval()\n      )\n    return Interval[\n      date from start of I.performed.toInterval(), \n      date from start of catheterRemoved.performed.toInterval()\n    ]"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 6
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIElements"
                },
                {
                  "url" : "name",
                  "valueString" : "Catheter Usage During Measurement Period"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Catheter Usage During Measurement Period\":\n  collapse (\n    \"Catheter Usage\" Usage\n        where Usage overlaps \"Measurement Period\"\n        return Interval[\n            Max({start of Usage, start of \"Measurement Period\"}),\n            Min({end of Usage, end of \"Measurement Period\"})\n        ]\n  )"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 7
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIRate"
                },
                {
                  "url" : "name",
                  "valueString" : "Denominator"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Denominator\":\n  \"Denominator Initial Population\""
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 8
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIElements"
                },
                {
                  "url" : "name",
                  "valueString" : "Urine Culture With Bacterium"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Urine Culture With Bacterium\":\n  [Observation: \"Urine Culture\"] O\n    where O.status = 'final'\n      and exists (\n        O.component C\n          where C.code in \"Bacterium Presence\"\n            and C.value >= 10000 '[CFU]/mL'\n      )"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 9
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIElements"
                },
                {
                  "url" : "name",
                  "valueString" : "UTI"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"UTI\":\n  \"Urine Culture With Bacterium\" U\n    let \n      DOE: date from start of U.effective.toInterval(),\n      IWP: Interval[DOE - 3 days, DOE + 3 days]\n    where start of U.effective.toInterval() during \"Measurement Period\"\n    return {\n      urineCultureResult: U,\n      dateOfEvent: DOE,\n      infectionWindowPeriod: IWP\n    }"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 10
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIElements"
                },
                {
                  "url" : "name",
                  "valueString" : "Catheter-Associated UTI"
                },
                {
                  "url" : "statement",
                  "valueString" : "define \"Catheter-Associated UTI\":\n  \"UTI\" U\n    where exists (\n        \"Catheter Usage\" Usage\n          where start of Usage before U.dateOfEvent\n            and end of Usage on or after U.dateOfEvent - 1 day\n            and duration in days of Usage > 2\n    )"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 11
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToInterval"
                },
                {
                  "url" : "statement",
                  "valueString" : "/*\n@description: Converts the given [Period](https://hl7.org/fhir/datatypes.html#Period)\nvalue to a CQL DateTime Interval\n@comment: If the start value of the given period is unspecified, the starting\nboundary of the resulting interval will be open (meaning the start of the interval\nis unknown, as opposed to interpreted as the beginning of time).\n*/\ndefine function ToInterval(period FHIR.Period):\n    if period is null then\n        null\n    else\n        if period.\"start\" is null then\n            Interval(period.\"start\".value, period.\"end\".value]\n        else\n            Interval[period.\"start\".value, period.\"end\".value]"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 12
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRCommon"
                },
                {
                  "url" : "name",
                  "valueString" : "references"
                },
                {
                  "url" : "statement",
                  "valueString" : "/*\n@description: Returns true if any of the given references are to the given resource\n@comment: Returns true if the `id` element of the given resource exactly equals the tail of any of the given references.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(references List<FHIR.Reference>, resource FHIR.Resource):\n  exists (references R where R.references(resource))"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 13
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRCommon"
                },
                {
                  "url" : "name",
                  "valueString" : "references"
                },
                {
                  "url" : "statement",
                  "valueString" : "/*\n@description: Returns true if the given reference is to the given resource\n@comment: Returns true if the `id` element of the given resource exactly equals the tail of the given reference.\nNOTE: This function assumes resources from the same source server.\n*/\ndefine fluent function references(reference FHIR.Reference, resource FHIR.Resource):\n  resource.id = Last(Split(reference.reference, '/'))"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 14
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToString"
                },
                {
                  "url" : "statement",
                  "valueString" : "define function ToString(value string): value.value"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 15
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIRate"
                },
                {
                  "url" : "name",
                  "valueString" : "Denominator Observation"
                },
                {
                  "url" : "statement",
                  "valueString" : "define function \"Denominator Observation\"():\n  Sum(\n    Elements.\"Catheter Usage During Measurement Period\" Usage\n      return all duration in days of Usage\n  )"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 16
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToString"
                },
                {
                  "url" : "statement",
                  "valueString" : "define function ToString(value ProcedureStatus): value.value"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 17
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRCommon"
                },
                {
                  "url" : "name",
                  "valueString" : "toInterval"
                },
                {
                  "url" : "statement",
                  "valueString" : "/*\n@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval\n@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types\nto an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible\nrepresentations for timing-valued elements in FHIR, allowing this function to be used across any resource.\n\nThe input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.\nThe intent of this function is to provide a clear and concise mechanism to treat single\nelements that have multiple possible representations as intervals so that logic doesn't have to account\nfor the variability. More complex calculations (such as medication request period or dispense period\ncalculation) need specific guidance and consideration. That guidance may make use of this function, but\nthe focus of this function is on single element calculations where the semantics are unambiguous.\nIf the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.\nIf the input is a Period, the result is a DateTime Interval.\nIf the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.\nIf the input is an instant, the result is a DateTime Interval beginning and ending on that instant.\nIf the input is a string, an error is raised indicating a single interval cannot be computed from a string.\nIf the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,\nand ending immediately prior to when the patient was the given Age plus one year.\nIf the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given\nby the low end of the Range, and ending immediately prior to when the patient was the Age given by the\nhigh end of the Range plus one year.\n\nNOTE: Due to the\ncomplexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used\nwith a Timing or String.\n*/\ndefine fluent function toInterval(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):\n  case\n    when choice is FHIR.dateTime then\n      Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]\n    when choice is FHIR.Period then\n      FHIRHelpers.ToInterval(choice as FHIR.Period)\n    when choice is FHIR.instant then\n      Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]\n    when choice is FHIR.Age then\n      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),\n        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)\n    when choice is FHIR.Range then\n      Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),\n        FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)\n    when choice is FHIR.Timing then\n      Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a Timing value is not supported')\n    when choice is FHIR.string then\n      Message(null as Interval<DateTime>, true, 'NOT_IMPLEMENTED', 'Error', 'Calculation of an interval from a String value is not supported')\n    else\n      null as Interval<DateTime>\n  end"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 18
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToDateTime"
                },
                {
                  "url" : "statement",
                  "valueString" : "define function ToDateTime(value dateTime): value.value"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 19
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToDateTime"
                },
                {
                  "url" : "statement",
                  "valueString" : "define function ToDateTime(value instant): value.value"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 20
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToDate"
                },
                {
                  "url" : "statement",
                  "valueString" : "define function ToDate(value date): value.value"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 21
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToQuantity"
                },
                {
                  "url" : "statement",
                  "valueString" : "/*\n@description: Converts the given FHIR [Quantity](https://hl7.org/fhir/datatypes.html#Quantity) \nvalue to a CQL Quantity\n@comment: If the given quantity has a comparator specified, a runtime error is raised. If the given quantity\nhas a system other than UCUM (i.e. `http://unitsofmeasure.org`) or CQL calendar units (i.e. `http://hl7.org/fhirpath/CodeSystem/calendar-units`)\nan error is raised. For UCUM to calendar units, the `ToCalendarUnit` function is used.\n@seealso: ToCalendarUnit\n*/\ndefine function ToQuantity(quantity FHIR.Quantity):\n    case\n        when quantity is null then null\n        when quantity.value is null then null\n        when quantity.comparator is not null then\n            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')\n        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'\n              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then\n            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }\n        else\n            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')\n    end"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 22
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToCalendarUnit"
                },
                {
                  "url" : "statement",
                  "valueString" : "/*\n@description: Converts a UCUM definite duration unit to a CQL calendar duration\nunit using conversions specified in the [quantities](https://cql.hl7.org/02-authorsguide.html#quantities) \ntopic of the CQL specification.\n@comment: Note that for durations above days (or weeks), the conversion is understood to be approximate\n*/\ndefine function ToCalendarUnit(unit System.String):\n    case unit\n        when 'ms' then 'millisecond'\n        when 's' then 'second'\n        when 'min' then 'minute'\n        when 'h' then 'hour'\n        when 'd' then 'day'\n        when 'wk' then 'week'\n        when 'mo' then 'month'\n        when 'a' then 'year'\n        else unit\n    end"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 23
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "CAUTIRate"
                },
                {
                  "url" : "name",
                  "valueString" : "Numerator Observation"
                },
                {
                  "url" : "statement",
                  "valueString" : "define function \"Numerator Observation\"():\n  Count(Elements.\"Catheter-Associated UTI\")"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 24
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToString"
                },
                {
                  "url" : "statement",
                  "valueString" : "define function ToString(value ObservationStatus): value.value"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 25
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToConcept"
                },
                {
                  "url" : "statement",
                  "valueString" : "/*\n@description: Converts the given FHIR [CodeableConcept](https://hl7.org/fhir/datatypes.html#CodeableConcept) value to a CQL Concept.\n*/\ndefine function ToConcept(concept FHIR.CodeableConcept):\n    if concept is null then\n        null\n    else\n        System.Concept {\n            codes: concept.coding C return ToCode(C),\n            display: concept.text.value\n        }"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 26
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            },
            {
              "extension" : [
                {
                  "url" : "libraryName",
                  "valueString" : "FHIRHelpers"
                },
                {
                  "url" : "name",
                  "valueString" : "ToCode"
                },
                {
                  "url" : "statement",
                  "valueString" : "/*\n@description: Converts the given FHIR [Coding](https://hl7.org/fhir/datatypes.html#Coding) value to a CQL Code.\n*/\ndefine function ToCode(coding FHIR.Coding):\n    if coding is null then\n        null\n    else\n        System.Code {\n          code: coding.code.value,\n          system: coding.system.value,\n          version: coding.version.value,\n          display: coding.display.value\n        }"
                },
                {
                  "url" : "displaySequence",
                  "valueInteger" : 27
                }
              ],
              "url" : "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"
            }
          ],
          "name" : "EffectiveDataRequirements",
          "status" : "active",
          "type" : {
            "coding" : [
              {
                "system" : "http://terminology.hl7.org/CodeSystem/library-type",
                "code" : "module-definition"
              }
            ]
          },
          "relatedArtifact" : [
            {
              "type" : "depends-on",
              "display" : "FHIR model information",
              "resource" : "http://hl7.org/fhir/uv/cql/Library/FHIR-ModelInfo|4.0.1"
            },
            {
              "type" : "depends-on",
              "display" : "Library Elements",
              "resource" : "http://hl7.org/fhir/uv/cqm/Library/CAUTIElements"
            },
            {
              "type" : "depends-on",
              "display" : "Library FHIRHelpers",
              "resource" : "http://hl7.org/fhir/uv/cql/Library/FHIRHelpers|4.0.1"
            },
            {
              "type" : "depends-on",
              "display" : "Library FHIRCommon",
              "resource" : "http://hl7.org/fhir/uv/cql/Library/FHIRCommon|2.0.0"
            },
            {
              "type" : "depends-on",
              "display" : "Value set Catheter Inserted",
              "resource" : "http://example.org/ValueSet/catheter-inserted"
            },
            {
              "type" : "depends-on",
              "display" : "Value set Catheter Removed",
              "resource" : "http://example.org/ValueSet/catheter-removed"
            },
            {
              "type" : "depends-on",
              "display" : "Value set Urine Culture",
              "resource" : "http://example.org/ValueSet/urine-culture"
            },
            {
              "type" : "depends-on",
              "display" : "Value set Bacterium Presence",
              "resource" : "http://example.org/ValueSet/bacterium-presence"
            }
          ],
          "parameter" : [
            {
              "name" : "Measurement Period",
              "use" : "in",
              "min" : 0,
              "max" : "1",
              "type" : "Period"
            },
            {
              "name" : "Denominator Initial Population",
              "use" : "out",
              "min" : 0,
              "max" : "*",
              "type" : "Location"
            },
            {
              "name" : "Numerator",
              "use" : "out",
              "min" : 0,
              "max" : "1",
              "type" : "boolean"
            },
            {
              "name" : "Denominator",
              "use" : "out",
              "min" : 0,
              "max" : "*",
              "type" : "Location"
            },
            {
              "name" : "Numerator Initial Population",
              "use" : "out",
              "min" : 0,
              "max" : "1",
              "type" : "boolean"
            }
          ],
          "dataRequirement" : [
            {
              "type" : "Encounter",
              "profile" : [
                🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
              ],
              "mustSupport" : [
                "period",
                "location"
              ]
            },
            {
              "type" : "Location",
              "profile" : [
                🔗 "http://hl7.org/fhir/StructureDefinition/Location"
              ]
            },
            {
              "type" : "Procedure",
              "profile" : [
                🔗 "http://hl7.org/fhir/StructureDefinition/Procedure"
              ],
              "mustSupport" : [
                "code",
                "status",
                "performed"
              ],
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/ValueSet/catheter-removed"
                }
              ]
            },
            {
              "type" : "Procedure",
              "profile" : [
                🔗 "http://hl7.org/fhir/StructureDefinition/Procedure"
              ],
              "mustSupport" : [
                "code",
                "status",
                "performed"
              ],
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/ValueSet/catheter-inserted"
                }
              ]
            },
            {
              "type" : "Patient",
              "profile" : [
                🔗 "http://hl7.org/fhir/StructureDefinition/Patient"
              ]
            },
            {
              "type" : "Observation",
              "profile" : [
                🔗 "http://hl7.org/fhir/StructureDefinition/Observation"
              ],
              "mustSupport" : [
                "code",
                "status",
                "component",
                "effective"
              ],
              "codeFilter" : [
                {
                  "path" : "code",
                  "valueSet" : "http://example.org/ValueSet/urine-culture"
                }
              ]
            }
          ]
        }
      ],
      "extension" : [
        {
          "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
          "valueCode" : "cqi"
        },
        {
          "url" : "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements",
          "valueCanonical" : "#effective-data-requirements"
        }
      ],
      "url" : "http://hl7.org/fhir/uv/cqm/Measure/CAUTIRateExample",
      "identifier" : [
        {
          "system" : "urn:ietf:rfc:3986",
          "value" : "urn:oid:2.16.840.1.113883.4.642.40.61.29.26"
        }
      ],
      "version" : "2.0.0-ballot",
      "name" : "CAUTIRateExample",
      "title" : "Example Catheter-Associated Urinary Tract Infection Rate",
      "status" : "draft",
      "experimental" : true,
      "date" : "2025-08-13",
      "publisher" : "HL7 International / Clinical Quality Information",
      "contact" : [
        {
          "telecom" : [
            {
              "system" : "url",
              "value" : "http://www.hl7.org/Special/committees/cqi"
            }
          ]
        }
      ],
      "description" : "Example measure illustrating an approach to representing the Catheter-Associated Urinary Tract Infection (CAUTI) Rate per 1000 indwelling urinary catheter (IUC) days. See https://github.com/cqframework/CQL-Formatting-and-Usage-Wiki/blob/master/Source/Cooking%20With%20CQL/93/CAUTI.md for more detailed discussion of the example.",
      "jurisdiction" : [
        {
          "coding" : [
            {
              "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
              "code" : "001"
            }
          ]
        }
      ],
      "topic" : [
        {
          "coding" : [
            {
              "system" : "http://loinc.org",
              "code" : "57024-2",
              "display" : "Health Quality Measure Document"
            }
          ]
        }
      ],
      "library" : [
        🔗 "http://hl7.org/fhir/uv/cqm/Library/CAUTIRate"
      ],
      "group" : [
        {
          "id" : "group-1",
          "extension" : [
            {
              "url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.linkId",
              "valueString" : "group-1"
            },
            {
              "url" : "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-populationBasis",
              "valueCode" : "Location"
            },
            {
              "url" : "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-scoring",
              "valueCodeableConcept" : {
                "coding" : [
                  {
                    "system" : "http://terminology.hl7.org/CodeSystem/measure-scoring",
                    "code" : "ratio",
                    "display" : "Ratio"
                  }
                ]
              }
            },
            {
              "url" : "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-scoringUnit",
              "valueCodeableConcept" : {
                "coding" : [
                  {
                    "system" : "http://unitsofmeasure.org",
                    "code" : "/1000.d",
                    "display" : "/1000.d"
                  }
                ],
                "text" : "per 1000 catheter days"
              }
            }
          ],
          "population" : [
            {
              "id" : "denominator-initial-population",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId",
                  "valueString" : "denominator-initial-population"
                }
              ],
              "code" : {
                "coding" : [
                  {
                    "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
                    "code" : "initial-population",
                    "display" : "Initial Population"
                  }
                ]
              },
              "criteria" : {
                "language" : "text/cql-identifier",
                "expression" : "Denominator Initial Population"
              }
            },
            {
              "id" : "denominator",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId",
                  "valueString" : "denominator"
                },
                {
                  "url" : "http://hl7.org/fhir/StructureDefinition/cqf-criteriaReference",
                  "valueString" : "denominator-initial-population"
                }
              ],
              "code" : {
                "coding" : [
                  {
                    "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
                    "code" : "denominator",
                    "display" : "Denominator"
                  }
                ]
              },
              "criteria" : {
                "language" : "text/cql-identifier",
                "expression" : "Denominator"
              }
            },
            {
              "id" : "denominator-observation",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId",
                  "valueString" : "denominator-observation"
                },
                {
                  "url" : "http://hl7.org/fhir/StructureDefinition/cqf-criteriaReference",
                  "valueString" : "denominator"
                },
                {
                  "url" : "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-aggregateMethod",
                  "valueCode" : "sum"
                }
              ],
              "code" : {
                "coding" : [
                  {
                    "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
                    "code" : "measure-observation",
                    "display" : "Measure Observation"
                  }
                ]
              },
              "criteria" : {
                "language" : "text/cql-identifier",
                "expression" : "Denominator Observation"
              }
            },
            {
              "id" : "numerator-initial-population",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId",
                  "valueString" : "numerator-initial-population"
                }
              ],
              "code" : {
                "coding" : [
                  {
                    "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
                    "code" : "initial-population",
                    "display" : "Initial Population"
                  }
                ]
              },
              "criteria" : {
                "language" : "text/cql-identifier",
                "expression" : "Numerator Initial Population"
              }
            },
            {
              "id" : "numerator",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId",
                  "valueString" : "numerator"
                },
                {
                  "url" : "http://hl7.org/fhir/StructureDefinition/cqf-criteriaReference",
                  "valueString" : "numerator-initial-population"
                }
              ],
              "code" : {
                "coding" : [
                  {
                    "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
                    "code" : "numerator",
                    "display" : "Numerator"
                  }
                ]
              },
              "criteria" : {
                "language" : "text/cql-identifier",
                "expression" : "Numerator"
              }
            },
            {
              "id" : "numerator-observation",
              "extension" : [
                {
                  "url" : "http://hl7.org/fhir/5.0/StructureDefinition/extension-Measure.group.population.linkId",
                  "valueString" : "numerator-observation"
                },
                {
                  "url" : "http://hl7.org/fhir/StructureDefinition/cqf-criteriaReference",
                  "valueString" : "numerator"
                },
                {
                  "url" : "http://hl7.org/fhir/uv/cqm/StructureDefinition/cqm-aggregateMethod",
                  "valueCode" : "sum"
                }
              ],
              "code" : {
                "coding" : [
                  {
                    "system" : "http://terminology.hl7.org/CodeSystem/measure-population",
                    "code" : "measure-observation",
                    "display" : "Measure Observation"
                  }
                ]
              },
              "criteria" : {
                "language" : "text/cql-identifier",
                "expression" : "Numerator Observation"
              }
            }
          ]
        }
      ]
    }