Title: | CDISC SDTM Controlled Terminology |
Version: | 2025-3-25 |
Description: | Clinical Data Interchange Standards Consortium (CDISC) Standard Data Tabulation Model (SDTM) controlled terminology, 2025-03-25. Source: https://evs.nci.nih.gov/ftp1/CDISC/SDTM/. |
License: | Apache License (≥ 2) |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Depends: | R (≥ 4.1.0) |
Imports: | dplyr, tibble |
URL: | https://github.com/patterninstitute/sdtm.terminology, https://www.pattern.institute/sdtm.terminology/ |
BugReports: | https://github.com/patterninstitute/sdtm.terminology/issues |
Config/Needs/website: | patterninstitute/chic |
NeedsCompilation: | no |
Packaged: | 2025-04-04 13:21:25 UTC; rmagno |
Author: | Ramiro Magno |
Maintainer: | Ramiro Magno <rmagno@pattern.institute> |
Repository: | CRAN |
Date/Publication: | 2025-04-07 16:30:01 UTC |
sdtm.terminology: CDISC SDTM Controlled Terminology
Description
Clinical Data Interchange Standards Consortium (CDISC) Standard Data Tabulation Model (SDTM) controlled terminology, 2025-03-25. Source: https://evs.nci.nih.gov/ftp1/CDISC/SDTM/.
Author(s)
Maintainer: Ramiro Magno rmagno@pattern.institute (ORCID)
Other contributors:
Pattern Institute [copyright holder, funder]
See Also
Useful links:
Report bugs at https://github.com/patterninstitute/sdtm.terminology/issues
SDTM codelist code to respective term
Description
clst_code_to_term()
maps SDTM terminology codelists' C-codes to respective
terms. For mapping codes other than those representing codelists, use
code_to_term()
instead.
Usage
clst_code_to_term(code)
Arguments
code |
A C-code with a leading character C followed by a sequence of digits used for uniquely identifying each SDTM terminology codelist. |
Value
A character vector of SDTM terms for codelists. The number
of elements returned matches the number of elements in code
, i.e. there
is a one-to-one correspondence between input and output. Invalid codes in
code
are mapped to NA
.
See Also
See clst_term_to_code()
for the inverse operation.
Examples
clst_code_to_term(code = "C66731")
# `code` is vectorized.
clst_code_to_term(code = c("C66731", "C66733"))
# Invalid codes (e.g. `"C007"`) map to `NA`.
clst_code_to_term(code = c("C66731", "C66733", "C007"))
SDTM code list term to respective code
Description
clst_term_to_code()
maps SDTM terminology codelists' terms to respective
C-codes. For mapping terms other than those representing codelists, use
term_to_code()
instead.
Usage
clst_term_to_code(term)
Arguments
term |
A SDTM controlled terminology term referring to a codelist. |
Value
A character vector of SDTM codes for codelists. The number
of elements returned matches the number of elements in term
, i.e. there
is a one-to-one correspondence between input and output. Invalid codes in
term
are mapped to NA
.
See Also
See clst_code_to_term()
for the inverse operation.
Examples
clst_term_to_code(term = "SEX")
# `term` is vectorized.
clst_term_to_code(term = c("SEX", "SIZE"))
# Invalid codes (e.g. `"YODA"`) map to `NA`.
clst_term_to_code(term = c("SEX", "SIZE", "YODA"))
SDTM code to term
Description
code_to_term()
maps SDTM terminology C-codes to respective terms. For
mapping codes representing codelists, use clst_code_to_term()
instead.
Usage
code_to_term(code, clst_code)
Arguments
code |
A C-code with a leading character C followed by a sequence of digits used for uniquely identifying each concept in NCI Thesaurus (NCIt), including all CDISC concepts. |
clst_code |
Parent codelist code. |
Value
A character vector of SDTM controlled terminology terms. The number
of elements returned matches the number of elements in code
, i.e. there
is a one-to-one correspondence between input and output. Invalid codes in
code
are mapped to NA
.
See Also
See term_to_code()
for the inverse operation.
Examples
code_to_term(code = "C174106", clst_code = "C141657")
# Both `code` and `clst_code` are vectorized. `clst_code` will be recycled
# to match `code` number of elements.
code_to_term(code = c("C174106", "C141700"), clst_code = "C141657")
# You may mix codelists as long as `code` and `clst_code` have the same
# number of elements; they will be matched element-wise.
code_to_term(
code = c("C174106", "C141700", "C141701"),
clst_code = c("C141657", "C141657", "C141656")
)
# Invalid codes (e.g. `"C00000"`) map to `NA`.
code_to_term(code = c("C174106", "C141700", "C00000"), clst_code = "C141657")
Retrieve CDISC SDTM Controlled Terminology
Description
Returns a tibble of CDISC SDTM controlled terminology, optionally filtered to include only term-level entries, only code list definitions, or both.
Usage
ct(subset = c("term", "list", "all"))
Arguments
subset |
One of |
Value
A tibble containing the requested subset of CDISC controlled terminology:
- clst_code
C-code of the code list that the term belongs to. Identifies the parent code list concept (e.g.,
C66742
for Yes/No/Unknown).- is_clst
Logical indicator:
TRUE
if the row represents a code list definition;FALSE
if it represents a term within a code list.- code
C-code of the concept (either a term or a code list). Each term and list has a unique NCI Thesaurus concept code (e.g.,
C49487
for "Yes").- term
Submission value or label for the term (e.g.,
"Y"
,"TENMW1-Was Walk/Run Performed"
). For code list rows, this may be the list name.- ext
Extensibility of the code list (
TRUE
,FALSE
, orNA
).NA
for term-level rows.- name
Name of the code list or term category (e.g.,
"Yes/No/Unknown Response"
or"10-Meter Walk/Run Functional Test Test Code"
).- syn
Synonyms or alternative names for the term, often used in CRF annotations or mappings.
- def
Definition or description of the term or code list, taken from the NCI Thesaurus.
- nci
Preferred label from the NCI Thesaurus; usually a short human-readable label for the concept.
Version
Controlled terminology data comes from the release dated 2025-03-25.
Source
https://evs.nci.nih.gov/ftp1/CDISC/SDTM/SDTM%20Terminology.txt
Examples
# Return only the terms
ct("term")
# Return only the code lists
ct("list")
# Return the full terminology (code lists and individual terms)
ct("all")
CDISC SDTM Controlled Terminology Release Date
Description
SDTM terminology release date.
Usage
ct_release()
Value
A Date object.
Examples
ct_release()
Is a code or term in a code list?
Description
is_code()
and is_term()
evaluate whether query codes or terms are part of
the SDTM controlled terminology within the context of a code list.
Usage
is_term(term, clst_code)
is_code(code, clst_code)
Arguments
term |
A character vector of terms (e.g. |
clst_code |
A character vector of codes referring to SDTM terminology
codelists (e.g. |
code |
A character vector of C-codes (e.g. |
Value
A logical
vector, where TRUE
indicates that term
is a
controlled terminology term within the clst_code
provided, and FALSE
,
otherwise.
Examples
is_term(term = "TENMW101", clst_code = "C141657")
# Note that the clst_code term itself (`"TENMW1TC"`) is not part of its own
# code list (`"C141657"`).
is_term(term = "TENMW1TC", clst_code = "C141657")
# `is_term()` is vectorized over `term` and `clst_code`
is_term(term = c("TENMW101", "TENMW104"), clst_code = "C141657")
is_code(code = "C174106", clst_code = "C141657")
# Note that the code list code itself (`"C141657"`) is not part of its own
# code list (`"C141657"`).
is_code(code = "C141657", clst_code = "C141657")
# `is_code()` is vectorized over `code` and `clst_code`
is_code(code = c("C174106", "C141701"), clst_code = "C141657")
Match code lists
Description
match_code_list_from_term()
takes terms as queries to look for associated
code lists.
match_code_list_from_code()
does the same starting from
C-codes.
Note that both mappings are potentially one to many as the same code or term may associate with more than one code list.
Usage
match_code_list_from_term(term)
match_code_list_from_code(code)
Arguments
term |
A character vector of SDTM terminology terms. |
code |
A character vector of SDTM terminology C-codes. |
Value
A tibble with at least as many rows as
there are elements in term
, but potentially more because of one-to-many
mappings. The returned tibble comprises three columns:
code
An SDTM terminology code (e.g.
"C141701"
).term
An SDTM terminology term (e.g.
"TENMW104"
).clst_code
The code of the associated code list.
Examples
# Find code lists where "DNA" and "RNA" are used.
match_code_list_from_term(c("DNA", "RNA"))
# Find code lists where "Yes"/"No" terms are controlled vocabulary.
match_code_list_from_term(c("Yes", "No"))
# C163560 is found in code list C71620.
match_code_list_from_code("C163560")
# C25613 however is mapped to many code lists.
match_code_list_from_code("C25613")
# Unmappable codes or terms map to `NA`.
match_code_list_from_code("Yoda")
match_code_list_from_term("R2D2")
# Codes for code lists are for all intents and purposes not mappable to
# parent code lists.
match_code_list_from_code(code = "C141657")
Get package name
Description
pkg_name()
returns package name.
Usage
pkg_name()
Value
Package name as character.
Get package version
Description
pkg_name()
returns package version
Usage
pkg_version()
Value
Package version as an object of class package_version.
SDTM term to code
Description
term_to_code()
maps SDTM terminology terms to respective C-codes. For
mapping terms referring to codelists, use clst_term_to_code()
instead.
Usage
term_to_code(term, clst_code)
Arguments
term |
A SDTM controlled terminology term (as expected in submissions). |
clst_code |
Parent codelist code. |
Value
A character vector of SDTM controlled terminology C-codes. The number
of elements returned matches the number of elements in term
, i.e. there
is a one-to-one correspondence between input and output. Invalid codes in
term
are mapped to NA
.
See Also
See code_to_term()
for the inverse operation.
Examples
term_to_code(term = "TENMW101", clst_code = "C141657")
# Both `term` and `clst_code` are vectorized. `clst_code` will be recycled
# to match `term` number of elements.
term_to_code(term = c("TENMW101", "TENMW102"), clst_code = "C141657")
# You may mix codelists as long as `term` and `clst_code` have the same
# number of elements; they will be matched element-wise.
term_to_code(
term = c("TENMW101", "TENMW102", "TENMW1-Test Grade"),
clst_code = c("C141657", "C141657", "C141656")
)
# Invalid terms (e.g. `"Gambelas"`) map to `NA`.
term_to_code(term = c("TENMW101", "TENMW102", "Gambelas"), clst_code = "C141657")