Your User Friendly Name for MyContentIG Here
0.5.3 - CI Build

Your User Friendly Name for MyContentIG Here, published by HL7 International - [Some] Work Group. This guide is not an authorized publication; it is the continuous build for version 0.5.3 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/cqframework/sample-content-ig/ and changes regularly. See the Directory of published versions

## Library: ExtensionAndSlicingExample

Official URL: http://somewhere.org/fhir/uv/mycontentig/Library/ExtensionAndSlicingExample | Version: 0.5.3
Draft as of 2025-12-10 | Computable Name: ExtensionAndSlicingExample

Metadata
Version | 0.5.3
Status | Draft
Jurisdiction | 001 from http://unstats.un.org/unsd/methods/m49/m49.htm
Steward (Publisher) | HL7 International - [Some] Work Group
Type | logic-library from http://terminology.hl7.org/CodeSystem/library-type
Dependency | Description: Library FHIRHelpers Resource: `http://somewhere.org/fhir/uv/mycontentig/Library/FHIRHelpers|4.0.1` Canonical URL: `http://somewhere.org/fhir/uv/mycontentig/Library/FHIRHelpers|4.0.1`
Dependency | Description: Code system LOINC Resource: Logical Observation Identifiers, Names and Codes (LOINC) Canonical URL: `http://loinc.org`
Dependency | Description: Code system CDC Race and Ethnicity Codes Resource: CDC Race and Ethnicity Canonical URL: `urn:oid:2.16.840.1.113883.6.238`
Data Requirement | Type: Patient Profile(s): Patient Must Support Elements: extension
Data Requirement | Type: Observation Profile(s): Observation Must Support Elements: code, component Code Filter(s): Path: code Code(s): LOINC: 85354-9 (Blood pressure panel with all children optional)
Parameters
Name | Use | Card. | Type | Documentation
Patient | Out | 0..1 | Patient |
TestSlices | Out | 0..* | Observation |
TestSimpleExtensions | Out | 0..1 | Patient |
TestComplexExtensions | Out | 0..1 | Patient |
Library Content
CQL Content |
    library ExtensionAndSlicingExample version '0.5.3-cibuild'

    using FHIR version '4.0.1'

    include FHIRHelpers version '4.0.1'

    codesystem "LOINC": 'http://loinc.org'
    codesystem "CDC Race and Ethnicity Codes": 'urn:oid:2.16.840.1.113883.6.238'

    code "Blood pressure": '85354-9' from "LOINC" display 'Blood pressure panel with all children optional'
    code "Diastolic blood pressure": '8462-4' from "LOINC" display 'Diastolic blood pressure'
    code "Systolic blood pressure": '8480-6' from "LOINC" display 'Systolic blood pressure'
    code "American Indian or Alaska Native": '1002-5' from "CDC Race and Ethnicity Codes"
    code "Alaska Native": '1735-0' from "CDC Race and Ethnicity Codes"

    context Patient

    define TestSlices:
      [Observation: "Blood pressure"] BP
        let
          SystolicBP: singleton from (BP.component C where C.code ~ "Systolic blood pressure"),
          DiastolicBP: singleton from (BP.component C where C.code ~ "Diastolic blood pressure")
        where SystolicBP.value < 140 'mm[Hg]'
          and DiastolicBP.value < 90 'mm[Hg]'

    define TestSimpleExtensions:
      Patient P
        let birthsex: singleton from (P.extension E
            where E.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex'
          )
        where birthsex.value = 'M'

    define TestComplexExtensions:
      Patient P
        let
          race: singleton from (P.extension E
            where E.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race'),
          ombCategory: race.extension E where E.url = 'ombCategory',
          detailed: race.extension E where E.url = 'detailed'
        where exists (ombCategory O where O.value ~ "American Indian or Alaska Native")
          and exists (detailed O where O.value ~ "Alaska Native")
ELM XML Content |
    Encoded data
ELM JSON Content |
    Encoded data
Generated using version 0.5.3 of the sample-content-ig Liquid templates