htmlCodelistHierarchy: Export a SNOMEDcodelist hierarchy to HTML

View source: R/htmlCodelistHierarchy.R

htmlCodelistHierarchyR Documentation

Export a SNOMEDcodelist hierarchy to HTML

Description

Exports a codelist with hierarchy as HTML for easy viewing.

Usage

htmlCodelistHierarchy(
  x,
  file = NULL,
  title = NULL,
  description = NULL,
  extracols = NULL,
  SNOMED = getSNOMED(),
  ...
)

Arguments

x

a SNOMEDcodelist, codelistHierarchy (output of showCodelistHierarchy), or an object which can be coerced to a SNOMEDcodelist (such as a SNOMEDconcept vector).

file

filename to export to. If NULL, no file is written

title

title of HTML document

description

paragraph of description text (excluding <p></p> tags)

extracols

character vector of additional columns of codelist_with_hierarchy to include in HTML output

SNOMED

environment containing the SNOMED dictionary to use

...

extra arguments to pass to as.SNOMEDcodelist

Value

a character vector containing HTML output

See Also

showCodelistHierarchy

Examples

data.table::setDTthreads(threads = 1) # for CRAN testing
SNOMED <- sampleSNOMED() # use sample SNOMED for testing

my_concepts <- SNOMEDconcept('Acute heart failure')
my_codelist <- SNOMEDcodelist(data.frame(conceptId = my_concepts,
  include_desc = TRUE))
my_codelist <- getMaps(my_codelist, to = 'icd10')
htmlCodelistHierarchy(my_codelist, file = paste0(tempdir(),
  '/codelist.html'), extracols = 'icd10_code')
# The codelist.html file can now be viewed in a web browser

# Clean up temporary file
file.remove(paste0(tempdir(), '/codelist.html'))

anoopshah/Rdiagnosislist documentation built on March 29, 2025, 10:46 a.m.