CDC National Healthcare Safety Network (NHSN) Digital Quality Measures (dQM) Content Package IG
1.0.0 - Release 1 United States of America flag

This page is part of the CDC National Healthcare Safety Network (NHSN) Digital Quality Measures (dQM) Content Package IG (v1.0.0: Release) based on FHIR (HL7® FHIR® Standard) R4. This is the current published version. For a full list of available versions, see the Directory of published versions

: NHSN Acute Care Hospital Monthly Initial Population Library - JSON Representation

Page standards status: Trial-use Maturity Level: 1

Raw json | Download

{
  "resourceType" : "Library",
  "id" : "NHSNAcuteCareHospitalMonthlyInitialPopulation",
  "text" : {
    "status" : "extensions",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n<div>\n    <table class=\"grid dict\">\n        \n        \n\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Id: </b></th>\n            <td style=\"padding-left: 4px;\">NHSNAcuteCareHospitalMonthlyInitialPopulation</td>\n        </tr>\n        \n\n        \n        \n        <tr>\n            <th scope=\"row\"><b>Version: </b></th>\n            <td style=\"padding-left: 4px;\">1.0.0</td>\n        </tr>\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Url: </b></th>\n            <td style=\"padding-left: 4px;\"><a href=\"Library-NHSNAcuteCareHospitalMonthlyInitialPopulation.html\">NHSNAcuteCareHospitalMonthlyInitialPopulation</a></td>\n        </tr>\n        \n\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Status: </b></th>\n            <td style=\"padding-left: 4px;\">draft</td>\n        </tr>\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Type: </b></th>\n            <td style=\"padding-left: 4px;\">\n                \n                    \n                        \n                        <p style=\"margin-bottom: 5px;\">\n                            <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>\n                        </p>\n                        \n                        \n                        <p style=\"margin-bottom: 5px;\">\n                            <b>code: </b> <span>logic-library</span>\n                        </p>\n                        \n                        \n                    \n                \n                \n            </td>\n        </tr>\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Date: </b></th>\n            <td style=\"padding-left: 4px;\">2025-09-15 12:53:39-0400</td>\n        </tr>\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Publisher: </b></th>\n            <td style=\"padding-left: 4px;\">CDC National Healthcare Safety Network (NHSN)</td>\n        </tr>\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Jurisdiction: </b></th>\n            <td style=\"padding-left: 4px;\">US</td>\n        </tr>\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n\n        \n        <tr>\n            <th scope=\"row\"><b>Related Artifacts: </b></th>\n            <td style=\"padding-left: 4px;\">\n                \n                \n                \n                <p><b>Dependencies</b></p>\n                <ul>\n                  \n                    <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>\n                  \n                    <li><code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2</code></li>\n                  \n                    <li><code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNHelpers|0.0.002</code></li>\n                  \n                    <li><code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/SharedResourceCreation|0.1.010</code></li>\n                  \n                    <li><a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-v3-ActCode.html\">ActCodeversion: null9.0.0)</a></li>\n                  \n                    <li><a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-observation-category.html\">Observation Category Codesversion: null1.0.1)</a></li>\n                  \n                    <li><a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-v3-loinc.html\">Logical Observation Identifiers, Names and Codes (LOINC)</a></li>\n                  \n                    <li><a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-v2-0074.html\">diagnosticServiceSectionIdversion: null2.5.0)</a></li>\n                  \n                    <li><a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-condition-category.html\">Condition Category Codesversion: null1.0.1)</a></li>\n                  \n                    <li><a href=\"http://hl7.org/fhir/us/core/STU3.1.1/CodeSystem-condition-category.html\">US Core Condition Category Extension Codes</a></li>\n                  \n                    <li><a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-condition-clinical.html\">Condition Clinical Status Codesversion: null3.0.0)</a></li>\n                  \n                    <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>\n                  \n                    <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>\n                  \n                    <li><a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion\">Encounter Inpatient</a></li>\n                  \n                    <li><a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion\">Observation Services</a></li>\n                  \n                    <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>\n                  \n                </ul>\n                \n                \n                \n                \n                \n            </td>\n        </tr>\n        \n\n        \n        <tr>\n          <th scope=\"row\"><b>Parameters: </b></th>\n          <td style=\"padding-left: 4px;\">\n            <table class=\"grid-dict\">\n              <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>\n              \n                <tr><th>Measurement Period</th><th>Period</th><th>0</th><th>1</th><th>In</th></tr>\n              \n                <tr><th>Patient</th><th>Patient</th><th>0</th><th>1</th><th>Out</th></tr>\n              \n                <tr><th>Qualifying Encounters During Measurement Period</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Encounters</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Encounters with Patient Hospital Locations</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Initial Population</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Conditions</th><th>Condition</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>DiagnosticReports</th><th>DiagnosticReport</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Observations</th><th>Observation</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>Get Locations from IP Encounters in Measurement Period</th><th>Location</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Condition</th><th>Condition</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Device</th><th>Device</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE DiagnosticReport Lab</th><th>DiagnosticReport</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE DiagnosticReport Note</th><th>DiagnosticReport</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE DiagnosticReport Others</th><th>DiagnosticReport</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Encounter</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE IP Encounters</th><th>Encounter</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Location</th><th>Location</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Medication Administration</th><th>MedicationAdministration</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Medication Request</th><th>MedicationRequest</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Medication</th><th>Medication</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Observation Lab Category</th><th>Observation</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Observation Vital Signs Category</th><th>Observation</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Observation Category</th><th>Observation</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Coverage</th><th>Coverage</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Procedure</th><th>Procedure</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Specimen</th><th>Specimen</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Service Request</th><th>ServiceRequest</th><th>0</th><th>*</th><th>Out</th></tr>\n              \n                <tr><th>SDE Minimal Patient</th><th>Patient</th><th>0</th><th>1</th><th>Out</th></tr>\n              \n            </table>\n          </td>\n        </tr>\n        \n\n        \n        <tr>\n          <th scope=\"row\"><b>Data Requirements:</b></th>\n          <td style=\"padding-left: 4px;\">\n            <table class=\"grid-dict\">\n              <tr><th><b>Type</b></th><th><b>Profile</b></th><th><b>MS</b></th><th><b>Code Filter</b></th></tr>\n              \n                <tr>\n                  <th>Patient</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Patient</th>\n                  <th/>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Encounter</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>\n                  <th>;;;;;;</th>\n                  <th>\n                    \n                      <b>code filter: </b>\n                      \n                      <br/>\n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>path: </b><span>type</span>\n                      </span>\n                      \n                      <br/>\n                      \n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307</span>\n                      </span>\n                      \n                      \n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Encounter</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>\n                  <th>;;;;;;</th>\n                  <th>\n                    \n                      <b>code filter: </b>\n                      \n                      <br/>\n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>path: </b><span>type</span>\n                      </span>\n                      \n                      <br/>\n                      \n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</span>\n                      </span>\n                      \n                      \n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Encounter</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>\n                  <th>;;;;;;</th>\n                  <th>\n                    \n                      <b>code filter: </b>\n                      \n                      <br/>\n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>path: </b><span>type</span>\n                      </span>\n                      \n                      <br/>\n                      \n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143</span>\n                      </span>\n                      \n                      \n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Encounter</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>\n                  <th>;;;;;;</th>\n                  <th>\n                    \n                      <b>code filter: </b>\n                      \n                      <br/>\n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>path: </b><span>class</span>\n                      </span>\n                      \n                      <br/>\n                      \n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>value set: </b><span>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274</span>\n                      </span>\n                      \n                      \n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Encounter</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>\n                  <th>;;;;;;</th>\n                  <th>\n                    \n                      <b>code filter: </b>\n                      \n                      <br/>\n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>path: </b><span>class</span>\n                      </span>\n                      \n                      <br/>\n                      \n                      \n                      \n                      \n                          \n                          <p style=\"margin-bottom: 5px;\">\n                              <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>\n                          </p>\n                          \n                          \n                          <p style=\"margin-bottom: 5px;\">\n                              <b>code: </b> <span>EMER</span>\n                          </p>\n                          \n                          \n                          <p style=\"margin-bottom: 5px;\">\n                              <b>display: </b> <span>emergency</span>\n                          </p>\n                          \n                      \n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Encounter</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>\n                  <th>;;;;;;</th>\n                  <th>\n                    \n                      <b>code filter: </b>\n                      \n                      <br/>\n                      \n                      \n                      <span style=\"padding-left: 4px;\">\n                          <b>path: </b><span>class</span>\n                      </span>\n                      \n                      <br/>\n                      \n                      \n                      \n                      \n                          \n                          <p style=\"margin-bottom: 5px;\">\n                              <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>\n                          </p>\n                          \n                          \n                          <p style=\"margin-bottom: 5px;\">\n                              <b>code: </b> <span>OBSENC</span>\n                          </p>\n                          \n                          \n                          <p style=\"margin-bottom: 5px;\">\n                              <b>display: </b> <span>observation encounter</span>\n                          </p>\n                          \n                      \n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Encounter</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Encounter</th>\n                  <th>;;;;;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Condition</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Condition</th>\n                  <th>;;;;;;;;;;;;;;;;;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>DiagnosticReport</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/DiagnosticReport</th>\n                  <th>;;;;;;;;;;;;;;;;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Observation</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Observation</th>\n                  <th>;;;;;;;;;;;;;;;;;;;;;;;;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Device</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Device</th>\n                  <th>;;;;;;;;;;;;;;;;;;;;;;;;;;;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>MedicationAdministration</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/MedicationAdministration</th>\n                  <th>;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>MedicationRequest</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/MedicationRequest</th>\n                  <th>;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Medication</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Medication</th>\n                  <th>;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Coverage</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Coverage</th>\n                  <th>;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Procedure</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Procedure</th>\n                  <th>;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>Specimen</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/Specimen</th>\n                  <th>;;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n                <tr>\n                  <th>ServiceRequest</th>\n                  <th>http://hl7.org/fhir/StructureDefinition/ServiceRequest</th>\n                  <th>;</th>\n                  <th>\n                    \n                  </th>\n                </tr>\n              \n            </table>\n          </td>\n        </tr>\n        \n\n        \n        \n        <tr>\n          <td colspan=\"2\">\n            <table>\n              <tr><th><a id=\"cql-content\"><b>Content: </b></a> text/cql</th></tr>\n              <tr><td><pre><code class=\"language-cql\">library NHSNAcuteCareHospitalMonthlyInitialPopulation version '1.0.1-dev'\r\n\r\nusing FHIR version '4.0.1'\r\n\r\ninclude FHIRHelpers version '4.0.2' called FHIRHelpers\r\ninclude NHSNHelpers version '0.0.002' called NHSNHelpers\r\ninclude SharedResourceCreation version '0.1.010' called SharedResource\r\n\r\ncodesystem &quot;ActCode&quot;: 'http://terminology.hl7.org/CodeSystem/v3-ActCode'\r\ncodesystem &quot;Observation Category&quot;: 'http://terminology.hl7.org/CodeSystem/observation-category'\r\ncodesystem &quot;LOINC&quot;: 'http://loinc.org' \r\ncodesystem &quot;V2-0074&quot;: 'http://terminology.hl7.org/CodeSystem/v2-0074'\r\ncodesystem &quot;Condition Category&quot;: 'http://terminology.hl7.org/CodeSystem/condition-category'\r\ncodesystem &quot;US Core Condition Category&quot;: 'http://hl7.org/fhir/us/core/CodeSystem/condition-category'\r\ncodesystem &quot;Condition Clinical Status&quot;: 'http://terminology.hl7.org/CodeSystem/condition-clinical'\r\n\r\nvalueset &quot;Inpatient, Emergency, and Observation Locations&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265'\r\nvalueset &quot;Emergency Department Visit&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'\r\nvalueset &quot;Encounter Inpatient&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'\r\nvalueset &quot;Observation Services&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'\r\nvalueset &quot;NHSN Inpatient Encounter Class Codes&quot;: 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274'\r\n\r\n//code for Observation Category\r\ncode &quot;laboratory&quot;: 'laboratory' from &quot;Observation Category&quot; display 'Laboratory'\r\ncode &quot;social-history&quot;: 'social-history' from &quot;Observation Category&quot; display 'Social History'\r\ncode &quot;vital-signs&quot;: 'vital-signs' from &quot;Observation Category&quot; display 'Vital Signs'\r\ncode &quot;imaging&quot;: 'imaging' from &quot;Observation Category&quot; display 'Imaging'\r\ncode &quot;procedure&quot;: 'procedure' from &quot;Observation Category&quot; display 'Procedure'\r\ncode &quot;survey&quot;: 'survey' from &quot;Observation Category&quot; display 'Survey'\r\n\r\n//code for Condition category\r\ncode &quot;problem-list-item&quot;: 'problem-list-item' from &quot;Condition Category&quot; display 'Problem List Item'\r\ncode &quot;encounter-diagnosis&quot;: 'encounter-diagnosis' from &quot;Condition Category&quot; display 'Encounter Diagnosis'\r\ncode &quot;health-concern&quot;: 'health-concern' from &quot;US Core Condition Category&quot; display 'Health Concern'\r\n\r\n//code for Diagnostic Report Category\r\ncode &quot;LAB&quot;: 'LAB' from &quot;V2-0074&quot; display 'Laboratory'\r\ncode &quot;Radiology&quot;: 'LP29684-5' from &quot;LOINC&quot; display 'Radiology'\r\ncode &quot;Pathology&quot;: 'LP7839-6' from &quot;LOINC&quot; display 'Pathology'\r\ncode &quot;Cardiology&quot;: 'LP29708-2' from &quot;LOINC&quot; display 'Cardiology'\r\n\r\n//code for Emergency Encounter Class\r\ncode &quot;emergency&quot;: 'EMER' from &quot;ActCode&quot; display 'emergency'\r\ncode &quot;observation encounter&quot;: 'OBSENC' from &quot;ActCode&quot; display 'observation encounter'\r\n\r\n//code for Condition clinicalStatus\r\ncode &quot;active&quot;: 'active' from &quot;Condition Clinical Status&quot; display 'active'\r\n\r\nparameter &quot;Measurement Period&quot; \r\n    default Interval[@2024-04-01T00:00:00.0, @2024-04-30T23:59:59.0)\r\n\r\ncontext Patient \r\n\r\ndefine &quot;Qualifying Encounters During Measurement Period&quot;:\r\n ( [Encounter: &quot;Encounter Inpatient&quot;]\r\n  union [Encounter: &quot;Emergency Department Visit&quot;]\r\n  union [Encounter: &quot;Observation Services&quot;]\r\n  union [Encounter: class in &quot;NHSN Inpatient Encounter Class Codes&quot;]\r\n  union [Encounter: class ~ &quot;emergency&quot;]\r\n  union [Encounter: class ~ &quot;observation encounter&quot;]) QualifyingEncounters\r\n  where QualifyingEncounters.status in {'in-progress', 'finished', 'triaged', 'onleave', 'entered-in-error'}\r\n    and QualifyingEncounters.period overlaps &quot;Measurement Period&quot; \r\n\r\ndefine &quot;Encounters with Patient Hospital Locations&quot;:\r\n  &quot;Encounters&quot; Encounters\r\n  where exists(\r\n    Encounters.location EncounterLocation\r\n    where NHSNHelpers.GetLocation(EncounterLocation.location).type in &quot;Inpatient, Emergency, and Observation Locations&quot;\r\n      and EncounterLocation.period overlaps Encounters.period\r\n  )\r\n  and Encounters.status in {'in-progress', 'finished', 'triaged', 'onleave', 'entered-in-error'}\r\n  and Encounters.period overlaps &quot;Measurement Period&quot;\r\n\r\ndefine &quot;Initial Population&quot;:\r\n  &quot;Qualifying Encounters During Measurement Period&quot;\r\n  union &quot;Encounters with Patient Hospital Locations&quot;\r\n\r\ndefine &quot;Encounters&quot;:\r\n  [Encounter]\r\n\r\ndefine &quot;Conditions&quot;:\r\n  [Condition]\r\n\r\ndefine &quot;DiagnosticReports&quot;:\r\n  [DiagnosticReport]\r\n\r\ndefine &quot;Observations&quot;:\r\n  [Observation]\r\n\r\ndefine &quot;Get Locations from IP Encounters in Measurement Period&quot;:\r\n  flatten(&quot;Initial Population&quot; IP\r\n  let locationElements: IP.location\r\n  return\r\n    locationElements LE\r\n    let locationReference: LE.location\r\n    return NHSNHelpers.GetLocation(locationReference))\r\n\r\n//============================================================================\r\n//Supplemental Data Element\r\n//When FHIR.canonical value is present, US Core 3.1.1 profiles are used\r\n//When FHIR.canonical value is not present, FHIR Base profiles are used\r\n//============================================================================\r\ndefine &quot;SDE Condition&quot;:\r\n  &quot;Conditions&quot; Conditions \r\n  where exists(\r\n    &quot;Initial Population&quot; IP\r\n    //Check for Problem List Conditions that were recorded before or during IP\r\n    where (\r\n      Conditions.recordedDate before end of IP.period\r\n      and exists(Conditions.category categories\r\n        where categories ~ &quot;problem-list-item&quot;)\r\n      and Conditions.clinicalStatus ~ &quot;active&quot;\r\n    )\r\n    //Check for Encounter Diagnosis Conditions that reference an IP encounter\r\n    or (\r\n      (exists(IP.diagnosis Diagnoses\r\n          where GetCondition(Diagnoses.condition).id = Conditions.id\r\n        )\r\n        or GetEncounter(Conditions.encounter).id = IP.id\r\n      )\r\n      and exists (Conditions.category categories\r\n        where categories ~ &quot;encounter-diagnosis&quot;\r\n          or categories ~ &quot;health-concern&quot;)\r\n    )\r\n  )\r\n  return ConditionResource(Conditions,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-condition'}},\r\n  {&quot;problem-list-item&quot;, &quot;encounter-diagnosis&quot;, &quot;health-concern&quot;})\r\n\r\ndefine &quot;SDE Device&quot;:\r\n  [Device] Devices \r\n  where exists(&quot;Initial Population&quot;)\r\n  return DeviceResource(Devices,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-device'}})\r\n\r\n//This block collects all DiagnosticReport resources while also marking Lab and Note DiagnosticReports with the appropriate profiles\r\n//#Start DiagnosticReport block\r\ndefine &quot;SDE DiagnosticReport Lab&quot;:\r\n  &quot;DiagnosticReports&quot; DiagnosticReports\r\n  where (exists(DiagnosticReports.category Category where Category ~ &quot;LAB&quot;)\r\n    and exists(\r\n      &quot;Initial Population&quot; IP\r\n      where NHSNHelpers.&quot;Normalize Interval&quot;(DiagnosticReports.effective) overlaps IP.period))\r\n  return SharedResource.DiagnosticReportLabResource(DiagnosticReports,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-diagnosticreport-lab'}})\r\n \r\ndefine &quot;SDE DiagnosticReport Note&quot;:\r\n  &quot;DiagnosticReports&quot; DiagnosticReports\r\n  where ((exists(DiagnosticReports.category Category where Category ~ &quot;Radiology&quot;))\r\n    or exists((DiagnosticReports.category Category where Category ~ &quot;Pathology&quot;))\r\n    or exists((DiagnosticReports.category Category where Category ~ &quot;Cardiology&quot;)))\r\n    and exists(\r\n      &quot;Initial Population&quot; IP\r\n      where NHSNHelpers.&quot;Normalize Interval&quot;(DiagnosticReports.effective) overlaps IP.period)\r\n  return DiagnosticReportResource(DiagnosticReports,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-diagnosticreport-note'}})\r\n\r\ndefine &quot;SDE DiagnosticReport Others&quot;:\r\n  [DiagnosticReport] DiagnosticReports\r\n  where not ((exists(DiagnosticReports.category Category where Category ~ &quot;Radiology&quot;))\r\n    or exists((DiagnosticReports.category Category where Category ~ &quot;Pathology&quot;))\r\n    or exists((DiagnosticReports.category Category where Category ~ &quot;Cardiology&quot;))\r\n    or exists(DiagnosticReports.category Category where Category ~ &quot;LAB&quot;))\r\n    and exists(&quot;Initial Population&quot; IP\r\n      where NHSNHelpers.&quot;Normalize Interval&quot;(DiagnosticReports.effective) overlaps IP.period)\r\n  return DiagnosticReportResource(DiagnosticReports,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-diagnosticreport'}})\r\n//#End DiagnosticReport block\r\n\r\ndefine &quot;SDE Encounter&quot;: \r\n  &quot;Encounters&quot; Encounters\r\n  where not CheckIP(Encounters)\r\n  and exists(\r\n    &quot;Initial Population&quot; IP\r\n    where Encounters.period overlaps IP.period)\r\n  return SharedResource.EncounterResource(Encounters,\r\n  {FHIR.canonical{value: 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter'}})\r\n\r\ndefine &quot;SDE IP Encounters&quot;:\r\n  &quot;Initial Population&quot; IP\r\n  return SharedResource.EncounterResource(IP, \r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-encounter'}})\r\n\r\ndefine &quot;SDE Location&quot;:\r\n  &quot;Get Locations from IP Encounters in Measurement Period&quot; Locations\r\n  where exists(&quot;Initial Population&quot;)\r\n  and Locations is not null\r\n  return SharedResource.LocationResource(Locations,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-location'}})\r\n \r\ndefine &quot;SDE Medication Administration&quot;:\r\n  [MedicationAdministration] MedicationAdministrations \r\n  where exists(\r\n    &quot;Initial Population&quot; IP\r\n    where NHSNHelpers.&quot;Normalize Interval&quot;(MedicationAdministrations.effective) overlaps IP.period)\r\n  return SharedResource.MedicationAdministrationResource(MedicationAdministrations,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-medicationadministration'}})\r\n \r\ndefine &quot;SDE Medication Request&quot;:\r\n  [MedicationRequest] MedicationRequests \r\n  where exists(\r\n    &quot;Initial Population&quot; IP\r\n    where MedicationRequests.authoredOn during IP.period)\r\n  return SharedResource.MedicationRequestResource(MedicationRequests,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-medicationrequest'}})\r\n\r\ndefine &quot;SDE Medication&quot;:\r\n  (&quot;SDE Medication Request&quot;\r\n  union &quot;SDE Medication Administration&quot;) MedReqOrAdmin\r\n  where MedReqOrAdmin.medication is FHIR.Reference\r\n  and exists(&quot;Initial Population&quot;) //No longer need to check for timing here because it's checked in SDE Medication Request/Administriation\r\n  return SharedResource.MedicationResource(GetMedicationFrom(MedReqOrAdmin.medication),\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-medication'}})\r\n\r\ndefine &quot;SDE Observation Lab Category&quot;:\r\n  &quot;Observations&quot; Observations \r\n  where (exists(Observations.category Category where Category ~ &quot;laboratory&quot;))\r\n    and exists(\r\n      &quot;Initial Population&quot; IP\r\n      where NHSNHelpers.&quot;Normalize Interval&quot;(Observations.effective) overlaps IP.period)\r\n  return SharedResource.ObservationLabResource(Observations,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-observation-lab'}})\r\n\r\n//Vital Signs Observation has its own profile in FHIR Base\r\ndefine &quot;SDE Observation Vital Signs Category&quot;:\r\n  &quot;Observations&quot; Observations \r\n  where (exists(Observations.category Category where Category ~ &quot;vital-signs&quot;))\r\n    and exists(\r\n      &quot;Initial Population&quot; IP\r\n      where NHSNHelpers.&quot;Normalize Interval&quot;(Observations.effective) overlaps IP.period)\r\n  return ObservationVitalSignsResource(Observations,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-observation-vitals'}})\r\n\r\n//Defaulting to base FHIR profile as there are no individual profiles in US Core 3.1.1 that cover these Observation categories\r\ndefine &quot;SDE Observation Category&quot;:\r\n  &quot;Observations&quot; Observations \r\n  where ((exists(Observations.category Category where Category ~ &quot;social-history&quot;))\r\n    or (exists(Observations.category Category where Category ~ &quot;survey&quot;))\r\n    or (exists(Observations.category Category where Category ~ &quot;imaging&quot;))\r\n    or (exists(Observations.category Category where Category ~ &quot;procedure&quot;)))\r\n    and exists(\r\n      &quot;Initial Population&quot; IP\r\n      where NHSNHelpers.&quot;Normalize Interval&quot;(Observations.effective) overlaps IP.period)\r\n  return ObservationResource(Observations,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-observation'}})\r\n\r\ndefine &quot;SDE Coverage&quot;: \r\n\t[Coverage] Coverages\r\n  where exists(\r\n    &quot;Initial Population&quot; IP\r\n    where Coverages.period overlaps IP.period)\r\n  return SharedResource.CoverageResource(Coverages,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-coverage'}})\r\n\r\ndefine &quot;SDE Procedure&quot;:\r\n  [Procedure] Procedures \r\n  where exists(\r\n    &quot;Initial Population&quot; IP\r\n    where NHSNHelpers.&quot;Normalize Interval&quot;(Procedures.performed) overlaps IP.period)\r\n  return SharedResource.ProcedureResource(Procedures,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-procedure'}})\r\n\r\ndefine &quot;SDE Specimen&quot;:\r\n  [Specimen] Specimens\r\n  where exists(\r\n    &quot;Initial Population&quot; IP\r\n    where NHSNHelpers.&quot;Normalize Interval&quot;(Specimens.collection.collected) overlaps IP.period\r\n  )\r\n  return SharedResource.SpecimenResource(Specimens,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-specimen'}})\r\n\r\ndefine &quot;SDE Service Request&quot;:\r\n  [ServiceRequest] ServiceRequests\r\n  where exists(&quot;Initial Population&quot; IP\r\n    where ServiceRequests.authoredOn during IP.period)\r\n  return SharedResource.ServiceRequestResource(ServiceRequests,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-monthly-servicerequest'}})\r\n\r\ndefine &quot;SDE Minimal Patient&quot;:\r\n  Patient p\r\n  return SharedResource.PatientResource(p,\r\n  {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/cross-measure-patient'}})\r\n\r\n//\r\n//Functions\r\n//\r\ndefine function &quot;CheckIP&quot;(encounter Encounter):\r\n  exists(&quot;Initial Population&quot; IP\r\n  where encounter.id = IP.id)\r\n\r\ndefine function &quot;GetMedicationFrom&quot;(choice Choice&lt;FHIR.CodeableConcept, FHIR.Reference&gt;):\r\n  case\r\n    when choice is FHIR.Reference then\r\n      GetMedication(choice as FHIR.Reference)\r\n    else\r\n      null\r\n  end\r\n\r\ndefine function &quot;GetMedication&quot;(reference Reference):\r\n  singleton from (\r\n    [Medication] Medications\r\n    where Medications.id = NHSNHelpers.GetId(reference.reference)\r\n  )\r\n\r\ndefine function &quot;GetCondition&quot;(reference Reference):\r\n  singleton from (\r\n    &quot;Conditions&quot; Conditions\r\n    where Conditions.id = NHSNHelpers.GetId(reference.reference)\r\n  )\r\n\r\ndefine function &quot;GetEncounter&quot;(reference Reference):\r\n  singleton from (\r\n    &quot;Encounters&quot; Encounters\r\n    where Encounters.id = NHSNHelpers.GetId(reference.reference)\r\n  )\r\n\r\ndefine function RemoveUnaccepted(codes List&lt;FHIR.CodeableConcept&gt;, accepted List&lt;System.Code&gt;):\r\n\tcodes c\r\n  where exists(\r\n    accepted a\r\n    where c ~ a\r\n  )\r\n\r\ndefine function FilterCodeableConcepts(codes List&lt;FHIR.CodeableConcept&gt;, accepted List&lt;System.Code&gt;):\r\n\tif Count(accepted) &gt; 0\r\n\t\tthen RemoveUnaccepted(codes, accepted)\r\n\telse codes\r\n\r\n//\r\n//Measure Specific Resource Creation Functions\r\n//\r\ndefine function ConditionResource(condition Condition, profileURLs List&lt;FHIR.canonical&gt;, acceptedCategories List&lt;System.Code&gt;):\r\n  condition c\r\n  return Condition{\r\n    id: FHIR.id {value: 'LCR-' + c.id},\r\n    meta: SharedResource.MetaElement(c, profileURLs),\r\n    extension: c.extension,\r\n    clinicalStatus: c.clinicalStatus,\r\n    verificationStatus: c.verificationStatus,\r\n    category: FilterCodeableConcepts(c.category, acceptedCategories),\r\n    severity: c.severity,\r\n    code: c.code,\r\n    bodySite: c.bodySite,\r\n    subject: c.subject,\r\n    encounter: c.encounter,\r\n    onset: c.onset,\r\n    abatement: c.abatement,\r\n    recordedDate: c.recordedDate,\r\n    stage: SharedResource.ConditionStage(c.stage),\r\n    evidence: SharedResource.ConditionEvidence(c.evidence),\r\n    note: c.note\r\n  }\r\n\r\ndefine function DeviceUdiCarrier(udiCarrier List&lt;FHIR.Device.UdiCarrier&gt;):\r\n  udiCarrier u\r\n  return FHIR.Device.UdiCarrier{\r\n    deviceIdentifier: u.deviceIdentifier,\r\n    issuer: u.issuer,\r\n    jurisdiction: u.jurisdiction,\r\n    carrierAIDC: u.carrierAIDC,\r\n    carrierHRF: u.carrierHRF,\r\n    entryType: u.entryType\r\n  }\r\n\r\ndefine function DeviceDeviceName(deviceName List&lt;FHIR.Device.DeviceName&gt;):\r\n  deviceName d\r\n  return FHIR.Device.DeviceName{\r\n    name: d.name,\r\n    type: d.type\r\n  }\r\n\r\ndefine function DeviceSpecialization(specialization List&lt;FHIR.Device.Specialization&gt;):\r\n  specialization s\r\n  return FHIR.Device.Specialization{\r\n    systemType: s.systemType,\r\n    version: s.version\r\n  }\r\n\r\ndefine function DeviceVersion(version List&lt;FHIR.Device.Version&gt;):\r\n  version v\r\n  return FHIR.Device.Version{\r\n    type: v.type,\r\n    component: v.component,\r\n    value: v.value\r\n  }\r\n\r\ndefine function DeviceProperty(deviceProperty List&lt;FHIR.Device.Property&gt;):\r\n  deviceProperty d\r\n  return FHIR.Device.Property{\r\n    id: d.id,\r\n    type: d.type,\r\n    valueQuantity: d.valueQuantity,\r\n    valueCode: d.valueCode\r\n  }\r\n\r\ndefine function DeviceResource(device Device, profileURLs List&lt;FHIR.canonical&gt;):\r\n  device d\r\n  return Device{\r\n    id: FHIR.id{value: 'LCR-' + d.id},\r\n    meta: SharedResource.MetaElement(d, profileURLs),\r\n    extension: d.extension,\r\n    definition: d.definition,\r\n    udiCarrier: DeviceUdiCarrier(d.udiCarrier),\r\n    status: d.status,\r\n    statusReason: d.statusReason,\r\n    distinctIdentifier: d.distinctIdentifier,\r\n    manufacturer: d.manufacturer,\r\n    manufactureDate: d.manufactureDate,\r\n    expirationDate: d.expirationDate,\r\n    lotNumber: d.lotNumber,\r\n    serialNumber: d.serialNumber,\r\n    deviceName: DeviceDeviceName(d.deviceName),\r\n    modelNumber: d.modelNumber,\r\n    partNumber: d.partNumber,\r\n    type: d.type,\r\n    specialization: DeviceSpecialization(d.specialization),\r\n    version: DeviceVersion(d.version),\r\n    property: DeviceProperty(d.property),\r\n    patient: d.patient,\r\n    owner: d.owner,\r\n    contact: d.contact,\r\n    location: d.location,\r\n    url: d.url,\r\n    note: d.note,\r\n    safety: d.safety,\r\n    parent: d.parent\r\n  }\r\n\r\ndefine function DiagnosticReportResource(diagnosticReport DiagnosticReport, profileURLs List&lt;FHIR.canonical&gt;):\r\n  diagnosticReport d\r\n  return DiagnosticReport{\r\n    id: FHIR.id{value: 'LCR-' + d.id},\r\n    meta: SharedResource.MetaElement(d, profileURLs),\r\n    extension: d.extension,\r\n    basedOn: d.basedOn,\r\n    status: d.status,\r\n    category: d.category,\r\n    code: d.code,\r\n    subject: d.subject,\r\n    encounter: d.encounter,\r\n    effective: d.effective,\r\n    issued: d.issued,\r\n    performer: d.performer,\r\n    resultsInterpreter: d.resultsInterpreter,\r\n    specimen: d.specimen,\r\n    result: d.result,\r\n    conclusion: d.conclusion,\r\n    conclusionCode: d.conclusionCode\r\n  }\r\n\r\ndefine function ObservationResource(observation Observation, profileURLs List&lt;FHIR.canonical&gt;):\r\n  observation o\r\n  return Observation{\r\n    id: FHIR.id {value: 'LCR-' + o.id},\r\n    meta: SharedResource.MetaElement(o, profileURLs),\r\n    extension: o.extension,\r\n    partOf: o.partOf,\r\n    status: o.status,\r\n    category: o.category,\r\n    code: o.code,\r\n    subject: o.subject,\r\n    focus: o.focus,\r\n    encounter: o.encounter,\r\n    effective: o.effective,\r\n    issued: o.issued,\r\n    performer: o.performer,\r\n    value: o.value,\r\n    dataAbsentReason: o.dataAbsentReason,\r\n    interpretation: o.interpretation,\r\n    note: o.note,\r\n    bodySite: o.bodySite,\r\n    method: o.method,\r\n    specimen: o.specimen,\r\n    device: o.device,\r\n    referenceRange: SharedResource.ObservationReferenceRange(o.referenceRange),\r\n    hasMember: o.hasMember,\r\n    derivedFrom: o.derivedFrom,\r\n    component: SharedResource.ObservationComponent(o.component)\r\n  }\r\n\r\ndefine function ObservationVitalSignsCoding(coding List&lt;Coding&gt;):\r\n  coding c\r\n  return Coding{\r\n    system: c.system,\r\n    version: c.version,\r\n    code: c.code,\r\n    display: c.display,\r\n    userSelected: c.userSelected\r\n  }\r\n\r\ndefine function ObservationVitalSignsCategory(category List&lt;CodeableConcept&gt;):\r\n  category c\r\n  return CodeableConcept{\r\n    coding: ObservationVitalSignsCoding(c.coding),\r\n    text: c.text\r\n  }\r\n\r\ndefine function ObservationVitalSignsComponent(component List&lt;FHIR.Observation.Component&gt;):\r\n  component c\r\n  return FHIR.Observation.Component{\r\n    code: c.code,\r\n    value: c.value,\r\n    dataAbsentReason: c.dataAbsentReason,\r\n    interpretation: c.interpretation,\r\n    referenceRange: SharedResource.ObservationReferenceRange(c.referenceRange)\r\n  }\r\n\r\ndefine function ObservationVitalSignsResource(observation Observation, profileURLs List&lt;FHIR.canonical&gt;):\r\n  observation o\r\n  return Observation{\r\n    id: FHIR.id {value: 'LCR-' + o.id},\r\n    meta: SharedResource.MetaElement(o, profileURLs),\r\n    extension: o.extension,\r\n    partOf: o.partOf,\r\n    status: o.status,\r\n    category: ObservationVitalSignsCategory(o.category),\r\n    code: o.code,\r\n    subject: o.subject,\r\n    focus: o.focus,\r\n    encounter: o.encounter,\r\n    effective: o.effective,\r\n    issued: o.issued,\r\n    performer: o.performer,\r\n    value: o.value,\r\n    dataAbsentReason: o.dataAbsentReason,\r\n    interpretation: o.interpretation,\r\n    note: o.note,\r\n    bodySite: o.bodySite,\r\n    method: o.method,\r\n    specimen: o.specimen,\r\n    device: o.device,\r\n    referenceRange: SharedResource.ObservationReferenceRange(o.referenceRange),\r\n    hasMember: o.hasMember,\r\n    derivedFrom: o.derivedFrom,\r\n    component: ObservationVitalSignsComponent(o.component)\r\n  }</code></pre></td></tr>\n            </table>\n          </td>\n        </tr>\n        \n        \n        \n    </table>\n</div>\n</div>"
  },
  "contained" : [
    {
      "resourceType" : "Parameters",
      "id" : "options",
      "parameter" : [
        {
          "name" : "translatorVersion",
          "valueString" : "3.25.0"
        },
        {
          "name" : "option",
          "valueString" : "EnableDateRangeOptimization"
        },
        {
          "name" : "option",
          "valueString" : "EnableAnnotations"
        },
        {
          "name" : "option",
          "valueString" : "EnableLocators"
        },
        {
          "name" : "option",
          "valueString" : "DisableListDemotion"
        },
        {
          "name" : "option",
          "valueString" : "DisableListPromotion"
        },
        {
          "name" : "analyzeDataRequirements",
          "valueBoolean" : false
        },
        {
          "name" : "collapseDataRequirements",
          "valueBoolean" : true
        },
        {
          "name" : "compatibilityLevel",
          "valueString" : "1.5"
        },
        {
          "name" : "enableCqlOnly",
          "valueBoolean" : false
        },
        {
          "name" : "errorLevel",
          "valueString" : "Info"
        },
        {
          "name" : "signatureLevel",
          "valueString" : "Overloads"
        },
        {
          "name" : "validateUnits",
          "valueBoolean" : true
        },
        {
          "name" : "verifyOnly",
          "valueBoolean" : false
        }
      ]
    }
  ],
  "extension" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions",
      "valueReference" : {
        "reference" : "#options"
      }
    }
  ],
  "url" : "http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNAcuteCareHospitalMonthlyInitialPopulation",
  "version" : "1.0.0",
  "name" : "NHSNAcuteCareHospitalMonthlyInitialPopulation",
  "status" : "draft",
  "type" : {
    "coding" : [
      {
        "system" : "http://terminology.hl7.org/CodeSystem/library-type",
        "code" : "logic-library"
      }
    ]
  },
  "date" : "2025-09-15T12:53:39-04:00",
  "publisher" : "CDC National Healthcare Safety Network (NHSN)",
  "contact" : [
    {
      "name" : "CDC National Healthcare Safety Network (NHSN)",
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.cdc.gov/nhsn"
        },
        {
          "system" : "email",
          "value" : "nhsn@cdc.gov"
        }
      ]
    }
  ],
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "urn:iso:std:iso:3166",
          "code" : "US"
        }
      ]
    }
  ],
  "relatedArtifact" : [
    {
      "type" : "depends-on",
      "display" : "FHIR model information",
      "resource" : "http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1"
    },
    {
      "type" : "depends-on",
      "display" : "Library FHIRHelpers",
      "resource" : "http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2"
    },
    {
      "type" : "depends-on",
      "display" : "Library NHSNHelpers",
      "resource" : "http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNHelpers|0.0.002"
    },
    {
      "type" : "depends-on",
      "display" : "Library SharedResource",
      "resource" : "http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/SharedResourceCreation|0.1.010"
    },
    {
      "type" : "depends-on",
      "display" : "Code system ActCode",
      "resource" : "http://terminology.hl7.org/CodeSystem/v3-ActCode|9.0.0"
    },
    {
      "type" : "depends-on",
      "display" : "Code system Observation Category",
      "resource" : "http://terminology.hl7.org/CodeSystem/observation-category|1.0.1"
    },
    {
      "type" : "depends-on",
      "display" : "Code system LOINC",
      "resource" : "http://loinc.org"
    },
    {
      "type" : "depends-on",
      "display" : "Code system V2-0074",
      "resource" : "http://terminology.hl7.org/CodeSystem/v2-0074|2.5.0"
    },
    {
      "type" : "depends-on",
      "display" : "Code system Condition Category",
      "resource" : "http://terminology.hl7.org/CodeSystem/condition-category|1.0.1"
    },
    {
      "type" : "depends-on",
      "display" : "Code system US Core Condition Category",
      "resource" : "http://hl7.org/fhir/us/core/CodeSystem/condition-category"
    },
    {
      "type" : "depends-on",
      "display" : "Code system Condition Clinical Status",
      "resource" : "http://terminology.hl7.org/CodeSystem/condition-clinical|3.0.0"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Inpatient, Emergency, and Observation Locations",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Emergency Department Visit",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Encounter Inpatient",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
    },
    {
      "type" : "depends-on",
      "display" : "Value set Observation Services",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"
    },
    {
      "type" : "depends-on",
      "display" : "Value set NHSN Inpatient Encounter Class Codes",
      "resource" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274"
    }
  ],
  "parameter" : [
    {
      "name" : "Measurement Period",
      "use" : "in",
      "min" : 0,
      "max" : "1",
      "type" : "Period"
    },
    {
      "name" : "Patient",
      "use" : "out",
      "min" : 0,
      "max" : "1",
      "type" : "Patient"
    },
    {
      "name" : "Qualifying Encounters During Measurement Period",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Encounter"
    },
    {
      "name" : "Encounters",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Encounter"
    },
    {
      "name" : "Encounters with Patient Hospital Locations",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Encounter"
    },
    {
      "name" : "Initial Population",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Encounter"
    },
    {
      "name" : "Conditions",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Condition"
    },
    {
      "name" : "DiagnosticReports",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "DiagnosticReport"
    },
    {
      "name" : "Observations",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Observation"
    },
    {
      "name" : "Get Locations from IP Encounters in Measurement Period",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Location"
    },
    {
      "name" : "SDE Condition",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Condition"
    },
    {
      "name" : "SDE Device",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Device"
    },
    {
      "name" : "SDE DiagnosticReport Lab",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "DiagnosticReport"
    },
    {
      "name" : "SDE DiagnosticReport Note",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "DiagnosticReport"
    },
    {
      "name" : "SDE DiagnosticReport Others",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "DiagnosticReport"
    },
    {
      "name" : "SDE Encounter",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Encounter"
    },
    {
      "name" : "SDE IP Encounters",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Encounter"
    },
    {
      "name" : "SDE Location",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Location"
    },
    {
      "name" : "SDE Medication Administration",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "MedicationAdministration"
    },
    {
      "name" : "SDE Medication Request",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "MedicationRequest"
    },
    {
      "name" : "SDE Medication",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Medication"
    },
    {
      "name" : "SDE Observation Lab Category",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Observation"
    },
    {
      "name" : "SDE Observation Vital Signs Category",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Observation"
    },
    {
      "name" : "SDE Observation Category",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Observation"
    },
    {
      "name" : "SDE Coverage",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Coverage"
    },
    {
      "name" : "SDE Procedure",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Procedure"
    },
    {
      "name" : "SDE Specimen",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "Specimen"
    },
    {
      "name" : "SDE Service Request",
      "use" : "out",
      "min" : 0,
      "max" : "*",
      "type" : "ServiceRequest"
    },
    {
      "name" : "SDE Minimal Patient",
      "use" : "out",
      "min" : 0,
      "max" : "1",
      "type" : "Patient"
    }
  ],
  "dataRequirement" : [
    {
      "type" : "Patient",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Patient"
      ]
    },
    {
      "type" : "Encounter",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
      ],
      "mustSupport" : [
        "type",
        "status",
        "period",
        "location",
        "diagnosis",
        "id"
      ],
      "codeFilter" : [
        {
          "path" : "type",
          "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"
        }
      ]
    },
    {
      "type" : "Encounter",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
      ],
      "mustSupport" : [
        "type",
        "status",
        "period",
        "location",
        "diagnosis",
        "id"
      ],
      "codeFilter" : [
        {
          "path" : "type",
          "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"
        }
      ]
    },
    {
      "type" : "Encounter",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
      ],
      "mustSupport" : [
        "type",
        "status",
        "period",
        "location",
        "diagnosis",
        "id"
      ],
      "codeFilter" : [
        {
          "path" : "type",
          "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"
        }
      ]
    },
    {
      "type" : "Encounter",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
      ],
      "mustSupport" : [
        "class",
        "status",
        "period",
        "location",
        "diagnosis",
        "id"
      ],
      "codeFilter" : [
        {
          "path" : "class",
          "valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274"
        }
      ]
    },
    {
      "type" : "Encounter",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
      ],
      "mustSupport" : [
        "class",
        "status",
        "period",
        "location",
        "diagnosis",
        "id"
      ],
      "codeFilter" : [
        {
          "path" : "class",
          "code" : [
            {
              "system" : "http://terminology.hl7.org/CodeSystem/v3-ActCode",
              "code" : "EMER",
              "display" : "emergency"
            }
          ]
        }
      ]
    },
    {
      "type" : "Encounter",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
      ],
      "mustSupport" : [
        "class",
        "status",
        "period",
        "location",
        "diagnosis",
        "id"
      ],
      "codeFilter" : [
        {
          "path" : "class",
          "code" : [
            {
              "system" : "http://terminology.hl7.org/CodeSystem/v3-ActCode",
              "code" : "OBSENC",
              "display" : "observation encounter"
            }
          ]
        }
      ]
    },
    {
      "type" : "Encounter",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Encounter"
      ],
      "mustSupport" : [
        "status",
        "period",
        "location",
        "diagnosis",
        "id"
      ]
    },
    {
      "type" : "Condition",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Condition"
      ],
      "mustSupport" : [
        "id",
        "extension",
        "clinicalStatus",
        "verificationStatus",
        "category",
        "severity",
        "code",
        "bodySite",
        "subject",
        "encounter",
        "onset",
        "abatement",
        "recordedDate",
        "stage",
        "evidence",
        "note",
        "encounter.id"
      ]
    },
    {
      "type" : "DiagnosticReport",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/DiagnosticReport"
      ],
      "mustSupport" : [
        "id",
        "extension",
        "basedOn",
        "status",
        "category",
        "code",
        "subject",
        "encounter",
        "effective",
        "issued",
        "performer",
        "resultsInterpreter",
        "specimen",
        "result",
        "conclusion",
        "conclusionCode"
      ]
    },
    {
      "type" : "Observation",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Observation"
      ],
      "mustSupport" : [
        "id",
        "extension",
        "partOf",
        "status",
        "category",
        "code",
        "subject",
        "focus",
        "encounter",
        "effective",
        "issued",
        "performer",
        "value",
        "dataAbsentReason",
        "interpretation",
        "note",
        "bodySite",
        "method",
        "specimen",
        "device",
        "referenceRange",
        "hasMember",
        "derivedFrom",
        "component"
      ]
    },
    {
      "type" : "Device",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Device"
      ],
      "mustSupport" : [
        "id",
        "extension",
        "definition",
        "udiCarrier",
        "status",
        "statusReason",
        "distinctIdentifier",
        "manufacturer",
        "manufactureDate",
        "expirationDate",
        "lotNumber",
        "serialNumber",
        "deviceName",
        "modelNumber",
        "partNumber",
        "type",
        "specialization",
        "version",
        "property",
        "patient",
        "owner",
        "contact",
        "location",
        "url",
        "note",
        "safety",
        "parent"
      ]
    },
    {
      "type" : "MedicationAdministration",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/MedicationAdministration"
      ],
      "mustSupport" : [
        "effective"
      ]
    },
    {
      "type" : "MedicationRequest",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/MedicationRequest"
      ],
      "mustSupport" : [
        "authoredOn"
      ]
    },
    {
      "type" : "Medication",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Medication"
      ],
      "mustSupport" : [
        "id"
      ]
    },
    {
      "type" : "Coverage",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Coverage"
      ],
      "mustSupport" : [
        "period"
      ]
    },
    {
      "type" : "Procedure",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Procedure"
      ],
      "mustSupport" : [
        "performed"
      ]
    },
    {
      "type" : "Specimen",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/Specimen"
      ],
      "mustSupport" : [
        "collection",
        "collection.collected"
      ]
    },
    {
      "type" : "ServiceRequest",
      "profile" : [
        🔗 "http://hl7.org/fhir/StructureDefinition/ServiceRequest"
      ],
      "mustSupport" : [
        "authoredOn"
      ]
    }
  ],
  "content" : [
    {
      "contentType" : "text/cql",
      "data" : "bGlicmFyeSBOSFNOQWN1dGVDYXJlSG9zcGl0YWxNb250aGx5SW5pdGlhbFBvcHVsYXRpb24gdmVyc2lvbiAnMS4wLjEtZGV2Jw0KDQp1c2luZyBGSElSIHZlcnNpb24gJzQuMC4xJw0KDQppbmNsdWRlIEZISVJIZWxwZXJzIHZlcnNpb24gJzQuMC4yJyBjYWxsZWQgRkhJUkhlbHBlcnMNCmluY2x1ZGUgTkh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