CDC National Healthcare Safety Network (NHSN) Digital Quality Measures (dQM) Content Package IG
1.0.0 - Release 1

CDC National Healthcare Safety Network (NHSN) Digital Quality Measures (dQM) Content Package IG - Downloaded Version 1.0.0 See the Directory of published versions

## : NHSN Acute Care Hospital Monthly Initial Population Library - XML Representation

Page standards status: Trial-use | Maturity Level: 1

Raw xml | Download

    <Library xmlns="http://hl7.org/fhir">
      <id value="NHSNAcuteCareHospitalMonthlyInitialPopulation"/>
      <text>
        <status value="extensions"/>
        <div xmlns="http://www.w3.org/1999/xhtml">
    <div>
        <table class="grid dict">

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

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

            <tr>
                <th scope="row"><b>Url: </b></th>
                <td style="padding-left: 4px;"><a href="Library-NHSNAcuteCareHospitalMonthlyInitialPopulation.html">NHSNAcuteCareHospitalMonthlyInitialPopulation</a></td>
            </tr>

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

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

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

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

                </td>
            </tr>

            <tr>
                <th scope="row"><b>Date: </b></th>
                <td style="padding-left: 4px;">2025-09-15 12:53:39-0400</td>
            </tr>

            <tr>
                <th scope="row"><b>Publisher: </b></th>
                <td style="padding-left: 4px;">CDC National Healthcare Safety Network (NHSN)</td>
            </tr>

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

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

                    <p><b>Dependencies</b></p>
                    <ul>

                        <li><a href="http://fhir.org/guides/cqf/common/4.0.1/4.0.1/Library-FHIR-ModelInfo.html">http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1</a></li>

                        <li><code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2</code></li>

                        <li><code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNHelpers|0.0.002</code></li>

                        <li><code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/SharedResourceCreation|0.1.010</code></li>

                        <li><a href="http://terminology.hl7.org/6.5.0/CodeSystem-v3-ActCode.html">ActCodeversion: null9.0.0)</a></li>

                        <li><a href="http://terminology.hl7.org/6.5.0/CodeSystem-observation-category.html">Observation Category Codesversion: null1.0.1)</a></li>

                        <li><a href="http://terminology.hl7.org/6.5.0/CodeSystem-v3-loinc.html">Logical Observation Identifiers, Names and Codes (LOINC)</a></li>

                        <li><a href="http://terminology.hl7.org/5.0.0/CodeSystem-v2-0074.html">diagnosticServiceSectionIdversion: null2.5.0)</a></li>

                        <li><a href="http://terminology.hl7.org/6.5.0/CodeSystem-condition-category.html">Condition Category Codesversion: null1.0.1)</a></li>

                        <li><a href="http://hl7.org/fhir/us/core/STU3.1.1/CodeSystem-condition-category.html">US Core Condition Category Extension Codes</a></li>

                        <li><a href="http://terminology.hl7.org/6.5.0/CodeSystem-condition-clinical.html">Condition Clinical Status Codesversion: null3.0.0)</a></li>

                        <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1046.265/expansion">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265</a></li>

                        <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion">Emergency Department Visit</a></li>

                        <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a></li>

                        <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion">Observation Services</a></li>

                        <li><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1046.274/expansion">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274</a></li>

                    </ul>

                </td>
            </tr>

            <tr>
              <th scope="row"><b>Parameters: </b></th>
              <td style="padding-left: 4px;">
                <table class="grid-dict">
                  <tr><th><b>Name</b></th><th><b>Type</b></th><th><b>Min</b></th><th><b>Max</b></th><th><b>In/Out</b></th></tr>

                    <tr><th>Measurement Period</th><th>Period</th><th>0</th><th>1</th><th>In</th></tr>

                    <tr><th>Patient</th><th>Patient</th><th>0</th><th>1</th><th>Out</th></tr>

                    <tr><th>Qualifying Encounters During Measurement Period</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>Encounters</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>Encounters with Patient Hospital Locations</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>Initial Population</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>Conditions</th><th>Condition</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>DiagnosticReports</th><th>DiagnosticReport</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>Observations</th><th>Observation</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>Get Locations from IP Encounters in Measurement Period</th><th>Location</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Condition</th><th>Condition</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Device</th><th>Device</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE DiagnosticReport Lab</th><th>DiagnosticReport</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE DiagnosticReport Note</th><th>DiagnosticReport</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE DiagnosticReport Others</th><th>DiagnosticReport</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Encounter</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE IP Encounters</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Location</th><th>Location</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Medication Administration</th><th>MedicationAdministration</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Medication Request</th><th>MedicationRequest</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Medication</th><th>Medication</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Observation Lab Category</th><th>Observation</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Observation Vital Signs Category</th><th>Observation</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Observation Category</th><th>Observation</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Coverage</th><th>Coverage</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Procedure</th><th>Procedure</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Specimen</th><th>Specimen</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Service Request</th><th>ServiceRequest</th><th>0</th><th>*</th><th>Out</th></tr>

                    <tr><th>SDE Minimal Patient</th><th>Patient</th><th>0</th><th>1</th><th>Out</th></tr>

                </table>
              </td>
            </tr>

            <tr>
              <th scope="row"><b>Data Requirements:</b></th>
              <td style="padding-left: 4px;">
                <table class="grid-dict">
                  <tr><th><b>Type</b></th><th><b>Profile</b></th><th><b>MS</b></th><th><b>Code Filter</b></th></tr>

                    <tr>
                      <th>Patient</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Patient</th>
                      <th/>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>Encounter</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>
                      <th>;;;;;;</th>
                      <th>

                          <b>code filter: </b>

                          <br/>

                          <span style="padding-left: 4px;">
                              <b>path: </b><span>type</span>
                          </span>

                          <br/>

                          <span style="padding-left: 4px;">
                              <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307</span>
                          </span>

                      </th>
                    </tr>

                    <tr>
                      <th>Encounter</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>
                      <th>;;;;;;</th>
                      <th>

                          <b>code filter: </b>

                          <br/>

                          <span style="padding-left: 4px;">
                              <b>path: </b><span>type</span>
                          </span>

                          <br/>

                          <span style="padding-left: 4px;">
                              <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</span>
                          </span>

                      </th>
                    </tr>

                    <tr>
                      <th>Encounter</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>
                      <th>;;;;;;</th>
                      <th>

                          <b>code filter: </b>

                          <br/>

                          <span style="padding-left: 4px;">
                              <b>path: </b><span>type</span>
                          </span>

                          <br/>

                          <span style="padding-left: 4px;">
                              <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143</span>
                          </span>

                      </th>
                    </tr>

                    <tr>
                      <th>Encounter</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>
                      <th>;;;;;;</th>
                      <th>

                          <b>code filter: </b>

                          <br/>

                          <span style="padding-left: 4px;">
                              <b>path: </b><span>class</span>
                          </span>

                          <br/>

                          <span style="padding-left: 4px;">
                              <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274</span>
                          </span>

                      </th>
                    </tr>

                    <tr>
                      <th>Encounter</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>
                      <th>;;;;;;</th>
                      <th>

                          <b>code filter: </b>

                          <br/>

                          <span style="padding-left: 4px;">
                              <b>path: </b><span>class</span>
                          </span>

                          <br/>

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

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

                              <p style="margin-bottom: 5px;">
                                  <b>display: </b> <span>emergency</span>
                              </p>

                      </th>
                    </tr>

                    <tr>
                      <th>Encounter</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>
                      <th>;;;;;;</th>
                      <th>

                          <b>code filter: </b>

                          <br/>

                          <span style="padding-left: 4px;">
                              <b>path: </b><span>class</span>
                          </span>

                          <br/>

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

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

                              <p style="margin-bottom: 5px;">
                                  <b>display: </b> <span>observation encounter</span>
                              </p>

                      </th>
                    </tr>

                    <tr>
                      <th>Encounter</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>
                      <th>;;;;;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>Condition</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Condition</th>
                      <th>;;;;;;;;;;;;;;;;;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>DiagnosticReport</th>
                      <th>http://hl7.org/fhir/StructureDefinition/DiagnosticReport</th>
                      <th>;;;;;;;;;;;;;;;;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>Observation</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Observation</th>
                      <th>;;;;;;;;;;;;;;;;;;;;;;;;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>Device</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Device</th>
                      <th>;;;;;;;;;;;;;;;;;;;;;;;;;;;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>MedicationAdministration</th>
                      <th>http://hl7.org/fhir/StructureDefinition/MedicationAdministration</th>
                      <th>;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>MedicationRequest</th>
                      <th>http://hl7.org/fhir/StructureDefinition/MedicationRequest</th>
                      <th>;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>Medication</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Medication</th>
                      <th>;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>Coverage</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Coverage</th>
                      <th>;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>Procedure</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Procedure</th>
                      <th>;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>Specimen</th>
                      <th>http://hl7.org/fhir/StructureDefinition/Specimen</th>
                      <th>;;</th>
                      <th>

                      </th>
                    </tr>

                    <tr>
                      <th>ServiceRequest</th>
                      <th>http://hl7.org/fhir/StructureDefinition/ServiceRequest</th>
                      <th>;</th>
                      <th>

                      </th>
                    </tr>

                </table>
              </td>
            </tr>

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

    using FHIR version '4.0.1'

    include FHIRHelpers version '4.0.2' called FHIRHelpers
    include NHSNHelpers version '0.0.002' called NHSNHelpers
    include SharedResourceCreation version '0.1.010' called SharedResource

    codesystem &quot;ActCode&quot;: 'http://terminology.hl7.org/CodeSystem/v3-ActCode'
    codesystem &quot;Observation Category&quot;: 'http://terminology.hl7.org/CodeSystem/observation-category'
    codesystem &quot;LOINC&quot;: 'http://loinc.org'
    codesystem &quot;V2-0074&quot;: 'http://terminology.hl7.org/CodeSystem/v2-0074'
    codesystem &quot;Condition Category&quot;: 'http://terminology.hl7.org/CodeSystem/condition-category'
    codesystem &quot;US Core Condition Category&quot;: 'http://hl7.org/fhir/us/core/CodeSystem/condition-category'
    codesystem &quot;Condition Clinical Status&quot;: 'http://terminology.hl7.org/CodeSystem/condition-clinical'

    valueset &quot;Inpatient, Emergency, and Observation Locations&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265'
    valueset &quot;Emergency Department Visit&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'
    valueset &quot;Encounter Inpatient&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
    valueset &quot;Observation Services&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'
    valueset &quot;NHSN Inpatient Encounter Class Codes&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274'

    //code for Observation Category
    code &quot;laboratory&quot;: 'laboratory' from &quot;Observation Category&quot; display 'Laboratory'
    code &quot;social-history&quot;: 'social-history' from &quot;Observation Category&quot; display 'Social History'
    code &quot;vital-signs&quot;: 'vital-signs' from &quot;Observation Category&quot; display 'Vital Signs'
    code &quot;imaging&quot;: 'imaging' from &quot;Observation Category&quot; display 'Imaging'
    code &quot;procedure&quot;: 'procedure' from &quot;Observation Category&quot; display 'Procedure'
    code &quot;survey&quot;: 'survey' from &quot;Observation Category&quot; display 'Survey'

    //code for Condition category
    code &quot;problem-list-item&quot;: 'problem-list-item' from &quot;Condition Category&quot; display 'Problem List Item'
    code &quot;encounter-diagnosis&quot;: 'encounter-diagnosis' from &quot;Condition Category&quot; display 'Encounter Diagnosis'
    code &quot;health-concern&quot;: 'health-concern' from &quot;US Core Condition Category&quot; display 'Health Concern'

    //code for Diagnostic Report Category
    code &quot;LAB&quot;: 'LAB' from &quot;V2-0074&quot; display 'Laboratory'
    code &quot;Radiology&quot;: 'LP29684-5' from &quot;LOINC&quot; display 'Radiology'
    code &quot;Pathology&quot;: 'LP7839-6' from &quot;LOINC&quot; display 'Pathology'
    code &quot;Cardiology&quot;: 'LP29708-2' from &quot;LOINC&quot; display 'Cardiology'

    //code for Emergency Encounter Class
    code &quot;emergency&quot;: 'EMER' from &quot;ActCode&quot; display 'emergency'
    code &quot;observation encounter&quot;: 'OBSENC' from &quot;ActCode&quot; display 'observation encounter'

    //code for Condition clinicalStatus
    code &quot;active&quot;: 'active' from &quot;Condition Clinical Status&quot; display 'active'

    parameter &quot;Measurement Period&quot;
        default Interval[@2024-04-01T00:00:00.0, @2024-04-30T23:59:59.0)

    context Patient

    define &quot;Qualifying Encounters During Measurement Period&quot;:
     ( [Encounter: &quot;Encounter Inpatient&quot;]
      union [Encounter: &quot;Emergency Department Visit&quot;]
      union [Encounter: &quot;Observation Services&quot;]
      union [Encounter: class in &quot;NHSN Inpatient Encounter Class Codes&quot;]
      union [Encounter: class ~ &quot;emergency&quot;]
      union [Encounter: class ~ &quot;observation encounter&quot;]) QualifyingEncounters
      where QualifyingEncounters.status in {'in-progress', 'finished', 'triaged', 'onleave', 'entered-in-error'}
        and QualifyingEncounters.period overlaps &quot;Measurement Period&quot;

    define &quot;Encounters with Patient Hospital Locations&quot;:
      &quot;Encounters&quot; Encounters
      where exists(
        Encounters.location EncounterLocation
        where NHSNHelpers.GetLocation(EncounterLocation.location).type in &quot;Inpatient, Emergency, and Observation Locations&quot;
          and EncounterLocation.period overlaps Encounters.period
      )
      and Encounters.status in {'in-progress', 'finished', 'triaged', 'onleave', 'entered-in-error'}
      and Encounters.period overlaps &quot;Measurement Period&quot;

    define &quot;Initial Population&quot;:
      &quot;Qualifying Encounters During Measurement Period&quot;
      union &quot;Encounters with Patient Hospital Locations&quot;

    define &quot;Encounters&quot;:
      [Encounter]

    define &quot;Conditions&quot;:
      [Condition]

    define &quot;DiagnosticReports&quot;:
      [DiagnosticReport]

    define &quot;Observations&quot;:
      [Observation]

    define &quot;Get Locations from IP Encounters in Measurement Period&quot;:
      flatten(&quot;Initial Population&quot; IP
      let locationElements: IP.location
      return
        locationElements LE
        let locationReference: LE.location
        return NHSNHelpers.GetLocation(locationReference))

    //============================================================================
    //Supplemental Data Element
    //When FHIR.canonical value is present, US Core 3.1.1 profiles are used
    //When FHIR.canonical value is not present, FHIR Base profiles are used
    //============================================================================
    define &quot;SDE Condition&quot;:
      &quot;Conditions&quot; Conditions
      where exists(
        &quot;Initial Population&quot; IP
        //Check for Problem List Conditions that were recorded before or during IP
        where (
          Conditions.recordedDate before end of IP.period
          and exists(Conditions.category categories
            where categories ~ &quot;problem-list-item&quot;)
          and Conditions.clinicalStatus ~ &quot;active&quot;
        )
        //Check for Encounter Diagnosis Conditions that reference an IP encounter
        or (
          (exists(IP.diagnosis Diagnoses
              where GetCondition(Diagnoses.condition).id = Conditions.id
            )
            or GetEncounter(Conditions.encounter).id = IP.id
          )
          and exists (Conditions.category categories
            where categories ~ &quot;encounter-diagnosis&quot;
              or categories ~ &quot;health-concern&quot;)
        )
      )
      return ConditionResource(Conditions,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-condition'}},
      {&quot;problem-list-item&quot;, &quot;encounter-diagnosis&quot;, &quot;health-concern&quot;})

    define &quot;SDE Device&quot;:
      [Device] Devices
      where exists(&quot;Initial Population&quot;)
      return DeviceResource(Devices,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-device'}})

    //This block collects all DiagnosticReport resources while also marking Lab and Note DiagnosticReports with the appropriate profiles
    //#Start DiagnosticReport block
    define &quot;SDE DiagnosticReport Lab&quot;:
      &quot;DiagnosticReports&quot; DiagnosticReports
      where (exists(DiagnosticReports.category Category where Category ~ &quot;LAB&quot;)
        and exists(
          &quot;Initial Population&quot; IP
          where NHSNHelpers.&quot;Normalize Interval&quot;(DiagnosticReports.effective) overlaps IP.period))
      return SharedResource.DiagnosticReportLabResource(DiagnosticReports,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-diagnosticreport-lab'}})

    define &quot;SDE DiagnosticReport Note&quot;:
      &quot;DiagnosticReports&quot; DiagnosticReports
      where ((exists(DiagnosticReports.category Category where Category ~ &quot;Radiology&quot;))
        or exists((DiagnosticReports.category Category where Category ~ &quot;Pathology&quot;))
        or exists((DiagnosticReports.category Category where Category ~ &quot;Cardiology&quot;)))
        and exists(
          &quot;Initial Population&quot; IP
          where NHSNHelpers.&quot;Normalize Interval&quot;(DiagnosticReports.effective) overlaps IP.period)
      return DiagnosticReportResource(DiagnosticReports,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-diagnosticreport-note'}})

    define &quot;SDE DiagnosticReport Others&quot;:
      [DiagnosticReport] DiagnosticReports
      where not ((exists(DiagnosticReports.category Category where Category ~ &quot;Radiology&quot;))
        or exists((DiagnosticReports.category Category where Category ~ &quot;Pathology&quot;))
        or exists((DiagnosticReports.category Category where Category ~ &quot;Cardiology&quot;))
        or exists(DiagnosticReports.category Category where Category ~ &quot;LAB&quot;))
        and exists(&quot;Initial Population&quot; IP
          where NHSNHelpers.&quot;Normalize Interval&quot;(DiagnosticReports.effective) overlaps IP.period)
      return DiagnosticReportResource(DiagnosticReports,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-diagnosticreport'}})
    //#End DiagnosticReport block

    define &quot;SDE Encounter&quot;:
      &quot;Encounters&quot; Encounters
      where not CheckIP(Encounters)
      and exists(
        &quot;Initial Population&quot; IP
        where Encounters.period overlaps IP.period)
      return SharedResource.EncounterResource(Encounters,
      {FHIR.canonical{value: 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter'}})

    define &quot;SDE IP Encounters&quot;:
      &quot;Initial Population&quot; IP
      return SharedResource.EncounterResource(IP,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-encounter'}})

    define &quot;SDE Location&quot;:
      &quot;Get Locations from IP Encounters in Measurement Period&quot; Locations
      where exists(&quot;Initial Population&quot;)
      and Locations is not null
      return SharedResource.LocationResource(Locations,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-location'}})

    define &quot;SDE Medication Administration&quot;:
      [MedicationAdministration] MedicationAdministrations
      where exists(
        &quot;Initial Population&quot; IP
        where NHSNHelpers.&quot;Normalize Interval&quot;(MedicationAdministrations.effective) overlaps IP.period)
      return SharedResource.MedicationAdministrationResource(MedicationAdministrations,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-medicationadministration'}})

    define &quot;SDE Medication Request&quot;:
      [MedicationRequest] MedicationRequests
      where exists(
        &quot;Initial Population&quot; IP
        where MedicationRequests.authoredOn during IP.period)
      return SharedResource.MedicationRequestResource(MedicationRequests,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-medicationrequest'}})

    define &quot;SDE Medication&quot;:
      (&quot;SDE Medication Request&quot;
      union &quot;SDE Medication Administration&quot;) MedReqOrAdmin
      where MedReqOrAdmin.medication is FHIR.Reference
      and exists(&quot;Initial Population&quot;) //No longer need to check for timing here because it's checked in SDE Medication Request/Administriation
      return SharedResource.MedicationResource(GetMedicationFrom(MedReqOrAdmin.medication),
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-medication'}})

    define &quot;SDE Observation Lab Category&quot;:
      &quot;Observations&quot; Observations
      where (exists(Observations.category Category where Category ~ &quot;laboratory&quot;))
        and exists(
          &quot;Initial Population&quot; IP
          where NHSNHelpers.&quot;Normalize Interval&quot;(Observations.effective) overlaps IP.period)
      return SharedResource.ObservationLabResource(Observations,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-observation-lab'}})

    //Vital Signs Observation has its own profile in FHIR Base
    define &quot;SDE Observation Vital Signs Category&quot;:
      &quot;Observations&quot; Observations
      where (exists(Observations.category Category where Category ~ &quot;vital-signs&quot;))
        and exists(
          &quot;Initial Population&quot; IP
          where NHSNHelpers.&quot;Normalize Interval&quot;(Observations.effective) overlaps IP.period)
      return ObservationVitalSignsResource(Observations,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-observation-vitals'}})

    //Defaulting to base FHIR profile as there are no individual profiles in US Core 3.1.1 that cover these Observation categories
    define &quot;SDE Observation Category&quot;:
      &quot;Observations&quot; Observations
      where ((exists(Observations.category Category where Category ~ &quot;social-history&quot;))
        or (exists(Observations.category Category where Category ~ &quot;survey&quot;))
        or (exists(Observations.category Category where Category ~ &quot;imaging&quot;))
        or (exists(Observations.category Category where Category ~ &quot;procedure&quot;)))
        and exists(
          &quot;Initial Population&quot; IP
          where NHSNHelpers.&quot;Normalize Interval&quot;(Observations.effective) overlaps IP.period)
      return ObservationResource(Observations,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-observation'}})

    define &quot;SDE Coverage&quot;:
    	[Coverage] Coverages
      where exists(
        &quot;Initial Population&quot; IP
        where Coverages.period overlaps IP.period)
      return SharedResource.CoverageResource(Coverages,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-coverage'}})

    define &quot;SDE Procedure&quot;:
      [Procedure] Procedures
      where exists(
        &quot;Initial Population&quot; IP
        where NHSNHelpers.&quot;Normalize Interval&quot;(Procedures.performed) overlaps IP.period)
      return SharedResource.ProcedureResource(Procedures,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-procedure'}})

    define &quot;SDE Specimen&quot;:
      [Specimen] Specimens
      where exists(
        &quot;Initial Population&quot; IP
        where NHSNHelpers.&quot;Normalize Interval&quot;(Specimens.collection.collected) overlaps IP.period
      )
      return SharedResource.SpecimenResource(Specimens,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-specimen'}})

    define &quot;SDE Service Request&quot;:
      [ServiceRequest] ServiceRequests
      where exists(&quot;Initial Population&quot; IP
        where ServiceRequests.authoredOn during IP.period)
      return SharedResource.ServiceRequestResource(ServiceRequests,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-servicerequest'}})

    define &quot;SDE Minimal Patient&quot;:
      Patient p
      return SharedResource.PatientResource(p,
      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/cross-measure-patient'}})

    //
    //Functions
    //
    define function &quot;CheckIP&quot;(encounter Encounter):
      exists(&quot;Initial Population&quot; IP
      where encounter.id = IP.id)

    define function &quot;GetMedicationFrom&quot;(choice Choice&lt;FHIR.CodeableConcept, FHIR.Reference&gt;):
      case
        when choice is FHIR.Reference then
          GetMedication(choice as FHIR.Reference)
        else
          null
      end

    define function &quot;GetMedication&quot;(reference Reference):
      singleton from (
        [Medication] Medications
        where Medications.id = NHSNHelpers.GetId(reference.reference)
      )

    define function &quot;GetCondition&quot;(reference Reference):
      singleton from (
        &quot;Conditions&quot; Conditions
        where Conditions.id = NHSNHelpers.GetId(reference.reference)
      )

    define function &quot;GetEncounter&quot;(reference Reference):
      singleton from (
        &quot;Encounters&quot; Encounters
        where Encounters.id = NHSNHelpers.GetId(reference.reference)
      )

    define function RemoveUnaccepted(codes List&lt;FHIR.CodeableConcept&gt;, accepted List&lt;System.Code&gt;):
    	codes c
      where exists(
        accepted a
        where c ~ a
      )

    define function FilterCodeableConcepts(codes List&lt;FHIR.CodeableConcept&gt;, accepted List&lt;System.Code&gt;):
    	if Count(accepted) &gt; 0
    		then RemoveUnaccepted(codes, accepted)
    	else codes

    //
    //Measure Specific Resource Creation Functions
    //
    define function ConditionResource(condition Condition, profileURLs List&lt;FHIR.canonical&gt;, acceptedCategories List&lt;System.Code&gt;):
      condition c
      return Condition{
        id: FHIR.id {value: 'LCR-' + c.id},
        meta: SharedResource.MetaElement(c, profileURLs),
        extension: c.extension,
        clinicalStatus: c.clinicalStatus,
        verificationStatus: c.verificationStatus,
        category: FilterCodeableConcepts(c.category, acceptedCategories),
        severity: c.severity,
        code: c.code,
        bodySite: c.bodySite,
        subject: c.subject,
        encounter: c.encounter,
        onset: c.onset,
        abatement: c.abatement,
        recordedDate: c.recordedDate,
        stage: SharedResource.ConditionStage(c.stage),
        evidence: SharedResource.ConditionEvidence(c.evidence),
        note: c.note
      }

    define function DeviceUdiCarrier(udiCarrier List&lt;FHIR.Device.UdiCarrier&gt;):
      udiCarrier u
      return FHIR.Device.UdiCarrier{
        deviceIdentifier: u.deviceIdentifier,
        issuer: u.issuer,
        jurisdiction: u.jurisdiction,
        carrierAIDC: u.carrierAIDC,
        carrierHRF: u.carrierHRF,
        entryType: u.entryType
      }

    define function DeviceDeviceName(deviceName List&lt;FHIR.Device.DeviceName&gt;):
      deviceName d
      return FHIR.Device.DeviceName{
        name: d.name,
        type: d.type
      }

    define function DeviceSpecialization(specialization List&lt;FHIR.Device.Specialization&gt;):
      specialization s
      return FHIR.Device.Specialization{
        systemType: s.systemType,
        version: s.version
      }

    define function DeviceVersion(version List&lt;FHIR.Device.Version&gt;):
      version v
      return FHIR.Device.Version{
        type: v.type,
        component: v.component,
        value: v.value
      }

    define function DeviceProperty(deviceProperty List&lt;FHIR.Device.Property&gt;):
      deviceProperty d
      return FHIR.Device.Property{
        id: d.id,
        type: d.type,
        valueQuantity: d.valueQuantity,
        valueCode: d.valueCode
      }

    define function DeviceResource(device Device, profileURLs List&lt;FHIR.canonical&gt;):
      device d
      return Device{
        id: FHIR.id{value: 'LCR-' + d.id},
        meta: SharedResource.MetaElement(d, profileURLs),
        extension: d.extension,
        definition: d.definition,
        udiCarrier: DeviceUdiCarrier(d.udiCarrier),
        status: d.status,
        statusReason: d.statusReason,
        distinctIdentifier: d.distinctIdentifier,
        manufacturer: d.manufacturer,
        manufactureDate: d.manufactureDate,
        expirationDate: d.expirationDate,
        lotNumber: d.lotNumber,
        serialNumber: d.serialNumber,
        deviceName: DeviceDeviceName(d.deviceName),
        modelNumber: d.modelNumber,
        partNumber: d.partNumber,
        type: d.type,
        specialization: DeviceSpecialization(d.specialization),
        version: DeviceVersion(d.version),
        property: DeviceProperty(d.property),
        patient: d.patient,
        owner: d.owner,
        contact: d.contact,
        location: d.location,
        url: d.url,
        note: d.note,
        safety: d.safety,
        parent: d.parent
      }

    define function DiagnosticReportResource(diagnosticReport DiagnosticReport, profileURLs List&lt;FHIR.canonical&gt;):
      diagnosticReport d
      return DiagnosticReport{
        id: FHIR.id{value: 'LCR-' + d.id},
        meta: SharedResource.MetaElement(d, profileURLs),
        extension: d.extension,
        basedOn: d.basedOn,
        status: d.status,
        category: d.category,
        code: d.code,
        subject: d.subject,
        encounter: d.encounter,
        effective: d.effective,
        issued: d.issued,
        performer: d.performer,
        resultsInterpreter: d.resultsInterpreter,
        specimen: d.specimen,
        result: d.result,
        conclusion: d.conclusion,
        conclusionCode: d.conclusionCode
      }

    define function ObservationResource(observation Observation, profileURLs List&lt;FHIR.canonical&gt;):
      observation o
      return Observation{
        id: FHIR.id {value: 'LCR-' + o.id},
        meta: SharedResource.MetaElement(o, profileURLs),
        extension: o.extension,
        partOf: o.partOf,
        status: o.status,
        category: o.category,
        code: o.code,
        subject: o.subject,
        focus: o.focus,
        encounter: o.encounter,
        effective: o.effective,
        issued: o.issued,
        performer: o.performer,
        value: o.value,
        dataAbsentReason: o.dataAbsentReason,
        interpretation: o.interpretation,
        note: o.note,
        bodySite: o.bodySite,
        method: o.method,
        specimen: o.specimen,
        device: o.device,
        referenceRange: SharedResource.ObservationReferenceRange(o.referenceRange),
        hasMember: o.hasMember,
        derivedFrom: o.derivedFrom,
        component: SharedResource.ObservationComponent(o.component)
      }

    define function ObservationVitalSignsCoding(coding List&lt;Coding&gt;):
      coding c
      return Coding{
        system: c.system,
        version: c.version,
        code: c.code,
        display: c.display,
        userSelected: c.userSelected
      }

    define function ObservationVitalSignsCategory(category List&lt;CodeableConcept&gt;):
      category c
      return CodeableConcept{
        coding: ObservationVitalSignsCoding(c.coding),
        text: c.text
      }

    define function ObservationVitalSignsComponent(component List&lt;FHIR.Observation.Component&gt;):
      component c
      return FHIR.Observation.Component{
        code: c.code,
        value: c.value,
        dataAbsentReason: c.dataAbsentReason,
        interpretation: c.interpretation,
        referenceRange: SharedResource.ObservationReferenceRange(c.referenceRange)
      }

    define function ObservationVitalSignsResource(observation Observation, profileURLs List&lt;FHIR.canonical&gt;):
      observation o
      return Observation{
        id: FHIR.id {value: 'LCR-' + o.id},
        meta: SharedResource.MetaElement(o, profileURLs),
        extension: o.extension,
        partOf: o.partOf,
        status: o.status,
        category: ObservationVitalSignsCategory(o.category),
        code: o.code,
        subject: o.subject,
        focus: o.focus,
        encounter: o.encounter,
        effective: o.effective,
        issued: o.issued,
        performer: o.performer,
        value: o.value,
        dataAbsentReason: o.dataAbsentReason,
        interpretation: o.interpretation,
        note: o.note,
        bodySite: o.bodySite,
        method: o.method,
        specimen: o.specimen,
        device: o.device,
        referenceRange: SharedResource.ObservationReferenceRange(o.referenceRange),
        hasMember: o.hasMember,
        derivedFrom: o.derivedFrom,
        component: ObservationVitalSignsComponent(o.component)
      }</code></pre></td></tr>
                </table>
              </td>
            </tr>

        </table>
    </div>
    </div>
      </text>
      <contained>
        <Parameters>
          <id value="options"/>
          <parameter>
            <name value="translatorVersion"/>
            <valueString value="3.25.0"/>
          </parameter>
          <parameter>
            <name value="option"/>
            <valueString value="EnableDateRangeOptimization"/>
          </parameter>
          <parameter>
            <name value="option"/>
            <valueString value="EnableAnnotations"/>
          </parameter>
          <parameter>
            <name value="option"/>
            <valueString value="EnableLocators"/>
          </parameter>
          <parameter>
            <name value="option"/>
            <valueString value="DisableListDemotion"/>
          </parameter>
          <parameter>
            <name value="option"/>
            <valueString value="DisableListPromotion"/>
          </parameter>
          <parameter>
            <name value="analyzeDataRequirements"/>
            <valueBoolean value="false"/>
          </parameter>
          <parameter>
            <name value="collapseDataRequirements"/>
            <valueBoolean value="true"/>
          </parameter>
          <parameter>
            <name value="compatibilityLevel"/>
            <valueString value="1.5"/>
          </parameter>
          <parameter>
            <name value="enableCqlOnly"/>
            <valueBoolean value="false"/>
          </parameter>
          <parameter>
            <name value="errorLevel"/>
            <valueString value="Info"/>
          </parameter>
          <parameter>
            <name value="signatureLevel"/>
            <valueString value="Overloads"/>
          </parameter>
          <parameter>
            <name value="validateUnits"/>
            <valueBoolean value="true"/>
          </parameter>
          <parameter>
            <name value="verifyOnly"/>
            <valueBoolean value="false"/>
          </parameter>
        </Parameters>
      </contained>
      <extension url="http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions">
        <valueReference>
          <reference value="#options"/>
        </valueReference>
      </extension>
      <url
           value="http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNAcuteCareHospitalMonthlyInitialPopulation"/>
      <version value="1.0.0"/>
      <name value="NHSNAcuteCareHospitalMonthlyInitialPopulation"/>
      <status value="draft"/>
      <type>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
          <code value="logic-library"/>
        </coding>
      </type>
      <date value="2025-09-15T12:53:39-04:00"/>
      <publisher value="CDC National Healthcare Safety Network (NHSN)"/>
      <contact>
        <name value="CDC National Healthcare Safety Network (NHSN)"/>
        <telecom>
          <system value="url"/>
          <value value="http://www.cdc.gov/nhsn"/>
        </telecom>
        <telecom>
          <system value="email"/>
          <value value="nhsn@cdc.gov"/>
        </telecom>
      </contact>
      <jurisdiction>
        <coding>
          <system value="urn:iso:std:iso:3166"/>
          <code value="US"/>
        </coding>
      </jurisdiction>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="FHIR model information"/>
        <resource
                  value="http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library FHIRHelpers"/>
        <resource
                  value="http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library NHSNHelpers"/>
        <resource
                  value="http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNHelpers|0.0.002"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Library SharedResource"/>
        <resource
                  value="http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/SharedResourceCreation|0.1.010"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system ActCode"/>
        <resource value="http://terminology.hl7.org/CodeSystem/v3-ActCode|9.0.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system Observation Category"/>
        <resource
                  value="http://terminology.hl7.org/CodeSystem/observation-category|1.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system LOINC"/>
        <resource value="http://loinc.org"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system V2-0074"/>
        <resource value="http://terminology.hl7.org/CodeSystem/v2-0074|2.5.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system Condition Category"/>
        <resource
                  value="http://terminology.hl7.org/CodeSystem/condition-category|1.0.1"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system US Core Condition Category"/>
        <resource
                  value="http://hl7.org/fhir/us/core/CodeSystem/condition-category"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Code system Condition Clinical Status"/>
        <resource
                  value="http://terminology.hl7.org/CodeSystem/condition-clinical|3.0.0"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display
                 value="Value set Inpatient, Emergency, and Observation Locations"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Emergency Department Visit"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Encounter Inpatient"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set Observation Services"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"/>
      </relatedArtifact>
      <relatedArtifact>
        <type value="depends-on"/>
        <display value="Value set NHSN Inpatient Encounter Class Codes"/>
        <resource
                  value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274"/>
      </relatedArtifact>
      <parameter>
        <name value="Measurement Period"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Period"/>
      </parameter>
      <parameter>
        <name value="Patient"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Patient"/>
      </parameter>
      <parameter>
        <name value="Qualifying Encounters During Measurement Period"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Encounters"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Encounters with Patient Hospital Locations"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Initial Population"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="Conditions"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Condition"/>
      </parameter>
      <parameter>
        <name value="DiagnosticReports"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="DiagnosticReport"/>
      </parameter>
      <parameter>
        <name value="Observations"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Observation"/>
      </parameter>
      <parameter>
        <name value="Get Locations from IP Encounters in Measurement Period"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Location"/>
      </parameter>
      <parameter>
        <name value="SDE Condition"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Condition"/>
      </parameter>
      <parameter>
        <name value="SDE Device"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Device"/>
      </parameter>
      <parameter>
        <name value="SDE DiagnosticReport Lab"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="DiagnosticReport"/>
      </parameter>
      <parameter>
        <name value="SDE DiagnosticReport Note"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="DiagnosticReport"/>
      </parameter>
      <parameter>
        <name value="SDE DiagnosticReport Others"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="DiagnosticReport"/>
      </parameter>
      <parameter>
        <name value="SDE Encounter"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="SDE IP Encounters"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="SDE Location"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Location"/>
      </parameter>
      <parameter>
        <name value="SDE Medication Administration"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="MedicationAdministration"/>
      </parameter>
      <parameter>
        <name value="SDE Medication Request"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="MedicationRequest"/>
      </parameter>
      <parameter>
        <name value="SDE Medication"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Medication"/>
      </parameter>
      <parameter>
        <name value="SDE Observation Lab Category"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Observation"/>
      </parameter>
      <parameter>
        <name value="SDE Observation Vital Signs Category"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Observation"/>
      </parameter>
      <parameter>
        <name value="SDE Observation Category"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Observation"/>
      </parameter>
      <parameter>
        <name value="SDE Coverage"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Coverage"/>
      </parameter>
      <parameter>
        <name value="SDE Procedure"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Procedure"/>
      </parameter>
      <parameter>
        <name value="SDE Specimen"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Specimen"/>
      </parameter>
      <parameter>
        <name value="SDE Service Request"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="ServiceRequest"/>
      </parameter>
      <parameter>
        <name value="SDE Minimal Patient"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Patient"/>
      </parameter>
      <dataRequirement>
        <type value="Patient"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="id"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="id"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="type"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="id"/>
        <codeFilter>
          <path value="type"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="class"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="id"/>
        <codeFilter>
          <path value="class"/>
          <valueSet
                    value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274"/>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="class"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="id"/>
        <codeFilter>
          <path value="class"/>
          <code>
            <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
            <code value="EMER"/>
            <display value="emergency"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="class"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="id"/>
        <codeFilter>
          <path value="class"/>
          <code>
            <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
            <code value="OBSENC"/>
            <display value="observation encounter"/>
          </code>
        </codeFilter>
      </dataRequirement>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="status"/>
        <mustSupport value="period"/>
        <mustSupport value="location"/>
        <mustSupport value="diagnosis"/>
        <mustSupport value="id"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Condition"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="clinicalStatus"/>
        <mustSupport value="verificationStatus"/>
        <mustSupport value="category"/>
        <mustSupport value="severity"/>
        <mustSupport value="code"/>
        <mustSupport value="bodySite"/>
        <mustSupport value="subject"/>
        <mustSupport value="encounter"/>
        <mustSupport value="onset"/>
        <mustSupport value="abatement"/>
        <mustSupport value="recordedDate"/>
        <mustSupport value="stage"/>
        <mustSupport value="evidence"/>
        <mustSupport value="note"/>
        <mustSupport value="encounter.id"/>
      </dataRequirement>
      <dataRequirement>
        <type value="DiagnosticReport"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/DiagnosticReport"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="basedOn"/>
        <mustSupport value="status"/>
        <mustSupport value="category"/>
        <mustSupport value="code"/>
        <mustSupport value="subject"/>
        <mustSupport value="encounter"/>
        <mustSupport value="effective"/>
        <mustSupport value="issued"/>
        <mustSupport value="performer"/>
        <mustSupport value="resultsInterpreter"/>
        <mustSupport value="specimen"/>
        <mustSupport value="result"/>
        <mustSupport value="conclusion"/>
        <mustSupport value="conclusionCode"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="partOf"/>
        <mustSupport value="status"/>
        <mustSupport value="category"/>
        <mustSupport value="code"/>
        <mustSupport value="subject"/>
        <mustSupport value="focus"/>
        <mustSupport value="encounter"/>
        <mustSupport value="effective"/>
        <mustSupport value="issued"/>
        <mustSupport value="performer"/>
        <mustSupport value="value"/>
        <mustSupport value="dataAbsentReason"/>
        <mustSupport value="interpretation"/>
        <mustSupport value="note"/>
        <mustSupport value="bodySite"/>
        <mustSupport value="method"/>
        <mustSupport value="specimen"/>
        <mustSupport value="device"/>
        <mustSupport value="referenceRange"/>
        <mustSupport value="hasMember"/>
        <mustSupport value="derivedFrom"/>
        <mustSupport value="component"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Device"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Device"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="definition"/>
        <mustSupport value="udiCarrier"/>
        <mustSupport value="status"/>
        <mustSupport value="statusReason"/>
        <mustSupport value="distinctIdentifier"/>
        <mustSupport value="manufacturer"/>
        <mustSupport value="manufactureDate"/>
        <mustSupport value="expirationDate"/>
        <mustSupport value="lotNumber"/>
        <mustSupport value="serialNumber"/>
        <mustSupport value="deviceName"/>
        <mustSupport value="modelNumber"/>
        <mustSupport value="partNumber"/>
        <mustSupport value="type"/>
        <mustSupport value="specialization"/>
        <mustSupport value="version"/>
        <mustSupport value="property"/>
        <mustSupport value="patient"/>
        <mustSupport value="owner"/>
        <mustSupport value="contact"/>
        <mustSupport value="location"/>
        <mustSupport value="url"/>
        <mustSupport value="note"/>
        <mustSupport value="safety"/>
        <mustSupport value="parent"/>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationAdministration"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
        <mustSupport value="effective"/>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
        <mustSupport value="authoredOn"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Medication"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Medication"/>
        <mustSupport value="id"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Coverage"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Coverage"/>
        <mustSupport value="period"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Procedure"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
        <mustSupport value="performed"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Specimen"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Specimen"/>
        <mustSupport value="collection"/>
        <mustSupport value="collection.collected"/>
      </dataRequirement>
      <dataRequirement>
        <type value="ServiceRequest"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        <mustSupport value="authoredOn"/>
      </dataRequirement>
      <content>
        <contentType value="text/cql"/>
        <data
              value=" "/>
      </content>
    </Library>