Description Usage Arguments Details Value Examples
Data concepts can be specified in JSON format as a concept dictionary which
can be read and parsed into concept
/item
objects. Dictionary loading
can either be performed on the default included dictionary or on a user-
specified custom dictionary. Furthermore, a mechanism is provided for adding
concepts and/or data sources to the existing dictionary (see the Details
section).
1 2 3 4 5 6 | load_dictionary(
src = NULL,
concepts = NULL,
name = "concept-dict",
cfg_dirs = NULL
)
|
src |
|
concepts |
A character vector used to subset the concept dictionary or
|
name |
Name of the dictionary to be read |
cfg_dirs |
File name of the dictionary |
A default dictionary is provided at
1 2 3 4 | system.file(
file.path("extdata", "config", "concept-dict.json"),
package = "ricu"
)
|
and can be loaded in to an R session by calling
get_config("concept-dict")
. The default dictionary can be extended by
adding a file concept-dict.json
to the path specified by the environment
variable RICU_CONFIG_PATH
. New concepts can be added to this file and
existing concepts can be extended (by adding new data sources).
Alternatively, load_dictionary()
can be called on non-default
dictionaries using the file
argument.
In order to specify a concept as JSON object, for example the numeric concept for glucose, is given by
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | {
"glu": {
"unit": "mg/dL",
"min": 0,
"max": 1000,
"description": "glucose",
"category": "chemistry",
"sources": {
"mimic_demo": [
{
"ids": [50809, 50931],
"table": "labevents",
"sub_var": "itemid"
}
]
}
}
}
|
Using such a specification, constructors for cncpt
and
itm
objects are called either using default arguments or as
specified by the JSON object, with the above corresponding to a call like
1 2 3 4 5 6 7 8 9 |
The arguments src
and concepts
can be used to only load a subset of a
dictionary by specifying a character vector of data sources and/or concept
names.
A concept
object containing several data concepts as cncpt
objects.
1 2 3 4 | if (require(mimic.demo)) {
head(load_dictionary("mimic_demo"))
load_dictionary("mimic_demo", c("glu", "lact"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.