All pages
Powered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

Querying the LOINC Ontology

The integration of LOINC observable entity concepts into SNOMED CT follows a structured yet distinct approach, wherein LOINC concepts are incorporated as subtypes of |Observable entity| but maintain a flat hierarchical structure.

In the LOINC Ontology browser, the flat structure becomes evident, when searching for the concept |observable entity| and then exploring the large number of direct children of this concept.

While this design ensures comprehensive coverage of LOINC concepts, it inherently limits the effectiveness of simple subsumption-based retrieval, as concepts are not deeply nested within a hierarchical framework. However, this challenge is mitigated by the rich semantic modeling of LOINC concepts within SNOMED CT, which includes well-defined attributes and explicit logical definitions.

To facilitate efficient retrieval of LOINC concepts within SNOMED CT, the Expression Constraint Language (ECL) serves as a robust querying mechanism. ECL enables users to construct precise and attribute-driven queries, leveraging core LOINC attributes such as component, property, system (specimen), time aspect, and method. This capability allows for highly granular and targeted data extraction, supporting advanced clinical decision-making, analytics, and interoperability within healthcare systems.

For a detailed introduction and guidance to the SNOMED CT Expression Constraint Language, please refer to Expression Constraint Language.

Simple Expression Constraints

The simplest form of an expression constraint consists of a focus concept, optionally preceded by a constraint operator. The focus concept represents a specific SNOMED CT term, while the constraint operator refines the selection. Simple expression constraints enable precise retrieval of concepts based on hierarchical relationships, making them fundamental for querying SNOMED CT data.

Examples

→ Retrieves the exact concept |Mass concentration of glucose in blood at point in time (observable entity)|

<<

&#xNAN;→ Retrieves the exact concept |Mass concentration of glucose in blood at point in time (observable entity)| and all its descendants

Operator
Name
Description
Example (LOINC Observable Entities in SNOMED CT)

Expression constraints with refinements extend simple expression constraints by specifying additional criteria to refine the selection of concepts. A refinement consists of an attribute-value pair, where the attribute represents a defining characteristic, and the value specifies the required condition. This allows for more precise querying of SNOMED CT concepts.

In the LOINC Ontology, expression constraints with refinements allow for more precise retrieval of LOINC terms based on specific attributes, such as Component, Site, or Technique. A refinement consists of an attribute-value pair, where the attribute defines a characteristic, and the value specifies the required condition.

Refinement Example

<< 363787002 : 370130000 = 117363000

→ Retrieves all Observable entity (363787002) terms where Property (370130000) is Mass concentration (117363000), such as Glucose [Mass/volume] in Blood.

The following page of the Specification and Guide details the different kinds of refinements that are supported by the Expression Constraint Language:

By applying refinements, users can precisely query LOINC-based Observable entities in SNOMED CT, ensuring they meet specific laboratory or clinical criteria.

The table below lists example ECL queries that can be performed to retrieve a set of concepts that matches the criteria delineated in the ECL expression.

ECL Query
Text Description of Query
Example Results

Expression constraints with filters enhance concept selection by applying additional conditions based on metadata or external attributes rather than defining characteristics. Filters enable more flexible and targeted queries by constraining results based on criteria such as term status, module, effective time, or description type.

In the LOINC Ontology, expression constraints with filters allow for refined retrieval of LOINC terms based on metadata attributes such as versioning, language, or active status. By applying filters, users can narrow down results to match specific implementation requirements, ensuring more relevant and precise data retrieval.

The following pages of the Specification and Guide details the different kinds of filters that can be used to refine a query:

The table below provides some examples of key filters for querying the LOINC Ontology content

Filter
ECL Query
Text Description of Query

To execute expression constraints using the SNOMED LOINC Browser, please follow these instructions:

  1. Navigate to the LOINC Ontology browser:

  2. Enter the "Expression constraints Queries" in the panel to the right, as shown here:

  3. Copy an expression constraint from the examples above

  4. Paste the expression constraint into the Expression Constraints Query text box, as shown here:

Click Execute (green button below the textbox)

  • View results

  • Self

    The expression constraint is satisfied only by the specified concept

    Retrieves only the specified concept

    593081010000107 |Aldosterone and renin activity panel - Plasma (observable entity)|

    < : = *

    Query for all observable entity concepts which have a

    >7000 concepts including:

    << : = << AND = <<

    Module Filter

    << {{ C moduleId = }}

    This ECL is satisfied by all concepts that are descendants or self of observable entities belonging to the LOINC extension module. Applying this module filter will ensure that only concepts belonging to the LOINC extension are returned.

    Description Filter

    << {{ term = "glucose"}}{{ C moduleId = }}

    Key Operators for Simple Expression Constraints

    Expression Constraints with Refinements

    Refinement Examples

    Expression Constraints with Filters

    Query using the SNOMED CT Browser

    174771010000107 |Mass concentration of glucose in blood at point in time (observable entity)|
    174771010000107 |Mass concentration of glucose in blood at point in time (observable entity)|
    Expression Constraint Language
    Expression Constraint Language
    https://browser.loincsnomed.org/
    Provide Feedback

    *

    Any

    Any concept in the substrate

    All LOINC Ontology concepts (incl. concepts in dependent modules)

    <

    Descendant of

    Retrieves all descendants (subtypes) of the specified concept

    < 540081010000107 |Panel (observable entity)|

    <<

    Descendant or self of

    Retrieves all descendants (subtypes) of the specified concept including the concept itself

    << 363787002 |Observable entity (observable entity)| → Includes all Observable entities

    <!

    Child of

    Retrieves all children (immediate subtypes) of the specified concept excluding the concept itself

    <! 363787002 |Observable entity (observable entity)| → Direct children like "Laboratory test result"

    <<!

    Child or self of

    Retrieves all children (immediate subtypes) of the specified concept including the concept itself

    <<! 363787002 |Observable entity (observable entity)| → "Laboratory test result" and itself

    >

    Ancestor of

    Retrieves all ancestors (supertypes) of the specified concept excluding the concept itself

    > 234567001 (Hemoglobin measurement) → Retrieves "Laboratory test result"

    >>

    Ancestor or self of

    Retrieves all ancestors (supertypes) of the specified concept including the concept itself

    >> 234567001 (Hemoglobin measurement) → Retrieves itself and ancestors

    >!

    Parent of

    Retrieves all parents (immediate supertypes) of the specified concept excluding the concept itself

    >! 123456001 (Blood glucose level) → Retrieves "Laboratory test result"

    >>!

    Parent or self of

    Retrieves all parents (immediate supertypes) of the specified concept including the concept itself

    >>! 123456001 (Blood glucose level) → Retrieves itself and immediate parent

    ^

    Member of

    Retrieves the referencedComponentId of all (active) members of a reference set

    ^ 735981007 (LOINC Reference Set in SNOMED CT) → Retrieves all members of the LOINC refset

    Query for all observable entity concepts where

    >8400 concepts including:

    << : = << AND =

    Query for all observable entity concepts where

    >629 concepts, including:

    >

    Query for all ancestors of

    3 concepts, including:

    >!

    Query for parent of

    <

    Query for all descendants of

    4 concepts including:

    << : = <<

    Query for all observable entity concepts where the property attribute is (or a subtype)

    ~11000 concepts including

    < {{ C definitionStatus = defined }}

    Query for all sufficiently defined observable entity concepts

    >18000 concepts including:

    < {{ C definitionStatusId = }} : = <<

    Query for all primitive observable entity concepts where the property is (or a subtype thereof)

    >1200 concepts, including:

    << : = << OR = <<

    Query for all observable entity concepts with a component of some sort of Immunoglobulin G or M

    ~4100 concepts including

    << : = << AND != <<

    Query for all observable entity concepts with a component as some sort of Immnunoglobulin G, but NOT a subtype or self of

    >2800 concepts, including:

    << : [1..1] = *, [1..1] = *, [1..1] = *, [0..0] = *, [0..0] =*

    Query for LOINC Groupers: By using cardinality to require Property, Direct site, and Component, and exclude Scale type and Time aspect, this query identifies generalized observables (), defining shared features without constraining time or scale.

    >2100 concepts, including:

    This ECL adds the description filter {{ term = "glucose"}}.

    This ECL is satisfied by all concepts that are descendants or self of observable entities belonging to the LOINC extension module and has a description including the term 'glucose'

    Description Filter

    Word-prefix-any-order

    << {{ term = "hydr uri"}} {{ C moduleId = }}

    This ECL adds the description filter {{ term = "hydr uri"}}.

    This example demonstrats the word-prefix-any-order search that is the default behaviour:

    By default, term filters match using a word-prefix-any-order match technique. This means that each string value in the search term must match the start of a word in the concept's description term, but that these words may appear in any order.

    363787002 |Observable entity (observable entity)|
    246501002 |Technique (attribute)|
    246501002 |Technique (attribute)|
    154831010000100 |Substance concentration of pro-brain natriuretic peptide in serum or plasma at point in time by immunoassay (observable entity)|
    363787002 |Observable entity (observable entity)|
    246093002 |Component (attribute)|
    68498002 |Antibody (substance)|
    704327008 |Direct site (attribute)|
    122592007 |Acellular blood (serum or plasma) specimen (specimen)|
    363787002 |Observable entity (observable entity)|
    11010000107 |LOINC Extension module|
    363787002 |Observable entity (observable entity)|
    11010000107 |LOINC Extension module|
    246093002
    859931010000102 |Arbitrary concentration of spermatozoa IgM in serum at point in time (observable entity)|
    363787002 |Observable entity (observable entity)|
    246093002 |Component (attribute)|
    68498002 |Antibody (substance)|
    704327008 |Direct site (attribute)|
    122592007 |Acellular blood (serum or plasma) specimen (specimen)|
    246093002
    856191010000105 |Presence of Zika virus IgM in serum or plasma at point in time by immunoassay (observable entity)|
    80151010000108 |Mass concentration of monoclonal IgG in serum at point in time (observable entity)|
    80151010000108 |Mass concentration of monoclonal IgG in serum at point in time (observable entity)|
    132201010000103 |Mass concentration of immunoglobulin G in serum or plasma at point in time (observable entity)|
    176671010000107 |Arbitrary concentration of Afipia felis IgG in serum at point in time (observable entity)|
    176671010000107 |Arbitrary concentration of Afipia felis IgG in serum at point in time (observable entity)|
    253191010000109 |Arbitrary concentration of immunoglobulin G in serum at point in time (observable entity)|
    96371010000104 |Arbitrary concentration of alphafetoprotein in body fluid at point in time (observable entity)|
    96371010000104 |Arbitrary concentration of alphafetoprotein in body fluid at point in time (observable entity)|
    137271010000105 |Arbitrary concentration of alphafetoprotein in pleural fluid at point in time (observable entity)|
    363787002 |Observable entity (observable entity)|
    370130000 |Property (attribute)|
    705057003 |Presence (property) (qualifier value)|
    705057003 |Presence (property) (qualifier value)|
    6270001000004106 |Presence of ulcer in primary malignant melanoma of skin (observable entity)|
    363787002 |Observable entity (observable entity)|
    219541010000104 |Presence of hepatitis B virus rRNA in specimen at point in time by nucleic acid hybridization probe (observable entity)|
    363787002 |Observable entity (observable entity)|
    900000000000074008 |Primitive|
    370130000 |Property (attribute)|
    705057003 |Presence (property) (qualifier value)|
    705057003 |Presence (property) (qualifier value)|
    2060001000004105 |Presence of tumor bud in primary malignant neoplasm of colon (observable entity)|
    363787002 |Observable entity (observable entity)|
    246093002 |Component (attribute)|
    29246005 |Immunoglobulin G (substance)|
    246093002 |Component (attribute)|
    74889000 |Immunoglobulin M (substance)|
    859751010000109 |Titer of Coxiella burnetii phase 2 IgM in serum at point in time (observable entity)|
    363787002 |Observable entity (observable entity)|
    246093002 |Component (attribute)|
    29246005 |Immunoglobulin G (substance)|
    246093002 |Component (attribute)|
    712606001 |Monoclonal immunoglobulin G (substance)|
    712606001 |Monoclonal immunoglobulin G (substance)|
    859421010000105 |Presence of interferon beta IgG in serum at point in time (observable entity)|
    363787002 |Observable entity (observable entity)|
    370130000 |Property (attribute)|
    704327008 |Direct site (attribute)|
    246093002 |Component (attribute)|
    370132008 |Scale type (attribute)|
    370134009 |Time aspect (attribute)|
    groupers
    733141010000107 |Measurement of free cortisol in urine (observable entity)|
    363787002 |Observable entity (observable entity)|
    11010000107 |LOINC Extension module|

    Using the LOINC Ontology

    When working with the LOINC Ontology, it’s essential to have efficient access to the content through various systems, regardless of the technology used.

    This chapter provides practical guidance on how the LOINC Ontology can be used effectively in clinical applications to support the use cases outlined in the Clinical Use Case section.

    Provide Feedback

    Accessing the Reference Set in a Relational Database

    If the LOINC Ontology has been loaded in a relational database using a model that complies with the RF2 specification for tables and column names, the content can be accessed using SQL queries in line with the examples below. To Set up SNOMED CT in a relational database, please follow the guidance and instructions provided in the SQL Practical Guide.

    SQL Examples

    Service Name
    SQL Query
    Result

    Get all members of the reference set

    The reference set used in this example is:

    635111010000100 |Logical Observation Identifiers Names and Codes Orderable Reference Set (foundation metadata concept)|

    for example

    Returns the ids of all the concepts or descriptions that are the members of the reference set.

    Test if a concept is a member of the reference set

    The concept used in this example is: 141951010000102 |Mass concentration of neopterin in urine at point in time (observable entity)|

    for example

    Returns:

    • 0 : if the candidate component is not in the reference set.

    • 1 : If the candidate component is a member of the reference set

      • Some types or reference set can include the same component more than once, so any value greater than zero indicate the component is a member of the references set.

    SELECT referencedComponentId FROM snap_refset_simple WHERE active=1 AND refsetId=[refsetId];
    SELECT referencedComponentId FROM snap_refset_simple WHERE active=1 AND refsetId=635111010000100;
    Provide Feedback
    SELECT count(referencedComponentId) FROM snap_refset_simple WHERE active=1 AND refsetId=[refsetId] AND referencedComponentId=[candidateComponentId];
    SELECT count(referencedComponentId) FROM snap_refset_simple WHERE active=1 AND refsetId=635111010000100 AND referencedComponentId=141951010000102;

    Accessing the LOINC Ontology from a FHIR Terminology Server

    When working with the LOINC Ontology, leveraging a FHIR terminology server can simplify access and management. The server allows you to handle the content as a specific CodeSystem version, providing access to all FHIR Terminology operations.

    LOINC Extension FHIR URIsing

    The SNOMED International URI standard specifies that identify unversioned editions (i.e. editions) and versioned editions (i.e. versions) take the following respective forms:

    • http://snomed.info/sct/{sctid}

    • http://snomed.info/sct/{sctid}/version/{timestamp}

    These URIs apply to the 'version' element of codes and the 'URL' parameter in FHIR Operations. The 'system" element value is always 'http://snomed.info/sct' for all SNOMED editions. For more information on the URI Specification, please refer to the document.

    The following table shows some examples of URIs for editions and versions relevant when working with the LOINC Ontology.

    Resource
    URI

    The following table lists a few key requests relevant for retrieving content from the LOINC Ontology using the FHIR Terminology services API.

    Service Name and Status
    Input
    Output

    Please refer to the for a comprehensive guidance on SNOMED CT enabled terminology services.

    These examples use the concept as the refsetId.

    Service Name
    API Call
    Result

    SNOMED CT International Edition

    SNOMED CT International Edition, 20250101

    SNOMED CT-LOINC

    $lookup

    A conceptId and a CodeSystem url

    • Concept metadata, including status, designations, etc.

    $expand

    Get all members of the reference set

    REQUIRED

    • A reference set specified by its refsetId, in this case the identifiers for the set of Orderable and Observable LOINC Terms:

    Get concept metadata

    Returns a JSON representation of concept metadata

    Get all members of the reference set

    for example

    An alternative solution is to use the expression constraint language, as shown here:

    Examples

    FHIR Operations

    Example FHIR Requests

    URI Standard
    SNOMED CT Terminology Services Guide
    635111010000100 |LOINC Orderable Reference Set|
    Provide Feedback

    http://snomed.info/sct/11010000107

    SNOMED CT-LOINC, 31 March 2025

    http://snomed.info/sct/11010000107/version/20250531

    LOINC Orderable Reference Set

    $validate-code

    Test if a concept or description is a member of a specified reference set

    REQUIRED

    • A reference set specified by its refsetId

    • A candidate concept.id

    • If the candidate concept is a member of the reference set: TRUE

    • Otherwise: FALSE

    Returns a JSON representation of data about each of the reference set member.

    The data returned for each concept includes:

    • code: the conceptId of the reference set member

    • display: the preferred term for the reference set member

    Also returns the total number of reference set members

    As some reference sets have very large numbers of children, this service is paged. Requests parameters include:

    • count to restrict the number of members returned.

    • offset to specify the start in the results (in multiples of the limit).

    Test if a concept is a member of the reference set

    for example

    Returns a JSON object with a "Parameters" resource, including a "result" parameter with a boolean value (true/false) indicating whether the member validated OK or not against the reference set.

    http://snomed.info/sct/900000000000207008
    http://snomed.info/sct/900000000000207008/version/20250101
    635111010000100
    GET [fhir]/ValueSet/$validate-code
    ?system=http://snomed.info/sct&code=537131010000109 &url=http://snomed.info/sct/[moduleId]/version/[effectiveTime]?fhir_vs=refset/[refsetId]
    GET [fhir]/ValueSet/$validate-code
    ?system=http://snomed.info/sct&code=537131010000109 &url=http://snomed.info/sct/900000000000207008/version/20200131?fhir_vs=refset/635111010000100
    GET fhir]/ValueSet/$expand
    ?url=http://snomed.info/sct?fhir_vs=refset/[refsetId]
    &code=537131010000109
    GET [fhir]/ValueSet/$expand
    ?url=http://snomed.info/sct?fhir_vs=refset/[refsetId]
    &count=10
    GET [fhir]/ValueSet/$expand
    ?url=http%3A%2F%2Fsnomed.info%2Fsct%3Ffhir_vs%3Drefset%2F635111010000100&count=10
    GET [fhir]/ValueSet/$expand
    ?url=http%3A%2F%2Fsnomed.info%2Fsct%3Ffhir_vs%3Decl%2F%5E%5B635111010000100%5D
    &count=10
    GET [fhir]/ValueSet/$expand
    ?url=http%3A%2F%2Fsnomed.info%2Fsct%3Ffhir_vs%3Decl%2F%5E635111010000100&count=10
    Refinements
    Description Filters
    Concept Filters
    Member Filters
    History Supplements