All pages
Powered by GitBook
1 of 1

Loading...

Get and Test Concept Subtypes and Supertypes

4.5 Get and Test Concept Subtypes and Supertypes

Overview

The inferred definition of each concept includes a set of one or more subtype relationships relationships.

A subtype relationship is a relationship that asserts that a concept is a subtype of another concept.

  • Subtype relationships are represented by relationship type 116680003 | is a| .

  • A subtype relationship asserts that a concept conforms to all the defining characteristics the supertype concept but also has at least one feature or refinement that distinguishes it from that concept.

  • Subtype relationships are transitive. Each individual subtype relationship links a concept to a supertype parent concept. That concept will also have one or more subtype relationships to its own supertype parents.

  • These transitive chains of subtype relationships link every active concept to a set of supertype ancestors and eventually to the .

The meaning of a concept subsumes the meaning of its subtype children and descendants. Therefore, service that test or traverse subtype relationships are essential for effective meaning-based reporting and analysis.

Requirements and Options

Display of the SNOMED CT hierarchy requires access to the direct supertype parents and subtype children of a specified concept.

Effective use of SNOMED CT for retrieval, analysis and constrained data entry requires rapid identification of concepts that are supertype ancestors or subtype descendants of a specified concept.

The requirements listed in the table below include services that return the full set of children, parents, descendants or ancestors of a concept. However, other requirements can be more efficiently met by testing for a transitive subtype or supertype relationship between a specified concept and a set of one or more candidate concepts.

Service Name and Status
Input
Output
  • Other Services

Service Name
API Call 4
Result
Service Name
API Call 6
Result
Service Name
SQL Query
Result

Notes

  • The services in this table that list subtype and supertype concepts are a subset of the services required to implement expression constraints (see see [4.7 Validate and Apply Expression Constraints" style="width: 100%;">). Therefore, it is recommended that the is used when requesting these services.

  • Language and/or dialect should be specified if the service returns terms associated with referenced concepts.

  • The subsumption test services are marked as recommended rather than required because they can be implemented by the client application using the results of the get subtype descendants and/or get supertype ancestors services.

Get subtype descendants of a concept

  • conceptId

  • Optionally, language or dialect code

  • Set of conceptIds of all concepts with a direct or transitive 116680003 | is a | relationship to the specified concept.

  • Optionally additional information such as the fully specified name or preferred term of each concept in the set.

Get supertype ancestors of a concept

  • conceptId

  • Optionally, language or dialect code

  • Set of conceptIds of all concepts with a direct or transitive 116680003 | is a | relationship from the specified concept.

  • Optionally additional information such as the fully specified name or preferred term of each concept in the set.

Test subsumption between two concepts 3

  • Predicate.conceptId

  • Candidate.conceptId

  • If Candidate concept is a subtype descendant of the predicate concept: TRUE

  • Otherwise: FALSE

Test a set of concepts for subsumption 3

  • Predicate.conceptId

  • Set of candidate.conceptIds

  • Set of conceptIds of all concepts in the candidate set that have a direct or transitive 116680003 | is a | relationship from the specified concept.

Test Expression Subsumption

  • Use Cases

    • Explore and Review SNOMED CT

    • EHR Data Entry

    • EHR Reporting and Analytics

  • Get subtype descendants of a concept

    for example


    Encoded URL

    Returns a JSON representation of data about each of the descendant concepts.

    The data returned for each concept includes:

    • All concept release file data

    • The preferred term and fully specified name.

    Also returns the total number of descendant concepts.

    As some concepts have very large numbers of descendants, this service is paged. Requests parameters include:

    Get supertype ancestors of a concept

    for example


    Encoded URL

    Returns a JSON representation of data about each of the ancestor concepts.

    The data returned for each concept includes:

    • All concept release file data

    • The preferred term and fully specified name.

    Also returns the total number of ancestor concepts.

    Test subsumption between two concepts

    Snowstorm does not provide a specific service for this test, but the test can be accomplished using the Get Concepts service (see ) with a combination of an expression constraint to represent the subsumption requirement and a list of concept identifiers.

    For example


    Encoded URL

    Returns a JSON object with contents that depend on whether the candidate concept is a subtype of the predicate concept:

    • If it is a subtype descendant the returned object contains:

      • The property total with value 1; and

      • An item array that contains data about the candidate concept (as it is the only concept that is both a subtype of the predicate and equal to the candidate concept).

    Test a set of concepts for subsumption

    Snowstorm does not provide a specific service for this test but the technique used in the row above can be used with all the candidate concept identifiers included in the comma separated list.

    For example


    Encoded URL

    Returns a JSON representation of the candidate concepts that are subtypes descendants of the predicate concept.

    • If one or more of the predicate concepts are subtypes of the candidate concept the returned object contains:

      • The property total with value equal to the number of candidate concepts that are subtypes of the predicate concept; and

      • For each candidate concept that is a subtype of the predicate concept a an item array that contain data about that candidate concept .

    Get subtype descendants of a concept

    Option 1)

    for example:

    Option 2)

    Returns a JSON representation of data about each of the descendant concepts.

    The data returned for each concept includes:

    • code: the code for each descendant

    • display: the preferred term for each descendant

    Also returns the total number of descendant concepts.

    As some concepts have very large numbers of descendants, this service is paged. Requests parameters include:

    Get supertype ancestors of a concept

    FHIR does not provide a specific operation for this service, but the supports that retrieval of the ancestors of SNOMED CT concept, and can thus be used to enable this service through the ValueSet/$expand operation.

    for example:

    Returns a JSON representation of data about each of the ancestor concepts.

    The data returned for each concept includes:

    • code: the code for each descendant

    • display: the preferred term for each descendant

    Also returns the total number of descendant concepts.

    As some concepts have very large numbers of ancestors, this service is paged. Requests parameters include:

    Test subsumption between two concepts

    for example:

    Returns a JSON representation of information about the subsumption relation between the two concepts:

    • subsumed-by indicates that the concept provided as the value for codeA is a subtype of the concept provided as the value for codeB

    • subsumes indicates that the concept provided as the value for codeA is a supertype of the concept provided as the value for codeB

    • not-subsumed indicates that there is no subsumption relationship between the concepts provided as values for codeA and codeB

    Get subtype descendants of a concept

    for example

    Returns rows containing the id and term for each subtype descendant of the specified concept.

    • The query shown return the preferred term for each concept

    • Replace the view suffix _pref with _fsn to return the fully specified name for each concept

    Get supertype ancestors of a concept

    for example

    Returns rows containing the id and term for each supertype ancestor of the specified concept.

    • The query shown return the preferred term for each concept

    • Replace the view suffix _pref with _fsn to return the fully specified name for each concept

    Test subsumption between two concepts

    for example

    Returns 1 if the candidate concept is a subtype of the supertype concept.

    Test a set of concept for subsumption

    Different approaches can be used depending on the specific requirement. As with the options for

    1. Use the get descendants service to generate the list of descendants of the predicate concept and use this list as part of a query for records containing subtypes of that concept;

    2. Individually, apply the test for subsumption between two concepts to each candidate concept;

    3. Extend the ECL query to include all the candidate concepts as illustrated below.

    Option 3 will return the ids of concepts in the bracketed list that are subtypes descendants of the predicate concept.

    In the Snowstorm service requests [snowstorm] should be replaced by the URL to the Snowstorm server endpoint.

  • Data in the definitionStatusId and active columns is represented as symbolic names rather than the boolean and SCTID data types used in release file columns.

  • In the FHIR service requests [fhir] should be replaced by the URL to the FHIR terminology server endpoint. FHIR® is a registered trademarks of HL7 (www.hl7.org).

  • The SNOMED CT MySQL example database is not designed as a terminology server and is not intended for use in a live system . It is referenced in this guide as an illustration that some readers may find helpful. For more information about the SNOMED CT example database see the SNOMED CT - SQL Practical Guide. For instructions on how to build the example database refer to Appendix A: Building the SNOMED CT Example Database.

  • Get subtype children of a concept

    • conceptId

    • Optionally, language or dialect code

    • Set of conceptIds of all concepts with a direct 116680003 | is a | relationship to the specified concept.

    • Optionally additional information such as the fully specified name or preferred term of each concept in the set.

    Get supertype parents of a concept

    • conceptId

    • Optionally, language or dialect code

    Get subtype children of a concept

    GET [snowstorm]/browser/[branch]/concepts/[conceptId]/children

    for example

    GET [snowstorm]/browser/MAIN/2020-01-31/concepts/80146002/children

    Encoded URL

    GET [snowstorm]/browser/MAIN%2F2020-01-31/concepts/80146002/children

    Returns a JSON representation of data about each of the child concepts.

    The data returned for each concept includes:

    • All concept release file data

    • The preferred term and fully specified name.

    Also returns the total number of child concepts.

    Get supertype parents of a concept

    GET [snowstorm]/browser/[branch]/concepts/[conceptId]/parents

    for example

    GET [snowstorm]/browser/MAIN/2020-01-31/concepts/80146002/parents

    Encoded URL

    GET [snowstorm]/browser/MAIN%2F2020-01-31/concepts/80146002/parents

    Get subtype children of a concept

    FHIR does not provide a specific operation for this service, but the SNOMED CT Expression Constraint Language supports that retrieval of the direct children of SNOMED CT concept, and can thus be used to enable this service through the ValueSet/$expand operation.

    GET [fhir]/ValueSet/$expand?url=[editionURI/versionURI]?fhir_vs=ecl/<![predicateSupertypeId]&count=10

    for example:

    GET [fhir]/ValueSet/$expand?url=http://snomed.info/sct?fhir_vs=ecl/<!26322001&count=10

    Returns a JSON representation of data about each of the subtype children concepts.

    The data returned for each concept includes:

    • code: the code for each subtype child

    • display: the preferred term for subtype child

    Also returns the total number of children concepts.

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

    • count to restrict the number of children returned.

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

    Get supertype parents of a concept

    FHIR does not provide a specific operation for this service, but the SNOMED CT Expression Constraint Language supports that retrieval of the direct parents of SNOMED CT concept, and can thus be used to enable this service through the ValueSet/$expand operation.

    GET [fhir]/ValueSet/$expand?url=[editionURI/versionURI]?fhir_vs=ecl/>![predicateSubtypeId]&count=10

    for example:

    GET [fhir]/ValueSet/$expand?url=[editionURI/versionURI]?fhir_vs=ecl/>!26322001&count=10

    Get subtype children of a concept

    SELECT id,term FROM snap_rel_child_fsn    WHERE conceptId=[conceptId]

    for example

    SELECT id,term FROM snap_rel_child_fsn    WHERE conceptId=80146002

    Returns rows containing the id and term for each subtype child of the specified concept.

    • The query shown return the fully specified name as the term for each concept

    • Replace the view suffix _fsn with _pref to return the preferred term for each concept

    Get supertype parents of a concept

    SELECT id,term FROM snap_rel_parent_fsn WHERE conceptId=[conceptId]

    for example

    SELECT id,term FROM snap_rel_parent_fsn WHERE conceptId=80146002

    Services Required

    Interdependencies

    Required By

    Depends On

    Service Examples

    The Snowstorm and FHIR examples are presented in plain text and URL encoded versions. Always use the "Encoded URL" when testing the example service requests. The plain text version is included to aid readability but using this version in a service request may result in errors. These errors result from characters that have to be encoded as they are not permitted in a URL (see IETF RFC1738).

    Snowstorm API

    FHIR API

    MySQL Example Database

    | SNOMED CT root concept|
    Validate and Apply Expression Constraints
    Find Concepts
    Validate Concept Definitions and Expressions
    Select Edition and Version
    Get a Concept, Description or Relationship
    Get Definition of a Concept
    Expression Constraint Language syntax
    Provide Feedback
    • Set of conceptIds of all concepts with a direct 116680003 | is a | relationship to the specified concept.

    • Optionally additional information such as the fully specified name or preferred term of each concept in the set.

    Returns a JSON representation of data about each of the parent concepts.

    The data returned for each concept includes:

    • All concept release file data

    • The preferred term and fully specified name.

    Also returns the total number of parent concepts.

    Returns a JSON representation of data about each of the parent concepts.

    The data returned for each concept includes:

    • code: the code for each parent

    • display: the preferred term for each parent

    Also returns the total number of parent concepts.

    As some concepts have very large numbers of parents, this service is paged. Requests parameters include:

    Returns rows containing the id and term for each supertype parent of the specified concept.

    • The query shown return the fully specified name as the term for each concept

    • Replace the view suffix _fsn with _pref to return the preferred term for each conce

    limit to restrict the number of descendants returned (default 50).

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

  • If it is not a subtype descendant the returned object contains:

    • The property total with value 0.

    If none of the candidate subtypes are a subtype descendants the returned object contains:

    • The property total with value 0.

    As some expression constraints are matched by large numbers of concept, this service is paged. Requests parameters include:

    • limit to restrict the number of concepts returned (default 50).

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

    count to restrict the number of parents returned.

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

  • count to restrict the number of descendants returned.

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

  • count to restrict the number of descendants returned.

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

  • Validate and Apply Expression Constraints
    SNOMED CT Expression Constraint Language
    GET [snowstorm]/[branch]/concepts/[conceptId]/descendants
    GET [snowstorm]/MAIN/2020-01-31/concepts/80146002/descendants?limit=50&offset=0
    GET [snowstorm]/MAIN%2F2020-01-31/concepts/80146002/descendants?limit=50&amp;offset=0
    GET [snowstorm]/browser/[branch]/concepts/[conceptId]/ancestors
    GET [snowstorm]/browser/MAIN/2020-01-31/concepts/80146002/ancestors
    GET [snowstorm]/browser/MAIN%2F2020-01-31/concepts/80146002/ancestors
    GET [snowstorm]/MAIN/2020-01-31/concepts?ecl=<[predicateSupertypeId]&conceptIds=[candidateSubtypeId]
    GET [snowstorm]/MAIN/2020-01-31/concepts?ecl=<404684003&conceptIds=703264005
    GET [snowstorm]/MAIN%2F2020-01-31/concepts?ecl=%3C404684003&amp;conceptIds=703264005
    GET [snowstorm]/MAIN/2020-01-31/concepts?ecl=<[predicateSupertypeId]&conceptIds=[candidateSubtypeIdList]
    GET [snowstorm]/MAIN/2020-01-31/concepts?ecl=<404684003&conceptIds=703264005,307581005,195967001
    GET [snowstorm]/MAIN%2F2020-01-31/concepts?ecl=%3C404684003&amp;conceptIds=703264005%2C307581005%2C195967001
    GET [fhir]/ValueSet/$expand?url=[editionURI/versionURI]?fhir_vs=isa/[predicateSupertypeId]&count=10
    GET [fhir]/ValueSet/$expand?url=http://snomed.info/sct?fhir_vs=isa/27624003&count=10
    GET [fhir]/ValueSet/$expand?url=[editionURI/versionURI]?fhir_vs=ecl/[predicateSupertypeId]&count=10
    GET [fhir]/ValueSet/$expand?url=[editionURI/versionURI]?fhir_vs=ecl/<26322001&count=10
    GET [fhir]/ValueSet/$expand?url=[editionURI/versionURI]?fhir_vs=ecl/>[predicateSubtypeId]&count=10
    GET [fhir]/ValueSet/$expand?url=[editionURI/versionURI]?fhir_vs=ecl/>26322001&count=10
    GET [fhir]/CodeSystem/$subsumes?system=[systemURI]&version=[versionURI]&codeA=[conceptId]&codeB=[conceptId]
    GET [fhir]/CodeSystem/$subsumes?system=http://snomed.info/sct&version=http://snomed.info/sct/900000000000207008/version/20200131&codeA=307355007&codeB=118940003
    SELECT id,term FROM snap_tc_descendant_pref WHERE conceptId=[conceptId]
    SELECT id,term FROM snap_tc_descendant_pref
    WHERE conceptId=80146002
    SELECT id,term FROM snap_tc_ancestor_pref
    WHERE conceptId=[conceptId]
    SELECT id,term FROM snap_tc_ancestor_pref
    WHERE conceptId=80146002
    SELECT count(supertypeId) FROM snap_transclose
    WHERE supertypeId=[predicateConceptId]
    AND subtypeId=[candidateConceptId] WHERE conceptId=80146002
    SELECT count(supertypeId) FROM snap_transclose
    WHERE supertypeId=80146002 AND subtypeId=6025007
    WHERE supertypeId=80146002 AND subtypeId=602500