Learn R Programming

sdtm.terminology (version 2025-3-25)

match_code_list_from_term: 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)

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.

Arguments

term

A character vector of SDTM terminology terms.

code

A character vector of SDTM terminology C-codes.

Examples

Run this code
# 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")

Run the code above in your browser using DataLab