CDC National Healthcare Safety Network (NHSN) Digital Quality Measures (dQM) Content Package IG
2.0.0-cibuild - Release 2 ci-build United States of America flag

CDC National Healthcare Safety Network (NHSN) Digital Quality Measures (dQM) Content Package IG - Local Development build (v2.0.0-cibuild) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

: NHSN Long Term Care Monthly Initial Population - XML Representation

Page standards status: Trial-use Maturity Level: 1

Raw xml | Download


<Measure xmlns="http://hl7.org/fhir">
  <id value="NHSNLongTermCareMonthlyInitialPopulation"/>
  <meta>
    <profile
             value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cohort-measure-cqfm"/>
    <profile
             value="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/computable-measure-cqfm"/>
  </meta>
  <text>
    <status value="extensions"/>
    <div xmlns="http://www.w3.org/1999/xhtml">
  <table class="narrative-table">
    <tbody>
<tr>

<th colspan="2" scope="row" class="row-header">Knowledge Artifact Metadata</th>

</tr>

<tr>

<th scope="row" class="row-header">Name (machine-readable)</th>

<td class="content-container">NHSNLongTermCareMonthlyInitialPopulation</td>
</tr>


<tr>

<th scope="row" class="row-header">Title (human-readable)</th>

<td class="content-container">NHSN Long Term Care Monthly Initial Population</td>
</tr>



<tr>

<th scope="row" class="row-header">Status</th>

<td class="content-container">Draft</td>
</tr>


<tr>

<th scope="row" class="row-header">Experimental</th>

<td class="content-container">false</td>
</tr>


<tr>

<th scope="row" class="row-header">Description</th>

<td class="content-container"><div><p>The Long Term Care Initial Population includes all encounters that overlap the measurement period.</p>
</div></td>
</tr>












<tr>

<th scope="row" class="row-header">Measure Steward</th>

<td class="content-container">CDC National Healthcare Safety Network (NHSN)</td>
</tr>


<tr>

<th scope="row" class="row-header">Steward Contact Details</th>

<td class="content-container">CDC National Healthcare Safety Network (NHSN): <a href="http://www.cdc.gov/nhsn">http://www.cdc.gov/nhsn</a>,<a href="mailto:nhsn@cdc.gov">nhsn@cdc.gov</a></td>
</tr>


<tr>

<th scope="row" class="row-header">Copyright</th>

<td class="content-container"><div><p>Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets.</p>
</div></td>
</tr>



<tr>
  
  
<th scope="row" class="row-header">Documentation</th>

  
  
  
  
  <td class="content-container">
    
    <em>Description</em>: https://www.cdc.gov/nhsn/index.html [placeholder for link to protocol on CDC website]
    
    <br/>
    
    
    
    
    <em>Content URL</em>: <a href="https://www.cdc.gov/nhsn/index.html">https://www.cdc.gov/nhsn/index.html</a>
    
    <br/>
    
    
    
    <em>Document</em>: null @ https://www.cdc.gov/nhsn/index.html
    
    
    
  </td>
</tr>










<tr>

<th colspan="2" scope="row" class="row-header">Measure Metadata</th>

</tr>






<tr>

<th scope="row" class="row-header">Version Number</th>

<td class="content-container">2.0.0-cibuild</td>
</tr>


<tr>

<th scope="row" class="row-header">Measure Scoring</th>

<td class="content-container"><span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-scoring cohort}">Cohort</span></td>
</tr>



<tr>

<th scope="row" class="row-header">Measure Type</th>

<td class="content-container"><span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-type outcome}">Outcome</span></td>
</tr>




<tr>

<th scope="row" class="row-header">Rationale</th>

<td class="content-container"><div><p>The NHSN Acute Care Hospital Monthly dQM allows for facilities to report line level patient data electronically to NHSN for the following modules that are reported monthly: Glycemic Control, Hypoglycemia; Healthcare facility-onset, antibiotic-Treated Clostridioides difficile (C. difficile) Infection (HT-CDI); Hospital-Onset Bacteremia &amp; Fungemia (HOB); Venous Thromboembolism (VTE); Late Onset Sepsis / Meningitis. *Please see <a href="https://www.cdc.gov/nhsn/acute-care-hospital/index.html">Acute Care / Critical Access Hospitals (ACH) | NHSN | CDC</a> for the individual measure protocols.</p>
</div></td>
</tr>







  
<tr>

<th scope="row" class="row-header">Population Basis</th>

<td class="content-container">Encounter</td>
</tr>





  
    <tr>

<th colspan="2" scope="row" class="row-header">Measure Population Criteria</th>

</tr>
  
  
  
  
    <tr>
      
        
<th scope="row" class="row-header">Initial Population</th>

      
      <td class="content-container">
        
        <em>ID</em>: initial-population
        <br/>
        
        
          <em>Description</em>:
          <p style="white-space: pre-line" class="tab-one">All encounters for patients of any age in an ED, observation, or inpatient location or all encounters for patients of any age with an ED, observation, inpatient, or short stay status during the measurement period.</p>
        
        
          
            
            <em>Logic Definition</em>: <a href="#nhsnlongtermcaremonthlyinitialpopulation-initial-population">Initial Population</a> 
          
        
      </td>
    </tr>
  

  
  











  <tr>

<th colspan="2" scope="row" class="row-header">Supplemental Data Elements</th>

</tr>


<tr>
  
<th scope="row" class="row-header">Supplemental Data Element</th>

  <td class="content-container">
    
      <em>ID</em>: sde-medication-administration
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Medication Administration
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#nhsnlongtermcaremonthlyinitialpopulation-sde-medication-administration">SDE Medication Administration</a> 
      
    
  </td>
</tr>

<tr>
  
<th scope="row" class="row-header">Supplemental Data Element</th>

  <td class="content-container">
    
      <em>ID</em>: sde-medication-request
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Medication Request
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#nhsnlongtermcaremonthlyinitialpopulation-sde-medication-request">SDE Medication Request</a> 
      
    
  </td>
</tr>

<tr>
  
<th scope="row" class="row-header">Supplemental Data Element</th>

  <td class="content-container">
    
      <em>ID</em>: sde-medication
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Medication
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#nhsnlongtermcaremonthlyinitialpopulation-sde-medication">SDE Medication</a> 
      
    
  </td>
</tr>

<tr>
  
<th scope="row" class="row-header">Supplemental Data Element</th>

  <td class="content-container">
    
      <em>ID</em>: sde-observation-lab-category
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Observation Lab Category
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#nhsnlongtermcaremonthlyinitialpopulation-sde-observation-lab-category">SDE Observation Lab Category</a> 
      
    
  </td>
</tr>

<tr>
  
<th scope="row" class="row-header">Supplemental Data Element</th>

  <td class="content-container">
    
      <em>ID</em>: sde-coverage
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Coverage
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#nhsnlongtermcaremonthlyinitialpopulation-sde-coverage">SDE Coverage</a> 
      
    
  </td>
</tr>

<tr>
  
<th scope="row" class="row-header">Supplemental Data Element</th>

  <td class="content-container">
    
      <em>ID</em>: sde-specimen
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Specimen
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#nhsnlongtermcaremonthlyinitialpopulation-sde-specimen">SDE Specimen</a> 
      
    
  </td>
</tr>

<tr>
  
<th scope="row" class="row-header">Supplemental Data Element</th>

  <td class="content-container">
    
      <em>ID</em>: sde-minimal-patient
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE Minimal Patient
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#nhsnlongtermcaremonthlyinitialpopulation-sde-minimal-patient">SDE Minimal Patient</a> 
      
    
  </td>
</tr>

<tr>
  
<th scope="row" class="row-header">Supplemental Data Element</th>

  <td class="content-container">
    
      <em>ID</em>: sde-ip-encounters
      
      <br/>
      
    
    
      
        
          <em>Usage Code</em>: <span title="Codes:{http://terminology.hl7.org/CodeSystem/measure-data-usage supplemental-data}">Supplemental Data</span>
        
        <br/>
      
    
    
      <em>Description</em>: SDE IP Encounters
    
    
      
        <br/>
        
        <em>Logic Definition</em>: <a href="#nhsnlongtermcaremonthlyinitialpopulation-sde-ip-encounters">SDE IP Encounters</a> 
      
    
  </td>
</tr>


<tr>

<th colspan="2" scope="row" class="row-header">Measure Logic</th>

</tr>

<tr>

<th scope="row" class="row-header">Primary Library</th>

<td class="content-container"><a href="Library-NHSNLongTermCareMonthlyInitialPopulation.html">NHSNLongTermCareMonthlyInitialPopulation</a></td>
</tr>




  
  

<tr>
  
  
  
  
  
<th scope="row" class="row-header">Dependency</th>

  
  <td class="content-container">
    
    <em>Description</em>: FHIR model information
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <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>
    <br/>
    <em>Canonical URL</em>: <tt>http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1</tt>
    
  </td>
</tr>

<tr>
  
  
  
  
  
<th scope="row" class="row-header">Dependency</th>

  
  <td class="content-container">
    
    <em>Description</em>: Library FHIRHelpers
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2</code>
    <br/>
    <em>Canonical URL</em>: <tt>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2</tt>
    
  </td>
</tr>

<tr>
  
  
  
  
  
<th scope="row" class="row-header">Dependency</th>

  
  <td class="content-container">
    
    <em>Description</em>: Library NHSNHelpers
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNHelpers|0.0.002</code>
    <br/>
    <em>Canonical URL</em>: <tt>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNHelpers|0.0.002</tt>
    
  </td>
</tr>

<tr>
  
  
  
  
  
<th scope="row" class="row-header">Dependency</th>

  
  <td class="content-container">
    
    <em>Description</em>: Library SharedResource
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <code>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/SharedResourceCreation|0.1.010</code>
    <br/>
    <em>Canonical URL</em>: <tt>http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/SharedResourceCreation|0.1.010</tt>
    
  </td>
</tr>

<tr>
  
  
  
  
  
<th scope="row" class="row-header">Dependency</th>

  
  <td class="content-container">
    
    <em>Description</em>: Code system Observation Category
    
    <br/>
    
    
    
    
    
    
    <em>Resource</em>: <a href="http://terminology.hl7.org/6.5.0/CodeSystem-observation-category.html">Observation Category Codesversion: null1.0.1)</a>
    <br/>
    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/observation-category|1.0.1</tt>
    
  </td>
</tr>


  
  <tr>
    <th scope="row" class="row-header">Direct Reference Code</th>
    <td class="content-container">
      
        <em>Display</em>: Laboratory
        <br/>
      
      <em>Code</em>: laboratory
      <br/>
      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/observation-category</tt>
    </td>
  </tr>

  
  <tr>
  
<th scope="row" class="row-header">Parameter</th>

  <td class="content-container">
    <em>Name</em>: Measurement Period
    <br/>
    <em>Use</em>: In
    <br/>
    <em>Min Cardinality</em>: 0
    <br/>
    <em>Max Cardinality</em>: 1
    <br/>
    <em>Type</em>: Period
  </td>
</tr>
  
  <tr>
  
<th scope="row" class="row-header">Parameter</th>

  <td class="content-container">
    <em>Name</em>: SDE Medication Administration
    <br/>
    <em>Use</em>: Out
    <br/>
    <em>Min Cardinality</em>: 0
    <br/>
    <em>Max Cardinality</em>: *
    <br/>
    <em>Type</em>: MedicationAdministration
  </td>
</tr>
  
  <tr>
  
<th scope="row" class="row-header">Parameter</th>

  <td class="content-container">
    <em>Name</em>: SDE Medication Request
    <br/>
    <em>Use</em>: Out
    <br/>
    <em>Min Cardinality</em>: 0
    <br/>
    <em>Max Cardinality</em>: *
    <br/>
    <em>Type</em>: MedicationRequest
  </td>
</tr>
  
  <tr>
  
<th scope="row" class="row-header">Parameter</th>

  <td class="content-container">
    <em>Name</em>: SDE Coverage
    <br/>
    <em>Use</em>: Out
    <br/>
    <em>Min Cardinality</em>: 0
    <br/>
    <em>Max Cardinality</em>: *
    <br/>
    <em>Type</em>: Coverage
  </td>
</tr>
  
  <tr>
  
<th scope="row" class="row-header">Parameter</th>

  <td class="content-container">
    <em>Name</em>: SDE IP Encounters
    <br/>
    <em>Use</em>: Out
    <br/>
    <em>Min Cardinality</em>: 0
    <br/>
    <em>Max Cardinality</em>: *
    <br/>
    <em>Type</em>: Encounter
  </td>
</tr>
  
  <tr>
  
<th scope="row" class="row-header">Parameter</th>

  <td class="content-container">
    <em>Name</em>: SDE Observation Lab Category
    <br/>
    <em>Use</em>: Out
    <br/>
    <em>Min Cardinality</em>: 0
    <br/>
    <em>Max Cardinality</em>: *
    <br/>
    <em>Type</em>: Observation
  </td>
</tr>
  
  <tr>
  
<th scope="row" class="row-header">Parameter</th>

  <td class="content-container">
    <em>Name</em>: Initial Population
    <br/>
    <em>Use</em>: Out
    <br/>
    <em>Min Cardinality</em>: 0
    <br/>
    <em>Max Cardinality</em>: *
    <br/>
    <em>Type</em>: Encounter
  </td>
</tr>
  
  <tr>
  
<th scope="row" class="row-header">Parameter</th>

  <td class="content-container">
    <em>Name</em>: SDE Minimal Patient
    <br/>
    <em>Use</em>: Out
    <br/>
    <em>Min Cardinality</em>: 0
    <br/>
    <em>Max Cardinality</em>: 1
    <br/>
    <em>Type</em>: Patient
  </td>
</tr>
  
  <tr>
  
<th scope="row" class="row-header">Parameter</th>

  <td class="content-container">
    <em>Name</em>: SDE Medication
    <br/>
    <em>Use</em>: Out
    <br/>
    <em>Min Cardinality</em>: 0
    <br/>
    <em>Max Cardinality</em>: *
    <br/>
    <em>Type</em>: Medication
  </td>
</tr>
  
  <tr>
  
<th scope="row" class="row-header">Parameter</th>

  <td class="content-container">
    <em>Name</em>: SDE Specimen
    <br/>
    <em>Use</em>: Out
    <br/>
    <em>Min Cardinality</em>: 0
    <br/>
    <em>Max Cardinality</em>: *
    <br/>
    <em>Type</em>: Specimen
  </td>
</tr>
  
  
  <tr>
    <th colspan="2" scope="row" class="section-header"><a name="effective-data-requirements"> </a>Measure Logic Data Requirements</th>
  </tr>
  
  
<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Encounter
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: period, id, extension, identifier, status, statusHistory, class, classHistory, type, subject, length, reasonCode, reasonReference, hospitalization, partOf
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: MedicationAdministration
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: effective, id, extension, instantiates, partOf, status, statusReason, category, medication, subject, context, supportingInformation, reasonCode, reasonReference, request, dosage, eventHistory
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: MedicationRequest
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: authoredOn, id, extension, status, statusReason, intent, category, priority, doNotPerform, reported, medication, subject, encounter, requester, recorder, reasonCode, reasonReference, instantiatesCanonical, instantiatesUri, courseOfTherapyType, dosageInstruction
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Coverage
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/coverage.html">Coverage</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: period, id, extension, status, type, subscriber
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Observation
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/observation.html">Observation</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: category, effective, id, extension, basedOn, partOf, status, code, subject, focus, encounter, issued, performer, value, dataAbsentReason, interpretation, note, bodySite, method, specimen, device, referenceRange, hasMember, derivedFrom, component
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Patient
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/patient.html">Patient</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: id, identifier, active, name, telecom, gender, birthDate, deceased, address, maritalStatus, multipleBirth, photo, contact, communication, generalPractitioner, managingOrganization, link
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Medication
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/medication.html">Medication</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: id, extension, code, status, form, amount, ingredient
    <br/>
   
   
  </td>
</tr>

<tr>
  <th scope="row" class="row-header">Data Requirement</th>
  <td class="content-container">
    <em>Type</em>: Specimen
    <br/>
  
    <em>Profile(s)</em>: 
  
    <a href="http://hl7.org/fhir/R4/specimen.html">Specimen</a>
    <br/>        
  
   
   
    <em>Must Support Elements</em>: collection, collection.collected, id, extension, identifier, accessionIdentifier, status, type, subject, receivedTime, parent, request, processing, container, condition, note
    <br/>
   
   
  </td>
</tr>

  
  <tr>

<th colspan="2" scope="row" class="row-header">Measure Logic Definitions</th>

</tr>
  
          
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-initial-population"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;Initial Population&quot;:   [Encounter] QualifyingEncounters   where QualifyingEncounters.period overlaps &quot;Measurement Period&quot;</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-sde-medication-administration"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">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 MedicationAdministrationResource(MedicationAdministrations,   {FHIR.canonical{value: ''}})</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-sde-medication-request"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Medication Request&quot;:   [MedicationRequest] MedicationRequests    where exists(     &quot;Initial Population&quot; IP     where MedicationRequests.authoredOn during IP.period)   return MedicationRequestResource(MedicationRequests,   {FHIR.canonical{value: ''}})</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-sde-coverage"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Coverage&quot;:   [Coverage] Coverages   where exists(     &quot;Initial Population&quot; IP     where Coverages.period overlaps IP.period)   return CoverageResource(Coverages,   {FHIR.canonical{value: ''}})</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-sde-ip-encounters"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE IP Encounters&quot;:   &quot;Initial Population&quot; IP   return EncounterResource(IP,    {FHIR.canonical{value: ''}})</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-sde-observation-lab-category"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Observation Lab Category&quot;:   [Observation] 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 ObservationLabResource(Observations,   {FHIR.canonical{value: ''}})</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-sde-minimal-patient"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define &quot;SDE Minimal Patient&quot;:   Patient p   return PatientResource(p,   {FHIR.canonical{value: ''}})</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-sde-medication"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">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 MedicationResource(GetMedicationFrom(MedReqOrAdmin.medication),   {FHIR.canonical{value: ''}})</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-sde-specimen"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">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: ''}})</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="fhirhelpers-tointerval"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToInterval(period FHIR.Period):     if period is null then         null      else          if period.&quot;start&quot;.value is null then             Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]         else              if time from period.&quot;start&quot;.value is null and time from period.&quot;end&quot;.value is not null then                 Interval[                     DateTime(year from period.&quot;start&quot;.value, month from period.&quot;start&quot;.value, day from period.&quot;start&quot;.value,                         0, 0, 0, 0, timezoneoffset from period.&quot;end&quot;.value),                      period.&quot;end&quot;.value                 ]         else              if time from period.&quot;end&quot;.value is null and time from period.&quot;start&quot;.value is not null then                 Interval[                     period.&quot;start&quot;.value,                      DateTime(year from period.&quot;end&quot;.value, month from period.&quot;end&quot;.value, day from period.&quot;end&quot;.value,                         23, 59, 59, 999, timezoneoffset from period.&quot;start&quot;.value)                 ]         else Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-medicationadministrationresource"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function MedicationAdministrationResource(medicationAdministration MedicationAdministration, profileURLs List&lt;FHIR.canonical&gt;):   medicationAdministration m   return MedicationAdministration{     id: FHIR.id {value: 'LCR-' + m.id},     meta: SharedResource.MetaElement(m, profileURLs),     extension: m.extension,     instantiates: m.instantiates,     partOf: m.partOf,     status: m.status,     statusReason: m.statusReason,     category: m.category,     medication: m.medication,     subject: m.subject,     context: m.context,     supportingInformation: m.supportingInformation,     effective: m.effective,     reasonCode: m.reasonCode,     reasonReference: m.reasonReference,     request: m.request,     dosage: MedicationAdministrationDosage(m.dosage),     eventHistory: m.eventHistory   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="fhirhelpers-tostring"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToString(value string): value.value</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-metaelement"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function &quot;MetaElement&quot;(resource Resource, profileURLs List&lt;FHIR.canonical&gt;):   resource r   return FHIR.Meta{     extension: r.meta.extension,     versionId: r.meta.versionId,     lastUpdated: r.meta.lastUpdated,     profile: profileURLs,     security: r.meta.security,     tag: r.meta.tag   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-medicationadministrationdosage"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function MedicationAdministrationDosage(dosage FHIR.MedicationAdministration.Dosage):   dosage d   return FHIR.MedicationAdministration.Dosage{     text: d.text,     route: d.route,     method: d.method,     dose: d.dose   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="fhirhelpers-todatetime"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToDateTime(value dateTime): value.value</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-medicationrequestresource"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function MedicationRequestResource(medicationRequest MedicationRequest, profileURLs List&lt;FHIR.canonical&gt;):   medicationRequest m   return MedicationRequest{     id: FHIR.id {value: 'LCR-' + m.id},     meta: SharedResource.MetaElement(medicationRequest, profileURLs),     extension: m.extension,     status: m.status,     statusReason: m.statusReason,     intent: m.intent,     category: m.category,     priority: m.priority,     doNotPerform: m.doNotPerform,     reported: m.reported,     medication: m.medication,     subject: m.subject,     encounter: m.encounter,     authoredOn: m.authoredOn,     requester: m.requester,     recorder: m.recorder,     reasonCode: m.reasonCode,     reasonReference: m.reasonReference,     instantiatesCanonical: m.instantiatesCanonical,     instantiatesUri: m.instantiatesUri,     courseOfTherapyType: m.courseOfTherapyType,     dosageInstruction: MedicationRequestDosageInstruction(m.dosageInstruction)   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-medicationrequestdosageinstruction"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function MedicationRequestDosageInstruction(dosageInstruction List&lt;FHIR.Dosage&gt;):   dosageInstruction dI   return FHIR.Dosage{     text: dI.text,     timing: dI.timing,     asNeeded: dI.asNeeded,     route: dI.route,     method: dI.method,     doseAndRate: MedicationRequestDoseAndRate(dI.doseAndRate)   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-medicationrequestdoseandrate"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function MedicationRequestDoseAndRate(doseAndRate List&lt;FHIR.Dosage.DoseAndRate&gt;):   doseAndRate dR   return FHIR.Dosage.DoseAndRate{     type: dR.type,     dose: dR.dose,     rate: dR.rate   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-coverageresource"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// //Measure Specific Resource Creation Functions // define function CoverageResource(coverage Coverage, profileURLs List&lt;FHIR.canonical&gt;):   coverage c   return Coverage{     id: FHIR.id{value: 'LCR-' + c.id},     meta: SharedResource.MetaElement(c, profileURLs),     extension: c.extension,     status: c.status,     type: c.type,     subscriber: c.subscriber,     period: c.period   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-encounterresource"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function EncounterResource(encounter Encounter, profileURLs List&lt;FHIR.canonical&gt;):   encounter e   return Encounter{     id: FHIR.id{value: 'LCR-' + e.id},     meta: SharedResource.MetaElement(e, profileURLs),     extension: e.extension,     identifier: SharedResource.EncounterIdentifier(e.identifier),     status: e.status,     statusHistory: SharedResource.EncounterStatusHistory(e.statusHistory),     class: e.class,     classHistory: SharedResource.EncounterClassHistory(e.classHistory),     type: e.type,     subject: e.subject,     period: e.period,     length: e.length,     reasonCode: e.reasonCode,     reasonReference: e.reasonReference,     hospitalization: EncounterHospitalization(e.hospitalization),     partOf: e.partOf   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-encounteridentifier"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function EncounterIdentifier(identifier List&lt;FHIR.Identifier&gt;):   identifier i   return FHIR.Identifier{     use: i.use,     type: i.type,     system: i.system,     value: i.value,     period: i.period   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-encounterstatushistory"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function EncounterStatusHistory(statusHistory List&lt;FHIR.Encounter.StatusHistory&gt;):   statusHistory sH   return FHIR.Encounter.StatusHistory{     status: sH.status,     period: sH.period   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-encounterclasshistory"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function EncounterClassHistory(classHistory List&lt;FHIR.Encounter.ClassHistory&gt;):   classHistory cH   return FHIR.Encounter.ClassHistory{     class: cH.class,     period: cH.period   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-encounterhospitalization"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function EncounterHospitalization(hospitalization FHIR.Encounter.Hospitalization):   hospitalization h   return FHIR.Encounter.Hospitalization{     origin: h.origin,     admitSource: h.admitSource,     reAdmission: h.reAdmission,     dischargeDisposition: h.dischargeDisposition   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="fhirhelpers-toconcept"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToConcept(concept FHIR.CodeableConcept):     if concept is null then         null     else         System.Concept {             codes: concept.coding C return ToCode(C),             display: concept.text.value         }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="fhirhelpers-tocode"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> FHIRHelpers</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ToCode(coding FHIR.Coding):     if coding is null then         null     else         System.Code {           code: coding.code.value,           system: coding.system.value,           version: coding.version.value,           display: coding.display.value         }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-observationlabresource"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ObservationLabResource(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,     basedOn: o.basedOn,     partOf: o.partOf,     status: o.status,     category: ObservationLabCategory(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)   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-observationlabcategory"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ObservationLabCategory(category List&lt;CodeableConcept&gt;):   category c   return CodeableConcept{     coding: ObservationLabCoding(c.coding),     text: c.text   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-observationlabcoding"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ObservationLabCoding(coding List&lt;Coding&gt;):   coding c   return Coding{     id: c.id,     extension: c.extension,     system: c.system,     code: c.code   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-observationreferencerange"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ObservationReferenceRange(referenceRange List&lt;FHIR.Observation.ReferenceRange&gt;):   referenceRange rR   return FHIR.Observation.ReferenceRange{     low: rR.low,     high: rR.high,     type: rR.type,     appliesTo: rR.appliesTo,     age: rR.age,     text: rR.text   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-observationcomponent"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function ObservationComponent(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: c.referenceRange   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-patientresource"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function PatientResource(patient Patient, profileURLs List&lt;FHIR.canonical&gt;):   patient p   return Patient{     id: FHIR.id{value: 'LCR-' + p.id},     meta: SharedResource.MetaElement(p, profileURLs),     extension: GetPatientExtensions(p),     identifier: p.identifier,     active: p.active,     name: SharedResource.PatientName(p.name),     telecom: SharedResource.PatientTelecom(p.telecom),     gender: p.gender,     birthDate: p.birthDate,     deceased: p.deceased,     address: SharedResource.PatientAddress(p.address),     maritalStatus: p.maritalStatus,     multipleBirth: p.multipleBirth,     photo: p.photo,     contact: SharedResource.PatientContact(p.contact),     communication: SharedResource.PatientCommunication(p.communication),     generalPractitioner: p.generalPractitioner,     managingOrganization: p.managingOrganization,     link: PatientLink(p.link)   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-getpatientextensions"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function &quot;GetPatientExtensions&quot;(domainResource DomainResource):   domainResource.extension E   where E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'     or E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'     or E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-tribal-affiliation'     or E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex'     or E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex'   return E</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-patientname"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">/* No longer needed but saving in case it's useful later define function PatientIdentifier(identifier List&lt;FHIR.Identifier&gt;):   identifier i   return FHIR.Identifier{     id: i.id,     extension: i.extension,     use: i.use,     type: i.type,     system: i.system,     value: i.value,     period: i.period,     assigner: i.assigner   }*/  define function PatientName(name List&lt;FHIR.HumanName&gt;):   name n   return FHIR.HumanName{     id: n.id,     extension: n.extension,     use: n.use,     text: n.text,     family: n.family,     given: n.given,     prefix: n.prefix,     suffix: n.suffix,     period: n.period   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-patienttelecom"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function PatientTelecom(telecom List&lt;FHIR.ContactPoint&gt;):   telecom t   return FHIR.ContactPoint{     system: t.system,     value: t.value,     use: t.use,     rank: t.rank,     period: t.period   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-patientaddress"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function PatientAddress(address List&lt;FHIR.Address&gt;):   address a   return FHIR.Address{     use: a.use,     type: a.type,     text: a.text,     line: a.line,     city: a.city,     district: a.district,     state: a.state,     postalCode: a.postalCode,     country: a.country,     period: a.period   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-patientcontact"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function PatientContact(contact List&lt;FHIR.Patient.Contact&gt;):   contact c   return FHIR.Patient.Contact{     relationship: c.relationship,     name: c.name,     telecom: c.telecom,     address: c.address,     gender: c.gender,     organization: c.organization,     period: c.period   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-patientcommunication"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function PatientCommunication(communication List&lt;FHIR.Patient.Communication&gt;):   communication c   return FHIR.Patient.Communication{     language: c.language,     preferred: c.preferred   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-patientlink"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function PatientLink(link List&lt;FHIR.Patient.Link&gt;):   link l   return FHIR.Patient.Link{     id: l.id,     other: l.other,     type: l.type   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-medicationresource"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function MedicationResource(medication Medication, profileURLs List&lt;FHIR.canonical&gt;):   medication m   return Medication{     id: FHIR.id {value: 'LCR-' + m.id},     meta: SharedResource.MetaElement(m, profileURLs),     extension: m.extension,     code: m.code,     status: m.status,     form: m.form,     amount: m.amount,     ingredient: SharedResource.MedicationIngredient(m.ingredient)   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-medicationingredient"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function MedicationIngredient(ingredient List&lt;FHIR.Medication.Ingredient&gt;):   ingredient i   return FHIR.Medication.Ingredient{     item: i.item,     strength: i.strength   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-getmedicationfrom"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">// //Functions // 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</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnlongtermcaremonthlyinitialpopulation-getmedication"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNLongTermCareMonthlyInitialPopulation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function &quot;GetMedication&quot;(reference Reference):   singleton from (     [Medication] Medications     where Medications.id = NHSNHelpers.GetId(reference.reference)   )</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="nhsnhelpers-getid"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> NHSNHelpers</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function &quot;GetId&quot;(uri String ):   Last(Split(uri, '/'))</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-specimenresource"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function SpecimenResource(specimen Specimen, profileURLs List&lt;FHIR.canonical&gt;):   specimen s   return Specimen{     id: FHIR.id {value: 'LCR-' + s.id},     meta: MetaElement(s, profileURLs),     extension: s.extension,     identifier: s.identifier,     accessionIdentifier: s.accessionIdentifier,     status: s.status,     type: s.type,     subject: s.subject,     receivedTime: s.receivedTime,     parent: s.parent,     request: s.request,     collection: SpecimenCollection(s.collection),     processing: SpecimenProcessing(s.processing),     container: SpecimenContainer(s.container),     condition: s.condition,     note: s.note   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-specimencollection"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function SpecimenCollection(collection FHIR.Specimen.Collection):   collection c   return FHIR.Specimen.Collection{     collector: c.collector,     collected: c.collected,     &quot;duration&quot;: c.&quot;duration&quot;,     quantity: c.quantity,     method: c.method,     bodySite: c.bodySite,     fastingStatus: c.fastingStatus   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-specimenprocessing"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function SpecimenProcessing(processing List&lt;FHIR.Specimen.Processing&gt;):   processing p   return FHIR.Specimen.Processing{     description: p.description,     procedure: p.procedure,     additive: p.additive,     time: p.time   }</code></pre>
  </td>

</tr>
        
<tr>
  <th scope="row" rowspan="2" class="row-header">
    
      
      <a name="sharedresourcecreation-specimencontainer"> </a>
    
    Logic Definition
  </th>

  <td class="content-container"><em>Library Name:</em> SharedResourceCreation</td>

</tr>
<tr>

  <td>
    <pre style="border: none;" class="content-container highlight language-cql"><code class="language-cql">define function SpecimenContainer(container List&lt;FHIR.Specimen.Container&gt;):   container c   return FHIR.Specimen.Container{     description: c.description,     type: c.type,     capacity: c.capacity,     specimenQuantity: c.specimenQuantity,     additive: c.additive   }</code></pre>
  </td>

</tr>

  

<tr>
  <th colspan="2" scope="row" class="row-header">Generated using version 0.4.6 of the sample-content-ig Liquid templates</th>
</tr>
    </tbody>
  </table>
</div>
  </text>
  <contained>
    <Library>
      <id value="effective-data-requirements"/>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode">
        <valueCoding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/observation-category"/>
          <code value="laboratory"/>
          <display value="Laboratory"/>
        </valueCoding>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="Initial Population"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;Initial Population&quot;:   [Encounter] QualifyingEncounters   where QualifyingEncounters.period overlaps &quot;Measurement Period&quot;"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="0"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Medication Administration"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="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 MedicationAdministrationResource(MedicationAdministrations,   {FHIR.canonical{value: ''}})"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="1"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Medication Request"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Medication Request&quot;:   [MedicationRequest] MedicationRequests    where exists(     &quot;Initial Population&quot; IP     where MedicationRequests.authoredOn during IP.period)   return MedicationRequestResource(MedicationRequests,   {FHIR.canonical{value: ''}})"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="2"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Coverage"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Coverage&quot;:   [Coverage] Coverages   where exists(     &quot;Initial Population&quot; IP     where Coverages.period overlaps IP.period)   return CoverageResource(Coverages,   {FHIR.canonical{value: ''}})"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="3"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE IP Encounters"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE IP Encounters&quot;:   &quot;Initial Population&quot; IP   return EncounterResource(IP,    {FHIR.canonical{value: ''}})"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="4"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Observation Lab Category"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Observation Lab Category&quot;:   [Observation] 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 ObservationLabResource(Observations,   {FHIR.canonical{value: ''}})"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="5"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Minimal Patient"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define &quot;SDE Minimal Patient&quot;:   Patient p   return PatientResource(p,   {FHIR.canonical{value: ''}})"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="6"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Medication"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="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 MedicationResource(GetMedicationFrom(MedReqOrAdmin.medication),   {FHIR.canonical{value: ''}})"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="7"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="SDE Specimen"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="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: ''}})"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="8"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToInterval"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToInterval(period FHIR.Period):     if period is null then         null      else          if period.&quot;start&quot;.value is null then             Interval(period.&quot;start&quot;.value, period.&quot;end&quot;.value]         else              if time from period.&quot;start&quot;.value is null and time from period.&quot;end&quot;.value is not null then                 Interval[                     DateTime(year from period.&quot;start&quot;.value, month from period.&quot;start&quot;.value, day from period.&quot;start&quot;.value,                         0, 0, 0, 0, timezoneoffset from period.&quot;end&quot;.value),                      period.&quot;end&quot;.value                 ]         else              if time from period.&quot;end&quot;.value is null and time from period.&quot;start&quot;.value is not null then                 Interval[                     period.&quot;start&quot;.value,                      DateTime(year from period.&quot;end&quot;.value, month from period.&quot;end&quot;.value, day from period.&quot;end&quot;.value,                         23, 59, 59, 999, timezoneoffset from period.&quot;start&quot;.value)                 ]         else Interval[period.&quot;start&quot;.value, period.&quot;end&quot;.value]"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="9"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="MedicationAdministrationResource"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function MedicationAdministrationResource(medicationAdministration MedicationAdministration, profileURLs List&lt;FHIR.canonical&gt;):   medicationAdministration m   return MedicationAdministration{     id: FHIR.id {value: 'LCR-' + m.id},     meta: SharedResource.MetaElement(m, profileURLs),     extension: m.extension,     instantiates: m.instantiates,     partOf: m.partOf,     status: m.status,     statusReason: m.statusReason,     category: m.category,     medication: m.medication,     subject: m.subject,     context: m.context,     supportingInformation: m.supportingInformation,     effective: m.effective,     reasonCode: m.reasonCode,     reasonReference: m.reasonReference,     request: m.request,     dosage: MedicationAdministrationDosage(m.dosage),     eventHistory: m.eventHistory   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="10"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToString"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToString(value string): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="11"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="MetaElement"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function &quot;MetaElement&quot;(resource Resource, profileURLs List&lt;FHIR.canonical&gt;):   resource r   return FHIR.Meta{     extension: r.meta.extension,     versionId: r.meta.versionId,     lastUpdated: r.meta.lastUpdated,     profile: profileURLs,     security: r.meta.security,     tag: r.meta.tag   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="12"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="MedicationAdministrationDosage"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function MedicationAdministrationDosage(dosage FHIR.MedicationAdministration.Dosage):   dosage d   return FHIR.MedicationAdministration.Dosage{     text: d.text,     route: d.route,     method: d.method,     dose: d.dose   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="13"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToDateTime"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToDateTime(value dateTime): value.value"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="14"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="MedicationRequestResource"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function MedicationRequestResource(medicationRequest MedicationRequest, profileURLs List&lt;FHIR.canonical&gt;):   medicationRequest m   return MedicationRequest{     id: FHIR.id {value: 'LCR-' + m.id},     meta: SharedResource.MetaElement(medicationRequest, profileURLs),     extension: m.extension,     status: m.status,     statusReason: m.statusReason,     intent: m.intent,     category: m.category,     priority: m.priority,     doNotPerform: m.doNotPerform,     reported: m.reported,     medication: m.medication,     subject: m.subject,     encounter: m.encounter,     authoredOn: m.authoredOn,     requester: m.requester,     recorder: m.recorder,     reasonCode: m.reasonCode,     reasonReference: m.reasonReference,     instantiatesCanonical: m.instantiatesCanonical,     instantiatesUri: m.instantiatesUri,     courseOfTherapyType: m.courseOfTherapyType,     dosageInstruction: MedicationRequestDosageInstruction(m.dosageInstruction)   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="15"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="MedicationRequestDosageInstruction"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function MedicationRequestDosageInstruction(dosageInstruction List&lt;FHIR.Dosage&gt;):   dosageInstruction dI   return FHIR.Dosage{     text: dI.text,     timing: dI.timing,     asNeeded: dI.asNeeded,     route: dI.route,     method: dI.method,     doseAndRate: MedicationRequestDoseAndRate(dI.doseAndRate)   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="16"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="MedicationRequestDoseAndRate"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function MedicationRequestDoseAndRate(doseAndRate List&lt;FHIR.Dosage.DoseAndRate&gt;):   doseAndRate dR   return FHIR.Dosage.DoseAndRate{     type: dR.type,     dose: dR.dose,     rate: dR.rate   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="17"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="CoverageResource"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="// //Measure Specific Resource Creation Functions // define function CoverageResource(coverage Coverage, profileURLs List&lt;FHIR.canonical&gt;):   coverage c   return Coverage{     id: FHIR.id{value: 'LCR-' + c.id},     meta: SharedResource.MetaElement(c, profileURLs),     extension: c.extension,     status: c.status,     type: c.type,     subscriber: c.subscriber,     period: c.period   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="18"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="EncounterResource"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function EncounterResource(encounter Encounter, profileURLs List&lt;FHIR.canonical&gt;):   encounter e   return Encounter{     id: FHIR.id{value: 'LCR-' + e.id},     meta: SharedResource.MetaElement(e, profileURLs),     extension: e.extension,     identifier: SharedResource.EncounterIdentifier(e.identifier),     status: e.status,     statusHistory: SharedResource.EncounterStatusHistory(e.statusHistory),     class: e.class,     classHistory: SharedResource.EncounterClassHistory(e.classHistory),     type: e.type,     subject: e.subject,     period: e.period,     length: e.length,     reasonCode: e.reasonCode,     reasonReference: e.reasonReference,     hospitalization: EncounterHospitalization(e.hospitalization),     partOf: e.partOf   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="19"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="EncounterIdentifier"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function EncounterIdentifier(identifier List&lt;FHIR.Identifier&gt;):   identifier i   return FHIR.Identifier{     use: i.use,     type: i.type,     system: i.system,     value: i.value,     period: i.period   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="20"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="EncounterStatusHistory"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function EncounterStatusHistory(statusHistory List&lt;FHIR.Encounter.StatusHistory&gt;):   statusHistory sH   return FHIR.Encounter.StatusHistory{     status: sH.status,     period: sH.period   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="21"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="EncounterClassHistory"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function EncounterClassHistory(classHistory List&lt;FHIR.Encounter.ClassHistory&gt;):   classHistory cH   return FHIR.Encounter.ClassHistory{     class: cH.class,     period: cH.period   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="22"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="EncounterHospitalization"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function EncounterHospitalization(hospitalization FHIR.Encounter.Hospitalization):   hospitalization h   return FHIR.Encounter.Hospitalization{     origin: h.origin,     admitSource: h.admitSource,     reAdmission: h.reAdmission,     dischargeDisposition: h.dischargeDisposition   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="23"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToConcept"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToConcept(concept FHIR.CodeableConcept):     if concept is null then         null     else         System.Concept {             codes: concept.coding C return ToCode(C),             display: concept.text.value         }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="24"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="FHIRHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="ToCode"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ToCode(coding FHIR.Coding):     if coding is null then         null     else         System.Code {           code: coding.code.value,           system: coding.system.value,           version: coding.version.value,           display: coding.display.value         }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="25"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="ObservationLabResource"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ObservationLabResource(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,     basedOn: o.basedOn,     partOf: o.partOf,     status: o.status,     category: ObservationLabCategory(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)   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="26"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="ObservationLabCategory"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ObservationLabCategory(category List&lt;CodeableConcept&gt;):   category c   return CodeableConcept{     coding: ObservationLabCoding(c.coding),     text: c.text   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="27"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="ObservationLabCoding"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ObservationLabCoding(coding List&lt;Coding&gt;):   coding c   return Coding{     id: c.id,     extension: c.extension,     system: c.system,     code: c.code   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="28"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="ObservationReferenceRange"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ObservationReferenceRange(referenceRange List&lt;FHIR.Observation.ReferenceRange&gt;):   referenceRange rR   return FHIR.Observation.ReferenceRange{     low: rR.low,     high: rR.high,     type: rR.type,     appliesTo: rR.appliesTo,     age: rR.age,     text: rR.text   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="29"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="ObservationComponent"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function ObservationComponent(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: c.referenceRange   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="30"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="PatientResource"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function PatientResource(patient Patient, profileURLs List&lt;FHIR.canonical&gt;):   patient p   return Patient{     id: FHIR.id{value: 'LCR-' + p.id},     meta: SharedResource.MetaElement(p, profileURLs),     extension: GetPatientExtensions(p),     identifier: p.identifier,     active: p.active,     name: SharedResource.PatientName(p.name),     telecom: SharedResource.PatientTelecom(p.telecom),     gender: p.gender,     birthDate: p.birthDate,     deceased: p.deceased,     address: SharedResource.PatientAddress(p.address),     maritalStatus: p.maritalStatus,     multipleBirth: p.multipleBirth,     photo: p.photo,     contact: SharedResource.PatientContact(p.contact),     communication: SharedResource.PatientCommunication(p.communication),     generalPractitioner: p.generalPractitioner,     managingOrganization: p.managingOrganization,     link: PatientLink(p.link)   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="31"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="GetPatientExtensions"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function &quot;GetPatientExtensions&quot;(domainResource DomainResource):   domainResource.extension E   where E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'     or E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'     or E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-tribal-affiliation'     or E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex'     or E.url.value = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex'   return E"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="32"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="PatientName"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="/* No longer needed but saving in case it's useful later define function PatientIdentifier(identifier List&lt;FHIR.Identifier&gt;):   identifier i   return FHIR.Identifier{     id: i.id,     extension: i.extension,     use: i.use,     type: i.type,     system: i.system,     value: i.value,     period: i.period,     assigner: i.assigner   }*/  define function PatientName(name List&lt;FHIR.HumanName&gt;):   name n   return FHIR.HumanName{     id: n.id,     extension: n.extension,     use: n.use,     text: n.text,     family: n.family,     given: n.given,     prefix: n.prefix,     suffix: n.suffix,     period: n.period   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="33"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="PatientTelecom"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function PatientTelecom(telecom List&lt;FHIR.ContactPoint&gt;):   telecom t   return FHIR.ContactPoint{     system: t.system,     value: t.value,     use: t.use,     rank: t.rank,     period: t.period   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="34"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="PatientAddress"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function PatientAddress(address List&lt;FHIR.Address&gt;):   address a   return FHIR.Address{     use: a.use,     type: a.type,     text: a.text,     line: a.line,     city: a.city,     district: a.district,     state: a.state,     postalCode: a.postalCode,     country: a.country,     period: a.period   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="35"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="PatientContact"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function PatientContact(contact List&lt;FHIR.Patient.Contact&gt;):   contact c   return FHIR.Patient.Contact{     relationship: c.relationship,     name: c.name,     telecom: c.telecom,     address: c.address,     gender: c.gender,     organization: c.organization,     period: c.period   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="36"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="PatientCommunication"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function PatientCommunication(communication List&lt;FHIR.Patient.Communication&gt;):   communication c   return FHIR.Patient.Communication{     language: c.language,     preferred: c.preferred   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="37"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="PatientLink"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function PatientLink(link List&lt;FHIR.Patient.Link&gt;):   link l   return FHIR.Patient.Link{     id: l.id,     other: l.other,     type: l.type   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="38"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="MedicationResource"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function MedicationResource(medication Medication, profileURLs List&lt;FHIR.canonical&gt;):   medication m   return Medication{     id: FHIR.id {value: 'LCR-' + m.id},     meta: SharedResource.MetaElement(m, profileURLs),     extension: m.extension,     code: m.code,     status: m.status,     form: m.form,     amount: m.amount,     ingredient: SharedResource.MedicationIngredient(m.ingredient)   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="39"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="MedicationIngredient"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function MedicationIngredient(ingredient List&lt;FHIR.Medication.Ingredient&gt;):   ingredient i   return FHIR.Medication.Ingredient{     item: i.item,     strength: i.strength   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="40"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="GetMedicationFrom"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="// //Functions // 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"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="41"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNLongTermCareMonthlyInitialPopulation"/>
        </extension>
        <extension url="name">
          <valueString value="GetMedication"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function &quot;GetMedication&quot;(reference Reference):   singleton from (     [Medication] Medications     where Medications.id = NHSNHelpers.GetId(reference.reference)   )"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="42"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="NHSNHelpers"/>
        </extension>
        <extension url="name">
          <valueString value="GetId"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function &quot;GetId&quot;(uri String ):   Last(Split(uri, '/'))"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="43"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="SpecimenResource"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function SpecimenResource(specimen Specimen, profileURLs List&lt;FHIR.canonical&gt;):   specimen s   return Specimen{     id: FHIR.id {value: 'LCR-' + s.id},     meta: MetaElement(s, profileURLs),     extension: s.extension,     identifier: s.identifier,     accessionIdentifier: s.accessionIdentifier,     status: s.status,     type: s.type,     subject: s.subject,     receivedTime: s.receivedTime,     parent: s.parent,     request: s.request,     collection: SpecimenCollection(s.collection),     processing: SpecimenProcessing(s.processing),     container: SpecimenContainer(s.container),     condition: s.condition,     note: s.note   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="44"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="SpecimenCollection"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function SpecimenCollection(collection FHIR.Specimen.Collection):   collection c   return FHIR.Specimen.Collection{     collector: c.collector,     collected: c.collected,     &quot;duration&quot;: c.&quot;duration&quot;,     quantity: c.quantity,     method: c.method,     bodySite: c.bodySite,     fastingStatus: c.fastingStatus   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="45"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="SpecimenProcessing"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function SpecimenProcessing(processing List&lt;FHIR.Specimen.Processing&gt;):   processing p   return FHIR.Specimen.Processing{     description: p.description,     procedure: p.procedure,     additive: p.additive,     time: p.time   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="46"/>
        </extension>
      </extension>
      <extension
                 url="http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition">
        <extension url="libraryName">
          <valueString value="SharedResourceCreation"/>
        </extension>
        <extension url="name">
          <valueString value="SpecimenContainer"/>
        </extension>
        <extension url="statement">
          <valueString
                       value="define function SpecimenContainer(container List&lt;FHIR.Specimen.Container&gt;):   container c   return FHIR.Specimen.Container{     description: c.description,     type: c.type,     capacity: c.capacity,     specimenQuantity: c.specimenQuantity,     additive: c.additive   }"/>
        </extension>
        <extension url="displaySequence">
          <valueInteger value="47"/>
        </extension>
      </extension>
      <name value="EffectiveDataRequirements"/>
      <status value="active"/>
      <type>
        <coding>
          <system value="http://terminology.hl7.org/CodeSystem/library-type"/>
          <code value="module-definition"/>
        </coding>
      </type>
      <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 Observation Category"/>
        <resource
                  value="http://terminology.hl7.org/CodeSystem/observation-category|1.0.1"/>
      </relatedArtifact>
      <parameter>
        <name value="Measurement Period"/>
        <use value="in"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Period"/>
      </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 Coverage"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Coverage"/>
      </parameter>
      <parameter>
        <name value="SDE IP Encounters"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="SDE Observation Lab Category"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Observation"/>
      </parameter>
      <parameter>
        <name value="Initial Population"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Encounter"/>
      </parameter>
      <parameter>
        <name value="SDE Minimal Patient"/>
        <use value="out"/>
        <min value="0"/>
        <max value="1"/>
        <type value="Patient"/>
      </parameter>
      <parameter>
        <name value="SDE Medication"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Medication"/>
      </parameter>
      <parameter>
        <name value="SDE Specimen"/>
        <use value="out"/>
        <min value="0"/>
        <max value="*"/>
        <type value="Specimen"/>
      </parameter>
      <dataRequirement>
        <type value="Encounter"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
        <mustSupport value="period"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="identifier"/>
        <mustSupport value="status"/>
        <mustSupport value="statusHistory"/>
        <mustSupport value="class"/>
        <mustSupport value="classHistory"/>
        <mustSupport value="type"/>
        <mustSupport value="subject"/>
        <mustSupport value="length"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="reasonReference"/>
        <mustSupport value="hospitalization"/>
        <mustSupport value="partOf"/>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationAdministration"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
        <mustSupport value="effective"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="instantiates"/>
        <mustSupport value="partOf"/>
        <mustSupport value="status"/>
        <mustSupport value="statusReason"/>
        <mustSupport value="category"/>
        <mustSupport value="medication"/>
        <mustSupport value="subject"/>
        <mustSupport value="context"/>
        <mustSupport value="supportingInformation"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="reasonReference"/>
        <mustSupport value="request"/>
        <mustSupport value="dosage"/>
        <mustSupport value="eventHistory"/>
      </dataRequirement>
      <dataRequirement>
        <type value="MedicationRequest"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/MedicationRequest"/>
        <mustSupport value="authoredOn"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="status"/>
        <mustSupport value="statusReason"/>
        <mustSupport value="intent"/>
        <mustSupport value="category"/>
        <mustSupport value="priority"/>
        <mustSupport value="doNotPerform"/>
        <mustSupport value="reported"/>
        <mustSupport value="medication"/>
        <mustSupport value="subject"/>
        <mustSupport value="encounter"/>
        <mustSupport value="requester"/>
        <mustSupport value="recorder"/>
        <mustSupport value="reasonCode"/>
        <mustSupport value="reasonReference"/>
        <mustSupport value="instantiatesCanonical"/>
        <mustSupport value="instantiatesUri"/>
        <mustSupport value="courseOfTherapyType"/>
        <mustSupport value="dosageInstruction"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Coverage"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Coverage"/>
        <mustSupport value="period"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="status"/>
        <mustSupport value="type"/>
        <mustSupport value="subscriber"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Observation"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
        <mustSupport value="category"/>
        <mustSupport value="effective"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="basedOn"/>
        <mustSupport value="partOf"/>
        <mustSupport value="status"/>
        <mustSupport value="code"/>
        <mustSupport value="subject"/>
        <mustSupport value="focus"/>
        <mustSupport value="encounter"/>
        <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="Patient"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
        <mustSupport value="id"/>
        <mustSupport value="identifier"/>
        <mustSupport value="active"/>
        <mustSupport value="name"/>
        <mustSupport value="telecom"/>
        <mustSupport value="gender"/>
        <mustSupport value="birthDate"/>
        <mustSupport value="deceased"/>
        <mustSupport value="address"/>
        <mustSupport value="maritalStatus"/>
        <mustSupport value="multipleBirth"/>
        <mustSupport value="photo"/>
        <mustSupport value="contact"/>
        <mustSupport value="communication"/>
        <mustSupport value="generalPractitioner"/>
        <mustSupport value="managingOrganization"/>
        <mustSupport value="link"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Medication"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Medication"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="code"/>
        <mustSupport value="status"/>
        <mustSupport value="form"/>
        <mustSupport value="amount"/>
        <mustSupport value="ingredient"/>
      </dataRequirement>
      <dataRequirement>
        <type value="Specimen"/>
        <profile value="http://hl7.org/fhir/StructureDefinition/Specimen"/>
        <mustSupport value="collection"/>
        <mustSupport value="collection.collected"/>
        <mustSupport value="id"/>
        <mustSupport value="extension"/>
        <mustSupport value="identifier"/>
        <mustSupport value="accessionIdentifier"/>
        <mustSupport value="status"/>
        <mustSupport value="type"/>
        <mustSupport value="subject"/>
        <mustSupport value="receivedTime"/>
        <mustSupport value="parent"/>
        <mustSupport value="request"/>
        <mustSupport value="processing"/>
        <mustSupport value="container"/>
        <mustSupport value="condition"/>
        <mustSupport value="note"/>
      </dataRequirement>
    </Library>
  </contained>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-populationBasis">
    <valueCode value="Encounter"/>
  </extension>
  <extension
             url="http://hl7.org/fhir/us/cqfmeasures/StructureDefinition/cqfm-softwaresystem">
    <valueReference>🔗 
      <reference value="Device/cqf-tooling"/>
    </valueReference>
  </extension>
  <extension
             url="http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements">
    <valueCanonical value="#effective-data-requirements"/>
  </extension>
  <url
       value="http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Measure/NHSNLongTermCareMonthlyInitialPopulation"/>
  <identifier>
    <system value="https://nhsnlink.org"/>
    <value value="NHSNLongTermCareMonthlyInitialPopulation"/>
  </identifier>
  <version value="2.0.0-cibuild"/>
  <name value="NHSNLongTermCareMonthlyInitialPopulation"/>
  <title value="NHSN Long Term Care Monthly Initial Population"/>
  <status value="draft"/>
  <experimental value="false"/>
  <date value="2025-11-10T11:09:17-05: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>
  <description
               value="The Long Term Care Initial Population includes all encounters that overlap the measurement period."/>
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166"/>
      <code value="US"/>
    </coding>
  </jurisdiction>
  <copyright
             value="Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets."/>
  <relatedArtifact>
    <type value="documentation"/>
    <display
             value="https://www.cdc.gov/nhsn/index.html [placeholder for link to protocol on CDC website]"/>
    <url value="https://www.cdc.gov/nhsn/index.html"/>
    <document>
      <url value="https://www.cdc.gov/nhsn/index.html"/>
    </document>
  </relatedArtifact>
  <library
           value="http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNLongTermCareMonthlyInitialPopulation"/>
  <disclaimer
              value="This performance measure is not a clinical guideline, does not establish a standard of medical care and has not been tested for all potential applications.        THE MEASURES AND SPECIFICATIONS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND.        This measure and specifications are subject to further revisions."/>
  <scoring>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/measure-scoring"/>
      <code value="cohort"/>
      <display value="Cohort"/>
    </coding>
  </scoring>
  <type>
    <coding>
      <system value="http://terminology.hl7.org/CodeSystem/measure-type"/>
      <code value="outcome"/>
      <display value="Outcome"/>
    </coding>
  </type>
  <rationale
             value="The NHSN Acute Care Hospital Monthly dQM allows for facilities to report line level patient data electronically to NHSN for the following modules that are reported monthly: Glycemic Control, Hypoglycemia; Healthcare facility-onset, antibiotic-Treated Clostridioides difficile (C. difficile) Infection (HT-CDI); Hospital-Onset Bacteremia &amp; Fungemia (HOB); Venous Thromboembolism (VTE); Late Onset Sepsis / Meningitis. *Please see [Acute Care / Critical Access Hospitals (ACH) | NHSN | CDC](https://www.cdc.gov/nhsn/acute-care-hospital/index.html) for the individual measure protocols."/>
  <group>
    <population id="initial-population">
      <code>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/measure-population"/>
          <code value="initial-population"/>
          <display value="Initial Population"/>
        </coding>
      </code>
      <description
                   value="All encounters for patients of any age in an ED, observation, or inpatient location or all encounters for patients of any age with an ED, observation, inpatient, or short stay status during the measurement period."/>
      <criteria>
        <language value="text/cql-identifier"/>
        <expression value="Initial Population"/>
      </criteria>
    </population>
  </group>
  <supplementalData id="sde-medication-administration">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Medication Administration"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Medication Administration"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-medication-request">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Medication Request"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Medication Request"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-medication">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Medication"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Medication"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-observation-lab-category">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Observation Lab Category"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Observation Lab Category"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-coverage">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Coverage"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Coverage"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-specimen">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Specimen"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Specimen"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-minimal-patient">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE Minimal Patient"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE Minimal Patient"/>
    </criteria>
  </supplementalData>
  <supplementalData id="sde-ip-encounters">
    <usage>
      <coding>
        <system
                value="http://terminology.hl7.org/CodeSystem/measure-data-usage"/>
        <code value="supplemental-data"/>
      </coding>
    </usage>
    <description value="SDE IP Encounters"/>
    <criteria>
      <language value="text/cql-identifier"/>
      <expression value="SDE IP Encounters"/>
    </criteria>
  </supplementalData>
</Measure>