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

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

## Measure: NHSN dQM Acute Care Hospital Daily Initial Population Measure

Official URL: http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Measure/NHSNAcuteCareHospitalDailyInitialPopulation | Version: 1.0.0
Standards status: Trial-use | Maturity Level: 1 | Computable Name: NHSNAcuteCareHospitalDailyInitialPopulation
Other Identifiers: https://nhsnlink.org#NHSNAcuteCareHospitalDailyInitialPopulation
Copyright/Legal: 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.

All encounters with an inpatient, observation, or short stay status for patients of any age during the measurement period.

Knowledge Artifact Metadata
Name (machine-readable) | NHSNAcuteCareHospitalDailyInitialPopulation
Title (human-readable) | NHSN Acute Care Hospital Daily Initial Population
Status | Draft
Experimental | false
Description | All encounters with an inpatient, observation, or short stay status for patients of any age during the measurement period.
Measure Steward | CDC National Healthcare Safety Network (NHSN)
Steward Contact Details | CDC National Healthcare Safety Network (NHSN): http://www.cdc.gov/nhsn,nhsn@cdc.gov
Copyright | 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.
Documentation | Description: https://www.cdc.gov/nhsn/index.html [placeholder for link to protocol on CDC website] Content URL: https://www.cdc.gov/nhsn/index.html Document: null @ https://www.cdc.gov/nhsn/index.html
Measure Metadata
Version Number | 1.0.0
Measure Scoring | Cohort
Measure Type | Outcome
Rationale | The NHSN Acute Care Hospital (ACH) Daily module enables the measurement of facility and unit-specific incidence and prevalence of Coronavirus 2019 (COVID-19), Influenza, and Respiratory Syncytial Virus (RSV) disease among patients admitted to the hospital (inpatient, observation, or short stay status), and specific associated patient outcomes. The ACH Daily Daily module supports an electronic health record (EHR)-/vendor-neutral standard for reporting patient-level data on hospitalized patients with a respiratory illness due to one or more of the pathogens under surveillance. Data collected via the ACH Daily module may be used by facilities for quality improvement and patient care planning purposes, as well as by local, state, and federal public health agencies in coordination and response to public health outbreaks. The ACH Daily module offers a mechanism for ongoing monitoring of infectious respiratory viral illness among hospitalized patients with minimal human resource expenditure via 100% electronically automated data capture. This initial version of the module is based on electronic data capture and upload of demographic, administrative, and clinical data from the facility’s electronic source systems such as the electronic health record (EHR), patient registration system (admission, discharge, and transfer [ADT] data), laboratory information system, and pharmacy electronic medication administration system. Facilities will have access to their data via the analysis functions of NHSN.
Population Basis | Encounter
Measure Population Criteria
Initial Population | ID: initial-population Description: The Acute Care Hospital Daily Initial Population includes all encounters with an inpatient, observation, or short stay status for patients of any age during the measurement period. Logic Definition: Initial Population
Supplemental Data Elements
Supplemental Data Element | ID: sde-minimal-patient Usage Code: Supplemental Data Description: SDE Minimal Patient Logic Definition: SDE Minimal Patient
Supplemental Data Element | ID: sde-location Usage Code: Supplemental Data Description: SDE Location Logic Definition: SDE Location
Supplemental Data Element | ID: sde-encounter-discharge-disposition Usage Code: Supplemental Data Description: SDE Encounter Discharge Dispositions Logic Definition: SDE Encounter Discharge Dispositions
Supplemental Data Element | ID: sde-ach-daily-observation Usage Code: Supplemental Data Description: SDE ACH Daily Observation Logic Definition: SDE ACH Daily Observation
Supplemental Data Element | ID: sde-rsv-pre-admission-observation Usage Code: Supplemental Data Description: SDE RSV PRE Admission Observation Logic Definition: SDE RSV PRE Admission Observation
Supplemental Data Element | ID: sde-covid-and-influenza-pre-admission-observation Usage Code: Supplemental Data Description: SDE COVID And Influenza PRE Admission Observation Logic Definition: SDE COVID And Influenza PRE Admission Observation
Supplemental Data Element | ID: sde-ach-daily-specimen Usage Code: Supplemental Data Description: SDE ACH Daily Specimen Logic Definition: SDE ACH Daily Specimen
Supplemental Data Element | ID: sde-rsv-specimen Usage Code: Supplemental Data Description: SDE RSV Specimen Logic Definition: SDE RSV Specimen
Supplemental Data Element | ID: sde-covid-and-influenza-specimen Usage Code: Supplemental Data Description: SDE COVID And Influenza Specimen Logic Definition: SDE COVID And Influenza Specimen
Supplemental Data Element | ID: sde-ach-daily-diagnosticreport Usage Code: Supplemental Data Description: SDE ACH Daily DiagnosticReport Logic Definition: SDE ACH Daily DiagnosticReport
Supplemental Data Element | ID: sde-rsv-diagnosticreport Usage Code: Supplemental Data Description: SDE RSV DiagnosticReport Logic Definition: SDE RSV DiagnosticReport
Supplemental Data Element | ID: sde-covid-and-influenza-diagnosticreport Usage Code: Supplemental Data Description: SDE COVID And Influenza DiagnosticReport Logic Definition: SDE COVID And Influenza DiagnosticReport
Supplemental Data Element | ID: sde-ach-daily-diagnosticreport-result-from-lab Usage Code: Supplemental Data Description: SDE ACH Daily DiagnosticReport Result from Lab Logic Definition: SDE ACH Daily DiagnosticReport Result from Lab
Supplemental Data Element | ID: sde-covid-and-influenza-diagnosticreport-result-from-lab Usage Code: Supplemental Data Description: SDE COVID and Influenza DiagnosticReport Result from Lab Logic Definition: SDE COVID and Influenza DiagnosticReport Result from Lab
Supplemental Data Element | ID: sde-rsv-diagnosticreport-result-from-lab Usage Code: Supplemental Data Description: SDE RSV DiagnosticReport Result from Lab Logic Definition: SDE RSV DiagnosticReport Result from Lab
Supplemental Data Element | ID: sde-ach-daily-servicerequest Usage Code: Supplemental Data Description: SDE ACH Daily ServiceRequest Logic Definition: SDE ACH Daily ServiceRequest
Supplemental Data Element | ID: sde-isolation-precautions-implemented Usage Code: Supplemental Data Description: SDE Isolation Precautions Implemented Logic Definition: SDE Isolation Precautions Implemented
Supplemental Data Element | ID: sde-covid-or-influenza-medication-administered Usage Code: Supplemental Data Description: SDE Covid or Influenza Medication Administered Logic Definition: SDE Covid or Influenza Medication Administered
Supplemental Data Element | ID: sde-covid-or-influenza-medication-ordered Usage Code: Supplemental Data Description: SDE Covid or Influenza Medication Ordered Logic Definition: SDE Covid or Influenza Medication Ordered
Supplemental Data Element | ID: sde-medication Usage Code: Supplemental Data Description: SDE Medication Logic Definition: SDE Medication
Supplemental Data Element | ID: sde-all-observations Usage Code: Supplemental Data Description: SDE All Observations Logic Definition: SDE All Observations
Supplemental Data Element | ID: sde-all-servicerequests Usage Code: Supplemental Data Description: SDE All ServiceRequests Logic Definition: SDE All ServiceRequests
Supplemental Data Element | ID: sde-all-procedures Usage Code: Supplemental Data Description: SDE All Procedures Logic Definition: SDE All Procedures
Supplemental Data Element | ID: sde-encounter Usage Code: Supplemental Data Description: SDE Encounter Logic Definition: SDE Encounter
Supplemental Data Element | ID: sde-ip-encounters Usage Code: Supplemental Data Description: SDE IP Encounters Logic Definition: SDE IP Encounters
Measure Logic
Primary Library | NHSNAcuteCareHospitalDailyInitialPopulation
Dependency | Description: Library FHIRHelpers Resource: `http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2` Canonical URL: `http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/FHIRHelpers|4.0.2`
Dependency | Description: Library NHSNHelpers Resource: `http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNHelpers|0.0.002` Canonical URL: `http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/NHSNHelpers|0.0.002`
Dependency | Description: Library SharedResource Resource: `http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/SharedResourceCreation|0.1.010` Canonical URL: `http://www.cdc.gov/nhsn/fhirportal/dqm/ig/Library/SharedResourceCreation|0.1.010`
Dependency | Description: Code system ActCode Resource: ActCodeversion: null9.0.0) Canonical URL: `http://terminology.hl7.org/CodeSystem/v3-ActCode|9.0.0`
Dependency | Description: Code system Observation Category Resource: Observation Category Codesversion: null1.0.1) Canonical URL: `http://terminology.hl7.org/CodeSystem/observation-category|1.0.1`
Dependency | Description: Value set Encounter Inpatient Resource: Encounter Inpatient Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307`
Dependency | Description: Value set NHSN Inpatient Encounter Class Codes Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274`
Dependency | Description: Value set Observation Services Resource: Observation Services Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143`
Dependency | Description: Value set Inpatient, Emergency, and Observation Locations Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265`
Dependency | Description: Value set COVID_19 (Tests for SARS_CoV_2 Nucleic Acid) Resource: COVID_19 (Tests for SARS_CoV_2 Nucleic Acid) Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1142`
Dependency | Description: Value set COVID_19 (Tests for SARS_CoV_2 Antigen) Resource: COVID_19 (Tests for SARS_CoV_2 Antigen) Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1158`
Dependency | Description: Value set Influenza (Tests for influenza A or B virus Nucleic Acid) Resource: Influenza (Tests for influenza A or B virus Nucleic Acid) Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.336`
Dependency | Description: Value set Influenza (Tests for influenza A or B virus Antigen) Resource: Influenza (Tests for influenza A or B virus Antigen) Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.337`
Dependency | Description: Value set RSV (Tests for RSV Nucleic Acid) Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1312 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1312`
Dependency | Description: Value set RSV (Tests for RSV Antigen) Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1311 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1311`
Dependency | Description: Value set Discharge Disposition Resource: Discharge dispositionversion: null1.0.1) Canonical URL: `http://terminology.hl7.org/ValueSet/encounter-discharge-disposition|1.0.1`
Dependency | Description: Value set Anakinra Resource: Anakinra Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2054`
Dependency | Description: Value set Baloxavir Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.85 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.85`
Dependency | Description: Value set Bamlanivimab Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2099 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2099`
Dependency | Description: Value set Baricitinib Resource: Baricitinib Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2046`
Dependency | Description: Value set Bebtelovimab Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2105 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2105`
Dependency | Description: Value set Casirivimab Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2097 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2097`
Dependency | Description: Value set Casirivimab / Imdevimab Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2103 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2103`
Dependency | Description: Value set COVID19 RxNorm Value Set for Tocilizumab Resource: COVID19 RxNorm Value Set for Tocilizumab Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2087`
Dependency | Description: Value set Etesevimab Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2100 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2100`
Dependency | Description: Value set Imdevimab Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2098 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2098`
Dependency | Description: Value set Molnupiravir Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2119 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2119`
Dependency | Description: Value set Nirmatrelvir / Ritonavir Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2104 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2104`
Dependency | Description: Value set Oseltamivir Resource: Oseltamivir Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2078`
Dependency | Description: Value set Peramivir Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.86 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.86`
Dependency | Description: Value set Remdesivir Resource: Remdesivir Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2081`
Dependency | Description: Value set Sarilumab Resource: Sarilumab Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2084`
Dependency | Description: Value set Sotrovimab Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2101 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2101`
Dependency | Description: Value set Tofacitinib Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2102 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.3616.200.110.102.2102`
Dependency | Description: Value set Zanamivir Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.87 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.87`
Dependency | Description: Value set Transmission Based Precaution Types Resource: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.10.20.22.5.300 Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.10.20.22.5.300`
Direct Reference Code | Display: observation encounter Code: OBSENC System: `http://terminology.hl7.org/CodeSystem/v3-ActCode`
Direct Reference Code | Display: Laboratory Code: laboratory System: `http://terminology.hl7.org/CodeSystem/observation-category`
Parameter | Name: Measurement Period Use: In Min Cardinality: 0 Max Cardinality: 1 Type: Period
Parameter | Name: SDE Encounter Use: Out Min Cardinality: 0 Max Cardinality: * Type: Encounter
Parameter | Name: SDE ACH Daily ServiceRequest Use: Out Min Cardinality: 0 Max Cardinality: * Type: ServiceRequest
Parameter | Name: SDE RSV Specimen Use: Out Min Cardinality: 0 Max Cardinality: * Type: Specimen
Parameter | Name: SDE ACH Daily Specimen Use: Out Min Cardinality: 0 Max Cardinality: * Type: Specimen
Parameter | Name: SDE ACH Daily DiagnosticReport Use: Out Min Cardinality: 0 Max Cardinality: * Type: DiagnosticReport
Parameter | Name: SDE RSV DiagnosticReport Use: Out Min Cardinality: 0 Max Cardinality: * Type: DiagnosticReport
Parameter | Name: SDE ACH Daily Observation Use: Out Min Cardinality: 0 Max Cardinality: * Type: Observation
Parameter | Name: Initial Population Use: Out Min Cardinality: 0 Max Cardinality: * Type: Encounter
Parameter | Name: SDE All Procedures Use: Out Min Cardinality: 0 Max Cardinality: * Type: Procedure
Parameter | Name: SDE Encounter Discharge Dispositions Use: Out Min Cardinality: 0 Max Cardinality: * Type: Encounter
Parameter | Name: SDE Covid or Influenza Medication Ordered Use: Out Min Cardinality: 0 Max Cardinality: * Type: MedicationRequest
Parameter | Name: SDE Minimal Patient Use: Out Min Cardinality: 0 Max Cardinality: 1 Type: Patient
Parameter | Name: SDE All Observations Use: Out Min Cardinality: 0 Max Cardinality: * Type: Observation
Parameter | Name: SDE Medication Use: Out Min Cardinality: 0 Max Cardinality: * Type: Medication
Parameter | Name: SDE Covid or Influenza Medication Administered Use: Out Min Cardinality: 0 Max Cardinality: * Type: MedicationAdministration
Parameter | Name: SDE RSV DiagnosticReport Result from Lab Use: Out Min Cardinality: 0 Max Cardinality: * Type: DiagnosticReport
Parameter | Name: SDE IP Encounters Use: Out Min Cardinality: 0 Max Cardinality: * Type: Encounter
Parameter | Name: SDE RSV PRE Admission Observation Use: Out Min Cardinality: 0 Max Cardinality: * Type: Observation
Parameter | Name: SDE Isolation Precautions Implemented Use: Out Min Cardinality: 0 Max Cardinality: * Type: Procedure
Parameter | Name: SDE COVID And Influenza Specimen Use: Out Min Cardinality: 0 Max Cardinality: * Type: Specimen
Parameter | Name: SDE All ServiceRequests Use: Out Min Cardinality: 0 Max Cardinality: * Type: ServiceRequest
Parameter | Name: SDE COVID And Influenza DiagnosticReport Use: Out Min Cardinality: 0 Max Cardinality: * Type: DiagnosticReport
Parameter | Name: SDE COVID And Influenza PRE Admission Observation Use: Out Min Cardinality: 0 Max Cardinality: * Type: Observation
Parameter | Name: SDE ACH Daily DiagnosticReport Result from Lab Use: Out Min Cardinality: 0 Max Cardinality: * Type: DiagnosticReport
Parameter | Name: SDE COVID and Influenza DiagnosticReport Result from Lab Use: Out Min Cardinality: 0 Max Cardinality: * Type: DiagnosticReport
Parameter | Name: SDE Location Use: Out Min Cardinality: 0 Max Cardinality: * Type: Location
Measure Logic Data Requirements
Data Requirement | Type: Encounter Profile(s): Encounter Must Support Elements: type, status, period, id, extension, identifier, statusHistory, class, classHistory, serviceType, priority, subject, length, reasonCode, reasonReference, diagnosis, account, hospitalization, location, partOf, hospitalization.dischargeDisposition Code Filter(s): Path: type ValueSet: Encounter Inpatient
Data Requirement | Type: Encounter Profile(s): Encounter Must Support Elements: class, status, period, id, extension, identifier, statusHistory, classHistory, type, serviceType, priority, subject, length, reasonCode, reasonReference, diagnosis, account, hospitalization, location, partOf, hospitalization.dischargeDisposition Code Filter(s): Path: class ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.274
Data Requirement | Type: Encounter Profile(s): Encounter Must Support Elements: type, status, period, id, extension, identifier, statusHistory, class, classHistory, serviceType, priority, subject, length, reasonCode, reasonReference, diagnosis, account, hospitalization, location, partOf, hospitalization.dischargeDisposition Code Filter(s): Path: type ValueSet: Observation Services
Data Requirement | Type: Encounter Profile(s): Encounter Must Support Elements: class, status, period, id, extension, identifier, statusHistory, classHistory, type, serviceType, priority, subject, length, reasonCode, reasonReference, diagnosis, account, hospitalization, location, partOf, hospitalization.dischargeDisposition Code Filter(s): Path: class Code:
Data Requirement | Type: Encounter Profile(s): Encounter Must Support Elements: status, period, id, extension, identifier, statusHistory, class, classHistory, type, serviceType, priority, subject, length, reasonCode, reasonReference, diagnosis, account, hospitalization, location, partOf, hospitalization.dischargeDisposition
Data Requirement | Type: Location Profile(s): Location Must Support Elements: id, extension, status, operationalStatus, name, alias, description, mode, type, telecom, address, physicalType, position, managingOrganization, partOf, hoursOfOperation, availabilityExceptions, endpoint
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, id, extension, instantiatesCanonical, instantiatesUri, basedOn, replaces, requisition, status, intent, category, priority, doNotPerform, orderDetail, quantity, subject, encounter, occurrence, asNeeded, authoredOn, requester, performerType, performer, locationCode, locationReference, reasonCode, reasonReference, insurance, supportingInfo, specimen, bodySite, note, patientInstruction, relevantHistory Code Filter(s): Path: code ValueSet: COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, id, extension, instantiatesCanonical, instantiatesUri, basedOn, replaces, requisition, status, intent, category, priority, doNotPerform, orderDetail, quantity, subject, encounter, occurrence, asNeeded, authoredOn, requester, performerType, performer, locationCode, locationReference, reasonCode, reasonReference, insurance, supportingInfo, specimen, bodySite, note, patientInstruction, relevantHistory Code Filter(s): Path: code ValueSet: COVID_19 (Tests for SARS_CoV_2 Antigen)
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, id, extension, instantiatesCanonical, instantiatesUri, basedOn, replaces, requisition, status, intent, category, priority, doNotPerform, orderDetail, quantity, subject, encounter, occurrence, asNeeded, authoredOn, requester, performerType, performer, locationCode, locationReference, reasonCode, reasonReference, insurance, supportingInfo, specimen, bodySite, note, patientInstruction, relevantHistory Code Filter(s): Path: code ValueSet: Influenza (Tests for influenza A or B virus Nucleic Acid)
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, id, extension, instantiatesCanonical, instantiatesUri, basedOn, replaces, requisition, status, intent, category, priority, doNotPerform, orderDetail, quantity, subject, encounter, occurrence, asNeeded, authoredOn, requester, performerType, performer, locationCode, locationReference, reasonCode, reasonReference, insurance, supportingInfo, specimen, bodySite, note, patientInstruction, relevantHistory Code Filter(s): Path: code ValueSet: Influenza (Tests for influenza A or B virus Antigen)
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, id, extension, instantiatesCanonical, instantiatesUri, basedOn, replaces, requisition, status, intent, category, priority, doNotPerform, orderDetail, quantity, subject, encounter, occurrence, asNeeded, authoredOn, requester, performerType, performer, locationCode, locationReference, reasonCode, reasonReference, insurance, supportingInfo, specimen, bodySite, note, patientInstruction, relevantHistory Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1312
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: code, id, extension, instantiatesCanonical, instantiatesUri, basedOn, replaces, requisition, status, intent, category, priority, doNotPerform, orderDetail, quantity, subject, encounter, occurrence, asNeeded, authoredOn, requester, performerType, performer, locationCode, locationReference, reasonCode, reasonReference, insurance, supportingInfo, specimen, bodySite, note, patientInstruction, relevantHistory Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1311
Data Requirement | Type: ServiceRequest Profile(s): ServiceRequest Must Support Elements: id, extension, instantiatesCanonical, instantiatesUri, basedOn, replaces, requisition, status, intent, category, priority, doNotPerform, code, orderDetail, quantity, subject, encounter, occurrence, asNeeded, authoredOn, requester, performerType, performer, locationCode, locationReference, reasonCode, reasonReference, insurance, supportingInfo, specimen, bodySite, note, patientInstruction, relevantHistory
Data Requirement | Type: Observation Profile(s): Observation Must Support Elements: code, category, status, effective, specimen, specimen.collection, specimen.collection.collected, id, extension, basedOn, partOf, subject, focus, encounter, issued, performer, value, dataAbsentReason, interpretation, note, bodySite, method, device, referenceRange, hasMember, derivedFrom, component Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1312
Data Requirement | Type: Observation Profile(s): Observation Must Support Elements: code, category, status, effective, specimen, specimen.collection, specimen.collection.collected, id, extension, basedOn, partOf, subject, focus, encounter, issued, performer, value, dataAbsentReason, interpretation, note, bodySite, method, device, referenceRange, hasMember, derivedFrom, component Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1311
Data Requirement | Type: Observation Profile(s): Observation Must Support Elements: code, category, status, effective, specimen, specimen.collection, specimen.collection.collected, id, extension, basedOn, partOf, subject, focus, encounter, issued, performer, value, dataAbsentReason, interpretation, note, bodySite, method, device, referenceRange, hasMember, derivedFrom, component Code Filter(s): Path: code ValueSet: Influenza (Tests for influenza A or B virus Nucleic Acid)
Data Requirement | Type: Observation Profile(s): Observation Must Support Elements: code, category, status, effective, specimen, specimen.collection, specimen.collection.collected, id, extension, basedOn, partOf, subject, focus, encounter, issued, performer, value, dataAbsentReason, interpretation, note, bodySite, method, device, referenceRange, hasMember, derivedFrom, component Code Filter(s): Path: code ValueSet: Influenza (Tests for influenza A or B virus Antigen)
Data Requirement | Type: Observation Profile(s): Observation Must Support Elements: code, category, status, effective, specimen, specimen.collection, specimen.collection.collected, id, extension, basedOn, partOf, subject, focus, encounter, issued, performer, value, dataAbsentReason, interpretation, note, bodySite, method, device, referenceRange, hasMember, derivedFrom, component Code Filter(s): Path: code ValueSet: COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)
Data Requirement | Type: Observation Profile(s): Observation Must Support Elements: code, category, status, effective, specimen, specimen.collection, specimen.collection.collected, id, extension, basedOn, partOf, subject, focus, encounter, issued, performer, value, dataAbsentReason, interpretation, note, bodySite, method, device, referenceRange, hasMember, derivedFrom, component Code Filter(s): Path: code ValueSet: COVID_19 (Tests for SARS_CoV_2 Antigen)
Data Requirement | Type: Observation Profile(s): Observation Must Support Elements: category, status, effective, specimen, specimen.collection, specimen.collection.collected, id, extension, basedOn, partOf, code, subject, focus, encounter, issued, performer, value, dataAbsentReason, interpretation, note, bodySite, method, device, referenceRange, hasMember, derivedFrom, component
Data Requirement | Type: Specimen Profile(s): Specimen Must Support Elements: id, extension, identifier, accessionIdentifier, status, type, subject, receivedTime, parent, request, collection, processing, container, condition, note
Data Requirement | Type: DiagnosticReport Profile(s): DiagnosticReport Must Support Elements: code, status, id, extension, basedOn, category, subject, encounter, effective, issued, performer, resultsInterpreter, specimen, result, conclusion, conclusionCode Code Filter(s): Path: code ValueSet: COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)
Data Requirement | Type: DiagnosticReport Profile(s): DiagnosticReport Must Support Elements: code, status, id, extension, basedOn, category, subject, encounter, effective, issued, performer, resultsInterpreter, specimen, result, conclusion, conclusionCode Code Filter(s): Path: code ValueSet: COVID_19 (Tests for SARS_CoV_2 Antigen)
Data Requirement | Type: DiagnosticReport Profile(s): DiagnosticReport Must Support Elements: code, status, id, extension, basedOn, category, subject, encounter, effective, issued, performer, resultsInterpreter, specimen, result, conclusion, conclusionCode Code Filter(s): Path: code ValueSet: Influenza (Tests for influenza A or B virus Nucleic Acid)
Data Requirement | Type: DiagnosticReport Profile(s): DiagnosticReport Must Support Elements: code, status, id, extension, basedOn, category, subject, encounter, effective, issued, performer, resultsInterpreter, specimen, result, conclusion, conclusionCode Code Filter(s): Path: code ValueSet: Influenza (Tests for influenza A or B virus Antigen)
Data Requirement | Type: DiagnosticReport Profile(s): DiagnosticReport Must Support Elements: code, status, id, extension, basedOn, category, subject, encounter, effective, issued, performer, resultsInterpreter, specimen, result, conclusion, conclusionCode Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1312
Data Requirement | Type: DiagnosticReport Profile(s): DiagnosticReport Must Support Elements: code, status, id, extension, basedOn, category, subject, encounter, effective, issued, performer, resultsInterpreter, specimen, result, conclusion, conclusionCode Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1146.1311
Data Requirement | Type: DiagnosticReport Profile(s): DiagnosticReport Must Support Elements: status, id, extension, basedOn, category, code, subject, encounter, effective, issued, performer, resultsInterpreter, specimen, result, conclusion, conclusionCode
Data Requirement | Type: Procedure Profile(s): Procedure Must Support Elements: id, extension, instantiatesCanonical, instantiatesUri, basedOn, partOf, status, statusReason, category, code, subject, encounter, performed, recorder, asserter, performer, location, reasonCode, reasonReference, bodySite, outcome, report, complication, complicationDetail, followUp, note, focalDevice, usedReference, usedCode
Data Requirement | Type: Procedure Profile(s): Procedure Must Support Elements: code, performed, id, extension, instantiatesCanonical, instantiatesUri, basedOn, partOf, status, statusReason, category, subject, encounter, recorder, asserter, performer, location, reasonCode, reasonReference, bodySite, outcome, report, complication, complicationDetail, followUp, note, focalDevice, usedReference, usedCode Code Filter(s): Path: code ValueSet: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.10.20.22.5.300
Data Requirement | Type: Medication Profile(s): Medication Must Support Elements: id, extension, code, status, manufacturer, form, amount, ingredient, batch Code Filter(s): Path: id
Data Requirement | Type: Patient Profile(s): Patient Must Support Elements: id, identifier, active, name, telecom, gender, birthDate, deceased, address, maritalStatus, multipleBirth, photo, contact, communication, generalPractitioner, managingOrganization, link
Data Requirement | Type: MedicationRequest Profile(s): MedicationRequest Must Support Elements: medication, authoredOn, id, extension, status, statusReason, intent, category, priority, doNotPerform, reported, subject, encounter, requester, recorder, reasonCode, reasonReference, instantiatesCanonical, instantiatesUri, courseOfTherapyType, dosageInstruction
Data Requirement | Type: MedicationAdministration Profile(s): MedicationAdministration Must Support Elements: medication, status, effective, id, extension, instantiates, partOf, statusReason, category, subject, context, supportingInformation, performer, reasonCode, reasonReference, request, device, note, dosage, eventHistory
Measure Logic Definitions
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //Common Retrievals define "Encounters":   [Encounter]
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "EncounterInpatient":   ([Encounter: "Encounter Inpatient"]     union [Encounter: class in "NHSN Inpatient Encounter Class Codes"]) Encounters   where Encounters.status in {'in-progress', 'finished', 'triaged', 'onleave', 'entered-in-error'}     and Encounters.period overlaps "Measurement Period"
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "EncounterObservation":   ([Encounter: "Observation Services"]     union [Encounter: class in {"observation encounter"}]) Encounters   where Encounters.status in {'in-progress', 'finished', 'triaged', 'onleave', 'entered-in-error'}     and Encounters.period overlaps "Measurement Period"
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "Encounters with Patient Hospital Locations":   [Encounter] Encounters   where exists(     Encounters.location EncounterLocation     let types: NHSNHelpers.GetLocation(EncounterLocation.location).type     where exists(       types type       where 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"   )
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //---------------------------------- // Initial Population //---------------------------------- define "Initial Population":   EncounterInpatient   union EncounterObservation   union "Encounters with Patient Hospital Locations"
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "SDE Encounter":    "Encounters" Encounters   where not CheckIP(Encounters)   and exists(     "Initial Population" IP     where Encounters.period overlaps IP.period)   return SharedResource.EncounterResource(Encounters,   {FHIR.canonical{value: 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "SDE ACH Daily ServiceRequest":   ([ServiceRequest: "COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)"]    union  [ServiceRequest: "COVID_19 (Tests for SARS_CoV_2 Antigen)"]    union  [ServiceRequest: "Influenza (Tests for influenza A or B virus Nucleic Acid)"]   union  [ServiceRequest: "Influenza (Tests for influenza A or B virus Antigen)"]   union  [ServiceRequest: "RSV (Tests for RSV Nucleic Acid)"]   union  [ServiceRequest: "RSV (Tests for RSV Antigen)"]   ) ServiceRequests     where ServiceRequests.intent ~ 'order'       and ServiceRequests.status ~ 'completed'       and exists("Initial Population")   return SharedResource.ServiceRequestResource(ServiceRequests,   {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-servicerequest'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "RSV Observation":   ([Observation: "RSV (Tests for RSV Nucleic Acid)"]   union [Observation: "RSV (Tests for RSV Antigen)"]      ) Observations     where exists(Observations.category Category where Category ~ "laboratory")       and Observations.status in {'final','registered','preliminary','partial'}       and exists("Initial Population")
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //further constrain RSV observation for 8 day lookback define "RSV PRE Admission Observation":   "RSV Observation" O    where exists(EncounterInpatient E      where (       NHSNHelpers."Normalize Interval"(O.effective) 8 days or less on or before start of E.period       or NHSNHelpers."Normalize Interval"(GetSpecimen(O.specimen).collection.collected) 8 days or less on or before start of E.period       )       and start of E.period during "Measurement Period"     )
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the Specimen related to the RSV Observation Pre Admission define "SDE RSV Specimen":   "RSV PRE Admission Observation" ObservationWithSpecimen     let Specimen: GetSpecimen(ObservationWithSpecimen.specimen)     return SharedResource.SpecimenResource(Specimen,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-specimen'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //----------------------------------------------- // Logic related to Laboratory //----------------------------------------------- //Lab Observations define "COVID And Influenza Observation":   ([Observation: "Influenza (Tests for influenza A or B virus Nucleic Acid)"]    union [Observation: "Influenza (Tests for influenza A or B virus Antigen)"]   union [Observation: "COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)"]   union [Observation: "COVID_19 (Tests for SARS_CoV_2 Antigen)"]   ) Observations     where exists(Observations.category Category where Category ~ "laboratory")       and Observations.status in {'final','registered','preliminary','partial'}       and exists("Initial Population")
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "ACH Daily Observation":   "RSV Observation"   union "COVID And Influenza Observation"
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the Specimen related to the Observation during the Measurement Period define "SDE ACH Daily Specimen":   "ACH Daily Observation" ObservationWithSpecimen     let Specimen: GetSpecimen(ObservationWithSpecimen.specimen)     return SharedResource.SpecimenResource(Specimen,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-specimen'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //Lab DiagnosticReport define "COVID And Influenza DiagnosticReport":   ([DiagnosticReport: "COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)"]     union [DiagnosticReport: "COVID_19 (Tests for SARS_CoV_2 Antigen)"]     union [DiagnosticReport: "Influenza (Tests for influenza A or B virus Nucleic Acid)"]     union [DiagnosticReport: "Influenza (Tests for influenza A or B virus Antigen)"]   ) Reports     where exists("Initial Population")       and Reports.status in {'final','registered','preliminary','partial'}
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "RSV DiagnosticReport":   ([DiagnosticReport: "RSV (Tests for RSV Nucleic Acid)"]     union [DiagnosticReport: "RSV (Tests for RSV Antigen)"]   ) Reports     where exists("Initial Population")       and Reports.status in {'final','registered','preliminary','partial'}
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "ACH Daily DiagnosticReport":   "COVID And Influenza DiagnosticReport"     union "RSV DiagnosticReport"
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the DiagnosticReport during the Measurement Period define "SDE ACH Daily DiagnosticReport":   "ACH Daily DiagnosticReport" Reports     return SharedResource.DiagnosticReportLabResource(Reports,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-diagnosticreport-lab'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the RSV DiagnosticReport pre admission define "SDE RSV DiagnosticReport":   "RSV DiagnosticReport" Reports     return SharedResource.DiagnosticReportLabResource(Reports,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-diagnosticreport-lab'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the Observation during the Measurement Period define "SDE ACH Daily Observation":   "ACH Daily Observation" Observations     return SharedResource.ObservationLabResource(Observations,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-observation-lab'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //To catch all isolation precautions define "SDE All Procedures":   [Procedure] P   where exists("Initial Population")   return SharedResource.ProcedureResource(P,   {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-procedure'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "SDE Encounter Discharge Dispositions":  "Initial Population" DischargeDispositions    where DischargeDispositions.hospitalization.dischargeDisposition in "Discharge Disposition"   return SharedResource.EncounterResource(DischargeDispositions,   {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-encounter'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "SDE Covid or Influenza Medication Ordered":   [MedicationRequest] RPSMedRequest     let Meds: GetMedicationCode(RPSMedRequest.medication)     where (Meds in "Anakinra"             or Meds in "Baloxavir"             or Meds in "Bamlanivimab"             or Meds in "Baricitinib"             or Meds in "Bebtelovimab"             or Meds in "Casirivimab"             or Meds in "Casirivimab / Imdevimab"             or Meds in "COVID19 RxNorm Value Set for Tocilizumab"             or Meds in "Etesevimab"             or Meds in "Imdevimab"             or Meds in "Molnupiravir"             or Meds in "Nirmatrelvir / Ritonavir"             or Meds in "Oseltamivir"             or Meds in "Peramivir"             or Meds in "Remdesivir"             or Meds in "Sarilumab"             or Meds in "Sotrovimab"                 or Meds in "Tofacitinib"             or Meds in "Zanamivir")       and exists("Initial Population")       and NHSNHelpers."Normalize Interval"(RPSMedRequest.authoredOn) during "Measurement Period"     return SharedResource.MedicationRequestResource(RPSMedRequest,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-medicationrequest'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "SDE Minimal Patient":   Patient p   where exists("Initial Population")   return SharedResource.PatientResource(p,    {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/cross-measure-patient'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "Observations":   [Observation]
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //To catch all isolation precautions define "SDE All Observations":   "Observations" O   where exists("Initial Population")   return SharedResource.ObservationLabResource(O,   {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-observation'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "SDE Covid or Influenza Medication Administered":   [MedicationAdministration] RPSMedAdmin     let Meds: GetMedicationCode(RPSMedAdmin.medication)    where (Meds in "Anakinra"             or Meds in "Bamlanivimab"             or Meds in "Baloxavir"             or Meds in "Baricitinib"             or Meds in "Bebtelovimab"             or Meds in "Casirivimab"             or Meds in "Casirivimab / Imdevimab"             or Meds in "COVID19 RxNorm Value Set for Tocilizumab"             or Meds in "Etesevimab"             or Meds in "Imdevimab"             or Meds in "Molnupiravir"             or Meds in "Nirmatrelvir / Ritonavir"             or Meds in "Oseltamivir"             or Meds in "Peramivir"             or Meds in "Remdesivir"             or Meds in "Sarilumab"             or Meds in "Sotrovimab"                 or Meds in "Tofacitinib"             or Meds in "Zanamivir")       and RPSMedAdmin.status ~ 'completed'       and exists("Initial Population")       and NHSNHelpers."Normalize Interval"(RPSMedAdmin.effective) during "Measurement Period"     return SharedResource.MedicationAdministrationResource(RPSMedAdmin,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-medicationadministration'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "SDE Medication":   ("SDE Covid or Influenza Medication Ordered"   union "SDE Covid or Influenza Medication Administered") MedReqOrAdmin   where MedReqOrAdmin.medication is FHIR.Reference   return SharedResource.MedicationResource(GetMedicationFrom(MedReqOrAdmin.medication),   {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-medication'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "DiagnosticReports":   [DiagnosticReport]
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "RSV Observations":   "Observations" Observations   where Observations.code in "RSV (Tests for RSV Nucleic Acid)"     or Observations.code in "RSV (Tests for RSV Antigen)"
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "RSV DiagnosticReport Observations":   "DiagnosticReports" Reports   where exists(     "RSV Observations" Observations     where Reports.result.references(Observations)   )
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "RSV DiagnosticReport Result from Lab":   [DiagnosticReport] Reports     where exists("RSV DiagnosticReport Observations")       and Reports.status in {'final','registered','preliminary','partial'}       and exists("Initial Population")
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the RSV DiagnosticReport based on the result pre admission define "SDE RSV DiagnosticReport Result from Lab":   "RSV DiagnosticReport Result from Lab" Reports     return SharedResource.DiagnosticReportLabResource(Reports,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-diagnosticreport-lab'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //---------------------------------- // SDE //---------------------------------- define "SDE IP Encounters":   "Initial Population" IP   return SharedResource.EncounterResource(IP,    {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-encounter'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the RSV Observation Pre Admission     define "SDE RSV PRE Admission Observation":   "RSV PRE Admission Observation" Observations     return SharedResource.ObservationLabResource(Observations,      {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-observation-lab'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "SDE Isolation Precautions Implemented":   [Procedure: "Transmission Based Precaution Types"] IsolationPrecautions     where NHSNHelpers."Normalize Interval"(IsolationPrecautions.performed) during "Measurement Period"     and exists("Initial Population")   return SharedResource.ProcedureResource(IsolationPrecautions,   {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-procedure'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //further constrain COVID-19 and Influenza Observations for 14 day lookback define "COVID And Influenza PRE Admission Observation":   "COVID And Influenza Observation" O     where exists( EncounterInpatient E      where (       NHSNHelpers."Normalize Interval"(O.effective) 14 days or less on or before start of E.period       or NHSNHelpers."Normalize Interval"(GetSpecimen(O.specimen).collection.collected) 14 days or less on or before start of E.period       )       and start of E.period during "Measurement Period"     )
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the Specimen related to the COVID-19 And Influenza Observation Pre Admission define "SDE COVID And Influenza Specimen":   "COVID And Influenza PRE Admission Observation" ObservationWithSpecimen     let Specimen: GetSpecimen(ObservationWithSpecimen.specimen)     return SharedResource.SpecimenResource(Specimen,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-specimen'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //To catch all isolation precautions define "SDE All ServiceRequests":   [ServiceRequest] SR   where exists("Initial Population")   return SharedResource.ServiceRequestResource(SR,   {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-servicerequest'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the COVID-19 And Influenza DiagnosticReport pre admission define "SDE COVID And Influenza DiagnosticReport":   "COVID And Influenza DiagnosticReport" Reports     return SharedResource.DiagnosticReportLabResource(Reports,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-diagnosticreport-lab'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the COVID-19 and Influenza Observation Pre Admission define "SDE COVID And Influenza PRE Admission Observation":   "COVID And Influenza PRE Admission Observation" Observations     return SharedResource.ObservationLabResource(Observations,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-observation-lab'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "COVID and Influenza DiagnosticReport Observations":   "Observations" Observations   where Observations.code in "COVID_19 (Tests for SARS_CoV_2 Nucleic Acid)"     or Observations.code in "COVID_19 (Tests for SARS_CoV_2 Antigen)"     or Observations.code in "Influenza (Tests for influenza A or B virus Nucleic Acid)"     or Observations.code in "Influenza (Tests for influenza A or B virus Antigen)"
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "COVID and Influenza DiagnosticReport Result from Lab":   "DiagnosticReports" Reports     where exists(       "COVID and Influenza DiagnosticReport Observations" Observations       where Reports.result.references(Observations)     )     and Reports.status in {'final','registered','preliminary','partial'}     and exists("Initial Population")
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "ACH Daily DiagnosticReport Result from Lab":   "COVID and Influenza DiagnosticReport Result from Lab"     union "RSV DiagnosticReport Result from Lab"
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the DiagnosticReport based on the result during the Measurement Period     define "SDE ACH Daily DiagnosticReport Result from Lab":   "ACH Daily DiagnosticReport Result from Lab" Reports     return SharedResource.DiagnosticReportLabResource(Reports,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-diagnosticreport-lab'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //return the COVID-19 and Influenza DiagnosticReport based on the result pre admission define "SDE COVID and Influenza DiagnosticReport Result from Lab":   "COVID and Influenza DiagnosticReport Result from Lab" Reports     return SharedResource.DiagnosticReportLabResource(Reports,     {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-diagnosticreport-lab'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define "SDE Location":   [Location] Locations   where exists("Initial Population")   return SharedResource.LocationResource(Locations,   {FHIR.canonical{value: 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/ach-daily-location'}})
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    //----------------------------------------------------- //functions //----------------------------------------------------- define function "CheckIP"(encounter Encounter):   exists("Initial Population" IP   where encounter.id = IP.id)
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value EncounterStatus): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToInterval(period FHIR.Period):     if period is null then         null      else          if period."start".value is null then             Interval(period."start".value, period."end".value]         else              if time from period."start".value is null and time from period."end".value is not null then                 Interval[                     DateTime(year from period."start".value, month from period."start".value, day from period."start".value,                         0, 0, 0, 0, timezoneoffset from period."end".value),                      period."end".value                 ]         else              if time from period."end".value is null and time from period."start".value is not null then                 Interval[                     period."start".value,                      DateTime(year from period."end".value, month from period."end".value, day from period."end".value,                         23, 59, 59, 999, timezoneoffset from period."start".value)                 ]         else Interval[period."start".value, period."end".value]
Logic Definition | Library Name: NHSNHelpers
    define function "GetLocation"(reference Reference ):   singleton from (  [Location] Locations   where Locations.id = GetId(reference.reference)   )
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value string): value.value
Logic Definition | Library Name: NHSNHelpers
    define function "GetId"(uri String ):   Last(Split(uri, '/'))
Logic Definition | Library Name: FHIRHelpers
    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         }
Logic Definition | Library Name: FHIRHelpers
    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         }
Logic Definition | Library Name: SharedResourceCreation
    define function EncounterResource(encounter Encounter, profileURLs List<FHIR.canonical>):   encounter e   return Encounter{     id: FHIR.id{value: 'LCR-' + e.id},     meta: MetaElement(e, profileURLs),     extension: e.extension,     identifier: EncounterIdentifier(e.identifier),     status: e.status,     statusHistory: EncounterStatusHistory(e.statusHistory),     class: e.class,     classHistory: 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: EncounterDiagnosis(e.diagnosis),     account: e.account,     hospitalization: EncounterHospitalization(e.hospitalization),     location: EncounterLocation(e.location),     partOf: e.partOf   }
Logic Definition | Library Name: SharedResourceCreation
    define function "MetaElement"(resource Resource, profileURLs List<FHIR.canonical>):   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   }
Logic Definition | Library Name: SharedResourceCreation
    define function EncounterIdentifier(identifier List<FHIR.Identifier>):   identifier i   return FHIR.Identifier{     use: i.use,     type: i.type,     system: i.system,     value: i.value,     period: i.period   }
Logic Definition | Library Name: SharedResourceCreation
    define function EncounterStatusHistory(statusHistory List<FHIR.Encounter.StatusHistory>):   statusHistory sH   return FHIR.Encounter.StatusHistory{     status: sH.status,     period: sH.period   }
Logic Definition | Library Name: SharedResourceCreation
    define function EncounterClassHistory(classHistory List<FHIR.Encounter.ClassHistory>):   classHistory cH   return FHIR.Encounter.ClassHistory{     class: cH.class,     period: cH.period   }
Logic Definition | Library Name: SharedResourceCreation
    /*No longer needed but saving for potential future use define function EncounterParticipant(participant List<FHIR.Encounter.Participant>):   participant p   return FHIR.Encounter.Participant{     type: p.type,     period: p.period,     individual: p.individual   }*/  define function EncounterDiagnosis(diagnosis List<FHIR.Encounter.Diagnosis>):   diagnosis d   return FHIR.Encounter.Diagnosis{     condition: d.condition,     use: d.use,     rank: d.rank   }
Logic Definition | Library Name: SharedResourceCreation
    define function EncounterHospitalization(hospitalization FHIR.Encounter.Hospitalization):   hospitalization h   return FHIR.Encounter.Hospitalization{     preAdmissionIdentifier: h.preAdmissionIdentifier,     origin: h.origin,     admitSource: h.admitSource,     reAdmission: h.reAdmission,     dietPreference: h.dietPreference,     specialCourtesy: h.specialCourtesy,     specialArrangement: h.specialArrangement,     destination: h.destination,     dischargeDisposition: h.dischargeDisposition   }
Logic Definition | Library Name: SharedResourceCreation
    define function EncounterLocation(location List<FHIR.Encounter.Location>):   location l   return FHIR.Encounter.Location{     location: l.location,     status: l.status,     physicalType: l.physicalType,     period: l.period   }
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value ServiceRequestIntent): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value ServiceRequestStatus): value.value
Logic Definition | Library Name: SharedResourceCreation
    define function ServiceRequestResource(serviceRequest ServiceRequest, profileURLs List<FHIR.canonical>):   serviceRequest sR   return ServiceRequest{     id: FHIR.id {value: 'LCR-' + sR.id},     meta: MetaElement(sR, profileURLs),     extension: sR.extension,     instantiatesCanonical: sR.instantiatesCanonical,     instantiatesUri: sR.instantiatesUri,     basedOn: sR.basedOn,     replaces: sR.replaces,     requisition: sR.requisition,     status: sR.status,     intent: sR.intent,     category: sR.category,     priority: sR.priority,     doNotPerform: sR.doNotPerform,     code: sR.code,     orderDetail: sR.orderDetail,     quantity: sR.quantity,     subject: sR.subject,     encounter: sR.encounter,     occurrence: sR.occurrence,     asNeeded: sR.asNeeded,     authoredOn: sR.authoredOn,     requester: sR.requester,     performerType: sR.performerType,     performer: sR.performer,     locationCode: sR.locationCode,     locationReference: sR.locationReference,     reasonCode: sR.reasonCode,     reasonReference: sR.reasonReference,     insurance: sR.insurance,     supportingInfo: sR.supportingInfo,     specimen: sR.specimen,     bodySite: sR.bodySite,     note: sR.note,     patientInstruction: sR.patientInstruction,     relevantHistory: sR.relevantHistory   }
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value ObservationStatus): value.value
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define function "GetSpecimen"(reference FHIR.Reference):   singleton from (     [Specimen] Specimens     where Specimens.id = NHSNHelpers.GetId(reference.reference)   )
Logic Definition | Library Name: SharedResourceCreation
    define function SpecimenResource(specimen Specimen, profileURLs List<FHIR.canonical>):   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   }
Logic Definition | Library Name: SharedResourceCreation
    define function SpecimenCollection(collection FHIR.Specimen.Collection):   collection c   return FHIR.Specimen.Collection{     collector: c.collector,     collected: c.collected,     "duration": c."duration",     quantity: c.quantity,     method: c.method,     bodySite: c.bodySite,     fastingStatus: c.fastingStatus   }
Logic Definition | Library Name: SharedResourceCreation
    define function SpecimenProcessing(processing List<FHIR.Specimen.Processing>):   processing p   return FHIR.Specimen.Processing{     description: p.description,     procedure: p.procedure,     additive: p.additive,     time: p.time   }
Logic Definition | Library Name: SharedResourceCreation
    define function SpecimenContainer(container List<FHIR.Specimen.Container>):   container c   return FHIR.Specimen.Container{     description: c.description,     type: c.type,     capacity: c.capacity,     specimenQuantity: c.specimenQuantity,     additive: c.additive   }
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value DiagnosticReportStatus): value.value
Logic Definition | Library Name: SharedResourceCreation
    define function DiagnosticReportLabResource(diagnosticReport DiagnosticReport, profileURLs List<FHIR.canonical>):   diagnosticReport d   return DiagnosticReport{     id: FHIR.id{value: 'LCR-' + d.id},     meta: MetaElement(d, profileURLs),     extension: d.extension,     basedOn: d.basedOn,     status: d.status,     category: DiagnosticReportCategory(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   }
Logic Definition | Library Name: SharedResourceCreation
    define function DiagnosticReportCategory(category List<CodeableConcept>):   category c   return CodeableConcept{     coding: DiagnosticReportCoding(c.coding)   }
Logic Definition | Library Name: SharedResourceCreation
    define function DiagnosticReportCoding(coding List<Coding>):   coding c   return Coding{     system: c.system,     version: c.version,     code: c.code,     display: c.display,     userSelected: c.userSelected   }
Logic Definition | Library Name: SharedResourceCreation
    define function ObservationLabResource(observation Observation, profileURLs List<FHIR.canonical>):   observation o   return Observation{     id: FHIR.id {value: 'LCR-' + o.id},     meta: 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: ObservationReferenceRange(o.referenceRange),     hasMember: o.hasMember,     derivedFrom: o.derivedFrom,     component: ObservationComponent(o.component)   }
Logic Definition | Library Name: SharedResourceCreation
    define function ObservationLabCategory(category List<CodeableConcept>):   category c   return CodeableConcept{     coding: ObservationLabCoding(c.coding),     text: c.text   }
Logic Definition | Library Name: SharedResourceCreation
    define function ObservationLabCoding(coding List<Coding>):   coding c   return Coding{     id: c.id,     extension: c.extension,     system: c.system,     version: c.version,     code: c.code,     display: c.display,     userSelected: c.userSelected   }
Logic Definition | Library Name: SharedResourceCreation
    define function ObservationReferenceRange(referenceRange List<FHIR.Observation.ReferenceRange>):   referenceRange rR   return FHIR.Observation.ReferenceRange{     low: rR.low,     high: rR.high,     type: rR.type,     appliesTo: rR.appliesTo,     age: rR.age,     text: rR.text   }
Logic Definition | Library Name: SharedResourceCreation
    define function ObservationComponent(component List<FHIR.Observation.Component>):   component c   return FHIR.Observation.Component{     code: c.code,     value: c.value,     dataAbsentReason: c.dataAbsentReason,     interpretation: c.interpretation,     referenceRange: c.referenceRange   }
Logic Definition | Library Name: SharedResourceCreation
    define function ProcedureResource(procedure Procedure, profileURLs List<FHIR.canonical>):   procedure p   return Procedure{     id: FHIR.id {value: 'LCR-' + p.id},     meta: MetaElement(p, profileURLs),     extension: p.extension,     instantiatesCanonical: p.instantiatesCanonical,     instantiatesUri: p.instantiatesUri,     basedOn: p.basedOn,     partOf: p.partOf,     status: p.status,     statusReason: p.statusReason,     category: p.category,     code: p.code,     subject: p.subject,     encounter: p.encounter,     performed: p.performed,     recorder: p.recorder,     asserter: p.asserter,     performer: ProcedurePerformer(p.performer),     location: p.location,     reasonCode: p.reasonCode,     reasonReference: p.reasonReference,     bodySite: p.bodySite,     outcome: p.outcome,     report: p.report,     complication: p.complication,     complicationDetail: p.complicationDetail,     followUp: p.followUp,     note: p.note,     focalDevice: ProcedureFocalDevice(p.focalDevice),     usedReference: p.usedReference,     usedCode: p.usedCode   }
Logic Definition | Library Name: SharedResourceCreation
    define function ProcedurePerformer(performer List<FHIR.Procedure.Performer>):   performer p   return FHIR.Procedure.Performer{     function: p.function,     actor: p.actor,     onBehalfOf: p.onBehalfOf   }
Logic Definition | Library Name: SharedResourceCreation
    define function ProcedureFocalDevice(device List<FHIR.Procedure.FocalDevice>):   device d   return FHIR.Procedure.FocalDevice{     action: d.action,     manipulated: d.manipulated   }
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define function "GetMedicationCode"(choice Choice<FHIR.CodeableConcept, FHIR.Reference>):   case     when choice is FHIR.CodeableConcept then       choice as FHIR.CodeableConcept     when choice is FHIR.Reference then       GetMedication(choice as FHIR.Reference).code     else       null as FHIR.CodeableConcept   end
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define function "GetMedication"(reference Reference ):   singleton from (     [Medication: id in {NHSNHelpers.GetId(reference.reference)}]   )
Logic Definition | Library Name: NHSNHelpers
    define function "Normalize Interval"(choice Choice<FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range>):   case    when choice is FHIR.dateTime then      Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]   when choice is FHIR.Period then     FHIRHelpers.ToInterval(choice as FHIR.Period)   when choice is FHIR.instant then    Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]   when choice is FHIR.Age then     Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),      FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)   when choice is FHIR.Range then     Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),      FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)   when choice is FHIR.Timing then     Message(null as Interval<DateTime>, true, '1', 'Error', 'Cannot compute a single interval from a Timing type')     when choice is FHIR.string then       Message(null as Interval<DateTime>, true, '1', 'Error', 'Cannot compute an interval from a String value')   else    null as Interval<DateTime>  end
Logic Definition | Library Name: FHIRHelpers
    define function ToDateTime(value dateTime): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToDateTime(value instant): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToDate(value date): value.value
Logic Definition | Library Name: FHIRHelpers
    define function ToQuantity(quantity FHIR.Quantity):     case         when quantity is null then null         when quantity.value is null then null         when quantity.comparator is not null then             Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')         when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'               or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then             System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }         else             Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' & quantity.unit.value & ' (' & quantity.system.value & '|' & quantity.code.value & ')')     end
Logic Definition | Library Name: FHIRHelpers
    define function ToCalendarUnit(unit System.String):     case unit         when 'ms' then 'millisecond'         when 's' then 'second'         when 'min' then 'minute'         when 'h' then 'hour'         when 'd' then 'day'         when 'wk' then 'week'         when 'mo' then 'month'         when 'a' then 'year'         else unit     end
Logic Definition | Library Name: SharedResourceCreation
    define function MedicationRequestResource(medicationRequest MedicationRequest, profileURLs List<FHIR.canonical>):   medicationRequest m   return MedicationRequest{     id: FHIR.id {value: 'LCR-' + m.id},     meta: 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)   }
Logic Definition | Library Name: SharedResourceCreation
    define function MedicationRequestDosageInstruction(dosageInstruction List<FHIR.Dosage>):   dosageInstruction dI   return FHIR.Dosage{     text: dI.text,     patientInstruction: dI.patientInstruction,     timing: dI.timing,     asNeeded: dI.asNeeded,     site: dI.site,     route: dI.route,     method: dI.method,     doseAndRate: MedicationRequestDoseAndRate(dI.doseAndRate)   }
Logic Definition | Library Name: SharedResourceCreation
    define function MedicationRequestDoseAndRate(doseAndRate List<FHIR.Dosage.DoseAndRate>):   doseAndRate dR   return FHIR.Dosage.DoseAndRate{     type: dR.type,     dose: dR.dose,     rate: dR.rate   }
Logic Definition | Library Name: SharedResourceCreation
    define function PatientResource(patient Patient, profileURLs List<FHIR.canonical>):   patient p   return Patient{     id: FHIR.id{value: 'LCR-' + p.id},     meta: MetaElement(p, profileURLs),     extension: GetPatientExtensions(p) union GetIdExtensions(p),     identifier: p.identifier,     active: p.active,     name: PatientName(p.name),     telecom: PatientTelecom(p.telecom),     gender: p.gender,     birthDate: p.birthDate,     deceased: p.deceased,     address: PatientAddress(p.address),     maritalStatus: p.maritalStatus,     multipleBirth: p.multipleBirth,     photo: p.photo,     contact: PatientContact(p.contact),     communication: PatientCommunication(p.communication),     generalPractitioner: p.generalPractitioner,     managingOrganization: p.managingOrganization,     link: PatientLink(p.link)   }
Logic Definition | Library Name: SharedResourceCreation
    define function "GetPatientExtensions"(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-birthsex'     or E.url.value = 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/link-original-resource-id-extension'   return E
Logic Definition | Library Name: SharedResourceCreation
    define function "GetIdExtensions"(domainResource DomainResource):   domainResource.extension E   where E.url.value = 'http://www.cdc.gov/nhsn/fhirportal/dqm/ig/StructureDefinition/link-original-resource-id-extension'   return E
Logic Definition | Library Name: SharedResourceCreation
    /* No longer needed but saving in case it's useful later define function PatientIdentifier(identifier List<FHIR.Identifier>):   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<FHIR.HumanName>):   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   }
Logic Definition | Library Name: SharedResourceCreation
    define function PatientTelecom(telecom List<FHIR.ContactPoint>):   telecom t   return FHIR.ContactPoint{     system: t.system,     value: t.value,     use: t.use,     rank: t.rank,     period: t.period   }
Logic Definition | Library Name: SharedResourceCreation
    define function PatientAddress(address List<FHIR.Address>):   address a   return FHIR.Address{     id: a.id,     extension: a.extension,     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   }
Logic Definition | Library Name: SharedResourceCreation
    define function PatientContact(contact List<FHIR.Patient.Contact>):   contact c   return FHIR.Patient.Contact{     id: c.id,     extension: c.extension,     relationship: c.relationship,     name: c.name,     telecom: c.telecom,     address: c.address,     gender: c.gender,     organization: c.organization,     period: c.period   }
Logic Definition | Library Name: SharedResourceCreation
    define function PatientCommunication(communication List<FHIR.Patient.Communication>):   communication c   return FHIR.Patient.Communication{     id: c.id,     extension: c.extension,     language: c.language,     preferred: c.preferred   }
Logic Definition | Library Name: SharedResourceCreation
    define function PatientLink(link List<FHIR.Patient.Link>):   link l   return FHIR.Patient.Link{     id: l.id,     extension: l.extension,     modifierExtension: l.modifierExtension,     other: l.other,     type: l.type   }
Logic Definition | Library Name: FHIRHelpers
    define function ToString(value MedicationAdministrationStatus): value.value
Logic Definition | Library Name: SharedResourceCreation
    define function MedicationAdministrationResource(medicationAdministration MedicationAdministration, profileURLs List<FHIR.canonical>):   medicationAdministration m   return MedicationAdministration{     id: FHIR.id {value: 'LCR-' + m.id},     meta: 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,     performer: MedicationAdministrationPerformer(m.performer),     reasonCode: m.reasonCode,     reasonReference: m.reasonReference,     request: m.request,     device: m.device,     note: m.note,     dosage: MedicationAdministrationDosage(m.dosage),     eventHistory: m.eventHistory   }
Logic Definition | Library Name: SharedResourceCreation
    define function MedicationAdministrationPerformer(performer List<FHIR.MedicationAdministration.Performer>):   performer p   return FHIR.MedicationAdministration.Performer{     function: p.function,     actor: p.actor   }
Logic Definition | Library Name: SharedResourceCreation
    define function MedicationAdministrationDosage(dosage FHIR.MedicationAdministration.Dosage):   dosage d   return FHIR.MedicationAdministration.Dosage{     text: d.text,     site: d.site,     route: d.route,     method: d.method,     dose: d.dose,     rate: d.rate   }
Logic Definition | Library Name: SharedResourceCreation
    define function MedicationResource(medication Medication, profileURLs List<FHIR.canonical>):   medication m   return Medication{     id: FHIR.id {value: 'LCR-' + m.id},     meta: MetaElement(m, profileURLs),     extension: m.extension,     code: m.code,     status: m.status,     manufacturer: m.manufacturer,     form: m.form,     amount: m.amount,     ingredient: MedicationIngredient(m.ingredient),     batch: MedicationBatch(m.batch)   }
Logic Definition | Library Name: SharedResourceCreation
    define function MedicationIngredient(ingredient List<FHIR.Medication.Ingredient>):   ingredient i   return FHIR.Medication.Ingredient{     item: i.item,     strength: i.strength   }
Logic Definition | Library Name: SharedResourceCreation
    define function MedicationBatch(batch FHIR.Medication.Batch):   batch b   return FHIR.Medication.Batch{     lotNumber: b.lotNumber,     expirationDate: b.expirationDate   }
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define function "GetMedicationFrom"(choice Choice<FHIR.CodeableConcept, FHIR.Reference>):   case     when choice is FHIR.Reference then       GetMedication(choice as FHIR.Reference)     else       null   end
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define fluent function references(references List<FHIR.Reference>, resource FHIR.Resource):   exists(references R where R.references(resource))
Logic Definition | Library Name: NHSNAcuteCareHospitalDailyInitialPopulation
    define fluent function references(reference FHIR.Reference, resource FHIR.Resource):   resource.id = Last(Split(reference.reference, '/'))
Logic Definition | Library Name: SharedResourceCreation
    define function LocationResource(location Location, profileURLs List<FHIR.canonical>):   location l   return Location{     id: FHIR.id {value: 'LCR-' + l.id},     meta: MetaElement(l, profileURLs),     extension: l.extension,     status: l.status,     operationalStatus: l.operationalStatus,     name: l.name,     alias: l.alias,     description: l.description,     mode: l.mode,     type: l.type,     telecom: l.telecom,     address: LocationAddress(l.address),     physicalType: l.physicalType,     position: LocationPosition(l.position),     managingOrganization: l.managingOrganization,     partOf: l.partOf,     hoursOfOperation: LocationHoursOfOperation(l.hoursOfOperation),     availabilityExceptions: l.availabilityExceptions,     endpoint: l.endpoint   }
Logic Definition | Library Name: SharedResourceCreation
    define function LocationAddress(address FHIR.Address):   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   }
Logic Definition | Library Name: SharedResourceCreation
    define function LocationPosition(position FHIR.Location.Position):   position p   return FHIR.Location.Position{     longitude: p.longitude,     latitude: p.latitude,     altitude: p.altitude   }
Logic Definition | Library Name: SharedResourceCreation
    define function LocationHoursOfOperation(hoursOfOperation List<FHIR.Location.HoursOfOperation>):   hoursOfOperation hOO   return FHIR.Location.HoursOfOperation{     daysOfWeek: hOO.daysOfWeek,     allDay: hOO.allDay,     openingTime: hOO.openingTime,     closingTime: hOO.closingTime   }
Generated using version 0.4.6 of the sample-content-ig Liquid templates