Data Exchange For Quality Measures Implementation Guide
1.0.0-ballot - STU 1 Ballot

Data Exchange For Quality Measures Implementation Guide - Downloaded Version 1.0.0-ballot See the Directory of published versions

## : Additional Supplemental Data Example - Artifact Bundle

Raw ttl | Download

    @prefix fhir: <http://hl7.org/fhir/> .
    @prefix owl: <http://www.w3.org/2002/07/owl#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

    # - resource -------------------------------------------------------------------

     a fhir:Bundle ;
      fhir:nodeRole fhir:treeRoot ;
      fhir:id [ fhir:v "sde-example-artifact-bundle"] ; #
      fhir:language [ fhir:v "en"] ; #
      fhir:type [ fhir:v "transaction"] ; #
      fhir:entry ( [
    fhir:fullUrl [
    fhir:v "urn:uuid:31244296-3e84-4e17-94b1-4159d64e41db"^^xsd:anyURI ;
    fhir:l <urn:uuid:31244296-3e84-4e17-94b1-4159d64e41db>     ] ;
        ( fhir:resource <urn:uuid:31244296-3e84-4e17-94b1-4159d64e41db> ) ;
    fhir:request [
    fhir:method [ fhir:v "PUT" ] ;
    fhir:url [
    fhir:v "Library/FHIRHelpers"^^xsd:anyURI ;
    fhir:l fhir:Library/FHIRHelpers       ]     ]
      ] [
    fhir:fullUrl [
    fhir:v "urn:uuid:aa99c584-12e5-46bb-8b30-ab10cfe26471"^^xsd:anyURI ;
    fhir:l <urn:uuid:aa99c584-12e5-46bb-8b30-ab10cfe26471>     ] ;
        ( fhir:resource <urn:uuid:aa99c584-12e5-46bb-8b30-ab10cfe26471> ) ;
    fhir:request [
    fhir:method [ fhir:v "PUT" ] ;
    fhir:url [
    fhir:v "Library/FHIRCommon"^^xsd:anyURI ;
    fhir:l fhir:Library/FHIRCommon       ]     ]
      ] [
    fhir:fullUrl [
    fhir:v "urn:uuid:b3463968-f67d-42ef-8494-cd4ea42e87b9"^^xsd:anyURI ;
    fhir:l <urn:uuid:b3463968-f67d-42ef-8494-cd4ea42e87b9>     ] ;
        ( fhir:resource <urn:uuid:b3463968-f67d-42ef-8494-cd4ea42e87b9> ) ;
    fhir:request [
    fhir:method [ fhir:v "PUT" ] ;
    fhir:url [
    fhir:v "Library/MATGlobalCommonFunctionsFHIR4"^^xsd:anyURI ;
    fhir:l fhir:Library/MATGlobalCommonFunctionsFHIR4       ]     ]
      ] [
    fhir:fullUrl [
    fhir:v "urn:uuid:c6098378-cb38-4ae2-a096-3a3cc5c620d5"^^xsd:anyURI ;
    fhir:l <urn:uuid:c6098378-cb38-4ae2-a096-3a3cc5c620d5>     ] ;
        ( fhir:resource <urn:uuid:c6098378-cb38-4ae2-a096-3a3cc5c620d5> ) ;
    fhir:request [
    fhir:method [ fhir:v "PUT" ] ;
    fhir:url [
    fhir:v "Library/SupplementalDataElementsFHIR4"^^xsd:anyURI ;
    fhir:l fhir:Library/SupplementalDataElementsFHIR4       ]     ]
      ] [
    fhir:fullUrl [
    fhir:v "urn:uuid:e3b78b9e-96ee-43fb-aeea-22a7681a1538"^^xsd:anyURI ;
    fhir:l <urn:uuid:e3b78b9e-96ee-43fb-aeea-22a7681a1538>     ] ;
        ( fhir:resource <urn:uuid:e3b78b9e-96ee-43fb-aeea-22a7681a1538> ) ;
    fhir:request [
    fhir:method [ fhir:v "PUT" ] ;
    fhir:url [
    fhir:v "Library/NHSNGlycemicControlHypoglycemicInitialPopulation"^^xsd:anyURI ;
    fhir:l fhir:Library/NHSNGlycemicControlHypoglycemicInitialPopulation       ]     ]
      ] [
    fhir:fullUrl [
    fhir:v "urn:uuid:61d3ae55-c7b7-484f-96df-4f3ef8c080c0"^^xsd:anyURI ;
    fhir:l <urn:uuid:61d3ae55-c7b7-484f-96df-4f3ef8c080c0>     ] ;
        ( fhir:resource <urn:uuid:61d3ae55-c7b7-484f-96df-4f3ef8c080c0> ) ;
    fhir:request [
    fhir:method [ fhir:v "PUT" ] ;
    fhir:url [
    fhir:v "Measure/NHSNGlycemicControlHypoglycemicInitialPopulation"^^xsd:anyURI ;
    fhir:l fhir:Measure/NHSNGlycemicControlHypoglycemicInitialPopulation       ]     ]
      ] ) . #

    <urn:uuid:31244296-3e84-4e17-94b1-4159d64e41db> a fhir:Library ;
      fhir:id [ fhir:v "FHIRHelpers"] ; #
      fhir:language [ fhir:v "en"] ; #
      fhir:text [
    fhir:status [ fhir:v "extensions" ] ;
    fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Library_FHIRHelpers\"> </a>\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n\n<td class=\"content-container\">FHIR Helpers</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">4.0.1</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Status</th>\n\n\n\n<td class=\"content-container\">Draft</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Experimental</th>\n\n\n\n<td class=\"content-container\">true</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n\n<td class=\"content-container\">\n    Logic Library\n\n\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"parameters\"> </a>Parameters</th>\n\n\n</tr>\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Parameter</th>\n\n\n\n<td class=\"content-container\">None</td>\n\n\n</tr>\n\n\n\n\n\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*#xD;\n@author: Bryn Rhodes#xD;\n@description: This library defines functions to convert between FHIR#xD;\n data types and CQL system-defined types, as well as functions to support#xD;\n FHIRPath implementation. For more information, see the FHIRHelpers wiki page:#xD;\n https://github.com/cqframework/clinical_quality_language/wiki/FHIRHelpers#xD;\n@allowFluent: true#xD;\n*/#xD;\nlibrary FHIRHelpers version '4.0.1'#xD;\n#xD;\nusing FHIR version '4.0.1'#xD;\n#xD;\ndefine function ToInterval(period FHIR.Period):#xD;\n    if period is null then#xD;\n        null#xD;\n    else#xD;\n        if period.\"start\" is null then#xD;\n            Interval(period.\"start\".value, period.\"end\".value]#xD;\n        else#xD;\n            Interval[period.\"start\".value, period.\"end\".value]#xD;\n#xD;\ndefine function ToCalendarUnit(unit System.String):#xD;\n    case unit#xD;\n        when 'ms' then 'millisecond'#xD;\n        when 's' then 'second'#xD;\n        when 'min' then 'minute'#xD;\n        when 'h' then 'hour'#xD;\n        when 'd' then 'day'#xD;\n        when 'wk' then 'week'#xD;\n        when 'mo' then 'month'#xD;\n        when 'a' then 'year'#xD;\n        else unit#xD;\n    end#xD;\n#xD;\ndefine function ToQuantity(quantity FHIR.Quantity):#xD;\n    case#xD;\n        when quantity is null then null#xD;\n        when quantity.value is null then null#xD;\n        when quantity.comparator is not null then#xD;\n            Message(null, true, 'FHIRHelpers.ToQuantity.ComparatorQuantityNotSupported', 'Error', 'FHIR Quantity value has a comparator and cannot be converted to a System.Quantity value.')#xD;\n        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'#xD;\n              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then#xD;\n            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }#xD;\n        else#xD;\n            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')#xD;\n    end#xD;\n#xD;\ndefine function ToQuantityIgnoringComparator(quantity FHIR.Quantity):#xD;\n    case#xD;\n        when quantity is null then null#xD;\n        when quantity.value is null then null#xD;\n        when quantity.system is null or quantity.system.value = 'http://unitsofmeasure.org'#xD;\n              or quantity.system.value = 'http://hl7.org/fhirpath/CodeSystem/calendar-units' then#xD;\n            System.Quantity { value: quantity.value.value, unit: ToCalendarUnit(Coalesce(quantity.code.value, quantity.unit.value, '1')) }#xD;\n        else#xD;\n            Message(null, true, 'FHIRHelpers.ToQuantity.InvalidFHIRQuantity', 'Error', 'Invalid FHIR Quantity code: ' &amp; quantity.unit.value &amp; ' (' &amp; quantity.system.value &amp; '|' &amp; quantity.code.value &amp; ')')#xD;\n    end#xD;\n#xD;\ndefine function ToInterval(quantity FHIR.Quantity):#xD;\n    if quantity is null then null else#xD;\n        case quantity.comparator.value#xD;\n            when '&lt;' then#xD;\n                Interval[#xD;\n                    null,#xD;\n                    ToQuantityIgnoringComparator(quantity)#xD;\n                )#xD;\n            when '&lt;=' then#xD;\n                Interval[#xD;\n                    null,#xD;\n                    ToQuantityIgnoringComparator(quantity)#xD;\n                ]#xD;\n            when '&gt;=' then#xD;\n                Interval[#xD;\n                    ToQuantityIgnoringComparator(quantity),#xD;\n                    null#xD;\n                ]#xD;\n            when '&gt;' then#xD;\n                Interval(#xD;\n                    ToQuantityIgnoringComparator(quantity),#xD;\n                    null#xD;\n                ]#xD;\n            else#xD;\n                Interval[ToQuantity(quantity), ToQuantity(quantity)]#xD;\n        end#xD;\n#xD;\ndefine function ToRatio(ratio FHIR.Ratio):#xD;\n    if ratio is null then#xD;\n        null#xD;\n    else#xD;\n        System.Ratio { numerator: ToQuantity(ratio.numerator), denominator: ToQuantity(ratio.denominator) }#xD;\n#xD;\ndefine function ToInterval(range FHIR.Range):#xD;\n    if range is null then#xD;\n        null#xD;\n    else#xD;\n        Interval[ToQuantity(range.low), ToQuantity(range.high)]#xD;\n#xD;\ndefine function ToCode(coding FHIR.Coding):#xD;\n    if coding is null then#xD;\n        null#xD;\n    else#xD;\n        System.Code {#xD;\n          code: coding.code.value,#xD;\n          system: coding.system.value,#xD;\n          version: coding.version.value,#xD;\n          display: coding.display.value#xD;\n        }#xD;\n#xD;\ndefine function ToConcept(concept FHIR.CodeableConcept):#xD;\n    if concept is null then#xD;\n        null#xD;\n    else#xD;\n        System.Concept {#xD;\n            codes: concept.coding C return ToCode(C),#xD;\n            display: concept.text.value#xD;\n        }#xD;\n#xD;\ndefine function reference(reference String):#xD;\n    if reference is null then#xD;\n        null#xD;\n    else#xD;\n        Reference { reference: string { value: reference } }#xD;\n#xD;\ndefine function resolve(reference String) returns Resource: external#xD;\ndefine function resolve(reference Reference) returns Resource: external#xD;\ndefine function reference(resource Resource) returns Reference: external#xD;\ndefine function extension(element Element, url String) returns List&lt;Element&gt;: external#xD;\ndefine function extension(resource Resource, url String) returns List&lt;Element&gt;: external#xD;\ndefine function hasValue(element Element) returns Boolean: external#xD;\ndefine function getValue(element Element) returns Any: external#xD;\ndefine function ofType(identifier String) returns List&lt;Any&gt;: external#xD;\ndefine function is(identifier String) returns Boolean: external#xD;\ndefine function as(identifier String) returns Any: external#xD;\ndefine function elementDefinition(element Element) returns ElementDefinition: external#xD;\ndefine function slice(element Element, url String, name String) returns List&lt;Element&gt;: external#xD;\ndefine function checkModifiers(resource Resource) returns Resource: external#xD;\ndefine function checkModifiers(resource Resource, modifier String) returns Resource: external#xD;\ndefine function checkModifiers(element Element) returns Element: external#xD;\ndefine function checkModifiers(element Element, modifier String) returns Element: external#xD;\ndefine function conformsTo(resource Resource, structure String) returns Boolean: external#xD;\ndefine function memberOf(code code, valueSet String) returns Boolean: external#xD;\ndefine function memberOf(coding Coding, valueSet String) returns Boolean: external#xD;\ndefine function memberOf(concept CodeableConcept, valueSet String) returns Boolean: external#xD;\ndefine function subsumes(coding Coding, subsumedCoding Coding) returns Boolean: external#xD;\ndefine function subsumes(concept CodeableConcept, subsumedConcept CodeableConcept) returns Boolean: external#xD;\ndefine function subsumedBy(coding Coding, subsumingCoding Coding) returns Boolean: external#xD;\ndefine function subsumedBy(concept CodeableConcept, subsumingConcept CodeableConcept) returns Boolean: external#xD;\ndefine function htmlChecks(element Element) returns Boolean: external#xD;\n#xD;\ndefine function ToString(value AccountStatus): value.value#xD;\ndefine function ToString(value ActionCardinalityBehavior): value.value#xD;\ndefine function ToString(value ActionConditionKind): value.value#xD;\ndefine function ToString(value ActionGroupingBehavior): value.value#xD;\ndefine function ToString(value ActionParticipantType): value.value#xD;\ndefine function ToString(value ActionPrecheckBehavior): value.value#xD;\ndefine function ToString(value ActionRelationshipType): value.value#xD;\ndefine function ToString(value ActionRequiredBehavior): value.value#xD;\ndefine function ToString(value ActionSelectionBehavior): value.value#xD;\ndefine function ToString(value ActivityDefinitionKind): value.value#xD;\ndefine function ToString(value ActivityParticipantType): value.value#xD;\ndefine function ToString(value AddressType): value.value#xD;\ndefine function ToString(value AddressUse): value.value#xD;\ndefine function ToString(value AdministrativeGender): value.value#xD;\ndefine function ToString(value AdverseEventActuality): value.value#xD;\ndefine function ToString(value AggregationMode): value.value#xD;\ndefine function ToString(value AllergyIntoleranceCategory): value.value#xD;\ndefine function ToString(value AllergyIntoleranceCriticality): value.value#xD;\ndefine function ToString(value AllergyIntoleranceSeverity): value.value#xD;\ndefine function ToString(value AllergyIntoleranceType): value.value#xD;\ndefine function ToString(value AppointmentStatus): value.value#xD;\ndefine function ToString(value AssertionDirectionType): value.value#xD;\ndefine function ToString(value AssertionOperatorType): value.value#xD;\ndefine function ToString(value AssertionResponseTypes): value.value#xD;\ndefine function ToString(value AuditEventAction): value.value#xD;\ndefine function ToString(value AuditEventAgentNetworkType): value.value#xD;\ndefine function ToString(value AuditEventOutcome): value.value#xD;\ndefine function ToString(value BindingStrength): value.value#xD;\ndefine function ToString(value BiologicallyDerivedProductCategory): value.value#xD;\ndefine function ToString(value BiologicallyDerivedProductStatus): value.value#xD;\ndefine function ToString(value BiologicallyDerivedProductStorageScale): value.value#xD;\ndefine function ToString(value BundleType): value.value#xD;\ndefine function ToString(value CapabilityStatementKind): value.value#xD;\ndefine function ToString(value CarePlanActivityKind): value.value#xD;\ndefine function ToString(value CarePlanActivityStatus): value.value#xD;\ndefine function ToString(value CarePlanIntent): value.value#xD;\ndefine function ToString(value CarePlanStatus): value.value#xD;\ndefine function ToString(value CareTeamStatus): value.value#xD;\ndefine function ToString(value CatalogEntryRelationType): value.value#xD;\ndefine function ToString(value ChargeItemDefinitionPriceComponentType): value.value#xD;\ndefine function ToString(value ChargeItemStatus): value.value#xD;\ndefine function ToString(value ClaimResponseStatus): value.value#xD;\ndefine function ToString(value ClaimStatus): value.value#xD;\ndefine function ToString(value ClinicalImpressionStatus): value.value#xD;\ndefine function ToString(value CodeSearchSupport): value.value#xD;\ndefine function ToString(value CodeSystemContentMode): value.value#xD;\ndefine function ToString(value CodeSystemHierarchyMeaning): value.value#xD;\ndefine function ToString(value CommunicationPriority): value.value#xD;\ndefine function ToString(value CommunicationRequestStatus): value.value#xD;\ndefine function ToString(value CommunicationStatus): value.value#xD;\ndefine function ToString(value CompartmentCode): value.value#xD;\ndefine function ToString(value CompartmentType): value.value#xD;\ndefine function ToString(value CompositionAttestationMode): value.value#xD;\ndefine function ToString(value CompositionStatus): value.value#xD;\ndefine function ToString(value ConceptMapEquivalence): value.value#xD;\ndefine function ToString(value ConceptMapGroupUnmappedMode): value.value#xD;\ndefine function ToString(value ConditionalDeleteStatus): value.value#xD;\ndefine function ToString(value ConditionalReadStatus): value.value#xD;\ndefine function ToString(value ConsentDataMeaning): value.value#xD;\ndefine function ToString(value ConsentProvisionType): value.value#xD;\ndefine function ToString(value ConsentState): value.value#xD;\ndefine function ToString(value ConstraintSeverity): value.value#xD;\ndefine function ToString(value ContactPointSystem): value.value#xD;\ndefine function ToString(value ContactPointUse): value.value#xD;\ndefine function ToString(value ContractPublicationStatus): value.value#xD;\ndefine function ToString(value ContractStatus): value.value#xD;\ndefine function ToString(value ContributorType): value.value#xD;\ndefine function ToString(value CoverageStatus): value.value#xD;\ndefine function ToString(value CurrencyCode): value.value#xD;\ndefine function ToString(value DayOfWeek): value.value#xD;\ndefine function ToString(value DaysOfWeek): value.value#xD;\ndefine function ToString(value DetectedIssueSeverity): value.value#xD;\ndefine function ToString(value DetectedIssueStatus): value.value#xD;\ndefine function ToString(value DeviceMetricCalibrationState): value.value#xD;\ndefine function ToString(value DeviceMetricCalibrationType): value.value#xD;\ndefine function ToString(value DeviceMetricCategory): value.value#xD;\ndefine function ToString(value DeviceMetricColor): value.value#xD;\ndefine function ToString(value DeviceMetricOperationalStatus): value.value#xD;\ndefine function ToString(value DeviceNameType): value.value#xD;\ndefine function ToString(value DeviceRequestStatus): value.value#xD;\ndefine function ToString(value DeviceUseStatementStatus): value.value#xD;\ndefine function ToString(value DiagnosticReportStatus): value.value#xD;\ndefine function ToString(value DiscriminatorType): value.value#xD;\ndefine function ToString(value DocumentConfidentiality): value.value#xD;\ndefine function ToString(value DocumentMode): value.value#xD;\ndefine function ToString(value DocumentReferenceStatus): value.value#xD;\ndefine function ToString(value DocumentRelationshipType): value.value#xD;\ndefine function ToString(value EligibilityRequestPurpose): value.value#xD;\ndefine function ToString(value EligibilityRequestStatus): value.value#xD;\ndefine function ToString(value EligibilityResponsePurpose): value.value#xD;\ndefine function ToString(value EligibilityResponseStatus): value.value#xD;\ndefine function ToString(value EnableWhenBehavior): value.value#xD;\ndefine function ToString(value EncounterLocationStatus): value.value#xD;\ndefine function ToString(value EncounterStatus): value.value#xD;\ndefine function ToString(value EndpointStatus): value.value#xD;\ndefine function ToString(value EnrollmentRequestStatus): value.value#xD;\ndefine function ToString(value EnrollmentResponseStatus): value.value#xD;\ndefine function ToString(value EpisodeOfCareStatus): value.value#xD;\ndefine function ToString(value EventCapabilityMode): value.value#xD;\ndefine function ToString(value EventTiming): value.value#xD;\ndefine function ToString(value EvidenceVariableType): value.value#xD;\ndefine function ToString(value ExampleScenarioActorType): value.value#xD;\ndefine function ToString(value ExplanationOfBenefitStatus): value.value#xD;\ndefine function ToString(value ExposureState): value.value#xD;\ndefine function ToString(value ExtensionContextType): value.value#xD;\ndefine function ToString(value FHIRAllTypes): value.value#xD;\ndefine function ToString(value FHIRDefinedType): value.value#xD;\ndefine function ToString(value FHIRDeviceStatus): value.value#xD;\ndefine function ToString(value FHIRResourceType): value.value#xD;\ndefine function ToString(value FHIRSubstanceStatus): value.value#xD;\ndefine function ToString(value FHIRVersion): value.value#xD;\ndefine function ToString(value FamilyHistoryStatus): value.value#xD;\ndefine function ToString(value FilterOperator): value.value#xD;\ndefine function ToString(value FlagStatus): value.value#xD;\ndefine function ToString(value GoalLifecycleStatus): value.value#xD;\ndefine function ToString(value GraphCompartmentRule): value.value#xD;\ndefine function ToString(value GraphCompartmentUse): value.value#xD;\ndefine function ToString(value GroupMeasure): value.value#xD;\ndefine function ToString(value GroupType): value.value#xD;\ndefine function ToString(value GuidanceResponseStatus): value.value#xD;\ndefine function ToString(value GuidePageGeneration): value.value#xD;\ndefine function ToString(value GuideParameterCode): value.value#xD;\ndefine function ToString(value HTTPVerb): value.value#xD;\ndefine function ToString(value IdentifierUse): value.value#xD;\ndefine function ToString(value IdentityAssuranceLevel): value.value#xD;\ndefine function ToString(value ImagingStudyStatus): value.value#xD;\ndefine function ToString(value ImmunizationEvaluationStatus): value.value#xD;\ndefine function ToString(value ImmunizationStatus): value.value#xD;\ndefine function ToString(value InvoicePriceComponentType): value.value#xD;\ndefine function ToString(value InvoiceStatus): value.value#xD;\ndefine function ToString(value IssueSeverity): value.value#xD;\ndefine function ToString(value IssueType): value.value#xD;\ndefine function ToString(value LinkType): value.value#xD;\ndefine function ToString(value LinkageType): value.value#xD;\ndefine function ToString(value ListMode): value.value#xD;\ndefine function ToString(value ListStatus): value.value#xD;\ndefine function ToString(value LocationMode): value.value#xD;\ndefine function ToString(value LocationStatus): value.value#xD;\ndefine function ToString(value MeasureReportStatus): value.value#xD;\ndefine function ToString(value MeasureReportType): value.value#xD;\ndefine function ToString(value MediaStatus): value.value#xD;\ndefine function ToString(value MedicationAdministrationStatus): value.value#xD;\ndefine function ToString(value MedicationDispenseStatus): value.value#xD;\ndefine function ToString(value MedicationKnowledgeStatus): value.value#xD;\ndefine function ToString(value MedicationRequestIntent): value.value#xD;\ndefine function ToString(value MedicationRequestPriority): value.value#xD;\ndefine function ToString(value MedicationRequestStatus): value.value#xD;\ndefine function ToString(value MedicationStatementStatus): value.value#xD;\ndefine function ToString(value MedicationStatus): value.value#xD;\ndefine function ToString(value MessageSignificanceCategory): value.value#xD;\ndefine function ToString(value Messageheader_Response_Request): value.value#xD;\ndefine function ToString(value MimeType): value.value#xD;\ndefine function ToString(value NameUse): value.value#xD;\ndefine function ToString(value NamingSystemIdentifierType): value.value#xD;\ndefine function ToString(value NamingSystemType): value.value#xD;\ndefine function ToString(value NarrativeStatus): value.value#xD;\ndefine function ToString(value NoteType): value.value#xD;\ndefine function ToString(value NutritiionOrderIntent): value.value#xD;\ndefine function ToString(value NutritionOrderStatus): value.value#xD;\ndefine function ToString(value ObservationDataType): value.value#xD;\ndefine function ToString(value ObservationRangeCategory): value.value#xD;\ndefine function ToString(value ObservationStatus): value.value#xD;\ndefine function ToString(value OperationKind): value.value#xD;\ndefine function ToString(value OperationParameterUse): value.value#xD;\ndefine function ToString(value OrientationType): value.value#xD;\ndefine function ToString(value ParameterUse): value.value#xD;\ndefine function ToString(value ParticipantRequired): value.value#xD;\ndefine function ToString(value ParticipantStatus): value.value#xD;\ndefine function ToString(value ParticipationStatus): value.value#xD;\ndefine function ToString(value PaymentNoticeStatus): value.value#xD;\ndefine function ToString(value PaymentReconciliationStatus): value.value#xD;\ndefine function ToString(value ProcedureStatus): value.value#xD;\ndefine function ToString(value PropertyRepresentation): value.value#xD;\ndefine function ToString(value PropertyType): value.value#xD;\ndefine function ToString(value ProvenanceEntityRole): value.value#xD;\ndefine function ToString(value PublicationStatus): value.value#xD;\ndefine function ToString(value QualityType): value.value#xD;\ndefine function ToString(value QuantityComparator): value.value#xD;\ndefine function ToString(value QuestionnaireItemOperator): value.value#xD;\ndefine function ToString(value QuestionnaireItemType): value.value#xD;\ndefine function ToString(value QuestionnaireResponseStatus): value.value#xD;\ndefine function ToString(value ReferenceHandlingPolicy): value.value#xD;\ndefine function ToString(value ReferenceVersionRules): value.value#xD;\ndefine function ToString(value ReferredDocumentStatus): value.value#xD;\ndefine function ToString(value RelatedArtifactType): value.value#xD;\ndefine function ToString(value RemittanceOutcome): value.value#xD;\ndefine function ToString(value RepositoryType): value.value#xD;\ndefine function ToString(value RequestIntent): value.value#xD;\ndefine function ToString(value RequestPriority): value.value#xD;\ndefine function ToString(value RequestStatus): value.value#xD;\ndefine function ToString(value ResearchElementType): value.value#xD;\ndefine function ToString(value ResearchStudyStatus): value.value#xD;\ndefine function ToString(value ResearchSubjectStatus): value.value#xD;\ndefine function ToString(value ResourceType): value.value#xD;\ndefine function ToString(value ResourceVersionPolicy): value.value#xD;\ndefine function ToString(value ResponseType): value.value#xD;\ndefine function ToString(value RestfulCapabilityMode): value.value#xD;\ndefine function ToString(value RiskAssessmentStatus): value.value#xD;\ndefine function ToString(value SPDXLicense): value.value#xD;\ndefine function ToString(value SearchComparator): value.value#xD;\ndefine function ToString(value SearchEntryMode): value.value#xD;\ndefine function ToString(value SearchModifierCode): value.value#xD;\ndefine function ToString(value SearchParamType): value.value#xD;\ndefine function ToString(value SectionMode): value.value#xD;\ndefine function ToString(value SequenceType): value.value#xD;\ndefine function ToString(value ServiceRequestIntent): value.value#xD;\ndefine function ToString(value ServiceRequestPriority): value.value#xD;\ndefine function ToString(value ServiceRequestStatus): value.value#xD;\ndefine function ToString(value SlicingRules): value.value#xD;\ndefine function ToString(value SlotStatus): value.value#xD;\ndefine function ToString(value SortDirection): value.value#xD;\ndefine function ToString(value SpecimenContainedPreference): value.value#xD;\ndefine function ToString(value SpecimenStatus): value.value#xD;\ndefine function ToString(value Status): value.value#xD;\ndefine function ToString(value StrandType): value.value#xD;\ndefine function ToString(value StructureDefinitionKind): value.value#xD;\ndefine function ToString(value StructureMapContextType): value.value#xD;\ndefine function ToString(value StructureMapGroupTypeMode): value.value#xD;\ndefine function ToString(value StructureMapInputMode): value.value#xD;\ndefine function ToString(value StructureMapModelMode): value.value#xD;\ndefine function ToString(value StructureMapSourceListMode): value.value#xD;\ndefine function ToString(value StructureMapTargetListMode): value.value#xD;\ndefine function ToString(value StructureMapTransform): value.value#xD;\ndefine function ToString(value SubscriptionChannelType): value.value#xD;\ndefine function ToString(value SubscriptionStatus): value.value#xD;\ndefine function ToString(value SupplyDeliveryStatus): value.value#xD;\ndefine function ToString(value SupplyRequestStatus): value.value#xD;\ndefine function ToString(value SystemRestfulInteraction): value.value#xD;\ndefine function ToString(value TaskIntent): value.value#xD;\ndefine function ToString(value TaskPriority): value.value#xD;\ndefine function ToString(value TaskStatus): value.value#xD;\ndefine function ToString(value TestReportActionResult): value.value#xD;\ndefine function ToString(value TestReportParticipantType): value.value#xD;\ndefine function ToString(value TestReportResult): value.value#xD;\ndefine function ToString(value TestReportStatus): value.value#xD;\ndefine function ToString(value TestScriptRequestMethodCode): value.value#xD;\ndefine function ToString(value TriggerType): value.value#xD;\ndefine function ToString(value TypeDerivationRule): value.value#xD;\ndefine function ToString(value TypeRestfulInteraction): value.value#xD;\ndefine function ToString(value UDIEntryType): value.value#xD;\ndefine function ToString(value UnitsOfTime): value.value#xD;\ndefine function ToString(value Use): value.value#xD;\ndefine function ToString(value VariableType): value.value#xD;\ndefine function ToString(value VisionBase): value.value#xD;\ndefine function ToString(value VisionEyes): value.value#xD;\ndefine function ToString(value VisionStatus): value.value#xD;\ndefine function ToString(value XPathUsageType): value.value#xD;\ndefine function ToString(value base64Binary): value.value#xD;\ndefine function ToBoolean(value boolean): value.value#xD;\ndefine function ToDate(value date): value.value#xD;\ndefine function ToDateTime(value dateTime): value.value#xD;\ndefine function ToDecimal(value decimal): value.value#xD;\ndefine function ToDateTime(value instant): value.value#xD;\ndefine function ToInteger(value integer): value.value#xD;\ndefine function ToString(value string): value.value#xD;\ndefine function ToTime(value time): value.value#xD;\ndefine function ToString(value uri): value.value#xD;\ndefine function ToString(value xhtml): value.value#xD;\n</code></pre>\n      </td>\n    </tr>\n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.4-cibuild of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"^^rdf:XMLLiteral ]
      ] ; #
      fhir:url [
    fhir:v "http://fhir.org/guides/cqf/common/Library/FHIRHelpers"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/common/Library/FHIRHelpers>
      ] ; #
      fhir:version [ fhir:v "4.0.1"] ; #
      fhir:name [ fhir:v "FHIRHelpers"] ; #
      fhir:title [ fhir:v "FHIR Helpers"] ; #
      fhir:status [ fhir:v "draft"] ; #
      fhir:experimental [ fhir:v true] ; #
      fhir:type [
        ( fhir:coding [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/library-type"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/library-type>       ] ;
    fhir:code [ fhir:v "logic-library" ] ;
    fhir:display [ fhir:v "Logic Library" ]     ] )
      ] ; #
      fhir:content ( [
    fhir:contentType [ fhir:v "text/cql" ] ;
    fhir:data [ fhir:v " "^^xsd:base64Binary ]
      ] ) . #

    <urn:uuid:aa99c584-12e5-46bb-8b30-ab10cfe26471> a fhir:Library ;
      fhir:id [ fhir:v "FHIRCommon"] ; #
      fhir:language [ fhir:v "en"] ; #
      fhir:text [
    fhir:status [ fhir:v "extensions" ] ;
    fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Library_FHIRCommon\"> </a>\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n\n<td class=\"content-container\">FHIRCommon</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">4.0.1</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Status</th>\n\n\n\n<td class=\"content-container\">Draft</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Experimental</th>\n\n\n\n<td class=\"content-container\">true</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n\n<td class=\"content-container\">\n    Logic Library\n\n\n</td>\n\n\n</tr>\n\n\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system LOINC\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-v3-loinc.html\">Logical Observation Identifiers, Names and Codes (LOINC)</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://loinc.org</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system SNOMEDCT\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://hl7.org/fhir/R4/codesystem-snomedct.html\">SNOMED CT (all versions)</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://snomed.info/sct</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system RoleCode\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-RoleCode.html\">RoleCode</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-RoleCode</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system Diagnosis Role\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-diagnosis-role.html\">Diagnosis Role</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/diagnosis-role</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system RequestIntent\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://hl7.org/fhir/R4/codesystem-request-intent.html\">RequestIntent</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://hl7.org/fhir/request-intent</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system MedicationRequestCategory\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-medicationrequest-category.html\">MedicationRequest Category Codes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/medicationrequest-category</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system ConditionClinicalStatusCodes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-condition-clinical.html\">Condition Clinical Status Codes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system ConditionVerificationStatusCodes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-condition-ver-status.html\">ConditionVerificationStatus</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system AllergyIntoleranceClinicalStatusCodes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-allergyintolerance-clinical.html\">AllergyIntolerance Clinical Status Codes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system AllergyIntoleranceVerificationStatusCodes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-allergyintolerance-verification.html\">AllergyIntolerance Verification Status</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/allergyintolerance-verification</tt>\n    \n    \n    \n  </td>\n</tr>\n\n\n\n\n\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Patient\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/patient.html\">Patient</a>\n    <br/>        \n  \n   \n   \n   \n  </td>\n</tr>\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"parameters\"> </a>Parameters</th>\n\n\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\"/>\n\n\n  <td class=\"content-container\">\n    <table>\n      <thead>\n        <tr>\n          <td><em>Name</em></td>\n          <td><em>Use</em></td>\n          <td><em>Card.</em></td>\n          <td><em>Type</em></td>\n          <td><em>Documentation</em></td>\n        </tr>\n      </thead>\n      <tbody>\n      \n        <tr>\n          <td>Patient</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>Patient</td>\n          <td/>\n        </tr>\n      \n      </tbody>\n    </table>\n  </td>\n</tr>\n\n\n\n\n\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">/*#xD;\n@author: Bryn Rhodes#xD;\n@description: Common terminologies and functions used in FHIR-based CQL artifacts#xD;\n*/#xD;\nlibrary FHIRCommon version '4.0.1'#xD;\n#xD;\nusing FHIR version '4.0.1'#xD;\n#xD;\ninclude FHIRHelpers version '4.0.1'#xD;\n#xD;\ncodesystem \"LOINC\": 'http://loinc.org'#xD;\ncodesystem \"SNOMEDCT\": 'http://snomed.info/sct'#xD;\ncodesystem \"RoleCode\": 'http://terminology.hl7.org/CodeSystem/v3-RoleCode'#xD;\ncodesystem \"Diagnosis Role\": 'http://terminology.hl7.org/CodeSystem/diagnosis-role'#xD;\ncodesystem \"RequestIntent\": 'http://terminology.hl7.org/CodeSystem/request-intent'#xD;\ncodesystem \"MedicationRequestCategory\": 'http://terminology.hl7.org/CodeSystem/medicationrequest-category'#xD;\ncodesystem \"ConditionClinicalStatusCodes\": 'http://terminology.hl7.org/CodeSystem/condition-clinical'#xD;\ncodesystem \"ConditionVerificationStatusCodes\": 'http://terminology.hl7.org/CodeSystem/condition-ver-status'#xD;\ncodesystem \"AllergyIntoleranceClinicalStatusCodes\": 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical'#xD;\ncodesystem \"AllergyIntoleranceVerificationStatusCodes\": 'http://terminology.hl7.org/CodeSystem/allergyintolerance-verification'#xD;\n#xD;\nvalueset \"Active Condition\": 'http://fhir.org/guides/cqf/common/ValueSet/active-condition'#xD;\nvalueset \"Inactive Condition\": 'http://fhir.org/guides/cqf/common/ValueSet/inactive-condition'#xD;\n#xD;\ncode \"Birthdate\": '21112-8' from \"LOINC\" display 'Birth date'#xD;\ncode \"Dead\": '419099009' from \"SNOMEDCT\" display 'Dead'#xD;\ncode \"ER\": 'ER' from \"RoleCode\" display 'Emergency room'#xD;\ncode \"ICU\": 'ICU' from \"RoleCode\" display 'Intensive care unit'#xD;\ncode \"Billing\": 'billing' from \"Diagnosis Role\" display 'Billing'#xD;\n#xD;\n// Condition Clinical Status Codes - Consider value sets for these#xD;\ncode \"active\": 'active' from \"ConditionClinicalStatusCodes\"#xD;\ncode \"recurrence\": 'recurrence' from \"ConditionClinicalStatusCodes\"#xD;\ncode \"relapse\": 'relapse' from \"ConditionClinicalStatusCodes\"#xD;\ncode \"inactive\": 'inactive' from \"ConditionClinicalStatusCodes\"#xD;\ncode \"remission\": 'remission' from \"ConditionClinicalStatusCodes\"#xD;\ncode \"resolved\": 'resolved' from \"ConditionClinicalStatusCodes\"#xD;\n#xD;\n// Condition Verification Status Codes - Consider value sets for these#xD;\ncode \"unconfirmed\": 'unconfirmed' from ConditionVerificationStatusCodes#xD;\ncode \"provisional\": 'provisional' from ConditionVerificationStatusCodes#xD;\ncode \"differential\": 'differential' from ConditionVerificationStatusCodes#xD;\ncode \"confirmed\": 'confirmed' from ConditionVerificationStatusCodes#xD;\ncode \"refuted\": 'refuted' from ConditionVerificationStatusCodes#xD;\ncode \"entered-in-error\": 'entered-in-error' from ConditionVerificationStatusCodes#xD;\n#xD;\ncode \"allergy-active\": 'active' from \"AllergyIntoleranceClinicalStatusCodes\"#xD;\ncode \"allergy-inactive\": 'inactive' from \"AllergyIntoleranceClinicalStatusCodes\"#xD;\ncode \"allergy-resolved\": 'resolved' from \"AllergyIntoleranceClinicalStatusCodes\"#xD;\n#xD;\n// Allergy/Intolerance Verification Status Codes - Consider value sets for these#xD;\ncode \"allergy-unconfirmed\": 'unconfirmed' from AllergyIntoleranceVerificationStatusCodes#xD;\ncode \"allergy-confirmed\": 'confirmed' from AllergyIntoleranceVerificationStatusCodes#xD;\ncode \"allergy-refuted\": 'refuted' from AllergyIntoleranceVerificationStatusCodes#xD;\n#xD;\n// MedicationRequest Category Codes#xD;\ncode \"Community\": 'community' from \"MedicationRequestCategory\" display 'Community'#xD;\ncode \"Discharge\": 'discharge' from \"MedicationRequestCategory\" display 'Discharge'#xD;\n#xD;\n// Diagnosis Role Codes#xD;\ncode \"AD\": 'AD' from \"Diagnosis Role\" display 'Admission diagnosis'#xD;\ncode \"DD\": 'DD' from \"Diagnosis Role\" display 'Discharge diagnosis'#xD;\ncode \"CC\": 'CC' from \"Diagnosis Role\" display 'Chief complaint'#xD;\ncode \"CM\": 'CM' from \"Diagnosis Role\" display 'Comorbidity diagnosis'#xD;\ncode \"pre-op\": 'pre-op' from \"Diagnosis Role\" display 'pre-op diagnosis'#xD;\ncode \"post-op\": 'post-op' from \"Diagnosis Role\" display 'post-op diagnosis'#xD;\ncode \"billing\": 'billing' from \"Diagnosis Role\" display 'billing diagnosis'#xD;\n#xD;\ncontext Patient#xD;\n#xD;\n/*#xD;\n@description: Normalizes a value that is a choice of timing-valued types to an equivalent interval#xD;\n@comment: Normalizes a choice type of FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instance, FHIR.string, FHIR.Age, or FHIR.Range types#xD;\nto an equivalent interval. This selection of choice types is a superset of the majority of choice types that are used as possible#xD;\nrepresentations for timing-valued elements in FHIR, allowing this function to be used across any resource. NOTE: Due to the#xD;\ncomplexity of determining a single interval from a Timing or String type, this function will throw a run-time exception if it is used#xD;\nwith a Timing or String.#xD;\n*/#xD;\ndefine function ToInterval(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt;):#xD;\n  case#xD;\n	  when choice is FHIR.dateTime then#xD;\n    	Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]#xD;\n		when choice is FHIR.Period then#xD;\n  		FHIRHelpers.ToInterval(choice as FHIR.Period)#xD;\n		when choice is FHIR.instant then#xD;\n			Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]#xD;\n		when choice is FHIR.Age then#xD;\n		  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),#xD;\n			  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)#xD;\n		when choice is FHIR.Range then#xD;\n		  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),#xD;\n			  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)#xD;\n		when choice is FHIR.Timing then#xD;\n		  Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute a single interval from a Timing type')#xD;\n    when choice is FHIR.string then#xD;\n      Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute an interval from a String value')#xD;\n		else#xD;\n			null as Interval&lt;DateTime&gt;#xD;\n	end#xD;\n#xD;\n/*#xD;\n@description: Returns an interval representing the normalized Abatement of a given Condition resource.#xD;\n@comment: NOTE: Due to the complexity of determining an interval from a String, this function will throw#xD;\na run-time exception if used with a Condition instance that has a String as the abatement value.#xD;\n*/#xD;\ndefine function ToAbatementInterval(condition Condition):#xD;\n	if condition.abatement is FHIR.dateTime then#xD;\n	  Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)]#xD;\n	else if condition.abatement is FHIR.Period then#xD;\n	  FHIRHelpers.ToInterval(condition.abatement as FHIR.Period)#xD;\n	else if condition.abatement is FHIR.string then#xD;\n    Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute an interval from a String value')#xD;\n	else if condition.abatement is FHIR.Age then#xD;\n		Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age),#xD;\n			FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year)#xD;\n	else if condition.abatement is FHIR.Range then#xD;\n	  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low),#xD;\n		  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year)#xD;\n	else if condition.abatement is FHIR.boolean then#xD;\n	  Interval[end of ToInterval(condition.onset), condition.recordedDate)#xD;\n	else null#xD;\n#xD;\n/*#xD;\n@description: Returns an interval representing the normalized prevalence period of a given Condition resource.#xD;\n@comment: Uses the ToInterval and ToAbatementInterval functions to determine the widest potential interval from#xD;\nonset to abatement as specified in the given Condition.#xD;\n*/#xD;\ndefine function ToPrevalenceInterval(condition Condition):#xD;\nif condition.clinicalStatus ~ \"active\"#xD;\n  or condition.clinicalStatus ~ \"recurrence\"#xD;\n  or condition.clinicalStatus ~ \"relapse\" then#xD;\n  Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition)]#xD;\nelse#xD;\n  Interval[start of ToInterval(condition.onset), end of ToAbatementInterval(condition))#xD;\n#xD;\n/*#xD;\n@description: Returns any extensions defined on the given resource with the specified url.#xD;\n@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the#xD;\nCQL model info.#xD;\n*/#xD;\ndefine function Extensions(domainResource DomainResource, url String):#xD;\n  domainResource.extension E#xD;\n	  where E.url = url#xD;\n		return E#xD;\n#xD;\n/*#xD;\n@description: Returns the single extension (if present) on the given resource with the specified url.#xD;\n@comment: This function uses singleton from to ensure that a run-time exception is thrown if there#xD;\nis more than one extension on the given resource with the specified url.#xD;\n*/#xD;\ndefine function Extension(domainResource DomainResource, url String):#xD;\n  singleton from \"Extensions\"(domainResource, url)#xD;\n#xD;\n/*#xD;\n@description: Returns any extensions defined on the given element with the specified url.#xD;\n@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the CQL model info.#xD;\n*/#xD;\ndefine function Extensions(element Element, url String):#xD;\n  element.extension E#xD;\n	  where E.url = url#xD;\n		return E#xD;\n#xD;\n/*#xD;\n@description: Returns the single extension (if present) on the given element with the specified url.#xD;\n@comment: This function uses singleton from to ensure that a run-time exception is thrown if there#xD;\nis more than one extension on the given resource with the specified url.#xD;\n*/#xD;\ndefine function Extension(element Element, url String):#xD;\n  singleton from Extensions(element, url)#xD;\n#xD;\n/*#xD;\n@description: Returns any modifier extensions defined on the given resource with the specified url.#xD;\n@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the#xD;\nCQL model info.#xD;\n*/#xD;\ndefine function ModifierExtensions(domainResource DomainResource, url String):#xD;\n  domainResource.modifierExtension E#xD;\n	  where E.url = url#xD;\n		return E#xD;\n#xD;\n/*#xD;\n@description: Returns the single modifier extension (if present) on the given resource with the specified url.#xD;\n@comment: This function uses singleton from to ensure that a run-time exception is thrown if there#xD;\nis more than one extension on the given resource with the specified url.#xD;\n*/#xD;\ndefine function ModifierExtension(domainResource DomainResource, url String):#xD;\n  singleton from ModifierExtensions(domainResource, url)#xD;\n#xD;\n/*#xD;\n@description: Returns any modifier extensions defined on the given element with the specified url.#xD;\n@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the CQL model info.#xD;\n*/#xD;\ndefine function ModifierExtensions(element BackboneElement, url String):#xD;\n  element.modifierExtension E#xD;\n	  where E.url = url#xD;\n		return E#xD;\n#xD;\n/*#xD;\n@description: Returns the single modifier extension (if present) on the given element with the specified url.#xD;\n@comment: This function uses singleton from to ensure that a run-time exception is thrown if there#xD;\nis more than one extension on the given resource with the specified url.#xD;\n*/#xD;\ndefine function ModifierExtension(element BackboneElement, url String):#xD;\n  singleton from ModifierExtensions(element, url)#xD;\n#xD;\n/*#xD;\n@description: Returns any base-FHIR extensions defined on the given resource with the specified id.#xD;\n@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the CQL model info.#xD;\n*/#xD;\ndefine function BaseExtensions(domainResource DomainResource, id String):#xD;\n  domainResource.extension E#xD;\n	  where E.url = ('http://hl7.org/fhir/StructureDefinition/' + id)#xD;\n		return E#xD;\n#xD;\n/*#xD;\n@description: Returns the single base-FHIR extension (if present) on the given resource with the specified id.#xD;\n@comment: This function uses singleton from to ensure that a run-time exception is thrown if there#xD;\nis more than one extension on the given resource with the specified url.#xD;\n*/#xD;\ndefine function BaseExtension(domainResource DomainResource, id String):#xD;\n  singleton from BaseExtensions(domainResource, id)#xD;\n#xD;\n/*#xD;\n@description: Returns any base-FHIR extensions defined on the given element with the specified id.#xD;\n@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the CQL model info.#xD;\n*/#xD;\ndefine function BaseExtensions(element Element, id String):#xD;\n  element.extension E#xD;\n	  where E.url = ('http://hl7.org/fhir/StructureDefinition/' + id)#xD;\n		return E#xD;\n#xD;\n/*#xD;\n@description: Returns the single base-FHIR extension (if present) on the given element with the specified id.#xD;\n@comment: This function uses singleton from to ensure that a run-time exception is thrown if there#xD;\nis more than one extension on the given resource with the specified url.#xD;\n*/#xD;\ndefine function BaseExtension(element Element, id String):#xD;\n  singleton from BaseExtensions(element, id)#xD;\n#xD;\n/*#xD;\n@description: Returns any base-FHIR modifier extensions defined on the given resource with the specified id.#xD;\n@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the CQL model info.#xD;\n*/#xD;\ndefine function BaseModifierExtensions(domainResource DomainResource, id String):#xD;\n  domainResource.modifierExtension E#xD;\n	  where E.url = ('http://hl7.org/fhir/StructureDefinition/' + id)#xD;\n		return E#xD;\n#xD;\n/*#xD;\n@description: Returns the single base-FHIR modifier extension (if present) on the given resource with the specified id.#xD;\n@comment: This function uses singleton from to ensure that a run-time exception is thrown if there#xD;\nis more than one extension on the given resource with the specified url.#xD;\n*/#xD;\ndefine function BaseModifierExtension(domainResource DomainResource, id String):#xD;\n  singleton from BaseModifierExtensions(domainResource, id)#xD;\n#xD;\n/*#xD;\n@description: Returns any base-FHIR modifier extensions defined on the given element with the specified id.#xD;\n@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the CQL model info.#xD;\n*/#xD;\ndefine function BaseModifierExtensions(element BackboneElement, id String):#xD;\n  element.modifierExtension E#xD;\n	  where E.url = ('http://hl7.org/fhir/StructureDefinition/' + id)#xD;\n		return E#xD;\n#xD;\n/*#xD;\n@description: Returns the single base-FHIR extension (if present) on the given element with the specified id.#xD;\n@comment: This function uses singleton from to ensure that a run-time exception is thrown if there#xD;\nis more than one extension on the given resource with the specified url.#xD;\n*/#xD;\ndefine function BaseModifierExtension(element BackboneElement, id String):#xD;\n  singleton from BaseModifierExtensions(element, id)#xD;\n</code></pre>\n      </td>\n    </tr>\n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.4-cibuild of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"^^rdf:XMLLiteral ]
      ] ; #
      fhir:url [
    fhir:v "http://fhir.org/guides/cqf/Library/FHIRCommon"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/Library/FHIRCommon>
      ] ; #
      fhir:version [ fhir:v "4.0.1"] ; #
      fhir:name [ fhir:v "FHIRCommon"] ; #
      fhir:title [ fhir:v "FHIRCommon"] ; #
      fhir:status [ fhir:v "draft"] ; #
      fhir:experimental [ fhir:v true] ; #
      fhir:type [
        ( fhir:coding [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/library-type"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/library-type>       ] ;
    fhir:code [ fhir:v "logic-library" ] ;
    fhir:display [ fhir:v "Logic Library" ]     ] )
      ] ; #
      fhir:relatedArtifact ( [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system LOINC" ] ;
    fhir:resource [
    fhir:v "http://loinc.org"^^xsd:anyURI ;
    fhir:l <http://loinc.org>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system SNOMEDCT" ] ;
    fhir:resource [
    fhir:v "http://snomed.info/sct"^^xsd:anyURI ;
    fhir:l <http://snomed.info/sct>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system RoleCode" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-RoleCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-RoleCode>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system Diagnosis Role" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/diagnosis-role"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/diagnosis-role>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system RequestIntent" ] ;
    fhir:resource [
    fhir:v "http://hl7.org/fhir/request-intent"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/request-intent>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system MedicationRequestCategory" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/medicationrequest-category"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/medicationrequest-category>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system ConditionClinicalStatusCodes" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/condition-clinical"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/condition-clinical>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system ConditionVerificationStatusCodes" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/condition-ver-status"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/condition-ver-status>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system AllergyIntoleranceClinicalStatusCodes" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system AllergyIntoleranceVerificationStatusCodes" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/allergyintolerance-verification>     ]
      ] ) ; #
      fhir:parameter ( [
    fhir:name [ fhir:v "Patient" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:type [ fhir:v "Patient" ]
      ] ) ; #
      fhir:dataRequirement ( [
    fhir:type [ fhir:v "Patient" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Patient"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Patient>     ] )
      ] ) ; #
      fhir:content ( [
    fhir:contentType [ fhir:v "text/cql" ] ;
    fhir:data [ fhir:v " "^^xsd:base64Binary ]
      ] ) . #

    <urn:uuid:b3463968-f67d-42ef-8494-cd4ea42e87b9> a fhir:Library ;
      fhir:id [ fhir:v "MATGlobalCommonFunctionsFHIR4"] ; #
      fhir:language [ fhir:v "en"] ; #
      fhir:text [
    fhir:status [ fhir:v "extensions" ] ;
    fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Library_MATGlobalCommonFunctionsFHIR4\"> </a>\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n\n<td class=\"content-container\">MAT Global Common Functions FHIRR4</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">6.1.000</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Status</th>\n\n\n\n<td class=\"content-container\">Draft</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Experimental</th>\n\n\n\n<td class=\"content-container\">true</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n\n<td class=\"content-container\">\n    Logic Library\n\n\n</td>\n\n\n</tr>\n\n\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system ConditionClinicalStatusCodes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-condition-clinical.html\">Condition Clinical Status Codes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-clinical</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system AllergyIntoleranceClinicalStatusCodes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-allergyintolerance-clinical.html\">AllergyIntolerance Clinical Status Codes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system AllergyIntoleranceVerificationStatusCodes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-allergyintolerance-verification.html\">AllergyIntolerance Verification Status</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/allergyintolerance-verification</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system Diagnosis Role\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-diagnosis-role.html\">Diagnosis Role</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/diagnosis-role</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system LOINC\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/6.5.0/CodeSystem-v3-loinc.html\">Logical Observation Identifiers, Names and Codes (LOINC)</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://loinc.org</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system MedicationRequestCategory\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-medicationrequest-category.html\">MedicationRequest Category Codes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/medicationrequest-category</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system ConditionVerificationStatusCodes\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-condition-ver-status.html\">ConditionVerificationStatus</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-ver-status</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system SNOMEDCT\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://hl7.org/fhir/R4/codesystem-snomedct.html\">SNOMED CT (all versions)</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://snomed.info/sct</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system RoleCode\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-RoleCode.html\">RoleCode</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-RoleCode</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Emergency Department Visit\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion\">Emergency Department Visit</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Encounter Inpatient\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion\">Encounter Inpatient</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Observation Services\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion\">Observation Services</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143</tt>\n    \n    \n    \n  </td>\n</tr>\n\n\n\n\n\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Patient\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/patient.html\">Patient</a>\n    <br/>        \n  \n   \n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, status, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion\">Encounter Inpatient</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion\">Observation Services</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, status, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion\">Emergency Department Visit</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/condition.html\">Condition</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: id\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Location\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/location.html\">Location</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: id\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Provenance\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/provenance.html\">Provenance</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: target\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: target</span>\n    <br/>\n  \n  \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"parameters\"> </a>Parameters</th>\n\n\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\"/>\n\n\n  <td class=\"content-container\">\n    <table>\n      <thead>\n        <tr>\n          <td><em>Name</em></td>\n          <td><em>Use</em></td>\n          <td><em>Card.</em></td>\n          <td><em>Type</em></td>\n          <td><em>Documentation</em></td>\n        </tr>\n      </thead>\n      <tbody>\n      \n        <tr>\n          <td>Measurement Period</td>\n          <td>In</td>\n          <td>0..1</td>\n          <td>Period</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Patient</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>Patient</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Inpatient Encounter</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n      </tbody>\n    </table>\n  </td>\n</tr>\n\n\n\n\n\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">library MATGlobalCommonFunctionsFHIR4 version '6.1.000'#xD;\n#xD;\n/*@update: BTR 2020-03-31 -&gt;#xD;\nIncremented version to 5.0.000#xD;\nUpdated FHIR version to 4.0.1#xD;\nChanged timezone keyword to timezoneoffset for use with CQL 1.4#xD;\nRemoved Normalize Onset in favor of more general Normalize Interval#xD;\nUpdated CodeSystems for ConditionVerificationStatusCodes and RoleCodes#xD;\n#xD;\n@update: BTR 2021-05-13 -&gt;#xD;\nAdded ActiveCondition Codes and Inactive Condition Codes value sets#xD;\nAdded function documentation throughout#xD;\nFixed EDVisit not using Last#xD;\nUpdated prevalence period to use an inclusive boundary if the condition is active#xD;\nAdded HasStart, HasEnd, Earliest, and Latest functions#xD;\nRemoved ToDate and Age calculation functions#xD;\n#xD;\n@update: BTR 2021-06-25 -&gt;#xD;\nAdded GetBaseExtension overloads for Element*/#xD;\n#xD;\nusing FHIR version '4.0.1'#xD;\n#xD;\ninclude FHIRHelpers version '4.0.1' called FHIRHelpers#xD;\n#xD;\ncodesystem \"ConditionClinicalStatusCodes\": 'http://terminology.hl7.org/CodeSystem/condition-clinical' #xD;\ncodesystem \"AllergyIntoleranceClinicalStatusCodes\": 'http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical' #xD;\ncodesystem \"AllergyIntoleranceVerificationStatusCodes\": 'http://terminology.hl7.org/CodeSystem/allergyintolerance-verification' #xD;\ncodesystem \"Diagnosis Role\": 'http://terminology.hl7.org/CodeSystem/diagnosis-role' #xD;\ncodesystem \"LOINC\": 'http://loinc.org' #xD;\ncodesystem \"MedicationRequestCategory\": 'http://terminology.hl7.org/CodeSystem/medicationrequest-category' #xD;\ncodesystem \"ConditionVerificationStatusCodes\": 'http://terminology.hl7.org/CodeSystem/condition-ver-status' #xD;\ncodesystem \"SNOMEDCT\": 'http://snomed.info/sct' #xD;\ncodesystem \"RoleCode\": 'http://terminology.hl7.org/CodeSystem/v3-RoleCode' #xD;\n#xD;\nvalueset \"Emergency Department Visit\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292' #xD;\nvalueset \"Encounter Inpatient\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307' #xD;\nvalueset \"Observation Services\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143' #xD;\n#xD;\ncode \"active\": 'active' from \"ConditionClinicalStatusCodes\" display 'active'#xD;\ncode \"allergy-active\": 'active' from \"AllergyIntoleranceClinicalStatusCodes\" display 'allergy-active'#xD;\ncode \"allergy-confirmed\": 'confirmed' from \"AllergyIntoleranceVerificationStatusCodes\" display 'allergy-confirmed'#xD;\ncode \"allergy-inactive\": 'inactive' from \"AllergyIntoleranceClinicalStatusCodes\" display 'allergy-inactive'#xD;\ncode \"allergy-refuted\": 'refuted' from \"AllergyIntoleranceVerificationStatusCodes\" display 'allergy-refuted'#xD;\ncode \"allergy-resolved\": 'resolved' from \"AllergyIntoleranceClinicalStatusCodes\" display 'allergy-resolved'#xD;\ncode \"allergy-unconfirmed\": 'unconfirmed' from \"AllergyIntoleranceVerificationStatusCodes\" display 'allergy-unconfirmed'#xD;\ncode \"Billing\": 'billing' from \"Diagnosis Role\" display 'Billing'#xD;\ncode \"Birthdate\": '21112-8' from \"LOINC\" display 'Birth date'#xD;\ncode \"Community\": 'community' from \"MedicationRequestCategory\" display 'Community'#xD;\ncode \"confirmed\": 'confirmed' from \"ConditionVerificationStatusCodes\" display 'confirmed'#xD;\ncode \"Dead\": '419099009' from \"SNOMEDCT\" display 'Dead'#xD;\ncode \"differential\": 'differential' from \"ConditionVerificationStatusCodes\" display 'differential'#xD;\ncode \"Discharge\": 'discharge' from \"MedicationRequestCategory\" display 'Discharge'#xD;\ncode \"entered-in-error\": 'entered-in-error' from \"ConditionVerificationStatusCodes\" display 'entered-in-error'#xD;\ncode \"ER\": 'ER' from \"RoleCode\" display 'Emergency room'#xD;\ncode \"ICU\": 'ICU' from \"RoleCode\" display 'Intensive care unit'#xD;\ncode \"inactive\": 'inactive' from \"ConditionClinicalStatusCodes\" display 'inactive'#xD;\ncode \"provisional\": 'provisional' from \"ConditionVerificationStatusCodes\" display 'provisional'#xD;\ncode \"recurrence\": 'recurrence' from \"ConditionClinicalStatusCodes\" display 'recurrence'#xD;\ncode \"refuted\": 'refuted' from \"ConditionVerificationStatusCodes\" display 'refuted'#xD;\ncode \"relapse\": 'relapse' from \"ConditionClinicalStatusCodes\" display 'relapse'#xD;\ncode \"remission\": 'remission' from \"ConditionClinicalStatusCodes\" display 'remission'#xD;\ncode \"resolved\": 'resolved' from \"ConditionClinicalStatusCodes\" display 'resolved'#xD;\ncode \"unconfirmed\": 'unconfirmed' from \"ConditionVerificationStatusCodes\" display 'unconfirmed'#xD;\n#xD;\nparameter \"Measurement Period\" Interval&lt;DateTime&gt;#xD;\n  default Interval[@2019-01-01T00:00:00.0, @2020-01-01T00:00:00.0)#xD;\n#xD;\ncontext Patient#xD;\n#xD;\ndefine \"Inpatient Encounter\":#xD;\n  [Encounter: \"Encounter Inpatient\"] EncounterInpatient#xD;\n      		where EncounterInpatient.status = 'finished'#xD;\n      		    and \"LengthInDays\"(EncounterInpatient.period) &lt;= 120#xD;\n      			and EncounterInpatient.period ends during \"Measurement Period\"#xD;\n#xD;\n/*Calculates the difference in calendar days between the start and end of the given interval.*/#xD;\ndefine function \"LengthInDays\"(Value Interval&lt;DateTime&gt; ):#xD;\n  difference in days between start of Value and end of Value#xD;\n#xD;\n/*Returns the most recent emergency department visit, if any, that occurs 1 hour or less prior to the given encounter.*/#xD;\ndefine function \"ED Visit\"(TheEncounter FHIR.Encounter ):#xD;\n  Last(#xD;\n    [Encounter: \"Emergency Department Visit\"] EDVisit#xD;\n      where EDVisit.status = 'finished'#xD;\n        and EDVisit.period ends 1 hour or less on or before start of FHIRHelpers.ToInterval(TheEncounter.period)#xD;\n      sort by end of period#xD;\n    )#xD;\n#xD;\n/*Hospitalization returns the total interval for admission to discharge for the given encounter, or for the admission of any immediately prior emergency department visit to the discharge of the given encounter.*/#xD;\ndefine function \"Hospitalization\"(TheEncounter FHIR.Encounter ):#xD;\n  ( \"ED Visit\"(TheEncounter) ) X#xD;\n    return#xD;\n        if X is null then TheEncounter.period#xD;\n        else Interval[start of FHIRHelpers.ToInterval(X.period), end of FHIRHelpers.ToInterval(TheEncounter.period)]#xD;\n#xD;\n/*Returns list of all locations within an encounter, including locations for immediately prior ED visit.*/#xD;\ndefine function \"Hospitalization Locations\"(TheEncounter FHIR.Encounter ):#xD;\n  ( \"ED Visit\"(TheEncounter) ) EDEncounter#xD;\n    return#xD;\n        if EDEncounter is null then TheEncounter.location#xD;\n        else flatten { EDEncounter.location, TheEncounter.location }#xD;\n#xD;\n/*Returns the length of stay in days (i.e. the number of days between admission and discharge) for the given encounter, or from the admission of any immediately prior emergency department visit to the discharge of the encounter*/#xD;\ndefine function \"Hospitalization Length of Stay\"(TheEncounter FHIR.Encounter ):#xD;\n  LengthInDays(\"Hospitalization\"(TheEncounter))#xD;\n#xD;\n/*Returns admission time for an encounter or for immediately prior emergency department visit.*/#xD;\ndefine function \"Hospital Admission Time\"(TheEncounter FHIR.Encounter ):#xD;\n  start of \"Hospitalization\"(TheEncounter)#xD;\n#xD;\n/*Hospital Discharge Time returns the discharge time for an encounter*/#xD;\ndefine function \"Hospital Discharge Time\"(TheEncounter FHIR.Encounter ):#xD;\n  end of FHIRHelpers.ToInterval(TheEncounter.period)#xD;\n#xD;\n/*Returns earliest arrival time for an encounter including any prior ED visit.*/#xD;\ndefine function \"Hospital Arrival Time\"(TheEncounter FHIR.Encounter ):#xD;\n  start of FHIRHelpers.ToInterval(First(#xD;\n  	    ( \"Hospitalization Locations\"(TheEncounter) ) HospitalLocation#xD;\n  			sort by start of FHIRHelpers.ToInterval(period)#xD;\n  	).period)#xD;\n  #xD;\n  // TODO - fix these (must fetch Location resources and compare id to reference)#xD;\n  /*Returns the latest departure time for encounter including any prior ED visit. */#xD;\n  /*#xD;\n  define function \"Hospital Departure Time\"(TheEncounter FHIR.Encounter):#xD;\n  	end of FHIRHelpers.ToInterval(Last(#xD;\n  	    ( \"Hospitalization Locations\"(TheEncounter) ) HospitalLocation#xD;\n  			sort by start of FHIRHelpers.ToInterval(period)#xD;\n  	).period)#xD;\n  #xD;\n  define function \"Emergency Department Arrival Time\"(TheEncounter FHIR.Encounter):#xD;\n  	start of FHIRHelpers.ToInterval((#xD;\n  	    singleton from (#xD;\n  	        ( \"Hospitalization Locations\"(TheEncounter) ) HospitalLocation#xD;\n  				where HospitalLocation.type ~ \"ER\"#xD;\n  		)#xD;\n  	).period)#xD;\n  #xD;\n  define function \"First Inpatient Intensive Care Unit\"(TheEncounter FHIR.Encounter):#xD;\n  	First(#xD;\n  	    ( TheEncounter.location ) HospitalLocation#xD;\n  			where HospitalLocation.type ~ \"ICU\"#xD;\n  				and HospitalLocation.period during TheEncounter.period#xD;\n  			sort by start of FHIRHelpers.ToInterval(period)#xD;\n  	)#xD;\n  */#xD;\n  #xD;\n  /*Hospitalization with Observation and Outpatient Surgery Service returns the total interval from the start of any immediately prior emergency department visit, outpatient surgery visit or observation visit to the discharge of the given encounter.*/#xD;\n  /* TODO:#xD;\n  define function \"HospitalizationWithObservationAndOutpatientSurgeryService\"(Encounter \"Encounter, Performed\" ):#xD;\n  Encounter Visit#xD;\n  	let ObsVisit: Last([\"Encounter, Performed\": \"Observation Services\"] LastObs#xD;\n  			where LastObs.relevantPeriod ends 1 hour or less on or before start of Visit.relevantPeriod#xD;\n  			sort by#xD;\n  			end of relevantPeriod#xD;\n  	),#xD;\n  	VisitStart: Coalesce(start of ObsVisit.relevantPeriod, start of Visit.relevantPeriod),#xD;\n  	EDVisit: Last([\"Encounter, Performed\": \"Emergency Department Visit\"] LastED#xD;\n  			where LastED.relevantPeriod ends 1 hour or less on or before VisitStart#xD;\n  			sort by#xD;\n  			end of relevantPeriod#xD;\n  	),#xD;\n  	VisitStartWithED: Coalesce(start of EDVisit.relevantPeriod, VisitStart),#xD;\n  	OutpatientSurgeryVisit: Last([\"Encounter, Performed\": \"Outpatient Surgery Service\"] LastSurgeryOP#xD;\n  			where LastSurgeryOP.relevantPeriod ends 1 hour or less on or before VisitStartWithED#xD;\n  			sort by#xD;\n  			end of relevantPeriod#xD;\n  	)#xD;\n  	return Interval[Coalesce(start of OutpatientSurgeryVisit.relevantPeriod, VisitStartWithED),#xD;\n  	end of Visit.relevantPeriod]#xD;\n  */#xD;\n#xD;\n/*Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter*/#xD;\ndefine function \"HospitalizationWithObservation\"(TheEncounter FHIR.Encounter ):#xD;\n  TheEncounter Visit#xD;\n  		let ObsVisit: Last([Encounter: \"Observation Services\"] LastObs#xD;\n  				where LastObs.period ends 1 hour or less on or before start of Visit.period#xD;\n  				sort by end of period#xD;\n  			),#xD;\n  			VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),#xD;\n  			EDVisit: Last([Encounter: \"Emergency Department Visit\"] LastED#xD;\n  				where LastED.period ends 1 hour or less on or before VisitStart#xD;\n  				sort by end of period#xD;\n  			)#xD;\n  		return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]#xD;\n#xD;\n/**#xD;\n* Normalizes the input argument to an interval representation.#xD;\n* The input can be provided as a dateTime, Period, Timing, instant, string, Age, or Range.#xD;\n* The intent of this function is to provide a clear and concise mechanism to treat single#xD;\n* elements that have multiple possible representations as intervals so that logic doesn't have to account#xD;\n* for the variability. More complex calculations (such as medication request period or dispense period#xD;\n* calculation) need specific guidance and consideration. That guidance may make use of this function, but#xD;\n* the focus of this function is on single element calculations where the semantics are unambiguous.#xD;\n* If the input is a dateTime, the result a DateTime Interval beginning and ending on that dateTime.#xD;\n* If the input is a Period, the result is a DateTime Interval.#xD;\n* If the input is a Timing, an error is raised indicating a single interval cannot be computed from a Timing.#xD;\n* If the input is an instant, the result is a DateTime Interval beginning and ending on that instant.#xD;\n* If the input is a string, an error is raised indicating a single interval cannot be computed from a string.#xD;\n* If the input is an Age, the result is a DateTime Interval beginning when the patient was the given Age,#xD;\nand ending immediately prior to when the patient was the given Age plus one year.#xD;\n* If the input is a Range, the result is a DateTime Interval beginning when the patient was the Age given#xD;\nby the low end of the Range, and ending immediately prior to when the patient was the Age given by the#xD;\nhigh end of the Range plus one year.*/#xD;\ndefine function \"Normalize Interval\"(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt; ):#xD;\n  case#xD;\n  	  when choice is FHIR.dateTime then#xD;\n  	Interval[FHIRHelpers.ToDateTime(choice as FHIR.dateTime), FHIRHelpers.ToDateTime(choice as FHIR.dateTime)]#xD;\n  		when choice is FHIR.Period then#xD;\n  		FHIRHelpers.ToInterval(choice as FHIR.Period)#xD;\n  		when choice is FHIR.instant then#xD;\n  			Interval[FHIRHelpers.ToDateTime(choice as FHIR.instant), FHIRHelpers.ToDateTime(choice as FHIR.instant)]#xD;\n  		when choice is FHIR.Age then#xD;\n  		  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age),#xD;\n  			  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(choice as FHIR.Age) + 1 year)#xD;\n  		when choice is FHIR.Range then#xD;\n  		  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).low),#xD;\n  			  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((choice as FHIR.Range).high) + 1 year)#xD;\n  		when choice is FHIR.Timing then#xD;\n  		  Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute a single interval from a Timing type')#xD;\n    when choice is FHIR.string then#xD;\n      Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute an interval from a String value')#xD;\n  		else#xD;\n  			null as Interval&lt;DateTime&gt;#xD;\n  	end#xD;\n#xD;\n/**#xD;\n* Returns an interval representing the abatement of the given condition, if an#xD;\nabatement element is present, null otherwise.#xD;\nThis function uses the semantics of Normalize Interval to interpret the abatement#xD;\nelement.*/#xD;\ndefine function \"Normalize Abatement\"(condition Condition ):#xD;\n  if condition.abatement is FHIR.dateTime then#xD;\n  	  Interval[FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime), FHIRHelpers.ToDateTime(condition.abatement as FHIR.dateTime)]#xD;\n  	else if condition.abatement is FHIR.Period then#xD;\n  	  FHIRHelpers.ToInterval(condition.abatement as FHIR.Period)#xD;\n  	else if condition.abatement is FHIR.string then#xD;\n  Message(null as Interval&lt;DateTime&gt;, true, '1', 'Error', 'Cannot compute an interval from a String value')#xD;\n  	else if condition.abatement is FHIR.Age then#xD;\n  		Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age),#xD;\n  			FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity(condition.abatement as FHIR.Age) + 1 year)#xD;\n  	else if condition.abatement is FHIR.Range then#xD;\n  	  Interval[FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).low),#xD;\n  		  FHIRHelpers.ToDate(Patient.birthDate) + FHIRHelpers.ToQuantity((condition.abatement as FHIR.Range).high) + 1 year)#xD;\n  	else if condition.abatement is FHIR.boolean then#xD;\n  	  Interval[end of \"Normalize Interval\"(condition.onset), condition.recordedDate)#xD;\n  	else null#xD;\n#xD;\n/*Returns an interval representing the period during which the condition was prevalent (i.e. onset to abatement)#xD;\nIf the condition is \"active\", then abatement being unknown#xD;\nwould indicate the condition is ongoing, and the ending boundary of the prevalence#xD;\nperiod is inclusive, otherwise, the abatement is considered unknown and the ending boundary#xD;\nof the prevalence period is exclusive.#xD;\nNote that when using this function it should be noted that many clinical systems#xD;\ndo not actually capture abatement, so care should be taken when using this function#xD;\nto meet clinical intent.*/#xD;\ndefine function \"Prevalence Period\"(condition Condition ):#xD;\n  if condition.clinicalStatus ~ \"active\"#xD;\n    or condition.clinicalStatus ~ \"recurrence\"#xD;\n    or condition.clinicalStatus ~ \"relapse\" then#xD;\n    Interval[start of \"Normalize Interval\"(condition.onset), end of \"Normalize Abatement\"(condition)]#xD;\n  else#xD;\n    Interval[start of \"Normalize Interval\"(condition.onset), end of \"Normalize Abatement\"(condition))#xD;\n#xD;\n/*Returns the tail of the given uri (i.e. everything after the last slash in the URI).*/#xD;\ndefine function \"GetId\"(uri String ):#xD;\n  Last(Split(uri, '/'))#xD;\n#xD;\n/*Returns the Condition resources referenced by the diagnosis element of the Encounter*/#xD;\ndefine function \"EncounterDiagnosis\"(Encounter Encounter ):#xD;\n  Encounter.diagnosis D#xD;\n    return singleton from ([Condition] C where C.id = \"GetId\"(D.condition.reference))#xD;\n  #xD;\n  // Returns the condition that is specified as the principal diagnosis for the encounter#xD;\n  // TODO: BTR 2019-07-30: Shouldn't need the FHIRHelpers reference here, investigate#xD;\n#xD;\ndefine function \"PrincipalDiagnosis\"(Encounter Encounter ):#xD;\n  (singleton from (Encounter.diagnosis D where FHIRHelpers.ToInteger(D.rank) = 1)) PD#xD;\n  		return singleton from ([Condition] C where C.id = \"GetId\"(PD.condition.reference))#xD;\n  // Returns the location for the given location reference#xD;\n#xD;\n/*Returns the Location resource specified by the given reference*/#xD;\ndefine function \"GetLocation\"(reference Reference ):#xD;\n  singleton from (#xD;\n    [Location] L where L.id = GetId(reference.reference)#xD;\n  )#xD;\n#xD;\n/*NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the#xD;\nCQL model info.*/#xD;\ndefine function \"GetExtensions\"(domainResource DomainResource, url String ):#xD;\n  domainResource.extension E#xD;\n  	  where E.url = ('http://hl7.org/fhir/us/qicore/StructureDefinition/' + url)#xD;\n  		return E#xD;\n#xD;\ndefine function \"GetExtension\"(domainResource DomainResource, url String ):#xD;\n  singleton from \"GetExtensions\"(domainResource, url)#xD;\n#xD;\n/*NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the#xD;\nCQL model info.*/#xD;\ndefine function \"GetExtensions\"(element Element, url String ):#xD;\n  element.extension E#xD;\n  	  where E.url = (url)#xD;\n  		return E#xD;\n#xD;\ndefine function \"GetExtension\"(element Element, url String ):#xD;\n  singleton from \"GetExtensions\"(element, url)#xD;\n#xD;\n/*NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the#xD;\nCQL model info.*/#xD;\ndefine function \"GetBaseExtensions\"(domainResource DomainResource, url String ):#xD;\n  domainResource.extension E#xD;\n  	  where E.url = ('http://hl7.org/fhir/StructureDefinition/' + url)#xD;\n  		return E#xD;\n#xD;\ndefine function \"GetBaseExtension\"(domainResource DomainResource, url String ):#xD;\n  singleton from \"GetBaseExtensions\"(domainResource, url)#xD;\n#xD;\n/*@description: Returns any base-FHIR extensions defined on the given element with the specified id.#xD;\n@comment: NOTE: Extensions are not the preferred approach, but are used as a way to access#xD;\ncontent that is defined by extensions but not yet surfaced in the CQL model info.*/#xD;\ndefine function \"BaseExtensions\"(element Element, id String ):#xD;\n  element.extension E#xD;\n  	  where E.url = ('http://hl7.org/fhir/StructureDefinition/' + id)#xD;\n  		return E#xD;\n#xD;\n/*@description: Returns the single base-FHIR extension (if present) on the given element with the specified id.#xD;\n@comment: This function uses singleton from to ensure that a run-time exception is thrown if there#xD;\nis more than one extension on the given resource with the specified url.*/#xD;\ndefine function \"BaseExtension\"(element Element, id String ):#xD;\n  singleton from BaseExtensions(element, id)#xD;\n#xD;\n/*NOTE: Provenance is not the preferred approach, this is provided only as an illustration#xD;\nfor what using Provenance could look like, and is not a tested pattern*/#xD;\ndefine function \"GetProvenance\"(resource Resource ):#xD;\n  singleton from ([Provenance: target in resource.id])#xD;\n#xD;\ndefine function \"GetMedicationCode\"(request MedicationRequest ):#xD;\n  if request.medication is CodeableConcept then#xD;\n  	  request.medication as CodeableConcept#xD;\n  	else#xD;\n  	  (singleton from ([Medication] M where M.id = GetId((request.medication as Reference).reference))).code#xD;\n#xD;\n/*Given an interval, return true if the interval has a starting boundary specified (i.e. the start of the interval is not null and not the minimum DateTime value)*/#xD;\ndefine function \"HasStart\"(period Interval&lt;DateTime&gt; ):#xD;\n  not ( start of period is null#xD;\n      or start of period = minimum DateTime#xD;\n  )#xD;\n#xD;\n/*Given an interval, return true if the interval has an ending boundary specified (i.e. the end of the interval is not null and not the maximum DateTime value)*/#xD;\ndefine function \"HasEnd\"(period Interval&lt;DateTime&gt; ):#xD;\n  not (#xD;\n    end of period is null#xD;\n      or#xD;\n      end of period = maximum DateTime#xD;\n  )#xD;\n#xD;\n/*Given an interval, return the ending point if the interval has an ending boundary specified, otherwise, return the starting point*/#xD;\ndefine function \"Latest\"(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt; ):#xD;\n  (\"Normalize Interval\"(choice)) period#xD;\n    return#xD;\n      if ( HasEnd(period)) then end of period#xD;\n      else start of period#xD;\n#xD;\n/*Given an interval, return the starting point if the interval has a starting boundary specified, otherwise, return the ending point*/#xD;\ndefine function \"Earliest\"(choice Choice&lt;FHIR.dateTime, FHIR.Period, FHIR.Timing, FHIR.instant, FHIR.string, FHIR.Age, FHIR.Range&gt; ):#xD;\n  (\"Normalize Interval\"(choice)) period#xD;\n    return#xD;\n      if (HasStart(period)) then start of period#xD;\n      else end of period#xD;\n#xD;\n</code></pre>\n      </td>\n    </tr>\n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.4-cibuild of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"^^rdf:XMLLiteral ]
      ] ; #
      fhir:url [
    fhir:v "http://fhir.org/guides/cqf/Library/MATGlobalCommonFunctionsFHIR4"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/Library/MATGlobalCommonFunctionsFHIR4>
      ] ; #
      fhir:version [ fhir:v "6.1.000"] ; #
      fhir:name [ fhir:v "MATGlobalCommonFunctionsFHIR4"] ; #
      fhir:title [ fhir:v "MAT Global Common Functions FHIRR4"] ; #
      fhir:status [ fhir:v "draft"] ; #
      fhir:experimental [ fhir:v true] ; #
      fhir:type [
        ( fhir:coding [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/library-type"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/library-type>       ] ;
    fhir:code [ fhir:v "logic-library" ] ;
    fhir:display [ fhir:v "Logic Library" ]     ] )
      ] ; #
      fhir:relatedArtifact ( [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system ConditionClinicalStatusCodes" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/condition-clinical"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/condition-clinical>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system AllergyIntoleranceClinicalStatusCodes" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system AllergyIntoleranceVerificationStatusCodes" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/allergyintolerance-verification>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system Diagnosis Role" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/diagnosis-role"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/diagnosis-role>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system LOINC" ] ;
    fhir:resource [
    fhir:v "http://loinc.org"^^xsd:anyURI ;
    fhir:l <http://loinc.org>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system MedicationRequestCategory" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/medicationrequest-category"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/medicationrequest-category>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system ConditionVerificationStatusCodes" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/condition-ver-status"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/condition-ver-status>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system SNOMEDCT" ] ;
    fhir:resource [
    fhir:v "http://snomed.info/sct"^^xsd:anyURI ;
    fhir:l <http://snomed.info/sct>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system RoleCode" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-RoleCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-RoleCode>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Emergency Department Visit" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Encounter Inpatient" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Observation Services" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143>     ]
      ] ) ; #
      fhir:parameter ( [
    fhir:name [ fhir:v "Measurement Period" ] ;
    fhir:use [ fhir:v "in" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:type [ fhir:v "Period" ]
      ] [
    fhir:name [ fhir:v "Patient" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:type [ fhir:v "Patient" ]
      ] [
    fhir:name [ fhir:v "Inpatient Encounter" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]
      ] ) ; #
      fhir:dataRequirement ( [
    fhir:type [ fhir:v "Patient" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Patient"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Patient>     ] )
      ] [
    fhir:type [ fhir:v "Encounter" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>     ] ) ;
        ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "status" ] [ fhir:v "period" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "type" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307>       ]     ] )
      ] [
    fhir:type [ fhir:v "Encounter" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>     ] ) ;
        ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "period" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "type" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143>       ]     ] )
      ] [
    fhir:type [ fhir:v "Encounter" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>     ] ) ;
        ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "status" ] [ fhir:v "period" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "type" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292>       ]     ] )
      ] [
    fhir:type [ fhir:v "Condition" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Condition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Condition>     ] ) ;
        ( fhir:mustSupport [ fhir:v "id" ] )
      ] [
    fhir:type [ fhir:v "Location" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Location"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Location>     ] ) ;
        ( fhir:mustSupport [ fhir:v "id" ] )
      ] [
    fhir:type [ fhir:v "Provenance" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Provenance"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Provenance>     ] ) ;
        ( fhir:mustSupport [ fhir:v "target" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "target" ]     ] )
      ] ) ; #
      fhir:content ( [
    fhir:contentType [ fhir:v "text/cql" ] ;
    fhir:data [ fhir:v " "^^xsd:base64Binary ]
      ] ) . #

    <urn:uuid:c6098378-cb38-4ae2-a096-3a3cc5c620d5> a fhir:Library ;
      fhir:id [ fhir:v "SupplementalDataElementsFHIR4"] ; #
      fhir:language [ fhir:v "en"] ; #
      fhir:text [
    fhir:status [ fhir:v "extensions" ] ;
    fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Library_SupplementalDataElementsFHIR4\"> </a>\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n\n<td class=\"content-container\">SupplementalDataElementsFHIR4</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">2.0.000</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Status</th>\n\n\n\n<td class=\"content-container\">Draft</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Experimental</th>\n\n\n\n<td class=\"content-container\">true</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n\n<td class=\"content-container\">\n    Logic Library\n\n\n</td>\n\n\n</tr>\n\n\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Ethnicity\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.837/expansion\">Ethnicity</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set ONC Administrative Sex\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1/expansion\">ONC Administrative Sex</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Payer\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion\">Payer Type</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Race\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.836/expansion\">Race</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836</tt>\n    \n    \n    \n  </td>\n</tr>\n\n\n\n\n\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Patient\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/patient.html\">Patient</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: url, extension, value\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Coverage\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/coverage.html\">Coverage</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion\">Payer Type</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"parameters\"> </a>Parameters</th>\n\n\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\"/>\n\n\n  <td class=\"content-container\">\n    <table>\n      <thead>\n        <tr>\n          <td><em>Name</em></td>\n          <td><em>Use</em></td>\n          <td><em>Card.</em></td>\n          <td><em>Type</em></td>\n          <td><em>Documentation</em></td>\n        </tr>\n      </thead>\n      <tbody>\n      \n        <tr>\n          <td>Patient</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>Patient</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Ethnicity</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Coding</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Payer</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Any</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Race</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Coding</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Sex</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>Coding</td>\n          <td/>\n        </tr>\n      \n      </tbody>\n    </table>\n  </td>\n</tr>\n\n\n\n\n\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">library SupplementalDataElementsFHIR4 version '2.0.000'#xD;\n#xD;\n/*@update: @@BTR 2020-03-31 -&gt;#xD;\nIncremented version to 2.0.0#xD;\nUpdated FHIR version to 4.0.1#xD;\n@@@*/#xD;\n#xD;\nusing FHIR version '4.0.1'#xD;\n#xD;\ninclude FHIRHelpers version '4.0.1' called FHIRHelpers#xD;\n#xD;\nvalueset \"Ethnicity\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837' #xD;\nvalueset \"ONC Administrative Sex\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1' #xD;\nvalueset \"Payer\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591' #xD;\nvalueset \"Race\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836' #xD;\n#xD;\ncontext Patient#xD;\n#xD;\ndefine \"SDE Ethnicity\":#xD;\n  (flatten (#xD;\n      Patient.extension Extension#xD;\n        where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'#xD;\n          return Extension.extension#xD;\n    )) E#xD;\n      where E.url = 'ombCategory'#xD;\n        or E.url = 'detailed'#xD;\n      return E.value as Coding#xD;\n#xD;\ndefine \"SDE Payer\":#xD;\n  [Coverage: type in \"Payer\"] Payer#xD;\n        return {#xD;\n          code: Payer.type,#xD;\n          period: Payer.period#xD;\n        }#xD;\n#xD;\ndefine \"SDE Race\":#xD;\n  (flatten (#xD;\n      Patient.extension Extension#xD;\n        where Extension.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'#xD;\n          return Extension.extension#xD;\n    )) E#xD;\n      where E.url = 'ombCategory'#xD;\n        or E.url = 'detailed'#xD;\n      return E.value as Coding#xD;\n#xD;\ndefine \"SDE Sex\":#xD;\n  case#xD;\n      when Patient.gender = 'male' then Code { code: 'M', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Male' }#xD;\n      when Patient.gender = 'female' then Code { code: 'F', system: 'http://hl7.org/fhir/v3/AdministrativeGender', display: 'Female' }#xD;\n      else null#xD;\n    end#xD;\n#xD;\n</code></pre>\n      </td>\n    </tr>\n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.4-cibuild of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"^^rdf:XMLLiteral ]
      ] ; #
      fhir:url [
    fhir:v "http://fhir.org/guides/cqf/Library/SupplementalDataElementsFHIR4"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/Library/SupplementalDataElementsFHIR4>
      ] ; #
      fhir:version [ fhir:v "2.0.000"] ; #
      fhir:name [ fhir:v "SupplementalDataElementsFHIR4"] ; #
      fhir:title [ fhir:v "SupplementalDataElementsFHIR4"] ; #
      fhir:status [ fhir:v "draft"] ; #
      fhir:experimental [ fhir:v true] ; #
      fhir:type [
        ( fhir:coding [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/library-type"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/library-type>       ] ;
    fhir:code [ fhir:v "logic-library" ] ;
    fhir:display [ fhir:v "Logic Library" ]     ] )
      ] ; #
      fhir:relatedArtifact ( [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Ethnicity" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.837>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set ONC Administrative Sex" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Payer" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Race" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836>     ]
      ] ) ; #
      fhir:parameter ( [
    fhir:name [ fhir:v "Patient" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:type [ fhir:v "Patient" ]
      ] [
    fhir:name [ fhir:v "SDE Ethnicity" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Coding" ]
      ] [
    fhir:name [ fhir:v "SDE Payer" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Any" ]
      ] [
    fhir:name [ fhir:v "SDE Race" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Coding" ]
      ] [
    fhir:name [ fhir:v "SDE Sex" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:type [ fhir:v "Coding" ]
      ] ) ; #
      fhir:dataRequirement ( [
    fhir:type [ fhir:v "Patient" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Patient"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Patient>     ] ) ;
        ( fhir:mustSupport [ fhir:v "url" ] [ fhir:v "extension" ] [ fhir:v "value" ] )
      ] [
    fhir:type [ fhir:v "Coverage" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Coverage"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Coverage>     ] ) ;
        ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "period" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "type" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591>       ]     ] )
      ] ) ; #
      fhir:content ( [
    fhir:contentType [ fhir:v "text/cql" ] ;
    fhir:data [ fhir:v " "^^xsd:base64Binary ]
      ] ) . #

    <urn:uuid:e3b78b9e-96ee-43fb-aeea-22a7681a1538> a fhir:Library ;
      fhir:id [ fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"] ; #
      fhir:language [ fhir:v "en"] ; #
      fhir:text [
    fhir:status [ fhir:v "extensions" ] ;
    fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Library_NHSNGlycemicControlHypoglycemicInitialPopulation\"> </a>\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n\n<td class=\"content-container\">NHSN Glycemic Control Hypoglycemic Initial Population</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">0.0.002</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Status</th>\n\n\n\n<td class=\"content-container\">Draft</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Experimental</th>\n\n\n\n<td class=\"content-container\">true</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Type</th>\n\n\n\n<td class=\"content-container\">\n    Logic Library\n\n\n</td>\n\n\n</tr>\n\n\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library SDE\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"Bundle-sde-example-artifact-bundle.html\">SupplementalDataElementsFHIR4</a> version: 2.0.000\n    <br/>\n    <em>Canonical URL</em>: <tt>http://fhir.org/guides/cqf/Library/SupplementalDataElementsFHIR4|2.0.000</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library Global\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"Bundle-sde-example-artifact-bundle.html\">MAT Global Common Functions FHIRR4</a> version: 6.1.000\n    <br/>\n    <em>Canonical URL</em>: <tt>http://fhir.org/guides/cqf/Library/MATGlobalCommonFunctionsFHIR4|6.1.000</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system ActCode\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html\">ActCode</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system Diagnosis Role\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-diagnosis-role.html\">Diagnosis Role</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/diagnosis-role</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system Specimen Type\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v2-0487.html\">specimenType</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/v2-0487</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system Observation Category\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-observation-category.html\">Observation Category Codes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/observation-category</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system Condition Category\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-condition-category.html\">Condition Category Codes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-category</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Blood Glucose Laboratory and Point of Care Tests\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1190.38/expansion\">Blood Glucose Laboratory and Point of Care Tests</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Inpatient, Emergency, and Observation Locations\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1046.265/expansion\">Inpatient, Emergency, and Observation Locations</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Discharge Disposition\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/ValueSet-encounter-discharge-disposition.html\">Discharge disposition</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/ValueSet/encounter-discharge-disposition</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Antidiabetic Medications\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1190.58/expansion\">Diabetes Medications</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.58</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Emergency Department Visit\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion\">Emergency Department Visit</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Encounter Inpatient\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion\">Encounter Inpatient</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Observation Services\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion\">Observation Services</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143</tt>\n    \n    \n    \n  </td>\n</tr>\n\n<tr>\n  \n  \n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Payer\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion\">Payer Type</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</tt>\n    \n    \n    \n  </td>\n</tr>\n\n\n\n\n\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Patient\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/patient.html\">Patient</a>\n    <br/>        \n  \n   \n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: class\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: class</span>\n    <br/>\n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Code(s)</em>: \n    \n      \n      <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html#v3-ActCode-IMP\">ActCode: IMP</a> (inpatient encounter), \n      \n    \n      \n      <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html#v3-ActCode-ACUTE\">ActCode: ACUTE</a> (inpatient acute), \n      \n    \n      \n      <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html#v3-ActCode-NONAC\">ActCode: NONAC</a> (inpatient non-acute), \n      \n    \n      \n      <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html#v3-ActCode-SS\">ActCode: SS</a> (short stay)\n      \n    \n    </span>\n    <br/>\n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, status, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.666.5.307/expansion\">Encounter Inpatient</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: location, period\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, class, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1111.143/expansion\">Observation Services</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, class, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113883.3.117.1.7.1.292/expansion\">Emergency Department Visit</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Location\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/location.html\">Location</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: id\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Medication\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/medication.html\">Medication</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: id\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: MedicationAdministration\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/medicationadministration.html\">MedicationAdministration</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: medication, status, effective\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: MedicationRequest\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/medicationrequest.html\">MedicationRequest</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: medication, authoredOn\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Specimen\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/specimen.html\">Specimen</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: id, collection, collection.collected\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/condition.html\">Condition</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: onset, category\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Observation\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/observation.html\">Observation</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, effective, specimen, specimen.collection, specimen.collection.collected, category\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: code</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1190.38/expansion\">Blood Glucose Laboratory and Point of Care Tests</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Coverage\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/coverage.html\">Coverage</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion\">Payer Type</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"parameters\"> </a>Parameters</th>\n\n\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\"/>\n\n\n  <td class=\"content-container\">\n    <table>\n      <thead>\n        <tr>\n          <td><em>Name</em></td>\n          <td><em>Use</em></td>\n          <td><em>Card.</em></td>\n          <td><em>Type</em></td>\n          <td><em>Documentation</em></td>\n        </tr>\n      </thead>\n      <tbody>\n      \n        <tr>\n          <td>Measurement Period</td>\n          <td>In</td>\n          <td>0..1</td>\n          <td>Period</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Patient</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>Patient</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Inpatient Encounter</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Patient Hospital Locations</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Antidiabetic Drugs Administered or Ordered</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Any</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Initial Population</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Chief Complaint</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Condition</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Condition</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Condition during Encounter</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Condition</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Encounter Discharge Dispositions</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Encounter Locations</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Medication Administration</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>MedicationAdministration</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Medication Request</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>MedicationRequest</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Blood Glucose Observation</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Observation</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Payer</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Any</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Specimen</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Specimen</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Minimal Patient</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>Patient</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Minimal Medication Requests</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>MedicationRequest</td>\n          <td/>\n        </tr>\n      \n      </tbody>\n    </table>\n  </td>\n</tr>\n\n\n\n\n\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Library Content</th>\n\n\n</tr>\n  \n    \n    <tr>\n      <th scope=\"row\" class=\"row-header\">CQL Content</th>\n      <td>\n        <a name=\"cql-content\"> </a>\n        <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">library NHSNGlycemicControlHypoglycemicInitialPopulation version '0.0.002'\n\nusing FHIR version '4.0.1'\n\ninclude FHIRHelpers version '4.0.1' called FHIRHelpers\ninclude SupplementalDataElementsFHIR4 version '2.0.000' called SDE\ninclude MATGlobalCommonFunctionsFHIR4 version '6.1.000' called Global\n\ncodesystem \"ActCode\": 'http://terminology.hl7.org/CodeSystem/v3-ActCode' \ncodesystem \"Diagnosis Role\": 'http://terminology.hl7.org/CodeSystem/diagnosis-role'\ncodesystem \"Specimen Type\": 'http://terminology.hl7.org/CodeSystem/v2-0487'\ncodesystem \"Observation Category\": 'http://terminology.hl7.org/CodeSystem/observation-category'\ncodesystem \"Condition Category\": 'http://terminology.hl7.org/CodeSystem/condition-category' \n\nvalueset \"Blood Glucose Laboratory and Point of Care Tests\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38'\nvalueset \"Inpatient, Emergency, and Observation Locations\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265'\nvalueset \"Discharge Disposition\": 'http://terminology.hl7.org/ValueSet/encounter-discharge-disposition'\nvalueset \"Antidiabetic Medications\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.58'\nvalueset \"Emergency Department Visit\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292'\nvalueset \"Encounter Inpatient\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307'\nvalueset \"Observation Services\": 'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143'\n\ncode \"Chief Complaint\": 'CC' from \"Diagnosis Role\" display 'Chief complaint'\ncode \"emergency\": 'EMER' from \"ActCode\" display 'emergency'\ncode \"inpatient acute\": 'ACUTE' from \"ActCode\" display 'inpatient acute'\ncode \"inpatient encounter\": 'IMP' from \"ActCode\" display 'inpatient encounter'\ncode \"inpatient non-acute\": 'NONAC' from \"ActCode\" display 'inpatient non-acute'\ncode \"observation encounter\": 'OBSENC' from \"ActCode\" display 'observation encounter'\ncode \"short stay\": 'SS' from \"ActCode\" display 'short stay'\ncode \"laboratory\": 'laboratory' from \"Observation Category\" display 'Laboratory'\ncode \"encounter-diagnosis\": 'encounter-diagnosis' from \"Condition Category\" display'encounter-diagnosis'\n\nparameter \"Measurement Period\" Interval&lt;DateTime&gt;\n default Interval[@2022-01-01T00:00:00.0, @2022-01-31T00:00:00.0)\n\ncontext Patient\n\ndefine \"Initial Population\":\n  (\"Inpatient Encounter\"\n  union \"Patient Hospital Locations\") InpatientEncounters\n  with \"Antidiabetic Drugs Administered or Ordered\" ADD\n  such that Coalesce(start of Global.\"Normalize Interval\"(ADD.effective), ADD.authoredOn)\n      during \"HospitalizationWithObservationOrEmergency\"(InpatientEncounters)\n    and Coalesce(start of Global.\"Normalize Interval\"(ADD.effective), ADD.authoredOn) during \"Measurement Period\"\n\ndefine \"Inpatient Encounter\":\n  [Encounter: class in {\"inpatient encounter\", \"inpatient acute\", \"inpatient non-acute\", \"short stay\"}]\n    union [Encounter: \"Encounter Inpatient\"] Encounters\n  where Encounters.status in {'in-progress', 'finished'}\n    and Encounters.period overlaps \"Measurement Period\"\n\ndefine \"Patient Hospital Locations\":\n  [Encounter] Encounters\n  where exists(\n    Encounters.location EncounterLocation\n    where Global.GetLocation(EncounterLocation.location).type in \"Inpatient, Emergency, and Observation Locations\"\n      and EncounterLocation.period during Encounters.period\n  )\n\ndefine \"Antidiabetic Drugs Administered or Ordered\":\n  ([MedicationAdministration] ADDMedAdmin\n    where GetMedicationCode(ADDMedAdmin.medication) in \"Antidiabetic Medications\"\n      and ADDMedAdmin.status ~ 'completed')\n  union (\n    [MedicationRequest] MedicationRequests\n      where GetMedicationCode(MedicationRequests.medication) in \"Antidiabetic Medications\"\n  )\n\ndefine function \"GetMedicationCode\"(choice Choice&lt;FHIR.CodeableConcept, FHIR.Reference&gt;):\n  case\n    when choice is FHIR.CodeableConcept then\n      choice as FHIR.CodeableConcept\n    when choice is FHIR.Reference then\n      GetMedication(choice as FHIR.Reference).code\n    else\n      null as FHIR.CodeableConcept\n  end\n\ndefine function \"GetMedication\"(reference Reference ):\n  singleton from (\n    [Medication] M where M.id = Global.GetId(reference.reference)\n  )\n\ndefine function \"HospitalizationWithObservationOrEmergency\"(TheEncounter FHIR.Encounter ):\n  TheEncounter Visit\n    let ObsVisit: Last([Encounter: \"Observation Services\"] LastObs\n        where LastObs.class ~ \"observation encounter\"\n          and LastObs.period ends 1 hour or less on or before start of Visit.period\n  				sort by end of period\n    ),\n    VisitStart: Coalesce(start of ObsVisit.period, start of Visit.period),\n    EDVisit: Last([Encounter: \"Emergency Department Visit\"] LastED\n        where LastED.class ~ \"emergency\"\n          and LastED.period ends 1 hour or less on or before start of Visit.period\n  				sort by end of period\n    )\n    return Interval[Coalesce(start of EDVisit.period, VisitStart), end of Visit.period]\n\ndefine function \"GetSpecimen\"(reference Reference):\n  singleton from (\n    [Specimen] S where S.id = Global.GetId(reference.reference)\n  )\n\ndefine function \"GetPatientExtensions\"(domainResource DomainResource):\n  domainResource.extension E\n    where E.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'\n      or E.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity'\n      or E.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex'\n      or E.url = 'https://hl7.org/fhir/us/core/StructureDefinition-us-core-genderIdentity'\n    return E\n\ndefine function \"GetPatientAddress\"(addresses List&lt;FHIR.Address&gt;):\n  addresses address\n  return FHIR.Address{\n    postalCode: address.postalCode\n  }\n\ndefine function \"MedicationRequestResource\"(medicationRequest MedicationRequest):\n  medicationRequest m\n  return MedicationRequest{\n    id: FHIR.id {value: 'new-' + m.id},\n    medication: GetMedicationCode(m.medication),\n    dosageInstruction: m.dosageInstruction\n  }\n  \n//Supplement Data Elements\ndefine \"SDE Chief Complaint\":\n  \"Initial Population\" IP\n  with IP.diagnosis InitialPopulationDiagnosis\n  such that InitialPopulationDiagnosis.use ~ \"Chief Complaint\"\n\ndefine \"SDE Condition\":\n  [Condition] Conditions\n  with \"Initial Population\" InitialPopulation\n  such that Global.\"Normalize Interval\"(Conditions.onset) overlaps InitialPopulation.period\n  \ndefine \"SDE Condition during Encounter\":\n  [Condition] ConditionEncounterDiagnosis\n  with ConditionEncounterDiagnosis.category Category\n  such that Category ~ \"encounter-diagnosis\"\n    and exists(\"Initial Population\")\n    \ndefine \"SDE Encounter Discharge Dispositions\":\n	\"Initial Population\" DischargeDispositions \n  where DischargeDispositions.hospitalization.dischargeDisposition in \"Discharge Disposition\"\n  \ndefine \"SDE Encounter Locations\":\n  \"Initial Population\" InitialPopulation \n  where exists ( \n    InitialPopulation.location InitialPopulationLocation\n    where (Global.GetLocation(InitialPopulationLocation.location).type in \"Inpatient, Emergency, and Observation Locations\"   \n      and InitialPopulationLocation.period during InitialPopulation.period)\n  )\n\ndefine \"SDE Medication Administration\":\n	[MedicationAdministration] MedicationAdministrations\n  with \"Initial Population\" InitialPopulation\n  such that start of Global.\"Normalize Interval\"(MedicationAdministrations.effective) during \"HospitalizationWithObservationOrEmergency\"(InitialPopulation)\n    and start of Global.\"Normalize Interval\"(MedicationAdministrations.effective) during \"Measurement Period\"\n\ndefine \"SDE Medication Request\":\n	[MedicationRequest] MedicationRequests\n  with \"Initial Population\" InitialPopulation\n	such that MedicationRequests.authoredOn during \"HospitalizationWithObservationOrEmergency\"(InitialPopulation)\n    and MedicationRequests.authoredOn during \"Measurement Period\"\n\ndefine \"SDE Blood Glucose Observation\":\n	[Observation: \"Blood Glucose Laboratory and Point of Care Tests\"] Observations \n  with \"Initial Population\" InitialPopulation\n  such that start of Global.\"Normalize Interval\"(Observations.effective) during InitialPopulation.period\n    or Global.\"Normalize Interval\"(GetSpecimen(Observations.specimen).collection.collected) during InitialPopulation.period\n  with Observations.category category\n  such that category ~ \"laboratory\"\n\ndefine \"SDE Payer\": \n	SDE.\"SDE Payer\" Payer\n  with \"Initial Population\" InitialPopulation\n  such that start of Payer.period before end of InitialPopulation.period\n  \ndefine \"SDE Specimen\":\n  [Specimen] Specimen\n  with \"Initial Population\" InitialPopulation\n  such that Global.\"Normalize Interval\"(Specimen.collection.collected) during InitialPopulation.period\n\n//Change on CQF ruler happened on 8/12. Check to make sure CQF-Ruler version is dated at or after (version 2.0.0). \n//Wait 2-3 days before the changes are actually applied to the CQF-Ruler.\ndefine \"SDE Minimal Patient\":\n  Patient{\n    id: Patient.id,\n    extension: GetPatientExtensions(Patient),\n    identifier: Patient.identifier,\n    gender: Patient.gender,\n    birthDate: Patient.birthDate,\n    deceased: Patient.deceased,\n    address: GetPatientAddress(Patient.address)\n  }\n  \ndefine \"SDE Minimal Medication Requests\":\n  [MedicationRequest] MedicationRequests\n  return MedicationRequestResource(MedicationRequests)\n\n/*define \"SDE Resource Construction Test Inlib\":\n  FHIR.Observation \n  {\n    id: FHIR.id { value: 'observation-sdetestinlib-' + ToString(Now()) },\n    status: FHIR.ObservationStatus { value: 'final' },\n    code: FHIR.CodeableConcept { coding: { FHIR.Coding { code: FHIR.code { value: 'days-since-appointment' } } } },\n    subject: FHIR.Reference { reference: FHIR.string { value: Patient.id.value }}\n    //value: FHIR.integer { value: Abs(difference in days between end of SDE.\"Last Appointment\".period and ToDateTime(Today())) }\n  }*/\n\n  define \"SDE Ethnicity Coding\":\n    SDE.\"SDE Ethnicity\"\n\n  define \"SDE Race Coding\":\n    SDE.\"SDE Race\"</code></pre>\n      </td>\n    </tr>\n    \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.4-cibuild of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"^^rdf:XMLLiteral ]
      ] ; #
      fhir:url [
    fhir:v "http://fhir.org/guides/cqf/Library/NHSNGlycemicControlHypoglycemicInitialPopulation"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/Library/NHSNGlycemicControlHypoglycemicInitialPopulation>
      ] ; #
      fhir:version [ fhir:v "0.0.002"] ; #
      fhir:name [ fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"] ; #
      fhir:title [ fhir:v "NHSN Glycemic Control Hypoglycemic Initial Population"] ; #
      fhir:status [ fhir:v "draft"] ; #
      fhir:experimental [ fhir:v true] ; #
      fhir:type [
        ( fhir:coding [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/library-type"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/library-type>       ] ;
    fhir:code [ fhir:v "logic-library" ] ;
    fhir:display [ fhir:v "Logic Library" ]     ] )
      ] ; #
      fhir:relatedArtifact ( [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Library SDE" ] ;
    fhir:resource [
    fhir:v "http://fhir.org/guides/cqf/Library/SupplementalDataElementsFHIR4|2.0.000"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/Library/SupplementalDataElementsFHIR4?version=2.0.000>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Library Global" ] ;
    fhir:resource [
    fhir:v "http://fhir.org/guides/cqf/Library/MATGlobalCommonFunctionsFHIR4|6.1.000"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/Library/MATGlobalCommonFunctionsFHIR4?version=6.1.000>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system ActCode" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system Diagnosis Role" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/diagnosis-role"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/diagnosis-role>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system Specimen Type" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/v2-0487"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v2-0487>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system Observation Category" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/observation-category"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/observation-category>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system Condition Category" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/condition-category"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/condition-category>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Blood Glucose Laboratory and Point of Care Tests" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Inpatient, Emergency, and Observation Locations" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Discharge Disposition" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/ValueSet/encounter-discharge-disposition"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/ValueSet/encounter-discharge-disposition>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Antidiabetic Medications" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.58"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.58>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Emergency Department Visit" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Encounter Inpatient" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Observation Services" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143>     ]
      ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Payer" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591>     ]
      ] ) ; #
      fhir:parameter ( [
    fhir:name [ fhir:v "Measurement Period" ] ;
    fhir:use [ fhir:v "in" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:type [ fhir:v "Period" ]
      ] [
    fhir:name [ fhir:v "Patient" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:type [ fhir:v "Patient" ]
      ] [
    fhir:name [ fhir:v "Inpatient Encounter" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]
      ] [
    fhir:name [ fhir:v "Patient Hospital Locations" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]
      ] [
    fhir:name [ fhir:v "Antidiabetic Drugs Administered or Ordered" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Any" ]
      ] [
    fhir:name [ fhir:v "Initial Population" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]
      ] [
    fhir:name [ fhir:v "SDE Chief Complaint" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]
      ] [
    fhir:name [ fhir:v "SDE Condition" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Condition" ]
      ] [
    fhir:name [ fhir:v "SDE Condition during Encounter" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Condition" ]
      ] [
    fhir:name [ fhir:v "SDE Encounter Discharge Dispositions" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]
      ] [
    fhir:name [ fhir:v "SDE Encounter Locations" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]
      ] [
    fhir:name [ fhir:v "SDE Medication Administration" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "MedicationAdministration" ]
      ] [
    fhir:name [ fhir:v "SDE Medication Request" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "MedicationRequest" ]
      ] [
    fhir:name [ fhir:v "SDE Blood Glucose Observation" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Observation" ]
      ] [
    fhir:name [ fhir:v "SDE Payer" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Any" ]
      ] [
    fhir:name [ fhir:v "SDE Specimen" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Specimen" ]
      ] [
    fhir:name [ fhir:v "SDE Minimal Patient" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:type [ fhir:v "Patient" ]
      ] [
    fhir:name [ fhir:v "SDE Minimal Medication Requests" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "MedicationRequest" ]
      ] ) ; #
      fhir:dataRequirement ( [
    fhir:type [ fhir:v "Patient" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Patient"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Patient>     ] )
      ] [
    fhir:type [ fhir:v "Encounter" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>     ] ) ;
        ( fhir:mustSupport [ fhir:v "class" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "class" ] ;
          ( fhir:code [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>         ] ;
    fhir:code [ fhir:v "IMP" ] ;
    fhir:display [ fhir:v "inpatient encounter" ]       ] [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>         ] ;
    fhir:code [ fhir:v "ACUTE" ] ;
    fhir:display [ fhir:v "inpatient acute" ]       ] [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>         ] ;
    fhir:code [ fhir:v "NONAC" ] ;
    fhir:display [ fhir:v "inpatient non-acute" ]       ] [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>         ] ;
    fhir:code [ fhir:v "SS" ] ;
    fhir:display [ fhir:v "short stay" ]       ] )     ] )
      ] [
    fhir:type [ fhir:v "Encounter" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>     ] ) ;
        ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "status" ] [ fhir:v "period" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "type" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.666.5.307>       ]     ] )
      ] [
    fhir:type [ fhir:v "Encounter" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>     ] ) ;
        ( fhir:mustSupport [ fhir:v "location" ] [ fhir:v "period" ] )
      ] [
    fhir:type [ fhir:v "Encounter" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>     ] ) ;
        ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "class" ] [ fhir:v "period" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "type" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1111.143>       ]     ] )
      ] [
    fhir:type [ fhir:v "Encounter" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>     ] ) ;
        ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "class" ] [ fhir:v "period" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "type" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.3.117.1.7.1.292>       ]     ] )
      ] [
    fhir:type [ fhir:v "Location" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Location"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Location>     ] ) ;
        ( fhir:mustSupport [ fhir:v "id" ] )
      ] [
    fhir:type [ fhir:v "Medication" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Medication"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Medication>     ] ) ;
        ( fhir:mustSupport [ fhir:v "id" ] )
      ] [
    fhir:type [ fhir:v "MedicationAdministration" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/MedicationAdministration"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/MedicationAdministration>     ] ) ;
        ( fhir:mustSupport [ fhir:v "medication" ] [ fhir:v "status" ] [ fhir:v "effective" ] )
      ] [
    fhir:type [ fhir:v "MedicationRequest" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/MedicationRequest"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/MedicationRequest>     ] ) ;
        ( fhir:mustSupport [ fhir:v "medication" ] [ fhir:v "authoredOn" ] )
      ] [
    fhir:type [ fhir:v "Specimen" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Specimen"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Specimen>     ] ) ;
        ( fhir:mustSupport [ fhir:v "id" ] [ fhir:v "collection" ] [ fhir:v "collection.collected" ] )
      ] [
    fhir:type [ fhir:v "Condition" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Condition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Condition>     ] ) ;
        ( fhir:mustSupport [ fhir:v "onset" ] [ fhir:v "category" ] )
      ] [
    fhir:type [ fhir:v "Observation" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Observation"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Observation>     ] ) ;
        ( fhir:mustSupport [ fhir:v "code" ] [ fhir:v "effective" ] [ fhir:v "specimen" ] [ fhir:v "specimen.collection" ] [ fhir:v "specimen.collection.collected" ] [ fhir:v "category" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "code" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38>       ]     ] )
      ] [
    fhir:type [ fhir:v "Coverage" ] ;
        ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Coverage"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Coverage>     ] ) ;
        ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "period" ] ) ;
        ( fhir:codeFilter [
    fhir:path [ fhir:v "type" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591>       ]     ] )
      ] ) ; #
      fhir:content ( [
    fhir:contentType [ fhir:v "text/cql" ] ;
    fhir:data [ fhir:v " "^^xsd:base64Binary ]
      ] ) . #

    <urn:uuid:61d3ae55-c7b7-484f-96df-4f3ef8c080c0> a fhir:Measure ;
      fhir:id [ fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"] ; #
      fhir:language [ fhir:v "en"] ; #
      fhir:text [
    fhir:status [ fhir:v "extensions" ] ;
    fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Measure_NHSNGlycemicControlHypoglycemicInitialPopulation\"> </a>\n  <table class=\"narrative-table\">\n    <tbody>\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Metadata</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Title</th>\n\n\n\n<td class=\"content-container\">NHSN Glycemic Control, Hypoglycemia Initial Population</td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Version</th>\n\n\n\n<td class=\"content-container\">0.000.01</td>\n\n\n</tr>\n\n\n\n\n\n\n\n  \n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Identifier</th>\n\n\n\n<td class=\"content-container\">nhsnglycemiccontrolhypoglycemicinitialpopulation</td>\n\n\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Status</th>\n\n\n\n<td class=\"content-container\">Draft</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Experimental</th>\n\n\n\n<td class=\"content-container\">true</td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Steward (Publisher)</th>\n\n\n\n<td class=\"content-container\">NHSN</td>\n\n\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Description</th>\n\n\n\n<td class=\"content-container\"><div><p>All inpatient encounters (including ED/Observation visits that end within 1 hour of the start of the inpatient encounter) for patients of all ages where at least one ADD was ordered or administered during the encounter that is during the measurement period.</p>\n</div></td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Purpose</th>\n\n\n\n<td class=\"content-container\"><div><p>The primary purpose of this site is to provide CDC’s NHSN with access to view measure specification content in the dQMs under development by Lantana Consulting Group. Please note, this site is draft and undergoes constant revision and is not intended to serve as an implementation guide.</p>\n</div></td>\n\n\n</tr>\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Copyright</th>\n\n\n\n<td class=\"content-container\"><div><p>This measure and specifications are subject to further revisions.      This performance measure is not a clinical guideline, does not establish a standard of medical care and has not been tested for all potential applications.        THE MEASURES AND SPECIFICATIONS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND.</p>\n</div></td>\n\n\n</tr>\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Measure Scoring</th>\n\n\n\n<td class=\"content-container\">\n    Cohort\n\n\n</td>\n\n\n</tr>\n\n\n\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Measure Type</th>\n\n\n\n<td class=\"content-container\">\n    Outcome\n\n\n</td>\n\n\n</tr>\n\n\n\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Rationale</th>\n\n\n\n<td class=\"content-container\"><div><p>The NHSN Glycemic Control, Hypoglycemia module provides a mechanism for facilities to report inpatient medication-related hypoglycemia events, and to provide analytic reports based on these data to inform glycemic control quality improvement efforts and patient safety events. The primary objective of the NHSN Glycemic Control, Hypoglycemia module is to facilitate measurement and benchmarking of medication-related hypoglycemia events within a facility. As additional data are collected by NHSN, an additional objective will be to facilitate inter-facility benchmarking and evaluate national-level trends of medication-related hypoglycemia over time. The IP dQM provides the initial population and FHIR line-level data necessary for calculating the module metrics.</p>\n</div></td>\n\n\n</tr>\n\n\n\n\n\n\n\n\n\n\n  \n  \n  \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate)</th>\n\n\n</tr>\n  \n  \n  \n\n\n\n\n\n\n\n\n\n\n\n  \n\n  \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Supplemental Data Elements</th>\n\n\n</tr>\n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-chief-complaint\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-chief-complaint\">SDE Chief Complaint</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-condition\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-condition\">SDE Condition</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-condition-during-encounter\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-condition-during-encounter\">SDE Condition during Encounter</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-encounter-discharge-dispositions\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-encounter-discharge-dispositions\">SDE Encounter Discharge Dispositions</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-encounter-locations\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-encounter-locations\">SDE Encounter Locations</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-medication-administration\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-medication-administration\">SDE Medication Administration</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-medication-request\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-medication-request\">SDE Medication Request</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-blood-glucose-observation\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-blood-glucose-observation\">SDE Blood Glucose Observation</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-payer\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-payer\">SDE Payer</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-specimen\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-specimen\">SDE Specimen</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-minimal-patient\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-minimal-patient\">SDE Minimal Patient</a> \n        \n      \n    \n  </td>\n</tr>\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Supplemental Data Element</th>\n\n\n  <td class=\"content-container\">\n    \n      <em>ID</em>: sde-minimal-medication-requests\n      \n    \n    \n    \n      <em>Description</em>: No description provided\n    \n    \n      \n        <br/>\n        \n          \n          <em>Logic Definition</em>: <a href=\"#nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-minimal-medication-requests\">SDE Minimal Medication Requests</a> \n        \n      \n    \n  </td>\n</tr>\n\n\n<tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Logic</th>\n\n\n</tr>\n\n<tr>\n\n\n<th scope=\"row\" class=\"row-header\">Primary Library</th>\n\n\n\n<td class=\"content-container\"><a href=\"Bundle-sde-example-artifact-bundle.html\">NHSN Glycemic Control Hypoglycemic Initial Population</a></td>\n\n\n</tr>\n\n\n\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Contents</th>\n  <td class=\"content-container\">\n    <em><a href=\"#population-criteria\">Population Criteria</a></em>\n    <br/>\n    <em><a href=\"#definitions\">Logic Definitions</a></em>\n    <br/>\n    <em><a href=\"#terminology\">Terminology</a></em>\n    <br/>\n    <em><a href=\"#dependencies\">Dependencies</a></em>\n    <br/>\n    <em><a href=\"#data-requirements\">Data Requirements</a></em>\n    <br/>\n    <em><a href=\"#parameters\">Parameters</a></em>\n    <br/>\n  </td>\n</tr>\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"population-criteria\"> </a>Population Criteria</th>\n\n\n</tr>\n  \n  \n  \n\n  \n  \n  \n    <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\">Measure Group (Rate)</th>\n\n\n</tr>\n  \n  \n  \n\n  \n\n\n  \n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"definitions\"> </a>Logic Definitions</th>\n\n\n</tr>\n  \n  \n          \n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> SupplementalDataElementsFHIR4</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"supplementaldataelementsfhir4-sde-payer\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Payer\":   [Coverage: type in \"Payer\"] Payer         return {           code: Payer.type,           period: Payer.period         }</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n        \n\n\n\n\n        \n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-inpatient-encounter\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"Inpatient Encounter\":   [Encounter: class in {\"inpatient encounter\", \"inpatient acute\", \"inpatient non-acute\", \"short stay\"}] Encounters   where Encounters.status in {'in-progress', 'finished'}   and Encounters.period overlaps \"Measurement Period\"</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-antidiabetic-drugs-administered-or-ordered\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"Antidiabetic Drugs Administered or Ordered\":   ([MedicationAdministration] ADDMedAdmin     where GetMedicationCode(ADDMedAdmin.medication) in \"Antidiabetic Medications\"       and ADDMedAdmin.status ~ 'completed')   union (     [MedicationRequest] MedicationRequests       where GetMedicationCode(MedicationRequests.medication) in \"Antidiabetic Medications\"   )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-initial-population\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"Initial Population\":   \"Inpatient Encounter\" InpatientEncounters   with \"Antidiabetic Drugs Administered or Ordered\" ADD   such that Coalesce(start of Global.\"Normalize Interval\"(ADD.effective), ADD.authoredOn)       during \"HospitalizationWithObservationOrEmergency\"(InpatientEncounters)     and Coalesce(start of Global.\"Normalize Interval\"(ADD.effective), ADD.authoredOn) during \"Measurement Period\"</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-medication-request\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Medication Request\":  [MedicationRequest] MedicationRequests   with \"Initial Population\" InitialPopulation  such that MedicationRequests.authoredOn during \"HospitalizationWithObservationOrEmergency\"(InitialPopulation)     and MedicationRequests.authoredOn during \"Measurement Period\"</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-encounter-locations\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Encounter Locations\":   \"Initial Population\" InitialPopulation    where exists (      InitialPopulation.location InitialPopulationLocation     where (Global.GetLocation(InitialPopulationLocation.location).type in \"Inpatient, Emergency, and Observation Locations\"          or Global.GetLocation(InitialPopulationLocation.location).physicalType in \"Inpatient, Emergency, and Observation Locations\")       and InitialPopulationLocation.period during InitialPopulation.period   )</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-minimal-medication-requests\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Minimal Medication Requests\":   [MedicationRequest] MedicationRequests   return MedicationRequest{     id: MedicationRequests.id,     medication: GetMedicationCode(MedicationRequests.medication),     dosageInstruction: MedicationRequests.dosageInstruction   }</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-condition-during-encounter\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Condition during Encounter\":   [Condition] ConditionEncounterDiagnosis   with ConditionEncounterDiagnosis.category Category   such that Category ~ \"encounter-diagnosis\"     and exists(\"Initial Population\")</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-medication-administration\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Medication Administration\":  [MedicationAdministration] MedicationAdministrations   with \"Initial Population\" InitialPopulation   such that start of Global.\"Normalize Interval\"(MedicationAdministrations.effective) during \"HospitalizationWithObservationOrEmergency\"(InitialPopulation)     and start of Global.\"Normalize Interval\"(MedicationAdministrations.effective) during \"Measurement Period\"</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-blood-glucose-observation\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Blood Glucose Observation\":  [Observation: \"Blood Glucose Laboratory and Point of Care Tests\"] Observations    with \"Initial Population\" InitialPopulation   such that start of Global.\"Normalize Interval\"(Observations.effective) during InitialPopulation.period     or Global.\"Normalize Interval\"(GetSpecimen(Observations.specimen).collection.collected) during InitialPopulation.period   with Observations.category category   such that category ~ \"laboratory\"</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-condition\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Condition\":   [Condition] Conditions   with \"Initial Population\" InitialPopulation   such that Global.\"Normalize Interval\"(Conditions.onset) overlaps InitialPopulation.period</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-payer\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Payer\":   SDE.\"SDE Payer\" Payer   with \"Initial Population\" InitialPopulation   such that start of Payer.period before end of InitialPopulation.period</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-encounter-discharge-dispositions\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Encounter Discharge Dispositions\":  \"Initial Population\" DischargeDispositions    where DischargeDispositions.hospitalization.dischargeDisposition in \"Discharge Disposition\"</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-minimal-patient\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">//Change on CQF ruler happened on 8/12. Check to make sure CQF-Ruler version is dated at or after define \"SDE Minimal Patient\":   Patient{     id: Patient.id,     gender: Patient.gender,     birthDate: Patient.birthDate   }</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-specimen\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">define \"SDE Specimen\":   [Specimen] Specimen   with \"Initial Population\" InitialPopulation   such that Global.\"Normalize Interval\"(Specimen.collection.collected) during InitialPopulation.period</code></pre>\n  </td>\n\n</tr>\n\n\n\n        \n\n\n<tr>\n  <th scope=\"row\" rowspan=\"2\" class=\"row-header\">\n    Logic Definition\n  </th>\n\n  <td class=\"content-container\"><em>Library Name:</em> NHSNGlycemicControlHypoglycemicInitialPopulation</td>\n\n</tr>\n<tr>\n\n  <td>\n    \n    \n    \n    \n      <a name=\"nhsnglycemiccontrolhypoglycemicinitialpopulation-sde-chief-complaint\"> </a>\n    \n    <pre style=\"border: none;\" class=\"content-container highlight language-cql\"><code class=\"language-cql\">//Supplement Data Elements define \"SDE Chief Complaint\":   \"Initial Population\" InitialPopulation   with InitialPopulation.diagnosis InitialPopulationDiagnosis   such that InitialPopulationDiagnosis.use ~ \"Chief Complaint\"</code></pre>\n  </td>\n\n</tr>\n\n\n\n\n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"terminology\"> </a>Terminology</th>\n\n\n</tr>\n  \n  \n  \n\n \n\n \n\n \n\n\n<tr>\n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Code System</th>\n\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system ActCode\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html\">ActCode</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Code System</th>\n\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system Condition Category\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-condition-category.html\">Condition Category Codes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-category</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Code System</th>\n\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system Observation Category\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-observation-category.html\">Observation Category Codes</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/observation-category</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n  \n\n<th scope=\"row\" class=\"row-header\">Code System</th>\n\n\n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Code system Diagnosis Role\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-diagnosis-role.html\">Diagnosis Role</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/CodeSystem/diagnosis-role</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Antidiabetic Medications\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1190.58/expansion\">Diabetes Medications</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.58</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Inpatient, Emergency, and Observation Locations\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1046.265/expansion\">Inpatient, Emergency, and Observation Locations</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Blood Glucose Laboratory and Point of Care Tests\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1190.38/expansion\">Blood Glucose Laboratory and Point of Care Tests</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Payer\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion\">Payer Type</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n  \n\n<th scope=\"row\" class=\"row-header\">Value Set</th>\n\n\n  \n  \n  <td class=\"content-container\">\n    \n    <em>Description</em>: Value set Discharge Disposition\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"http://terminology.hl7.org/7.1.0/ValueSet-encounter-discharge-disposition.html\">Discharge disposition</a>\n    <br/>\n    <em>Canonical URL</em>: <tt>http://terminology.hl7.org/ValueSet/encounter-discharge-disposition</tt>\n    \n  </td>\n</tr>\n \n\n\n  \n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: inpatient encounter\n        <br/>\n      \n      <em>Code</em>: IMP\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>\n    </td>\n  </tr>\n\n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: inpatient acute\n        <br/>\n      \n      <em>Code</em>: ACUTE\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>\n    </td>\n  </tr>\n\n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: inpatient non-acute\n        <br/>\n      \n      <em>Code</em>: NONAC\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>\n    </td>\n  </tr>\n\n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: short stay\n        <br/>\n      \n      <em>Code</em>: SS\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>\n    </td>\n  </tr>\n\n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: observation encounter\n        <br/>\n      \n      <em>Code</em>: OBSENC\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>\n    </td>\n  </tr>\n\n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: emergency\n        <br/>\n      \n      <em>Code</em>: EMER\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/v3-ActCode</tt>\n    </td>\n  </tr>\n\n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: Encounter Diagnosis\n        <br/>\n      \n      <em>Code</em>: encounter-diagnosis\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/condition-category</tt>\n    </td>\n  </tr>\n\n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: Laboratory\n        <br/>\n      \n      <em>Code</em>: laboratory\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/observation-category</tt>\n    </td>\n  </tr>\n\n  <tr>\n    <th scope=\"row\" class=\"row-header\">Direct Reference Code</th>\n    <td class=\"content-container\">\n      \n        <em>Display</em>: Chief complaint\n        <br/>\n      \n      <em>Code</em>: CC\n      <br/>\n      <em>System</em>: <tt>http://terminology.hl7.org/CodeSystem/diagnosis-role</tt>\n    </td>\n  </tr>\n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"dependencies\"> </a>Dependencies</th>\n\n\n</tr>\n  \n  \n  \n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library FHIRHelpers\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"Bundle-sde-example-artifact-bundle.html\">FHIR Helpers</a> version: 4.0.1\n    <br/>\n    <em>Canonical URL</em>: <tt>http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library Global\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"Bundle-sde-example-artifact-bundle.html\">MAT Global Common Functions FHIRR4</a> version: 6.1.000\n    <br/>\n    <em>Canonical URL</em>: <tt>http://fhir.org/guides/cqf/Library/MATGlobalCommonFunctionsFHIR4|6.1.000</tt>\n    \n  </td>\n</tr>\n \n\n\n<tr>\n  \n\n<th scope=\"row\" class=\"row-header\">Dependency</th>\n\n\n  <td class=\"content-container\">\n    \n    <em>Description</em>: Library SDE\n    \n    <br/>\n    \n    \n    \n    \n    \n    \n    <em>Resource</em>: <a href=\"Bundle-sde-example-artifact-bundle.html\">SupplementalDataElementsFHIR4</a> version: 2.0.000\n    <br/>\n    <em>Canonical URL</em>: <tt>http://fhir.org/guides/cqf/Library/SupplementalDataElementsFHIR4|2.0.000</tt>\n    \n  </td>\n</tr>\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n \n\n\n  \n  \n\n\n\n\n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"data-requirements\"> </a>Data Requirements</th>\n\n\n</tr>\n  \n  \n  \n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: class, period\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Encounter\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/encounter.html\">Encounter</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: class, status, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: class</span>\n    <br/>\n  \n  \n  \n  \n    <span class=\"tab-one\"><em>Code(s)</em>: \n    \n      \n      <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html#v3-ActCode-IMP\">ActCode: IMP</a> (inpatient encounter), \n      \n    \n      \n      <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html#v3-ActCode-ACUTE\">ActCode: ACUTE</a> (inpatient acute), \n      \n    \n      \n      <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html#v3-ActCode-NONAC\">ActCode: NONAC</a> (inpatient non-acute), \n      \n    \n      \n      <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-v3-ActCode.html#v3-ActCode-SS\">ActCode: SS</a> (short stay)\n      \n    \n    </span>\n    <br/>\n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Medication\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/medication.html\">Medication</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: id\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: MedicationAdministration\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/medicationadministration.html\">MedicationAdministration</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: medication, status, effective\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: MedicationRequest\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/medicationrequest.html\">MedicationRequest</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: medication, authoredOn, id, dosageInstruction\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Location\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/location.html\">Location</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: id\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Condition\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/condition.html\">Condition</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: category, onset\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Specimen\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/specimen.html\">Specimen</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: id, collection, collection.collected\n    <br/>\n   \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Observation\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/observation.html\">Observation</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: code, effective, specimen, specimen.collection, specimen.collection.collected, category\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: code</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.113762.1.4.1190.38/expansion\">Blood Glucose Laboratory and Point of Care Tests</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Coverage\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/coverage.html\">Coverage</a>\n    <br/>        \n  \n   \n   \n    <em>Must Support Elements</em>: type, period\n    <br/>\n   \n  \n    <em>Code Filter(s)</em>: \n    <br/>\n  \n  \n    <span class=\"tab-one\"><em>Path</em>: type</span>\n    <br/>\n  \n  \n  \n    <span class=\"tab-one\"><em>ValueSet</em>:</span> <a href=\"https://vsac.nlm.nih.gov/valueset/2.16.840.1.114222.4.11.3591/expansion\">Payer Type</a>\n    <br/> \n  \n  \n  \n   \n  </td>\n</tr>\n\n<tr>\n  <th scope=\"row\" class=\"row-header\">Data Requirement</th>\n  <td class=\"content-container\">\n    <em>Type</em>: Patient\n    <br/>\n  \n    <em>Profile(s)</em>: \n  \n    <a href=\"http://hl7.org/fhir/R4/patient.html\">Patient</a>\n    <br/>        \n  \n   \n   \n   \n  </td>\n</tr>\n\n  \n  \n\n\n  <tr>\n\n\n<th colspan=\"2\" scope=\"row\" class=\"row-header\"><a name=\"parameters\"> </a>Parameters</th>\n\n\n</tr>\n  \n  \n  <tr>\n  \n\n<th scope=\"row\" class=\"row-header\"/>\n\n\n  <td class=\"content-container\">\n    <table>\n      <thead>\n        <tr>\n          <td><em>Name</em></td>\n          <td><em>Use</em></td>\n          <td><em>Card.</em></td>\n          <td><em>Type</em></td>\n          <td><em>Documentation</em></td>\n        </tr>\n      </thead>\n      <tbody>\n      \n        <tr>\n          <td>Measurement Period</td>\n          <td>In</td>\n          <td>0..1</td>\n          <td>Period</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Medication Request</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>MedicationRequest</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Encounter Locations</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Minimal Medication Requests</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>MedicationRequest</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Condition during Encounter</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Condition</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Medication Administration</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>MedicationAdministration</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Blood Glucose Observation</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Observation</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Condition</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Condition</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Payer</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Any</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>Initial Population</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Encounter Discharge Dispositions</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Minimal Patient</td>\n          <td>Out</td>\n          <td>0..1</td>\n          <td>Patient</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Specimen</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Specimen</td>\n          <td/>\n        </tr>\n      \n        <tr>\n          <td>SDE Chief Complaint</td>\n          <td>Out</td>\n          <td>0..*</td>\n          <td>Encounter</td>\n          <td/>\n        </tr>\n      \n      </tbody>\n    </table>\n  </td>\n</tr>\n\n  \n  \n\n<tr>\n  <th colspan=\"2\" scope=\"row\" class=\"row-header\">Generated using version 0.5.4-cibuild of the sample-content-ig Liquid templates</th>\n</tr>\n\n    </tbody>\n  </table>\n</div>"^^rdf:XMLLiteral ]
      ] ; #
      fhir:contained ( [
    a fhir:Library ;
    fhir:id [ fhir:v "effective-data-requirements" ] ;
        ( fhir:extension [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode>       ] ;
    fhir:value [
    a fhir:Coding ;
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>         ] ;
    fhir:code [ fhir:v "IMP" ] ;
    fhir:display [ fhir:v "inpatient encounter" ]       ]     ] [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode>       ] ;
    fhir:value [
    a fhir:Coding ;
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>         ] ;
    fhir:code [ fhir:v "ACUTE" ] ;
    fhir:display [ fhir:v "inpatient acute" ]       ]     ] [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode>       ] ;
    fhir:value [
    a fhir:Coding ;
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>         ] ;
    fhir:code [ fhir:v "NONAC" ] ;
    fhir:display [ fhir:v "inpatient non-acute" ]       ]     ] [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode>       ] ;
    fhir:value [
    a fhir:Coding ;
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>         ] ;
    fhir:code [ fhir:v "SS" ] ;
    fhir:display [ fhir:v "short stay" ]       ]     ] [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode>       ] ;
    fhir:value [
    a fhir:Coding ;
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>         ] ;
    fhir:code [ fhir:v "OBSENC" ] ;
    fhir:display [ fhir:v "observation encounter" ]       ]     ] [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode>       ] ;
    fhir:value [
    a fhir:Coding ;
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>         ] ;
    fhir:code [ fhir:v "EMER" ] ;
    fhir:display [ fhir:v "emergency" ]       ]     ] [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode>       ] ;
    fhir:value [
    a fhir:Coding ;
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/condition-category"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/condition-category>         ] ;
    fhir:code [ fhir:v "encounter-diagnosis" ] ;
    fhir:display [ fhir:v "Encounter Diagnosis" ]       ]     ] [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode>       ] ;
    fhir:value [
    a fhir:Coding ;
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/observation-category"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/observation-category>         ] ;
    fhir:code [ fhir:v "laboratory" ] ;
    fhir:display [ fhir:v "Laboratory" ]       ]     ] [
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-directReferenceCode>       ] ;
    fhir:value [
    a fhir:Coding ;
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/diagnosis-role"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/diagnosis-role>         ] ;
    fhir:code [ fhir:v "CC" ] ;
    fhir:display [ fhir:v "Chief complaint" ]       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "Inpatient Encounter"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"Inpatient Encounter\":   [Encounter: class in {\"inpatient encounter\", \"inpatient acute\", \"inpatient non-acute\", \"short stay\"}] Encounters   where Encounters.status in {'in-progress', 'finished'}   and Encounters.period overlaps \"Measurement Period\""         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 0         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "Antidiabetic Drugs Administered or Ordered"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"Antidiabetic Drugs Administered or Ordered\":   ([MedicationAdministration] ADDMedAdmin     where GetMedicationCode(ADDMedAdmin.medication) in \"Antidiabetic Medications\"       and ADDMedAdmin.status ~ 'completed')   union (     [MedicationRequest] MedicationRequests       where GetMedicationCode(MedicationRequests.medication) in \"Antidiabetic Medications\"   )"         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 1         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "Initial Population"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"Initial Population\":   \"Inpatient Encounter\" InpatientEncounters   with \"Antidiabetic Drugs Administered or Ordered\" ADD   such that Coalesce(start of Global.\"Normalize Interval\"(ADD.effective), ADD.authoredOn)       during \"HospitalizationWithObservationOrEmergency\"(InpatientEncounters)     and Coalesce(start of Global.\"Normalize Interval\"(ADD.effective), ADD.authoredOn) during \"Measurement Period\""         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 2         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Medication Request"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Medication Request\":  [MedicationRequest] MedicationRequests   with \"Initial Population\" InitialPopulation  such that MedicationRequests.authoredOn during \"HospitalizationWithObservationOrEmergency\"(InitialPopulation)     and MedicationRequests.authoredOn during \"Measurement Period\""         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 3         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Encounter Locations"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Encounter Locations\":   \"Initial Population\" InitialPopulation    where exists (      InitialPopulation.location InitialPopulationLocation     where (Global.GetLocation(InitialPopulationLocation.location).type in \"Inpatient, Emergency, and Observation Locations\"          or Global.GetLocation(InitialPopulationLocation.location).physicalType in \"Inpatient, Emergency, and Observation Locations\")       and InitialPopulationLocation.period during InitialPopulation.period   )"         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 4         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Minimal Medication Requests"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Minimal Medication Requests\":   [MedicationRequest] MedicationRequests   return MedicationRequest{     id: MedicationRequests.id,     medication: GetMedicationCode(MedicationRequests.medication),     dosageInstruction: MedicationRequests.dosageInstruction   }"         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 5         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Condition during Encounter"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Condition during Encounter\":   [Condition] ConditionEncounterDiagnosis   with ConditionEncounterDiagnosis.category Category   such that Category ~ \"encounter-diagnosis\"     and exists(\"Initial Population\")"         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 6         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Medication Administration"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Medication Administration\":  [MedicationAdministration] MedicationAdministrations   with \"Initial Population\" InitialPopulation   such that start of Global.\"Normalize Interval\"(MedicationAdministrations.effective) during \"HospitalizationWithObservationOrEmergency\"(InitialPopulation)     and start of Global.\"Normalize Interval\"(MedicationAdministrations.effective) during \"Measurement Period\""         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 7         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Blood Glucose Observation"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Blood Glucose Observation\":  [Observation: \"Blood Glucose Laboratory and Point of Care Tests\"] Observations    with \"Initial Population\" InitialPopulation   such that start of Global.\"Normalize Interval\"(Observations.effective) during InitialPopulation.period     or Global.\"Normalize Interval\"(GetSpecimen(Observations.specimen).collection.collected) during InitialPopulation.period   with Observations.category category   such that category ~ \"laboratory\""         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 8         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Condition"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Condition\":   [Condition] Conditions   with \"Initial Population\" InitialPopulation   such that Global.\"Normalize Interval\"(Conditions.onset) overlaps InitialPopulation.period"         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 9         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SupplementalDataElementsFHIR4"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Payer"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Payer\":   [Coverage: type in \"Payer\"] Payer         return {           code: Payer.type,           period: Payer.period         }"         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 10         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Payer"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Payer\":   SDE.\"SDE Payer\" Payer   with \"Initial Population\" InitialPopulation   such that start of Payer.period before end of InitialPopulation.period"         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 11         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Encounter Discharge Dispositions"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Encounter Discharge Dispositions\":  \"Initial Population\" DischargeDispositions    where DischargeDispositions.hospitalization.dischargeDisposition in \"Discharge Disposition\""         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 12         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Minimal Patient"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "//Change on CQF ruler happened on 8/12. Check to make sure CQF-Ruler version is dated at or after define \"SDE Minimal Patient\":   Patient{     id: Patient.id,     gender: Patient.gender,     birthDate: Patient.birthDate   }"         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 13         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Specimen"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "define \"SDE Specimen\":   [Specimen] Specimen   with \"Initial Population\" InitialPopulation   such that Global.\"Normalize Interval\"(Specimen.collection.collected) during InitialPopulation.period"         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 14         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] [
          ( fhir:extension [
    fhir:url [
    fhir:v "libraryName"^^xsd:anyURI ;
    fhir:l fhir:libraryName         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"         ]       ] [
    fhir:url [
    fhir:v "name"^^xsd:anyURI ;
    fhir:l fhir:name         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "SDE Chief Complaint"         ]       ] [
    fhir:url [
    fhir:v "statement"^^xsd:anyURI ;
    fhir:l fhir:statement         ] ;
    fhir:value [
    a fhir:String ;
    fhir:v "//Supplement Data Elements define \"SDE Chief Complaint\":   \"Initial Population\" InitialPopulation   with InitialPopulation.diagnosis InitialPopulationDiagnosis   such that InitialPopulationDiagnosis.use ~ \"Chief Complaint\""         ]       ] [
    fhir:url [
    fhir:v "displaySequence"^^xsd:anyURI ;
    fhir:l fhir:displaySequence         ] ;
    fhir:value [
    a fhir:Integer ;
    fhir:v 15         ]       ] ) ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/cqf-logicDefinition>       ]     ] ) ;
    fhir:status [ fhir:v "active" ] ;
    fhir:type [
          ( fhir:coding [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/library-type"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/library-type>         ] ;
    fhir:code [ fhir:v "module-definition" ]       ] )     ] ;
        ( fhir:relatedArtifact [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Library FHIRHelpers" ] ;
    fhir:resource [
    fhir:v "http://fhir.org/guides/cqf/common/Library/FHIRHelpers|4.0.1"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/common/Library/FHIRHelpers?version=4.0.1>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Library Global" ] ;
    fhir:resource [
    fhir:v "http://fhir.org/guides/cqf/Library/MATGlobalCommonFunctionsFHIR4|6.1.000"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/Library/MATGlobalCommonFunctionsFHIR4?version=6.1.000>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Library SDE" ] ;
    fhir:resource [
    fhir:v "http://fhir.org/guides/cqf/Library/SupplementalDataElementsFHIR4|2.0.000"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/Library/SupplementalDataElementsFHIR4?version=2.0.000>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system ActCode" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system Condition Category" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/condition-category"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/condition-category>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system Observation Category" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/observation-category"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/observation-category>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Code system Diagnosis Role" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/CodeSystem/diagnosis-role"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/diagnosis-role>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Antidiabetic Medications" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.58"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.58>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Inpatient, Emergency, and Observation Locations" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1046.265>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Blood Glucose Laboratory and Point of Care Tests" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Payer" ] ;
    fhir:resource [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591>       ]     ] [
    fhir:type [ fhir:v "depends-on" ] ;
    fhir:display [ fhir:v "Value set Discharge Disposition" ] ;
    fhir:resource [
    fhir:v "http://terminology.hl7.org/ValueSet/encounter-discharge-disposition"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/ValueSet/encounter-discharge-disposition>       ]     ] ) ;
        ( fhir:parameter [
    fhir:name [ fhir:v "Measurement Period" ] ;
    fhir:use [ fhir:v "in" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:type [ fhir:v "Period" ]     ] [
    fhir:name [ fhir:v "SDE Medication Request" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "MedicationRequest" ]     ] [
    fhir:name [ fhir:v "SDE Encounter Locations" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]     ] [
    fhir:name [ fhir:v "SDE Minimal Medication Requests" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "MedicationRequest" ]     ] [
    fhir:name [ fhir:v "SDE Condition during Encounter" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Condition" ]     ] [
    fhir:name [ fhir:v "SDE Medication Administration" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "MedicationAdministration" ]     ] [
    fhir:name [ fhir:v "SDE Blood Glucose Observation" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Observation" ]     ] [
    fhir:name [ fhir:v "SDE Condition" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Condition" ]     ] [
    fhir:name [ fhir:v "SDE Payer" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Any" ]     ] [
    fhir:name [ fhir:v "Initial Population" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]     ] [
    fhir:name [ fhir:v "SDE Encounter Discharge Dispositions" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]     ] [
    fhir:name [ fhir:v "SDE Minimal Patient" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "1" ] ;
    fhir:type [ fhir:v "Patient" ]     ] [
    fhir:name [ fhir:v "SDE Specimen" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Specimen" ]     ] [
    fhir:name [ fhir:v "SDE Chief Complaint" ] ;
    fhir:use [ fhir:v "out" ] ;
    fhir:min [ fhir:v 0 ] ;
    fhir:max [ fhir:v "*" ] ;
    fhir:type [ fhir:v "Encounter" ]     ] ) ;
        ( fhir:dataRequirement [
    fhir:type [ fhir:v "Encounter" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>       ] ) ;
          ( fhir:mustSupport [ fhir:v "class" ] [ fhir:v "status" ] [ fhir:v "period" ] ) ;
          ( fhir:codeFilter [
    fhir:path [ fhir:v "class" ] ;
            ( fhir:code [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>           ] ;
    fhir:code [ fhir:v "IMP" ] ;
    fhir:display [ fhir:v "inpatient encounter" ]         ] [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>           ] ;
    fhir:code [ fhir:v "ACUTE" ] ;
    fhir:display [ fhir:v "inpatient acute" ]         ] [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>           ] ;
    fhir:code [ fhir:v "NONAC" ] ;
    fhir:display [ fhir:v "inpatient non-acute" ]         ] [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>           ] ;
    fhir:code [ fhir:v "SS" ] ;
    fhir:display [ fhir:v "short stay" ]         ] )       ] )     ] [
    fhir:type [ fhir:v "Encounter" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>       ] ) ;
          ( fhir:mustSupport [ fhir:v "class" ] [ fhir:v "period" ] )     ] [
    fhir:type [ fhir:v "Encounter" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Encounter"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Encounter>       ] ) ;
          ( fhir:mustSupport [ fhir:v "class" ] [ fhir:v "status" ] [ fhir:v "period" ] ) ;
          ( fhir:codeFilter [
    fhir:path [ fhir:v "class" ] ;
            ( fhir:code [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>           ] ;
    fhir:code [ fhir:v "IMP" ] ;
    fhir:display [ fhir:v "inpatient encounter" ]         ] [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>           ] ;
    fhir:code [ fhir:v "ACUTE" ] ;
    fhir:display [ fhir:v "inpatient acute" ]         ] [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>           ] ;
    fhir:code [ fhir:v "NONAC" ] ;
    fhir:display [ fhir:v "inpatient non-acute" ]         ] [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/v3-ActCode"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/v3-ActCode>           ] ;
    fhir:code [ fhir:v "SS" ] ;
    fhir:display [ fhir:v "short stay" ]         ] )       ] )     ] [
    fhir:type [ fhir:v "Medication" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Medication"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Medication>       ] ) ;
          ( fhir:mustSupport [ fhir:v "id" ] )     ] [
    fhir:type [ fhir:v "MedicationAdministration" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/MedicationAdministration"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/MedicationAdministration>       ] ) ;
          ( fhir:mustSupport [ fhir:v "medication" ] [ fhir:v "status" ] [ fhir:v "effective" ] )     ] [
    fhir:type [ fhir:v "MedicationRequest" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/MedicationRequest"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/MedicationRequest>       ] ) ;
          ( fhir:mustSupport [ fhir:v "medication" ] [ fhir:v "authoredOn" ] [ fhir:v "id" ] [ fhir:v "dosageInstruction" ] )     ] [
    fhir:type [ fhir:v "Location" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Location"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Location>       ] ) ;
          ( fhir:mustSupport [ fhir:v "id" ] )     ] [
    fhir:type [ fhir:v "Condition" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Condition"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Condition>       ] ) ;
          ( fhir:mustSupport [ fhir:v "category" ] [ fhir:v "onset" ] )     ] [
    fhir:type [ fhir:v "Specimen" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Specimen"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Specimen>       ] ) ;
          ( fhir:mustSupport [ fhir:v "id" ] [ fhir:v "collection" ] [ fhir:v "collection.collected" ] )     ] [
    fhir:type [ fhir:v "Observation" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Observation"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Observation>       ] ) ;
          ( fhir:mustSupport [ fhir:v "code" ] [ fhir:v "effective" ] [ fhir:v "specimen" ] [ fhir:v "specimen.collection" ] [ fhir:v "specimen.collection.collected" ] [ fhir:v "category" ] ) ;
          ( fhir:codeFilter [
    fhir:path [ fhir:v "code" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1190.38>         ]       ] )     ] [
    fhir:type [ fhir:v "Coverage" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Coverage"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Coverage>       ] ) ;
          ( fhir:mustSupport [ fhir:v "type" ] [ fhir:v "period" ] ) ;
          ( fhir:codeFilter [
    fhir:path [ fhir:v "type" ] ;
    fhir:valueSet [
    fhir:v "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591"^^xsd:anyURI ;
    fhir:l <http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.3591>         ]       ] )     ] [
    fhir:type [ fhir:v "Patient" ] ;
          ( fhir:profile [
    fhir:v "http://hl7.org/fhir/StructureDefinition/Patient"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/StructureDefinition/Patient>       ] )     ] )
      ] ) ; #
      fhir:extension ( [
    fhir:id [ fhir:v "effective-data-requirements" ] ;
    fhir:url [
    fhir:v "http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements"^^xsd:anyURI ;
    fhir:l <http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-effectiveDataRequirements>     ] ;
    fhir:value [
    a fhir:Canonical ;
    fhir:v "#effective-data-requirements"^^xsd:anyURI ;
    fhir:l <#effective-data-requirements>     ]
      ] ) ; #
      fhir:url [
    fhir:v "http://nhsnlink.org/fhir/Measure/NHSNGlycemicControlHypoglycemicInitialPopulation"^^xsd:anyURI ;
    fhir:l <http://nhsnlink.org/fhir/Measure/NHSNGlycemicControlHypoglycemicInitialPopulation>
      ] ; #
      fhir:identifier ( [
    fhir:system [
    fhir:v "https://nhsnlink.org"^^xsd:anyURI ;
    fhir:l <https://nhsnlink.org>     ] ;
    fhir:value [ fhir:v "nhsnglycemiccontrolhypoglycemicinitialpopulation" ]
      ] ) ; #
      fhir:version [ fhir:v "0.000.01"] ; #
      fhir:name [ fhir:v "NHSNGlycemicControlHypoglycemicInitialPopulation"] ; #
      fhir:title [ fhir:v "NHSN Glycemic Control, Hypoglycemia Initial Population"] ; #
      fhir:status [ fhir:v "draft"] ; #
      fhir:experimental [ fhir:v true] ; #
      fhir:date [ fhir:v "2022-08-29T12:53:08-08:00"^^xsd:dateTime] ; #
      fhir:publisher [ fhir:v "NHSN"] ; #
      fhir:description [ fhir:v "All inpatient encounters (including ED/Observation visits that end within 1 hour of the start of the inpatient encounter) for patients of all ages where at least one ADD was ordered or administered during the encounter that is during the measurement period."] ; #
      fhir:purpose [ fhir:v "The primary purpose of this site is to provide CDC’s NHSN with access to view measure specification content in the dQMs under development by Lantana Consulting Group. Please note, this site is draft and undergoes constant revision and is not intended to serve as an implementation guide."] ; #
      fhir:copyright [ fhir:v "This measure and specifications are subject to further revisions.      This performance measure is not a clinical guideline, does not establish a standard of medical care and has not been tested for all potential applications.        THE MEASURES AND SPECIFICATIONS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND."] ; #
      fhir:library ( [
    fhir:v "http://fhir.org/guides/cqf/Library/NHSNGlycemicControlHypoglycemicInitialPopulation"^^xsd:anyURI ;
    fhir:l <http://fhir.org/guides/cqf/Library/NHSNGlycemicControlHypoglycemicInitialPopulation>
      ] ) ; #
      fhir:scoring [
        ( fhir:coding [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/measure-scoring"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/measure-scoring>       ] ;
    fhir:code [ fhir:v "cohort" ] ;
    fhir:display [ fhir:v "Cohort" ]     ] )
      ] ; #
      fhir:type ( [
        ( fhir:coding [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/measure-type"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/measure-type>       ] ;
    fhir:code [ fhir:v "outcome" ] ;
    fhir:display [ fhir:v "Outcome" ]     ] )
      ] ) ; #
      fhir:rationale [ fhir:v "The NHSN Glycemic Control, Hypoglycemia module provides a mechanism for facilities to report inpatient medication-related hypoglycemia events, and to provide analytic reports based on these data to inform glycemic control quality improvement efforts and patient safety events. The primary objective of the NHSN Glycemic Control, Hypoglycemia module is to facilitate measurement and benchmarking of medication-related hypoglycemia events within a facility. As additional data are collected by NHSN, an additional objective will be to facilitate inter-facility benchmarking and evaluate national-level trends of medication-related hypoglycemia over time. The IP dQM provides the initial population and FHIR line-level data necessary for calculating the module metrics."] ; #
      fhir:definition ( [ fhir:v "Antidiabetic Drug Days (ADD): Aggregate number of inpatient encounter days within the facility in which at least one injectable or oral ADD was received. All patients who received ADDs during the hospitalization contribute to the initial population regardless of whether the patient experienced a hypoglycemic event."] [ fhir:v "Emergency Department (ED) or Observation (OBS) encounters: ED or observation encounters that ended within an hour of the inpatient admission are included when calculating the start and stop times of the hospitalization. Only Metric 1 includes ED  and OBS encounters."] [ fhir:v "Hypoglycemia Day: An inpatient day with at least one documented hypoglycemia event."] [ fhir:v "Hypoglycemia Event includes the following during an inpatient hospitalization: A hypoglycemic blood glucose (BG) result during the encounter and ADD administered within 24 hours prior to the start of the hypoglycemic BG result and no subsequent test for blood glucose with a result ≥80 mg/dL within five minutes of the start of the initial low blood glucose test."] [ fhir:v "Inpatient Encounter: A hospitalization in any inpatient facility that meets the criteria for reporting to the NHSN Glycemic Control Hypoglycemia Module (refer to CDC Locations and Descriptions manual)."] [ fhir:v "Measurement Period: From the first day of each calendar month through the last day of that calendar month. Mild hypoglycemia: Blood glucose 54 mg/dL to 69 mg/dL as identified on central laboratory device (CLD) or prescription point-of-care (POC) device."] [ fhir:v "Moderate hypoglycemia: Blood glucose 40 mg/dL to 53 mg/dL as identified on CLD or prescription POC device."] [ fhir:v "Severe hypoglycemia Blood glucose < 40 mg/dL as identified on CLD or prescription POC device."] ) ; #
      fhir:group ( [
        ( fhir:population [
    fhir:id [ fhir:v "initial-population-01" ] ;
    fhir:code [
            ( fhir:coding [
    fhir:system [
    fhir:v "http://terminology.hl7.org/CodeSystem/measure-population"^^xsd:anyURI ;
    fhir:l <http://terminology.hl7.org/CodeSystem/measure-population>           ] ;
    fhir:code [ fhir:v "initial-population" ] ;
    fhir:display [ fhir:v "Initial Population" ]         ] )       ] ;
    fhir:description [ fhir:v "All inpatient encounters, as well as ED and OBS encounters that end within 1 hour of the start of the inpatient encounter, for patients of all ages where at least one antidiabetic drug (ADD) was ordered or administered during the encounter that is during the measurement period." ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "Initial Population" ]       ]     ] )
      ] ) ; #
      fhir:supplementalData ( [
    fhir:id [ fhir:v "sde-chief-complaint" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Chief Complaint" ]     ]
      ] [
    fhir:id [ fhir:v "sde-condition" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Condition" ]     ]
      ] [
    fhir:id [ fhir:v "sde-condition-during-encounter" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Condition during Encounter" ]     ]
      ] [
    fhir:id [ fhir:v "sde-encounter-discharge-dispositions" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Encounter Discharge Dispositions" ]     ]
      ] [
    fhir:id [ fhir:v "sde-encounter-locations" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Encounter Locations" ]     ]
      ] [
    fhir:id [ fhir:v "sde-medication-administration" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Medication Administration" ]     ]
      ] [
    fhir:id [ fhir:v "sde-medication-request" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Medication Request" ]     ]
      ] [
    fhir:id [ fhir:v "sde-blood-glucose-observation" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Blood Glucose Observation" ]     ]
      ] [
    fhir:id [ fhir:v "sde-payer" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Payer" ]     ]
      ] [
    fhir:id [ fhir:v "sde-specimen" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Specimen" ]     ]
      ] [
    fhir:id [ fhir:v "sde-minimal-patient" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Minimal Patient" ]     ]
      ] [
    fhir:id [ fhir:v "sde-minimal-medication-requests" ] ;
    fhir:criteria [
    fhir:language [ fhir:v "text/cql.identifier" ] ;
    fhir:expression [ fhir:v "SDE Minimal Medication Requests" ]     ]
      ] ) . #