Using SNOMED dictionaries and codelists

This package is designed to make it easier to use SNOMED CT in R, including searching the SNOMED CT dictionary and relations, and creating and manipulating SNOMED CT codelists.

Basic introduction to SNOMED CT

SNOMED CT is a clinical terminology system which contains thousands of concepts, each of which has a distinct meaning. Each concept has a unique concept ID, and one or more descriptions (synonyms). It also contains a knowledge model (ontology), specifying which concepts are subtypes of another concept or associated in other ways.

The SNOMED dictionaries are contained within four key tables:

Each SNOMED CT concept may have any number of synonyms, but there are the following special types:

Each concept also has a semantic tag, which denotes what type of concept it is (e.g. 'disorder' or 'organism'). This is currently recorded in parentheses at the end of the Fully Specified Name, and can be extracted using the semanticType function in this package.

Loading the SNOMED CT dictionaries

This package contains functions to import a set of SNOMED CT release files from NHS Digital TRUD (https://isd.digital.nhs.uk/trud3/user/guest/group/0/home). The International and UK release files are provided in separate downloads, and need to be combined to create the whole dictionary. This can be done using the loadSNOMED() function and specifying a vector of folder paths to load.

For most users the 'Snapshot' files, containing the current versions of the entries, will be the most useful, and the sample dictionaries in this package are based on the Snapshot file format. The 'Delta' files contain changes since the previous version, and the 'Full' files contain a history of the changes to each entry.

When the NHS Digital SNOMED CT files are extracted, they will be in a folder such as 'SnomedCT_InternationalRF2_PRODUCTION_20200731T120000Z', and the relevant tables will be in the subfolder 'Snapshot/Terminology'. Code such as the following can be used to load the tables into R (the file paths should be changed to the actual file paths on your system).

# Load package
require(Rdiagnosislist)

# Load UK and International SNOMED CT release files into an
# R environment called 'SNOMED'
SNOMED <- loadSNOMED(c(
  'SnomedCT_InternationalRF2_PRODUCTION_20200731T120000Z/Snapshot/Terminology',
  'SnomedCT_UKClinicalRF2_PRODUCTION_20210317T000001Z/Snapshot/Terminology'))

# Save the 'SNOMED' environment to a file on disk
saveRDS(SNOMED, file = 'mySNOMED.RDS')

# Reload the 'SNOMED' environment from file
SNOMED <- readRDS('mySNOMED.RDS')

Using R environments

The SNOMED CT dictionary files are loaded into an R 'environment', which is an object that can contain other objects. This is a convenient way in R to store a group of objects without cluttering up the global environment with too many individual objects. It also allows different versions of SNOMED CT dictionaries to be used side by side, by loading them into different environments. For ease of use, many of the functions in the package will search for the dictionaries in an environment named 'SNOMED' by default, but for programming use it is recommended to specify the environment explicitly in function calls to avoid unexpected errors.

For the purpose of this vignette, we will create a sample set of SNOMED CT files from the sample dictionaries included with the package.

# The sampleSNOMED() function returns an environment containing
# the sample dictionaries
require(Rdiagnosislist)
## Loading required package: Rdiagnosislist
## 
## Attaching package: 'Rdiagnosislist'
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, union
TEST <- sampleSNOMED()

# TEST is now an environment containing the sample SNOMED CT dictionary.
# Objects within the environment can be retrieved using the $ operator
# or the 'get' function. We will export the sample dictionaries to a
# temporary folder to show how to reload them using loadSNOMED()

for (table in c('Concept', 'Description', 'Relationship',
  'StatedRelationship')){
  write.table(get(toupper(table), envir = TEST), paste0(tempdir(),
    '/sct_', table, '_test.txt'), row.names = FALSE, sep = '\t', quote = FALSE)
}

# loadSNOMED searches for files containing _Concept_, _Description_,
# _Relationship_ or _StatedRelationship_, as in the actual SNOMED CT
# release files.

# Import using the loadSNOMED function
SNOMED <- loadSNOMED(tempdir(), active_only = FALSE)
## Attempting to load from /tmp/RtmpDuCoT4
## Attempting to load sct_Concept_test.txt
##   Loaded 62 rows.
##   Converted effectiveTime to IDate.
##   Converting active to logical.
##   Naming as CONCEPT
## Attempting to load sct_Description_test.txt
##   Loaded 183 rows.
##   Converted effectiveTime to IDate.
##   Converting active to logical.
##   Naming as DESCRIPTION
## Attempting to load sct_StatedRelationship_test.txt
##   Loaded 61 rows.
##   Converted effectiveTime to IDate.
##   Converting destinationId to integer64.
##   Converting typeId to integer64.
##   Converting active to logical.
##   Naming as STATEDRELATIONSHIP
## Attempting to load sct_Relationship_test.txt
##   Loaded 77 rows.
##   Converted effectiveTime to IDate.
##   Converting destinationId to integer64.
##   Converting typeId to integer64.
##   Naming as RELATIONSHIP
## 
## SNOMED CT tables loaded into environment:
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB

SNOMED CT concepts IDs in R

SNOMED CT concept IDs are long integers which need to be represented using the integer64 data type in R. This is not available in base R but is provided in the bit64 package which is automatically loaded with this package. They must not be stored as short integer or numeric values because they cannot be stored precisely and may be incorrect.

This package makes it easier to use SNOMED CT concept IDs because they can be supplied as character vectors and converted to 'SNOMEDconcept' vectors. The SNOMEDconcept class is a 64-bit integer class which can faithfully store SNOMED CT concept IDs, and is more memory-efficient than storing them as character vectors. If the SNOMED dictionary is available in the R environment, the concepts are displayed with their description in the default print method.

The function 'as.SNOMEDconcept' can be used to retrieve the SNOMED concept ID matching a description. This function also converts SNOMED CT concept IDs in other formats (numeric, 64-bit integer or character) into SNOMEDconcept objects.

# Make sure the SNOMED environment is available and contains the SNOMED dictionary
as.SNOMEDconcept('Heart failure', SNOMED = SNOMED)
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "84114007 | Heart failure (disorder)"
# To use the sample SNOMED dictionary for testing
as.SNOMEDconcept('Heart failure', SNOMED = sampleSNOMED())
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "84114007 | Heart failure (disorder)"
# If an object named SNOMED containing the SNOMED dictionary is available
# in the current environment, it does not need to be stated in the
# function call
SNOMED <- sampleSNOMED()
as.SNOMEDconcept('Heart failure')
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "84114007 | Heart failure (disorder)"
# The argument 'exact' can be used to specify whether a regular expression
# search should be done, e.g.
as.SNOMEDconcept('Heart f', exact = FALSE)
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##  [1] "84114007 | Heart failure (disorder)"                                 
##  [2] "89819002 | Cardiac insufficiency during AND/OR resulting from a p..."
##  [3] "233924009 | Heart failure as a complication of care (disorder)"      
##  [4] "309634009 | History of heart failure in last year (situation)"       
##  [5] "390868005 | Heart failure screen (procedure)"                        
##  [6] "394927007 | Heart failure excluded (situation)"                      
##  [7] "395105005 | Heart failure confirmed (situation)"                     
##  [8] "423475008 | Heart failure education (procedure)"                     
##  [9] "446221000 | Heart failure with normal ejection fraction (disorder)"  
## [10] "471880001 | Heart failure due to end stage congenital heart disea..."
## [11] "703272007 | Heart failure with reduced ejection fraction (disorder)"
# The 'description' function can be used to return the descriptions of
# the concepts found. It returns a data.table with the fully specified 
# name for each term.
description(as.SNOMEDconcept('Heart f', exact = FALSE))
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##             id conceptId
##  1:  825890014  84114007
##  2:  832792011  89819002
##  3:  622176015 233924009
##  4: 2987039012 309634009
##  5: 1465046015 390868005
##  6: 2612836016 394927007
##  7: 2612834018 395105005
##  8: 2641521019 423475008
##  9: 2881211010 446221000
## 10: 2950980013 471880001
## 11: 3008153015 703272007
##                                                                          term
##  1:                                                  Heart failure (disorder)
##  2: Cardiac insufficiency during AND/OR resulting from a procedure (disorder)
##  3:                        Heart failure as a complication of care (disorder)
##  4:                         History of heart failure in last year (situation)
##  5:                                          Heart failure screen (procedure)
##  6:                                        Heart failure excluded (situation)
##  7:                                       Heart failure confirmed (situation)
##  8:                                       Heart failure education (procedure)
##  9:                    Heart failure with normal ejection fraction (disorder)
## 10:        Heart failure due to end stage congenital heart disease (disorder)
## 11:                   Heart failure with reduced ejection fraction (disorder)
# The 'semantic type' function returns the semantic type of the concept
# from the Fully Specified Name
semanticType(as.SNOMEDconcept('Heart failure'))
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "disorder"
# Functions which expect a SNOMEDconcept object, such as semanticType,
# will automatically convert their argument to SNOMEDconcept using the
# function as.SNOMEDconcept
semanticType('Heart failure')
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "disorder"

Set operations using SNOMEDconcept

This package provides versions of the set functions 'setdiff', 'intersect' and 'union' which work with SNOMEDconcept objects.

# A list of concepts with a description containing the term 'heart'
# (not that all synonyms are searched, not just the Fully Specified Names)
heart <- as.SNOMEDconcept('Heart|heart', exact = FALSE, SNOMED = sampleSNOMED())

# A list of concepts containing the term 'fail'
fail <- as.SNOMEDconcept('Fail|fail', exact = FALSE, SNOMED = sampleSNOMED())

# Concepts with heart and fail
intersect(heart, fail)
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##  [1] "446221000 | Heart failure with normal ejection fraction (disorder)"  
##  [2] "813991000000101 | Education about deteriorating heart failure (pr..."
##  [3] "10091002 | High output heart failure (disorder)"                     
##  [4] "25544003 | Low output heart failure (disorder)"                      
##  [5] "42343007 | Congestive heart failure (disorder)"                      
##  [6] "46113002 | Hypertensive heart failure (disorder)"                    
##  [7] "48447003 | Chronic heart failure (disorder)"                         
##  [8] "56675007 | Acute heart failure (disorder)"                           
##  [9] "84114007 | Heart failure (disorder)"                                 
## [10] "85232009 | Left heart failure (disorder)"                            
## [11] "89819002 | Cardiac insufficiency during AND/OR resulting from a p..."
## [12] "128404006 | Right heart failure (disorder)"                          
## [13] "161505003 | History of heart failure (situation)"                    
## [14] "233924009 | Heart failure as a complication of care (disorder)"      
## [15] "309634009 | History of heart failure in last year (situation)"       
## [16] "314206003 | Refractory heart failure (disorder)"                     
## [17] "390868005 | Heart failure screen (procedure)"                        
## [18] "394887005 | Suspected heart failure (situation)"                     
## [19] "394927007 | Heart failure excluded (situation)"                      
## [20] "395105005 | Heart failure confirmed (situation)"                     
## [21] "418304008 | Diastolic heart failure (disorder)"                      
## [22] "417996009 | Systolic heart failure (disorder)"                       
## [23] "423475008 | Heart failure education (procedure)"                     
## [24] "429959009 | Family history of heart failure (situation)"             
## [25] "462172006 | Fetal heart failure (disorder)"                          
## [26] "471880001 | Heart failure due to end stage congenital heart disea..."
## [27] "703272007 | Heart failure with reduced ejection fraction (disorder)" 
## [28] "718287008 | Provision of written information about heart failure ..."
# Concepts with heart and not fail
setdiff(heart, fail)
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "80891009 | Heart structure (body structure)"
## [2] "57809008 | Myocardial disease (disorder)"
# Concepts with heart or fail
union(heart, fail)
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##  [1] "446221000 | Heart failure with normal ejection fraction (disorder)"  
##  [2] "813991000000101 | Education about deteriorating heart failure (pr..."
##  [3] "10091002 | High output heart failure (disorder)"                     
##  [4] "25544003 | Low output heart failure (disorder)"                      
##  [5] "42343007 | Congestive heart failure (disorder)"                      
##  [6] "46113002 | Hypertensive heart failure (disorder)"                    
##  [7] "48447003 | Chronic heart failure (disorder)"                         
##  [8] "56675007 | Acute heart failure (disorder)"                           
##  [9] "80891009 | Heart structure (body structure)"                         
## [10] "84114007 | Heart failure (disorder)"                                 
## [11] "85232009 | Left heart failure (disorder)"                            
## [12] "89819002 | Cardiac insufficiency during AND/OR resulting from a p..."
## [13] "128404006 | Right heart failure (disorder)"                          
## [14] "161505003 | History of heart failure (situation)"                    
## [15] "233924009 | Heart failure as a complication of care (disorder)"      
## [16] "309634009 | History of heart failure in last year (situation)"       
## [17] "314206003 | Refractory heart failure (disorder)"                     
## [18] "57809008 | Myocardial disease (disorder)"                            
## [19] "390868005 | Heart failure screen (procedure)"                        
## [20] "394887005 | Suspected heart failure (situation)"                     
## [21] "394927007 | Heart failure excluded (situation)"                      
## [22] "395105005 | Heart failure confirmed (situation)"                     
## [23] "418304008 | Diastolic heart failure (disorder)"                      
## [24] "417996009 | Systolic heart failure (disorder)"                       
## [25] "423475008 | Heart failure education (procedure)"                     
## [26] "429959009 | Family history of heart failure (situation)"             
## [27] "462172006 | Fetal heart failure (disorder)"                          
## [28] "471880001 | Heart failure due to end stage congenital heart disea..."
## [29] "703272007 | Heart failure with reduced ejection fraction (disorder)" 
## [30] "718287008 | Provision of written information about heart failure ..."
## [31] "55565007 | Cardiac failure after obstetrical surgery AND/OR other..."
## [32] "195111005 | Decompensated cardiac failure (disorder)"                
## [33] "195112003 | Compensated cardiac failure (disorder)"                  
## [34] "206586007 | Congenital cardiac failure (disorder)"                   
## [35] "276514007 | Neonatal cardiac failure (disorder)"                     
## [36] "277639002 | Sepsis-associated right ventricular failure (disorder)"  
## [37] "313389004 | No cardiac failure (situation)"                          
## [38] "367363000 | Right ventricular failure (disorder)"                    
## [39] "410431009 | Cardiorespiratory failure (disorder)"                    
## [40] "609507007 | Induced termination of pregnancy complicated by cardi..."
## [41] "722095005 | Acute kidney injury due to circulatory failure (disor..."

These set operations can be used to create lists of SNOMED CT concepts of interest, similar to the way researchers use Read codes. However, SNOMED CT also allows the use of hierarchies and relationships to locate concepts by their meaning.

Using relationships between SNOMED CT concepts

The most important relationship is the 'Is a' relationship, also known as parent and child. This makes it easy to find all specific concepts that are a subtype of a more general concept. The relationship functions (parents, ancestors, children and descendants) all take a SNOMEDconcept object as input, or attempt to convert their argument to SNOMEDconcept.

SNOMED <- sampleSNOMED()

# Parents (immediate ancestors)
parents('Acute heart failure')
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "84114007 | Heart failure (disorder)"
# Ancestors
ancestors('Acute heart failure')
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "84114007 | Heart failure (disorder)"                
## [2] "105981003 | Disorder of cardiac function (disorder)"
# Children (immediate descendants)
children('Acute heart failure')
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "722095005 | Acute kidney injury due to circulatory failure (disor..."
# Descendants
descendants('Acute heart failure')
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "722095005 | Acute kidney injury due to circulatory failure (disor..."

Attributes of SNOMED CT concepts

The 'hasAttributes' function can be used to find terms with particular attributes. For example, to find all disorders with a finding site of the heart, we can use the relatedConcepts function, which retrieves relationships from the RELATIONSHIP and STATEDRELATIONSHIP tables.

In order to find the finding site of a disorder, we use the 'forward' relationship. In order to find disorders with a particular finding site, we use the relationship in the 'reverse' direction.

require(Rdiagnosislist)
SNOMED <- sampleSNOMED()

# List all the attributes of a concept
print(attrConcept('Heart failure'))
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##       sourceId destinationId    typeId relationshipGroup
##   1:  84114007     105981003 116680003                 0
##   2:  84114007      80891009 363698007                 0
##   3:  84114007      57809008 116680003                 0
##   4:  84114007     105981003 116680003                 0
##   5:  84114007      74281007 363698007                 0
##  ---                                                    
##  98: 206586007      84114007 116680003                 0
##  99: 703272007      84114007 116680003                 0
## 100: 718287008      84114007 363702006                 0
## 101: 722095005      84114007  42752001                 0
## 102: 236003008      84114007  42752001                 0
##                                                            sourceDesc
##   1:                                         Heart failure (disorder)
##   2:                                         Heart failure (disorder)
##   3:                                         Heart failure (disorder)
##   4:                                         Heart failure (disorder)
##   5:                                         Heart failure (disorder)
##  ---                                                                 
##  98:                            Congenital cardiac failure (disorder)
##  99:          Heart failure with reduced ejection fraction (disorder)
## 100: Provision of written information about heart failure (procedure)
## 101:        Acute kidney injury due to circulatory failure (disorder)
## 102:                                       Cardiac ascites (disorder)
##                              destinationDesc                 typeDesc
##   1: Disorder of cardiac function (disorder)         Is a (attribute)
##   2:        Heart structure (body structure) Finding site (attribute)
##   3:           Myocardial disease (disorder)         Is a (attribute)
##   4: Disorder of cardiac function (disorder)         Is a (attribute)
##   5:   Myocardium structure (body structure) Finding site (attribute)
##  ---                                                                 
##  98:                Heart failure (disorder)         Is a (attribute)
##  99:                Heart failure (disorder)         Is a (attribute)
## 100:                Heart failure (disorder)    Has focus (attribute)
## 101:                Heart failure (disorder)       Due to (attribute)
## 102:                Heart failure (disorder)       Due to (attribute)
# 'Finding site' of a particular disorder
relatedConcepts('Heart failure', 'Finding site')
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## [1] "80891009 | Heart structure (body structure)"
# Disorders with a 'Finding site' of 'Heart'
relatedConcepts('Heart', 'Finding site', reverse = TRUE)
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##  [1] "10091002 | High output heart failure (disorder)"                     
##  [2] "105981003 | Disorder of cardiac function (disorder)"                 
##  [3] "314206003 | Refractory heart failure (disorder)"                     
##  [4] "25544003 | Low output heart failure (disorder)"                      
##  [5] "367363000 | Right ventricular failure (disorder)"                    
##  [6] "46113002 | Hypertensive heart failure (disorder)"                    
##  [7] "48447003 | Chronic heart failure (disorder)"                         
##  [8] "55565007 | Cardiac failure after obstetrical surgery AND/OR other..."
##  [9] "56675007 | Acute heart failure (disorder)"                           
## [10] "84114007 | Heart failure (disorder)"                                 
## [11] "89819002 | Cardiac insufficiency during AND/OR resulting from a p..."
## [12] "195111005 | Decompensated cardiac failure (disorder)"                
## [13] "195112003 | Compensated cardiac failure (disorder)"                  
## [14] "195130005 | Post cardiac operation functional disturbance (disorder)"
## [15] "233924009 | Heart failure as a complication of care (disorder)"      
## [16] "410431009 | Cardiorespiratory failure (disorder)"                    
## [17] "276514007 | Neonatal cardiac failure (disorder)"                     
## [18] "418304008 | Diastolic heart failure (disorder)"                      
## [19] "417996009 | Systolic heart failure (disorder)"                       
## [20] "68583001 | Auricular dilatation (disorder)"                          
## [21] "445236007 | Cardiorenal syndrome (disorder)"                         
## [22] "446221000 | Heart failure with normal ejection fraction (disorder)"  
## [23] "462172006 | Fetal heart failure (disorder)"                          
## [24] "471880001 | Heart failure due to end stage congenital heart disea..."
## [25] "609507007 | Induced termination of pregnancy complicated by cardi..."
## [26] "206586007 | Congenital cardiac failure (disorder)"                   
## [27] "703272007 | Heart failure with reduced ejection fraction (disorder)" 
## [28] "722095005 | Acute kidney injury due to circulatory failure (disor..."

SNOMED CT codelists

The SNOMED CT codelist data type allows a list of SNOMED CT concepts to be curated. It allows codelists to be expressed in a contracted (simplified) form with descendants implicitly included.

SNOMED <- sampleSNOMED()

# Create a codelist containing all the descendants of
# the concept 'Heart failure'
my_heart_failure_codelist <- SNOMEDcodelist(
  as.SNOMEDconcept('Heart failure'), include_desc = TRUE)
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
## Converting 1 concept(s) to a codelist
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
# Original codelist
print(my_heart_failure_codelist)
##    conceptId include_desc                     term
## 1:  84114007         TRUE Heart failure (disorder)
# Expanded codelist
expanded <- expandSNOMED(my_heart_failure_codelist)
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
print(expanded)
##     conceptId include_desc
##  1:  10091002           NA
##  2:  25544003           NA
##  3:  42343007           NA
##  4:  46113002           NA
##  5:  48447003           NA
##  6:  55565007           NA
##  7:  56675007           NA
##  8:  84114007         TRUE
##  9:  85232009           NA
## 10:  89819002           NA
## 11: 128404006           NA
## 12: 195111005           NA
## 13: 195112003           NA
## 14: 206586007           NA
## 15: 233924009           NA
## 16: 276514007           NA
## 17: 277639002           NA
## 18: 314206003           NA
## 19: 367363000           NA
## 20: 410431009           NA
## 21: 417996009           NA
## 22: 418304008           NA
## 23: 445236007           NA
## 24: 446221000           NA
## 25: 462172006           NA
## 26: 471880001           NA
## 27: 609507007           NA
## 28: 703272007           NA
## 29: 722095005           NA
##     conceptId include_desc
##                                                                                               term
##  1:                                                           High output heart failure (disorder)
##  2:                                                            Low output heart failure (disorder)
##  3:                                                            Congestive heart failure (disorder)
##  4:                                                          Hypertensive heart failure (disorder)
##  5:                                                               Chronic heart failure (disorder)
##  6: Cardiac failure after obstetrical surgery AND/OR other procedure including delivery (disorder)
##  7:                                                                 Acute heart failure (disorder)
##  8:                                                                       Heart failure (disorder)
##  9:                                                                  Left heart failure (disorder)
## 10:                      Cardiac insufficiency during AND/OR resulting from a procedure (disorder)
## 11:                                                                 Right heart failure (disorder)
## 12:                                                       Decompensated cardiac failure (disorder)
## 13:                                                         Compensated cardiac failure (disorder)
## 14:                                                          Congenital cardiac failure (disorder)
## 15:                                             Heart failure as a complication of care (disorder)
## 16:                                                            Neonatal cardiac failure (disorder)
## 17:                                         Sepsis-associated right ventricular failure (disorder)
## 18:                                                            Refractory heart failure (disorder)
## 19:                                                           Right ventricular failure (disorder)
## 20:                                                           Cardiorespiratory failure (disorder)
## 21:                                                              Systolic heart failure (disorder)
## 22:                                                             Diastolic heart failure (disorder)
## 23:                                                                Cardiorenal syndrome (disorder)
## 24:                                         Heart failure with normal ejection fraction (disorder)
## 25:                                                                 Fetal heart failure (disorder)
## 26:                             Heart failure due to end stage congenital heart disease (disorder)
## 27:                     Induced termination of pregnancy complicated by cardiac failure (disorder)
## 28:                                        Heart failure with reduced ejection fraction (disorder)
## 29:                                      Acute kidney injury due to circulatory failure (disorder)
##                                                                                               term
# Contract codelist
contracted <- contractSNOMED(expanded)
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
##                  NAME NROW NCOL MB
## 1:            CONCEPT   62    5  0
## 2:        DESCRIPTION  183    9  0
## 3:       RELATIONSHIP   77   10  0
## 4: STATEDRELATIONSHIP   61   10  0
##                                                               COLS KEY
## 1:             id,moduleId,definitionStatusId,effectiveTime,active    
## 2:              id,moduleId,conceptId,languageCode,typeId,term,...    
## 3: id,active,moduleId,sourceId,destinationId,relationshipGroup,...    
## 4: id,moduleId,sourceId,destinationId,relationshipGroup,typeId,...    
## Total: 0MB
print(contracted)
##    conceptId include_desc                     term
## 1:  84114007         TRUE Heart failure (disorder)
# Write out codelist to file
write.csv(my_heart_failure_codelist, file = paste0(tempdir(),
  '/hf_codes.csv'), row.names = FALSE)

# Reload codelist from file
reloaded_codelist <- as.SNOMEDcodelist(
  data.table::fread(paste0(tempdir(), '/hf_codes.csv')))
print(reloaded_codelist)
##    conceptId include_desc                     term
## 1:  84114007         TRUE Heart failure (disorder)

More information

For more information about SNOMED CT, visit the SNOMED CT international website: https://www.snomed.org/

SNOMED CT (UK edition) can be downloaded from the NHS Digital site: https://isd.digital.nhs.uk/trud3/user/guest/group/0/home

The NHS Digital terminology browser can be used to search for terms interactively: https://termbrowser.nhs.uk/