Learn R Programming

Rdiagnosislist (version 1.4.0)

expandSNOMED: Expand or contract a SNOMEDcodelist

Description

SNOMEDcodelist is an S3 class for sets of SNOMED concepts. In the 'contracted' form, it may contain only parents and not child terms (to create a more succinct list). The 'Expanded' form contains all concepts. The output of 'showCodelistHierarchy' includes all hierarchies contained within the codelist in a format suitable for display.

Usage

expandSNOMED(x, SNOMED = getSNOMED(), ...)

contractSNOMED(x, SNOMED = getSNOMED(), ...)

showCodelistHierarchy( x, SNOMED = getSNOMED(), max_excluded_descendants = 200, ... )

Value

An object of class 'SNOMEDcodelist' with attribute Expanded = TRUE

Arguments

x

SNOMEDcodelist to expand or contract. If x is not a SNOMEDcodelist, it is coerced to one by as.SNOMEDcodelist

SNOMED

environment containing a SNOMED dictionary

...

other arguments to pass to as.SNOMEDcodelist

max_excluded_descendants

(integer) whether to show excluded descendants as long as they do not exceed this number (a limit is suggested to avoid the program crashing if there are too many descendants). If this number is exceeded, the program will initially try to include children only, and if there are still too many, it will ignore all descendants. An 'included' column is added to the codelist showing which terms are included. This can make it easy to see if a codelist is consistent with the SNOMED CT ontology.

See Also

Other SNOMEDcodelist functions: SNOMEDcodelist(), addInactiveConcepts(), export(), is.SNOMEDcodelist(), print.SNOMEDcodelist()

Other SNOMEDcodelist functions: SNOMEDcodelist(), addInactiveConcepts(), export(), is.SNOMEDcodelist(), print.SNOMEDcodelist()

Other SNOMEDcodelist functions: SNOMEDcodelist(), addInactiveConcepts(), export(), is.SNOMEDcodelist(), print.SNOMEDcodelist()

Examples

Run this code
SNOMED <- sampleSNOMED()

my_concepts <- SNOMEDconcept('Heart failure')
my_codelist <- SNOMEDcodelist(data.frame(conceptId = my_concepts,
  include_desc = TRUE))
expanded_codelist <- expandSNOMED(my_codelist)
contractSNOMED(expanded_codelist)

Run the code above in your browser using DataLab