Looks a codelist up in the shipped CDISC SDTM controlled terminology sdtm_ct by its submission value ("SEX"), its name ("Sex") or its NCI code ("C66731"), whichever the report or the specification happens to use.

ct_codelist(codelist)

Arguments

codelist

A single codelist submission value, name or NCI concept code. Case and surrounding whitespace are ignored.

Value

A tibble of the codelist's terms, one row per allowed submission value, with the columns of sdtm_ct and a ct_release attribute. A codelist that is not in the dictionary returns zero rows rather than an error, so callers can fall back to a study specification.

Examples

ct_codelist("SEX")$value
#> [1] "F"        "INTERSEX" "M"        "U"       
ct_codelist("Severity/Intensity Scale for Adverse Events")$value
#> [1] "MILD"     "MODERATE" "SEVERE"  
nrow(ct_codelist("NOT A CODELIST"))
#> [1] 0