Fetches all (or a page of) controlled vocabulary entries from
GET /api/v1/vocabularies. The result is one row per vocabulary term,
with the parent domain and type attached to every row. This is useful for
understanding allowed values for fields such as name type, substance class,
relationship type, code system, and more.
Value
A data frame with columns:
- domain
Vocabulary domain name (e.g.,
"NAME_TYPE","SUBSTANCE_CLASS","RELATIONSHIP_TYPE").- term_type
Vocabulary term type identifier.
- editable
Logical;
TRUEif the vocabulary can be extended.- filterable
Logical;
TRUEif the vocabulary supports filtering.- value
The controlled term value (used in the API/data).
- display
Human-readable display label for the term.
- hidden
Logical;
TRUEif the term is hidden from the UI.- selected
Logical;
TRUEif the term is selected by default.- date_retrieved
Date the response was received.
Returns NULL on error (with a warning).
Examples
# \donttest{
Sys.sleep(2)
vocab <- gsrs_vocabularies(verbose = FALSE)
if (!is.null(vocab)) {
# See all name type values
print(vocab[vocab$domain == "NAME_TYPE", c("value", "display")])
}
#> value display
#> 911 of Official Name
#> 912 sys Systematic Name
#> 913 bn Brand Name
#> 914 cn Common Name
#> 915 cd Code
# }
