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: RetrieveExample

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

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: Value set Lung Cancer Resource: Lung Cancer Canonical URL: `http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1116.89`
Dependency | Description: Value set Condition Clinical Status Resource: `http://utah.edu/fhir/lcs-cds/ValueSet/conditionclinical` Canonical URL: `http://utah.edu/fhir/lcs-cds/ValueSet/conditionclinical`
Data Requirement | Type: Patient Profile(s): Patient
Data Requirement | Type: Observation Profile(s): Observation Must Support Elements: code, status Code Filter(s): Path: code Code(s): LOINC: 72166-2 (Tobacco smoking status)
Data Requirement | Type: Condition Profile(s): Condition Must Support Elements: code, clinicalStatus Code Filter(s): Path: code ValueSet: Lung Cancer
Parameters
Name | Use | Card. | Type | Documentation
Patient | Out | 0..1 | Patient |
Smoking status observation | Out | 0..* | Observation |
Lung cancer diagnosis | Out | 0..* | Condition |
Library Content
CQL Content |
    library RetrieveExample version '0.5.3-cibuild'

    using FHIR version '4.0.1'

    include FHIRHelpers version '4.0.1'

    codesystem "LOINC": 'http://loinc.org'

    valueset "Lung Cancer":  'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1116.89'
    valueset "Condition Clinical Status": 'http://utah.edu/fhir/lcs-cds/ValueSet/conditionclinical'

    code "Tobacco Smoking Status": '72166-2' from "LOINC"

    context Patient

    define "Smoking status observation":
      [Observation: "Tobacco Smoking Status"] O
        where O.status in { 'final', 'amended' }

    define "Lung cancer diagnosis":
      [Condition: "Lung Cancer"] C
        where C.clinicalStatus in "Condition Clinical Status"
ELM XML Content |
    Encoded data
ELM JSON Content |
    Encoded data
Generated using version 0.5.3 of the sample-content-ig Liquid templates