loadSNOMED | R Documentation |
Identifies relevant SNOMED CT files from the folder structure of a SNOMED CT distribution. This includes the core 'Snapshot' tables mapping tables from the 'Refset' folder and the history substitution table and query table. The relevant tables are loaded into an R environment, which can be saved and then easily retrieved for future use. Files from two folders (e.g. International and UK versions) can be loaded together, and are automatically appended by the function.
loadSNOMED(folders, active_only = TRUE, version = NULL)
folders |
Vector of folder paths containing SNOMED CT files |
active_only |
Whether to limit to current (active) SNOMED CT concepts |
version |
Version description. If NULL, it is derived from the folder paths and expressed in the form: INT date & UK date |
The SNOMED CT files are available from the NHS Digital Technology Reference Update Distribution: https://isd.digital.nhs.uk/trud/user/guest/group/0/home
An environment containing data.table objects: CONCEPT, DESCRIPTION, RELATIONSHIP, STATEDRELATIONSHIP, REFSET, SIMPLEMAP, EXTENDEDMAP, HISTORY (optional), QUERY (optional)
loadREADMAPS, CONCEPT, DESCRIPTION, RELATIONSHIP, STATEDRELATIONSHIP, REFSET, SIMPLEMAP, EXTENDEDMAP, QUERY, HISTORY sampleSNOMED, getSNOMED, exportSNOMEDenvir
# Create a TEST environment and load the sample dictionaries
TEST <- sampleSNOMED()
# Export to temporary directory
exportSNOMEDenvir(TEST, tempdir())
# Try to import using the loadSNOMED function
TEST2 <- loadSNOMED(tempdir(), active_only = FALSE)
# Check that reimported SNOMED dictionary is the same as the original
all.equal(TEST$CONCEPT, TEST2$CONCEPT)
all.equal(TEST$DESCRIPTION, TEST2$DESCRIPTION)
all.equal(TEST$RELATIONSHIP, TEST2$RELATIONSHIP)
all.equal(TEST$STATEDRELATIONSHIP, TEST2$STATEDRELATIONSHIP)
all.equal(TEST$REFSET, TEST2$REFSET)
all.equal(TEST$SIMPLEMAP, TEST2$SIMPLEMAP)
all.equal(TEST$EXTENDEDMAP, TEST2$EXTENDEDMAP)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.