National Healthcare Safety Network (NHSN) Digital Quality Measure (dQM) Reporting Implementation Guide, published by HL7 International / Public Health. This guide is not an authorized publication; it is the continuous build for version 1.0.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/nhsn-dqm/ and changes regularly. See the Directory of published versions
Page standards status: Informative |
<Library xmlns="http://hl7.org/fhir">
<id value="NHSNdQMAcuteCareHospitalInitialPopulationLibrary"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: Library NHSNdQMAcuteCareHospitalInitialPopulationLibrary</b></p><a name="NHSNdQMAcuteCareHospitalInitialPopulationLibrary"> </a><a name="hcNHSNdQMAcuteCareHospitalInitialPopulationLibrary"> </a><a name="NHSNdQMAcuteCareHospitalInitialPopulationLibrary-en-US"> </a><h2>Related Artifacts</h2><table class="grid"><tr><td>Depends On</td><td>FHIR model information</td><td><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></td></tr><tr><td>Depends On</td><td>Library FHIRHelpers</td><td><a href="http://fhir.org/guides/cqf/common/4.0.1/4.0.1/Library-FHIRHelpers.html">http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1</a></td></tr><tr><td>Depends On</td><td>Library Global</td><td><a href="http://hl7.org/fhir/us/cqfmeasures/STU4/Library-MATGlobalCommonFunctions.html">http://hl7.org/fhir/us/cqfmeasures/Library/MATGlobalCommonFunctions</a></td></tr><tr><td>Depends On</td><td>Library SDE</td><td><a href="http://hl7.org/fhir/us/cqfmeasures/STU4/Library-SupplementalDataElements.html">http://hl7.org/fhir/us/cqfmeasures/Library/SupplementalDataElements</a></td></tr><tr><td>Depends On</td><td>Code system ActCode</td><td><a href="http://terminology.hl7.org/5.5.0/CodeSystem-v3-ActCode.html">ActCode</a></td></tr><tr><td>Depends On</td><td>Code system Observation Category</td><td><a href="http://terminology.hl7.org/5.5.0/CodeSystem-observation-category.html">Observation Category Codes</a></td></tr><tr><td>Depends On</td><td>Code system LOINC</td><td><a href="http://terminology.hl7.org/5.5.0/CodeSystem-v3-loinc.html">Logical Observation Identifiers, Names and Codes (LOINC)</a></td></tr><tr><td>Depends On</td><td>Code system V2-0074</td><td><a href="http://terminology.hl7.org/5.2.0/CodeSystem-v2-0074.html">diagnosticServiceSectionId</a></td></tr><tr><td>Depends On</td><td>Value set Inpatient, Emergency, and Observation Locations</td><td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1046.265/expansion">Inpatient, Emergency, and Observation Locations</a></td></tr><tr><td>Depends On</td><td>Value set Emergency Department Visit</td><td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion">Emergency Department Visit</a></td></tr><tr><td>Depends On</td><td>Value set Encounter Inpatient</td><td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a></td></tr><tr><td>Depends On</td><td>Value set Observation Services</td><td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion">Observation Services</a></td></tr><tr><td>Depends On</td><td>Value set NHSN Inpatient Encounter Class Codes</td><td><a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1046.274/expansion">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274</a></td></tr></table><h2>Parameters</h2><table class="grid"><tr><td>Measurement Period</td><td>in</td><td>0</td><td>1</td><td>Period</td></tr><tr><td>Patient</td><td>out</td><td>0</td><td>1</td><td>Patient</td></tr><tr><td>Qualifying Encounters During Measurement Period</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>Encounters</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>Encounters with Patient Hospital Locations</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>Initial Population</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>DiagnosticReports</td><td>out</td><td>0</td><td>*</td><td>DiagnosticReport</td></tr><tr><td>Observations</td><td>out</td><td>0</td><td>*</td><td>Observation</td></tr><tr><td>IP Encounters Overlap Measurement Period</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>Get Locations from IP Encounters in Measurement Period</td><td>out</td><td>0</td><td>*</td><td>Location</td></tr><tr><td>SDE Condition</td><td>out</td><td>0</td><td>*</td><td>Condition</td></tr><tr><td>SDE Device</td><td>out</td><td>0</td><td>*</td><td>Device</td></tr><tr><td>SDE DiagnosticReport Lab</td><td>out</td><td>0</td><td>*</td><td>DiagnosticReport</td></tr><tr><td>SDE DiagnosticReport Note</td><td>out</td><td>0</td><td>*</td><td>DiagnosticReport</td></tr><tr><td>SDE DiagnosticReport Others</td><td>out</td><td>0</td><td>*</td><td>DiagnosticReport</td></tr><tr><td>SDE Encounter</td><td>out</td><td>0</td><td>*</td><td>Encounter</td></tr><tr><td>SDE Location</td><td>out</td><td>0</td><td>*</td><td>Location</td></tr><tr><td>SDE Medication Administration</td><td>out</td><td>0</td><td>*</td><td>MedicationAdministration</td></tr><tr><td>SDE Medication Request</td><td>out</td><td>0</td><td>*</td><td>MedicationRequest</td></tr><tr><td>SDE Medication</td><td>out</td><td>0</td><td>*</td><td>Medication</td></tr><tr><td>SDE Observation Lab Category</td><td>out</td><td>0</td><td>*</td><td>Observation</td></tr><tr><td>SDE Observation Vital Signs Category</td><td>out</td><td>0</td><td>*</td><td>Observation</td></tr><tr><td>SDE Observation Category</td><td>out</td><td>0</td><td>*</td><td>Observation</td></tr><tr><td>SDE Coverage</td><td>out</td><td>0</td><td>*</td><td>Coverage</td></tr><tr><td>SDE Procedure</td><td>out</td><td>0</td><td>*</td><td>Procedure</td></tr><tr><td>SDE Specimen</td><td>out</td><td>0</td><td>*</td><td>Specimen</td></tr><tr><td>SDE Service Request</td><td>out</td><td>0</td><td>*</td><td>ServiceRequest</td></tr><tr><td>SDE Minimal Patient</td><td>out</td><td>0</td><td>1</td><td>Patient</td></tr></table><h2>Data Requirements</h2><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/patient.html">Patient</a> (<a href="http://hl7.org/fhir/R4/patient.html">Patient</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> (<a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>)</td></tr><tr style="background-color: #efefef"><td>Filter</td><td>Value</td></tr><tr><td>type</td><td>In ValueSet <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion">Encounter Inpatient</a></td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> (<a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>)</td></tr><tr style="background-color: #efefef"><td>Filter</td><td>Value</td></tr><tr><td>type</td><td>In ValueSet <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion">Emergency Department Visit</a></td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> (<a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>)</td></tr><tr style="background-color: #efefef"><td>Filter</td><td>Value</td></tr><tr><td>type</td><td>In ValueSet <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion">Observation Services</a></td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> (<a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>)</td></tr><tr style="background-color: #efefef"><td>Filter</td><td>Value</td></tr><tr><td>class</td><td>In ValueSet <a href="https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1046.274/expansion">http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274</a></td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a> (<a href="http://hl7.org/fhir/R4/encounter.html">Encounter</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/location.html">Location</a> (<a href="http://hl7.org/fhir/R4/location.html">Location</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/diagnosticreport.html">DiagnosticReport</a> (<a href="http://hl7.org/fhir/R4/diagnosticreport.html">DiagnosticReport</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/observation.html">Observation</a> (<a href="http://hl7.org/fhir/R4/observation.html">Observation</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/condition.html">Condition</a> (<a href="http://hl7.org/fhir/R4/condition.html">Condition</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/device.html">Device</a> (<a href="http://hl7.org/fhir/R4/device.html">Device</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a> (<a href="http://hl7.org/fhir/R4/medicationadministration.html">MedicationAdministration</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a> (<a href="http://hl7.org/fhir/R4/medicationrequest.html">MedicationRequest</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/medication.html">Medication</a> (<a href="http://hl7.org/fhir/R4/medication.html">Medication</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/coverage.html">Coverage</a> (<a href="http://hl7.org/fhir/R4/coverage.html">Coverage</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/procedure.html">Procedure</a> (<a href="http://hl7.org/fhir/R4/procedure.html">Procedure</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/specimen.html">Specimen</a> (<a href="http://hl7.org/fhir/R4/specimen.html">Specimen</a>)</td></tr></table><table class="grid"><tr><td colspan="2"><b>Type</b>: <a href="http://hl7.org/fhir/R4/servicerequest.html">ServiceRequest</a> (<a href="http://hl7.org/fhir/R4/servicerequest.html">ServiceRequest</a>)</td></tr></table><h2>Contents</h2><p><code>text/cql</code></p><pre><code>library NHSNdQMAcuteCareHospitalInitialPopulation version '0.0.014'
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1' called FHIRHelpers
include MATGlobalCommonFunctionsFHIR4 version '6.1.000' called Global
include SupplementalDataElementsFHIR4 version '2.0.000' called SDE
include SharedResourceCreation version '0.1.005' called SharedResource
codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'
codesystem "Observation Category": 'http://terminology.hl7.org/CodeSystem/observation-category'
codesystem "LOINC": 'http://loinc.org'
codesystem "V2-0074": 'http://terminology.hl7.org/CodeSystem/v2-0074'
valueset "Inpatient, Emergency, and Observation Locations": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265'
valueset "Emergency Department Visit": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'
valueset "Encounter Inpatient": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'
valueset "Observation Services": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'
valueset "NHSN Inpatient Encounter Class Codes": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274'
//code for Observation Category
code "laboratory": 'laboratory' from "Observation Category" display 'Laboratory'
code "social-history": 'social-history' from "Observation Category" display 'Social History'
code "vital-signs": 'vital-signs' from "Observation Category" display 'Vital Signs'
code "imaging": 'imaging' from "Observation Category" display 'Imaging'
code "procedure": 'procedure' from "Observation Category" display 'Procedure'
code "survey": 'survey' from "Observation Category" display 'Survey'
//code for Diagnostic Report Category
code "LAB": 'LAB' from "V2-0074" display 'Laboratory'
code "Radiology": 'LP29684-5' from "LOINC" display 'Radiology'
code "Pathology": 'LP7839-6' from "LOINC" display 'Pathology'
code "Cardiology": 'LP29708-2' from "LOINC" display 'Cardiology'
parameter "Measurement Period"
default Interval[@2024-01-01T00:00:00.0, @2024-01-31T00:00:00.0)
context Patient
define "Qualifying Encounters During Measurement Period":
( [Encounter: "Encounter Inpatient"]
union [Encounter: "Emergency Department Visit"]
union [Encounter: "Observation Services"]
union [Encounter: class in "NHSN Inpatient Encounter Class Codes"]) QualifyingEncounters
where QualifyingEncounters.status in {'in-progress', 'finished', 'triaged', 'onleave', 'entered-in-error'}
and QualifyingEncounters.period overlaps "Measurement Period"
define "Encounters with Patient Hospital Locations":
"Encounters" Encounters
where exists(
Encounters.location EncounterLocation
where Global.GetLocation(EncounterLocation.location).type in "Inpatient, Emergency, and Observation Locations"
and EncounterLocation.period overlaps Encounters.period
)
and Encounters.status in {'in-progress', 'finished', 'triaged', 'onleave', 'entered-in-error'}
and Encounters.period overlaps "Measurement Period"
define "Initial Population":
"Qualifying Encounters During Measurement Period"
union "Encounters with Patient Hospital Locations"
define "Encounters":
[Encounter]
define "DiagnosticReports":
[DiagnosticReport]
define "Observations":
[Observation]
//Double checking for IP's period during MP as IP is created out of qualifying encounters, which checks for it,
//and encounter's locations, which doesn't
define "IP Encounters Overlap Measurement Period":
"Initial Population" IP
where IP.period overlaps "Measurement Period"
define "Get Locations from IP Encounters in Measurement Period":
flatten("IP Encounters Overlap Measurement Period" Encounters
let locationElements: Encounters.location
return
locationElements LE
let locationReference: LE.location
return Global.GetLocation(locationReference))
//============================================================================
//Supplemental Data Element
//When FHIR.canonical value is present, US Core 3.1.1 profiles are used
//When FHIR.canonical value is not present, FHIR Base profiles are used
//============================================================================
define "SDE Condition":
[Condition] Conditions
where exists("Initial Population")
return SharedResource.ConditionResource(Conditions,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-condition'}})
define "SDE Device":
[Device] Devices
where exists("Initial Population")
return DeviceResource(Devices,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-device'}})
define "SDE DiagnosticReport Lab":
"DiagnosticReports" DiagnosticReports
where (exists(DiagnosticReports.category Category where Category ~ "LAB")
and exists(
"Initial Population" IP
where Global."Normalize Interval"(DiagnosticReports.effective) overlaps IP.period))
return SharedResource.DiagnosticReportLabResource(DiagnosticReports,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-diagnosticreport-lab'}})
define "SDE DiagnosticReport Note":
"DiagnosticReports" DiagnosticReports
where ((exists(DiagnosticReports.category Category where Category ~ "Radiology"))
or exists((DiagnosticReports.category Category where Category ~ "Pathology"))
or exists((DiagnosticReports.category Category where Category ~ "Cardiology")))
and exists(
"Initial Population" IP
where Global."Normalize Interval"(DiagnosticReports.effective) overlaps IP.period)
return DiagnosticReportResource(DiagnosticReports,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-diagnosticreport-note'}})
define "SDE DiagnosticReport Others":
[DiagnosticReport] DiagnosticReports
where not ((exists(DiagnosticReports.category Category where Category ~ "Radiology"))
or exists((DiagnosticReports.category Category where Category ~ "Pathology"))
or exists((DiagnosticReports.category Category where Category ~ "Cardiology"))
or exists(DiagnosticReports.category Category where Category ~ "LAB"))
and exists("Initial Population" IP
where Global."Normalize Interval"(DiagnosticReports.effective) overlaps IP.period)
return DiagnosticReportResource(DiagnosticReports,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-diagnosticreport'}})
define "SDE Encounter":
"Encounters" Encounters
where exists(
"Initial Population" IP
where Encounters.period overlaps IP.period)
return EncounterResource(Encounters,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-encounter'}})
define "SDE Location":
"Get Locations from IP Encounters in Measurement Period" Locations
where exists("Initial Population")
and Locations is not null
return SharedResource.LocationResource(Locations,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-location'}})
define "SDE Medication Administration":
[MedicationAdministration] MedicationAdministrations
where exists(
"Initial Population" IP
where Global."Normalize Interval"(MedicationAdministrations.effective) overlaps IP.period)
return SharedResource.MedicationAdministrationResource(MedicationAdministrations,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-medicationadministration'}})
define "SDE Medication Request":
[MedicationRequest] MedicationRequests
where exists(
"Initial Population" IP
where MedicationRequests.authoredOn during IP.period)
return SharedResource.MedicationRequestResource(MedicationRequests,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-medicationrequest'}})
define "SDE Medication":
("SDE Medication Request"
union "SDE Medication Administration") MedReqOrAdmin
where MedReqOrAdmin.medication is FHIR.Reference
and exists("Initial Population") //No longer need to check for timing here because it's checked in SDE Medication Request/Administriation
return SharedResource.MedicationResource(GetMedicationFrom(MedReqOrAdmin.medication),
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-medication'}})
define "SDE Observation Lab Category":
"Observations" Observations
where (exists(Observations.category Category where Category ~ "laboratory"))
and exists(
"Initial Population" IP
where Global."Normalize Interval"(Observations.effective) overlaps IP.period)
return SharedResource.ObservationLabResource(Observations,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-observation-lab'}})
//Vital Signs Observation has its own profile in FHIR Base
define "SDE Observation Vital Signs Category":
"Observations" Observations
where (exists(Observations.category Category where Category ~ "vital-signs"))
and exists(
"Initial Population" IP
where Global."Normalize Interval"(Observations.effective) overlaps IP.period)
return ObservationVitalSignsResource(Observations,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-observation-vitals'}})
//Defaulting to base FHIR profile as there are no individual profiles in US Core 3.1.1 that cover these Observation categories
define "SDE Observation Category":
"Observations" Observations
where ((exists(Observations.category Category where Category ~ "social-history"))
or (exists(Observations.category Category where Category ~ "survey"))
or (exists(Observations.category Category where Category ~ "imaging"))
or (exists(Observations.category Category where Category ~ "procedure")))
and exists(
"Initial Population" IP
where Global."Normalize Interval"(Observations.effective) overlaps IP.period)
return ObservationResource(Observations,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-observation'}})
define "SDE Coverage":
[Coverage] Coverages
where exists(
"Initial Population" IP
where Coverages.period overlaps IP.period)
return SharedResource.CoverageResource(Coverages,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-coverage'}})
define "SDE Procedure":
[Procedure] Procedures
where exists(
"Initial Population" IP
where Global."Normalize Interval"(Procedures.performed) overlaps IP.period)
return SharedResource.ProcedureResource(Procedures,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-procedure'}})
define "SDE Specimen":
[Specimen] Specimens
where exists(
"Initial Population" IP
where Global."Normalize Interval"(Specimens.collection.collected) overlaps IP.period
)
return SharedResource.SpecimenResource(Specimens,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-specimen'}})
define "SDE Service Request":
[ServiceRequest] ServiceRequests
where exists("Initial Population" IP
where ServiceRequests.authoredOn during IP.period)
return SharedResource.ServiceRequestResource(ServiceRequests,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/ach-servicerequest'}})
define "SDE Minimal Patient":
Patient p
return SharedResource.PatientResource(p,
{FHIR.canonical{value: 'http://hl7.org/fhir/us/nhsn-dqm/StructureDefinition/cross-measure-patient'}})
//
//Functions
//
define function "GetMedicationFrom"(choice Choice<FHIR.CodeableConcept, FHIR.Reference>):
case
when choice is FHIR.Reference then
GetMedication(choice as FHIR.Reference)
else
null
end
define function "GetMedication"(reference Reference ):
singleton from (
[Medication] Medications
where Medications.id = Global.GetId(reference.reference)
)
//
//Measure Specific Resource Creation Functions
//
define function DeviceUdiCarrier(udiCarrier List<FHIR.Device.UdiCarrier>):
udiCarrier u
return FHIR.Device.UdiCarrier{
deviceIdentifier: u.deviceIdentifier,
issuer: u.issuer,
jurisdiction: u.jurisdiction,
carrierAIDC: u.carrierAIDC,
carrierHRF: u.carrierHRF,
entryType: u.entryType
}
define function DeviceDeviceName(deviceName List<FHIR.Device.DeviceName>):
deviceName d
return FHIR.Device.DeviceName{
name: d.name,
type: d.type
}
define function DeviceSpecialization(specialization List<FHIR.Device.Specialization>):
specialization s
return FHIR.Device.Specialization{
systemType: s.systemType,
version: s.version
}
define function DeviceVersion(version List<FHIR.Device.Version>):
version v
return FHIR.Device.Version{
type: v.type,
component: v.component,
value: v.value
}
define function DeviceProperty(deviceProperty List<FHIR.Device.Property>):
deviceProperty d
return FHIR.Device.Property{
id: d.id,
type: d.type,
valueQuantity: d.valueQuantity,
valueCode: d.valueCode
}
define function DeviceResource(device Device, profileURLs List<FHIR.canonical>):
device d
return Device{
id: FHIR.id{value: 'LCR-' + d.id},
meta: SharedResource.MetaElement(d, profileURLs),
extension: d.extension,
definition: d.definition,
udiCarrier: DeviceUdiCarrier(d.udiCarrier),
status: d.status,
statusReason: d.statusReason,
distinctIdentifier: d.distinctIdentifier,
manufacturer: d.manufacturer,
manufactureDate: d.manufactureDate,
expirationDate: d.expirationDate,
lotNumber: d.lotNumber,
serialNumber: d.serialNumber,
deviceName: DeviceDeviceName(d.deviceName),
modelNumber: d.modelNumber,
partNumber: d.partNumber,
type: d.type,
specialization: DeviceSpecialization(d.specialization),
version: DeviceVersion(d.version),
property: DeviceProperty(d.property),
patient: d.patient,
owner: d.owner,
contact: d.contact,
location: d.location,
url: d.url,
note: d.note,
safety: d.safety,
parent: d.parent
}
define function DiagnosticReportResource(diagnosticReport DiagnosticReport, profileURLs List<FHIR.canonical>):
diagnosticReport d
return DiagnosticReport{
id: FHIR.id{value: 'LCR-' + d.id},
meta: SharedResource.MetaElement(d, profileURLs),
extension: d.extension,
basedOn: d.basedOn,
status: d.status,
category: d.category,
code: d.code,
subject: d.subject,
encounter: d.encounter,
effective: d.effective,
issued: d.issued,
performer: d.performer,
resultsInterpreter: d.resultsInterpreter,
specimen: d.specimen,
result: d.result,
conclusion: d.conclusion,
conclusionCode: d.conclusionCode
}
define function EncounterResource(encounter Encounter, profileURLs List<FHIR.canonical>):
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,
serviceType: e.serviceType,
priority: e.priority,
subject: e.subject,
period: e.period,
length: e.length,
reasonCode: e.reasonCode,
reasonReference: e.reasonReference,
diagnosis: SharedResource.EncounterDiagnosis(e.diagnosis),
account: e.account,
hospitalization: SharedResource.EncounterHospitalization(e.hospitalization),
location: SharedResource.EncounterLocation(e.location),
partOf: e.partOf
}
define function ObservationResource(observation Observation, profileURLs List<FHIR.canonical>):
observation o
return Observation{
id: FHIR.id {value: 'LCR-' + o.id},
meta: SharedResource.MetaElement(o, profileURLs),
extension: o.extension,
partOf: o.partOf,
status: o.status,
category: o.category,
code: o.code,
subject: o.subject,
focus: o.focus,
encounter: o.encounter,
effective: o.effective,
issued: o.issued,
performer: o.performer,
value: o.value,
dataAbsentReason: o.dataAbsentReason,
interpretation: o.interpretation,
note: o.note,
bodySite: o.bodySite,
method: o.method,
specimen: o.specimen,
device: o.device,
referenceRange: SharedResource.ObservationReferenceRange(o.referenceRange),
hasMember: o.hasMember,
derivedFrom: o.derivedFrom,
component: SharedResource.ObservationComponent(o.component)
}
define function ObservationVitalSignsCoding(coding List<Coding>):
coding c
return Coding{
system: c.system,
version: c.version,
code: c.code,
display: c.display,
userSelected: c.userSelected
}
define function ObservationVitalSignsCategory(category List<CodeableConcept>):
category c
return CodeableConcept{
coding: ObservationVitalSignsCoding(c.coding),
text: c.text
}
define function ObservationVitalSignsComponent(component List<FHIR.Observation.Component>):
component c
return FHIR.Observation.Component{
code: c.code,
value: c.value,
dataAbsentReason: c.dataAbsentReason,
interpretation: c.interpretation,
referenceRange: SharedResource.ObservationReferenceRange(c.referenceRange)
}
define function ObservationVitalSignsResource(observation Observation, profileURLs List<FHIR.canonical>):
observation o
return Observation{
id: FHIR.id {value: 'LCR-' + o.id},
meta: SharedResource.MetaElement(o, profileURLs),
extension: o.extension,
partOf: o.partOf,
status: o.status,
category: ObservationVitalSignsCategory(o.category),
code: o.code,
subject: o.subject,
focus: o.focus,
encounter: o.encounter,
effective: o.effective,
issued: o.issued,
performer: o.performer,
value: o.value,
dataAbsentReason: o.dataAbsentReason,
interpretation: o.interpretation,
note: o.note,
bodySite: o.bodySite,
method: o.method,
specimen: o.specimen,
device: o.device,
referenceRange: SharedResource.ObservationReferenceRange(o.referenceRange),
hasMember: o.hasMember,
derivedFrom: o.derivedFrom,
component: ObservationVitalSignsComponent(o.component)
}</code></pre></div>
</text>
<contained>
<Parameters>
<id value="ach-options"/>
<parameter>
<name value="translatorVersion"/>
<valueString value="3.5.1"/>
</parameter>
<parameter>
<name value="option"/>
<valueString value="EnableDateRangeOptimization"/>
</parameter>
<parameter>
<name value="option"/>
<valueString value="EnableAnnotations"/>
</parameter>
<parameter>
<name value="option"/>
<valueString value="EnableLocators"/>
</parameter>
<parameter>
<name value="option"/>
<valueString value="DisableListDemotion"/>
</parameter>
<parameter>
<name value="option"/>
<valueString value="DisableListPromotion"/>
</parameter>
<parameter>
<name value="analyzeDataRequirements"/>
<valueBoolean value="false"/>
</parameter>
<parameter>
<name value="collapseDataRequirements"/>
<valueBoolean value="true"/>
</parameter>
<parameter>
<name value="compatibilityLevel"/>
<valueString value="1.5"/>
</parameter>
<parameter>
<name value="enableCqlOnly"/>
<valueBoolean value="false"/>
</parameter>
<parameter>
<name value="errorLevel"/>
<valueString value="Info"/>
</parameter>
<parameter>
<name value="signatureLevel"/>
<valueString value="None"/>
</parameter>
<parameter>
<name value="validateUnits"/>
<valueBoolean value="true"/>
</parameter>
<parameter>
<name value="verifyOnly"/>
<valueBoolean value="false"/>
</parameter>
</Parameters>
</contained>
<extension url="http://hl7.org/fhir/StructureDefinition/cqf-cqlOptions">
<valueReference>
<reference value="#ach-options"/>
</valueReference>
</extension>
<url
value="http://hl7.org/fhir/us/nhsn-dqm/Library/NHSNdQMAcuteCareHospitalInitialPopulationLibrary"/>
<identifier>
<system value="urn:ietf:rfc:3986"/>
<value value="urn:oid:2.25.316204395913842452684237438142819890580.28.2"/>
</identifier>
<version value="1.0.0-ballot"/>
<name value="NHSNdQMAcuteCareHospitalInitialPopulation"/>
<status value="active"/>
<type>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/library-type"/>
<code value="logic-library"/>
</coding>
</type>
<date value="2024-11-14T20:28:17+00:00"/>
<publisher value="HL7 International / Public Health"/>
<contact>
<name value="HL7 International / Public Health"/>
<telecom>
<system value="url"/>
<value value="http://www.hl7.org/Special/committees/pher"/>
</telecom>
</contact>
<jurisdiction>
<coding>
<system value="urn:iso:std:iso:3166"/>
<code value="US"/>
<display value="United States of America"/>
</coding>
</jurisdiction>
<relatedArtifact>
<type value="depends-on"/>
<display value="FHIR model information"/>
<resource
value="http://fhir.org/guides/cqf/common/Library/FHIR-ModelInfo|4.0.1"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library FHIRHelpers"/>
<resource
value="http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library Global"/>
<resource
value="http://hl7.org/fhir/us/cqfmeasures/Library/MATGlobalCommonFunctions"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Library SDE"/>
<resource
value="http://hl7.org/fhir/us/cqfmeasures/Library/SupplementalDataElements"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Code system ActCode"/>
<resource value="http://terminology.hl7.org/CodeSystem/v3-ActCode"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Code system Observation Category"/>
<resource
value="http://terminology.hl7.org/CodeSystem/observation-category"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Code system LOINC"/>
<resource value="http://loinc.org"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Code system V2-0074"/>
<resource value="http://terminology.hl7.org/CodeSystem/v2-0074"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display
value="Value set Inpatient, Emergency, and Observation Locations"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Emergency Department Visit"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Encounter Inpatient"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set Observation Services"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"/>
</relatedArtifact>
<relatedArtifact>
<type value="depends-on"/>
<display value="Value set NHSN Inpatient Encounter Class Codes"/>
<resource
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274"/>
</relatedArtifact>
<parameter>
<name value="Measurement Period"/>
<use value="in"/>
<min value="0"/>
<max value="1"/>
<type value="Period"/>
</parameter>
<parameter>
<name value="Patient"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="Patient"/>
</parameter>
<parameter>
<name value="Qualifying Encounters During Measurement Period"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Encounter"/>
</parameter>
<parameter>
<name value="Encounters"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Encounter"/>
</parameter>
<parameter>
<name value="Encounters with Patient Hospital Locations"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Encounter"/>
</parameter>
<parameter>
<name value="Initial Population"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Encounter"/>
</parameter>
<parameter>
<name value="DiagnosticReports"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="DiagnosticReport"/>
</parameter>
<parameter>
<name value="Observations"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Observation"/>
</parameter>
<parameter>
<name value="IP Encounters Overlap Measurement Period"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Encounter"/>
</parameter>
<parameter>
<name value="Get Locations from IP Encounters in Measurement Period"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Location"/>
</parameter>
<parameter>
<name value="SDE Condition"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Condition"/>
</parameter>
<parameter>
<name value="SDE Device"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Device"/>
</parameter>
<parameter>
<name value="SDE DiagnosticReport Lab"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="DiagnosticReport"/>
</parameter>
<parameter>
<name value="SDE DiagnosticReport Note"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="DiagnosticReport"/>
</parameter>
<parameter>
<name value="SDE DiagnosticReport Others"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="DiagnosticReport"/>
</parameter>
<parameter>
<name value="SDE Encounter"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Encounter"/>
</parameter>
<parameter>
<name value="SDE Location"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Location"/>
</parameter>
<parameter>
<name value="SDE Medication Administration"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="MedicationAdministration"/>
</parameter>
<parameter>
<name value="SDE Medication Request"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="MedicationRequest"/>
</parameter>
<parameter>
<name value="SDE Medication"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Medication"/>
</parameter>
<parameter>
<name value="SDE Observation Lab Category"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Observation"/>
</parameter>
<parameter>
<name value="SDE Observation Vital Signs Category"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Observation"/>
</parameter>
<parameter>
<name value="SDE Observation Category"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Observation"/>
</parameter>
<parameter>
<name value="SDE Coverage"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Coverage"/>
</parameter>
<parameter>
<name value="SDE Procedure"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Procedure"/>
</parameter>
<parameter>
<name value="SDE Specimen"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="Specimen"/>
</parameter>
<parameter>
<name value="SDE Service Request"/>
<use value="out"/>
<min value="0"/>
<max value="*"/>
<type value="ServiceRequest"/>
</parameter>
<parameter>
<name value="SDE Minimal Patient"/>
<use value="out"/>
<min value="0"/>
<max value="1"/>
<type value="Patient"/>
</parameter>
<dataRequirement>
<type value="Patient"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
<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="Encounter"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mustSupport value="type"/>
<mustSupport value="status"/>
<mustSupport value="period"/>
<mustSupport value="location"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="identifier"/>
<mustSupport value="statusHistory"/>
<mustSupport value="class"/>
<mustSupport value="classHistory"/>
<mustSupport value="serviceType"/>
<mustSupport value="priority"/>
<mustSupport value="subject"/>
<mustSupport value="length"/>
<mustSupport value="reasonCode"/>
<mustSupport value="reasonReference"/>
<mustSupport value="diagnosis"/>
<mustSupport value="account"/>
<mustSupport value="hospitalization"/>
<mustSupport value="partOf"/>
<codeFilter>
<path value="type"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="Encounter"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mustSupport value="type"/>
<mustSupport value="status"/>
<mustSupport value="period"/>
<mustSupport value="location"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="identifier"/>
<mustSupport value="statusHistory"/>
<mustSupport value="class"/>
<mustSupport value="classHistory"/>
<mustSupport value="serviceType"/>
<mustSupport value="priority"/>
<mustSupport value="subject"/>
<mustSupport value="length"/>
<mustSupport value="reasonCode"/>
<mustSupport value="reasonReference"/>
<mustSupport value="diagnosis"/>
<mustSupport value="account"/>
<mustSupport value="hospitalization"/>
<mustSupport value="partOf"/>
<codeFilter>
<path value="type"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="Encounter"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mustSupport value="type"/>
<mustSupport value="status"/>
<mustSupport value="period"/>
<mustSupport value="location"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="identifier"/>
<mustSupport value="statusHistory"/>
<mustSupport value="class"/>
<mustSupport value="classHistory"/>
<mustSupport value="serviceType"/>
<mustSupport value="priority"/>
<mustSupport value="subject"/>
<mustSupport value="length"/>
<mustSupport value="reasonCode"/>
<mustSupport value="reasonReference"/>
<mustSupport value="diagnosis"/>
<mustSupport value="account"/>
<mustSupport value="hospitalization"/>
<mustSupport value="partOf"/>
<codeFilter>
<path value="type"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="Encounter"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mustSupport value="class"/>
<mustSupport value="status"/>
<mustSupport value="period"/>
<mustSupport value="location"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="identifier"/>
<mustSupport value="statusHistory"/>
<mustSupport value="classHistory"/>
<mustSupport value="type"/>
<mustSupport value="serviceType"/>
<mustSupport value="priority"/>
<mustSupport value="subject"/>
<mustSupport value="length"/>
<mustSupport value="reasonCode"/>
<mustSupport value="reasonReference"/>
<mustSupport value="diagnosis"/>
<mustSupport value="account"/>
<mustSupport value="hospitalization"/>
<mustSupport value="partOf"/>
<codeFilter>
<path value="class"/>
<valueSet
value="http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274"/>
</codeFilter>
</dataRequirement>
<dataRequirement>
<type value="Encounter"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Encounter"/>
<mustSupport value="status"/>
<mustSupport value="period"/>
<mustSupport value="location"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="identifier"/>
<mustSupport value="statusHistory"/>
<mustSupport value="class"/>
<mustSupport value="classHistory"/>
<mustSupport value="type"/>
<mustSupport value="serviceType"/>
<mustSupport value="priority"/>
<mustSupport value="subject"/>
<mustSupport value="length"/>
<mustSupport value="reasonCode"/>
<mustSupport value="reasonReference"/>
<mustSupport value="diagnosis"/>
<mustSupport value="account"/>
<mustSupport value="hospitalization"/>
<mustSupport value="partOf"/>
</dataRequirement>
<dataRequirement>
<type value="Location"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Location"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="status"/>
<mustSupport value="operationalStatus"/>
<mustSupport value="name"/>
<mustSupport value="alias"/>
<mustSupport value="description"/>
<mustSupport value="mode"/>
<mustSupport value="type"/>
<mustSupport value="telecom"/>
<mustSupport value="address"/>
<mustSupport value="physicalType"/>
<mustSupport value="position"/>
<mustSupport value="managingOrganization"/>
<mustSupport value="partOf"/>
<mustSupport value="hoursOfOperation"/>
<mustSupport value="availabilityExceptions"/>
<mustSupport value="endpoint"/>
</dataRequirement>
<dataRequirement>
<type value="DiagnosticReport"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/DiagnosticReport"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="basedOn"/>
<mustSupport value="status"/>
<mustSupport value="category"/>
<mustSupport value="code"/>
<mustSupport value="subject"/>
<mustSupport value="encounter"/>
<mustSupport value="effective"/>
<mustSupport value="issued"/>
<mustSupport value="performer"/>
<mustSupport value="resultsInterpreter"/>
<mustSupport value="specimen"/>
<mustSupport value="result"/>
<mustSupport value="conclusion"/>
<mustSupport value="conclusionCode"/>
</dataRequirement>
<dataRequirement>
<type value="Observation"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="basedOn"/>
<mustSupport value="partOf"/>
<mustSupport value="status"/>
<mustSupport value="category"/>
<mustSupport value="code"/>
<mustSupport value="subject"/>
<mustSupport value="focus"/>
<mustSupport value="encounter"/>
<mustSupport value="effective"/>
<mustSupport value="issued"/>
<mustSupport value="performer"/>
<mustSupport value="value"/>
<mustSupport value="dataAbsentReason"/>
<mustSupport value="interpretation"/>
<mustSupport value="note"/>
<mustSupport value="bodySite"/>
<mustSupport value="method"/>
<mustSupport value="specimen"/>
<mustSupport value="device"/>
<mustSupport value="referenceRange"/>
<mustSupport value="hasMember"/>
<mustSupport value="derivedFrom"/>
<mustSupport value="component"/>
</dataRequirement>
<dataRequirement>
<type value="Condition"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="clinicalStatus"/>
<mustSupport value="verificationStatus"/>
<mustSupport value="category"/>
<mustSupport value="severity"/>
<mustSupport value="code"/>
<mustSupport value="bodySite"/>
<mustSupport value="subject"/>
<mustSupport value="encounter"/>
<mustSupport value="onset"/>
<mustSupport value="abatement"/>
<mustSupport value="recordedDate"/>
<mustSupport value="stage"/>
<mustSupport value="evidence"/>
<mustSupport value="note"/>
</dataRequirement>
<dataRequirement>
<type value="Device"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Device"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="definition"/>
<mustSupport value="udiCarrier"/>
<mustSupport value="status"/>
<mustSupport value="statusReason"/>
<mustSupport value="distinctIdentifier"/>
<mustSupport value="manufacturer"/>
<mustSupport value="manufactureDate"/>
<mustSupport value="expirationDate"/>
<mustSupport value="lotNumber"/>
<mustSupport value="serialNumber"/>
<mustSupport value="deviceName"/>
<mustSupport value="modelNumber"/>
<mustSupport value="partNumber"/>
<mustSupport value="type"/>
<mustSupport value="specialization"/>
<mustSupport value="version"/>
<mustSupport value="property"/>
<mustSupport value="patient"/>
<mustSupport value="owner"/>
<mustSupport value="contact"/>
<mustSupport value="location"/>
<mustSupport value="url"/>
<mustSupport value="note"/>
<mustSupport value="safety"/>
<mustSupport value="parent"/>
</dataRequirement>
<dataRequirement>
<type value="MedicationAdministration"/>
<profile
value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration"/>
<mustSupport value="effective"/>
<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="performer"/>
<mustSupport value="reasonCode"/>
<mustSupport value="reasonReference"/>
<mustSupport value="request"/>
<mustSupport value="device"/>
<mustSupport value="note"/>
<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="Medication"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Medication"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="code"/>
<mustSupport value="status"/>
<mustSupport value="manufacturer"/>
<mustSupport value="form"/>
<mustSupport value="amount"/>
<mustSupport value="ingredient"/>
<mustSupport value="batch"/>
</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="policyHolder"/>
<mustSupport value="subscriber"/>
<mustSupport value="subscriberId"/>
<mustSupport value="beneficiary"/>
<mustSupport value="dependent"/>
<mustSupport value="relationship"/>
<mustSupport value="payor"/>
<mustSupport value="class"/>
<mustSupport value="order"/>
<mustSupport value="network"/>
<mustSupport value="subrogation"/>
<mustSupport value="contract"/>
</dataRequirement>
<dataRequirement>
<type value="Procedure"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Procedure"/>
<mustSupport value="performed"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="instantiatesCanonical"/>
<mustSupport value="instantiatesUri"/>
<mustSupport value="basedOn"/>
<mustSupport value="partOf"/>
<mustSupport value="status"/>
<mustSupport value="statusReason"/>
<mustSupport value="category"/>
<mustSupport value="code"/>
<mustSupport value="subject"/>
<mustSupport value="encounter"/>
<mustSupport value="recorder"/>
<mustSupport value="asserter"/>
<mustSupport value="performer"/>
<mustSupport value="location"/>
<mustSupport value="reasonCode"/>
<mustSupport value="reasonReference"/>
<mustSupport value="bodySite"/>
<mustSupport value="outcome"/>
<mustSupport value="report"/>
<mustSupport value="complication"/>
<mustSupport value="complicationDetail"/>
<mustSupport value="followUp"/>
<mustSupport value="note"/>
<mustSupport value="focalDevice"/>
<mustSupport value="usedReference"/>
<mustSupport value="usedCode"/>
</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>
<dataRequirement>
<type value="ServiceRequest"/>
<profile value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
<mustSupport value="authoredOn"/>
<mustSupport value="id"/>
<mustSupport value="extension"/>
<mustSupport value="instantiatesCanonical"/>
<mustSupport value="instantiatesUri"/>
<mustSupport value="basedOn"/>
<mustSupport value="replaces"/>
<mustSupport value="requisition"/>
<mustSupport value="status"/>
<mustSupport value="intent"/>
<mustSupport value="category"/>
<mustSupport value="priority"/>
<mustSupport value="doNotPerform"/>
<mustSupport value="code"/>
<mustSupport value="orderDetail"/>
<mustSupport value="quantity"/>
<mustSupport value="subject"/>
<mustSupport value="encounter"/>
<mustSupport value="occurrence"/>
<mustSupport value="asNeeded"/>
<mustSupport value="requester"/>
<mustSupport value="performerType"/>
<mustSupport value="performer"/>
<mustSupport value="locationCode"/>
<mustSupport value="locationReference"/>
<mustSupport value="reasonCode"/>
<mustSupport value="reasonReference"/>
<mustSupport value="insurance"/>
<mustSupport value="supportingInfo"/>
<mustSupport value="specimen"/>
<mustSupport value="bodySite"/>
<mustSupport value="note"/>
<mustSupport value="patientInstruction"/>
<mustSupport value="relevantHistory"/>
</dataRequirement>
<content>
<contentType value="text/cql"/>
<data
value="bGlicmFyeSBOSFNOZFFNQWN1dGVDYXJlSG9zcGl0YWxJbml0aWFsUG9wdWxhdGlvbiB2ZXJzaW9uICcwLjAuMDE0JwoKdXNpbmcgRkhJUiB2ZXJzaW9uICc0LjAuMScKCmluY2x1ZGUgRkhJUkhlbHBlcnMgdmVyc2lvbiAnNC4wLjEnIGNhbGxlZCBGSElSSGVscGVycwppbmNsdWRlIE1BVEdsb2JhbENvbW1vbkZ1bmN0aW9uc0ZISVI0IHZlcnNpb24gJzYuMS4wMDAnIGNhbGxlZCBHbG9iYWwKaW5jbHVkZSBTdXBwbGVtZW50YWxEYXRhRWxlbWVudHNGSElSNCB2ZXJzaW9uICcyLjAuMDAwJyBjYWxsZWQgU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ZXJsYXAgTWVhc3VyZW1lbnQgUGVyaW9kIjoKICAiSW5pdGlhbCBQb3B1bGF0aW9uIiBJUAogIHdoZXJlIElQLnBlcmlvZCBvdmVybGFwcyAiTWVhc3VyZW1lbnQgUGVyaW9kIgoKZGVmaW5lICJHZXQgTG9jYXRpb25zIGZyb20gSVAgRW5jb3VudGVycyBpbiBNZWFzdXJlbWVudCBQZXJpb2QiOgogIGZsYXR0ZW4oIklQIEVuY291bnRlcnMgT3ZlcmxhcCBNZWFzdXJlbWVudCBQZXJpb2QiIEVuY291bnRlcnMKICBsZXQgbG9jYXRpb25FbGVtZW50czogRW5jb3VudGVycy5sb2NhdGlvbgogIHJldHVybgogICAgbG9jYXRpb25FbGVtZW50cyBMRQogICAgbGV0IGxvY2F0aW9uUmVmZXJlbmNlOiBMRS5sb2NhdGlvbgogICAgcmV0dXJuIEdsb2JhbC5HZXRMb2NhdGlvbihsb2NhdGlvblJlZmVyZW5jZSkpCgovLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLy9TdXBwbGVtZW50YWwgRGF0YSBFbGVtZW50Ci8vV2hlbiBGSElSLmNhbm9uaWNhbCB2YWx1ZSBpcyBwcmVzZW50LCBVUyBDb3JlIDMuMS4xIHByb2ZpbGVzIGFyZSB1c2VkCi8vV2hlbiBGSElSLmNhbm9uaWNhbCB2YWx1ZSBpcyBub3QgcHJlc2VudCwgRkhJUiBCYXNlIHByb2ZpbGVzIGFyZSB1c2VkCi8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpkZWZpbmUgIlNERSBDb25kaXRpb24iOgogIFtDb25kaXRpb25dIENvbmRpdGlvbnMgCiAgd2hlcmUgZXhpc3RzKCJJbml0aWFsIFBvcHVsYXRpb24iKQogIHJldHVybiBTaGFyZWRSZXNvdXJjZS5Db25kaXR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V4dGVuc2lvbiwKICAgIGRlZmluaXRpb246IGQuZGVmaW5pdGlvbiwKICAgIHVkaUNhcnJpZXI6IERldmljZVVkaUNhcnJpZXIoZC51ZGlDYXJyaWVyKSwKICAgIHN0YXR1czogZC5zdGF0dXMsCiAgICBzdGF0dXNSZWFzb246IGQuc3RhdHVzUmVhc29uLAogICAgZGlzdGluY3RJZGVudGlmaWVyOiBkLmRpc3RpbmN0SWRlbnRpZmllciwKICAgIG1hbnVmYWN0dXJlcjogZC5tYW51ZmFjdHVyZXIsCiAgICBtYW51ZmFjdHVyZURhdGU6IGQubWFudWZhY3R1cmVEYXRlLAogICAgZXhwaXJhdGlvbkRhdGU6IGQuZXhwaXJhdGlvbkRhdGUsCiAgICBsb3ROdW1iZXI6IGQubG90TnVtYmVyLAogICAgc2VyaWFsTnVtYmVyOiBkLnNlcmlhbE51bWJlciwKICAgIGRldmljZU5hbWU6IERldmljZURldmljZU5hbWUoZC5kZXZpY2VOYW1lKSwKICAgIG1vZGVsTnVtYmVyOiBkLm1vZGVsTnVtYmVyLAogICAgcGFydE51bWJlcjogZC5wYXJ0TnVtYmVyLAogICAgdHlwZTogZC50eXBlLAogICAgc3BlY2lhbGl6YXRpb246IERldmljZVNwZWNpYWxpemF0aW9uKGQuc3BlY2lhbGl6YXRpb24pLAogICAgdmVyc2lvbjogRGV2aWNlVmVyc2lvbihkLnZlcnNpb24pLAogICAgcHJvcGVydHk6IERldmljZVByb3BlcnR5KGQucHJvcGVydHkpLAogICAgcGF0aWVudDogZC5wYXRpZW50LAogICAgb3duZXI6IGQub3duZXIsCiAgICBjb250YWN0OiBkLmNvbnRhY3QsCiAgICBsb2NhdGlvbjogZC5sb2NhdGlvbiwKICAgIHVybDogZC51cmwsCiAgICBub3RlOiBkLm5vdGUsCiAgICBzYWZldHk6IGQuc2FmZXR5LAogICAgcGFyZW50OiBkLnBhcmVudAogIH0KCmRlZmluZSBmdW5jdGlvbiBEaWFnbm9zdGljUmVwb3J0UmVzb3VyY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