# A few example terms.
terms <-
c(
"/day",
"Yes",
"Unknown",
"Prior",
"Every 2 hours",
"Percentage",
"International Unit"
)
# Load a controlled terminology example
(ct_spec <- read_ct_spec_example("ct-01-cm"))
# Use all possible matching terms in the controlled terminology.
ct_map(x = terms, ct_spec = ct_spec)
# Note that if the controlled terminology mapping is restricted to a codelist
# code, e.g. C71113, then only `"/day"` and `"Every 2 hours"` get mapped to
# `"QD"` and `"Q2H"`, respectively; remaining terms won't match given the
# codelist code restriction, and will be mapped to an uppercase version of
# the original terms.
ct_map(x = terms, ct_spec = ct_spec, ct_clst = "C71113")
Run the code above in your browser using DataLab