Skip to contents

Stratify a codelist by dose unit.

Usage

stratifyByDoseUnit(x, cdm, keepOriginal = FALSE)

Arguments

x

A codelist.

cdm

A cdm reference via CDMConnector.

keepOriginal

Whether to keep the original codelist and append the stratify (if TRUE) or just return the stratified codelist (if FALSE).

Value

The codelist with the required stratifications, as different elements of the list.

Examples

# \donttest{
library(CodelistGenerator)
cdm <- mockVocabRef()
#> Warning: There are observation period end dates after the current date: 2025-04-11
#>  The latest max observation period end date found is 2025-12-31
codes <- list("concepts" = c(20,21))
new_codes <- stratifyByDoseUnit(x = codes,
                                cdm = cdm,
                                keepOriginal = TRUE)
#> Warning: ! `codelist` casted to integers.
new_codes
#> 
#> ── 3 codelists ─────────────────────────────────────────────────────────────────
#> 
#> - concepts (2 codes)
#> - concepts_milligram (1 codes)
#> - concepts_percent (1 codes)
# }