generateAtcCohortSet {DrugUtilisation} | R Documentation |
Generate a set of drug cohorts based on ATC classification
Description
Adds a new cohort table to the cdm reference with individuals who have drug exposure records that belong to the specified Anatomical Therapeutic Chemical (ATC) classification. Cohort start and end dates will be based on drug record start and end dates, respectively. Records that overlap or have fewer days between them than the specified gap era will be concatenated into a single cohort entry.
Usage
generateAtcCohortSet(
cdm,
name,
atcName = NULL,
level = c("ATC 1st"),
doseForm = NULL,
gapEra = 1,
durationRange = lifecycle::deprecated(),
imputeDuration = lifecycle::deprecated(),
priorUseWashout = lifecycle::deprecated(),
priorObservation = lifecycle::deprecated(),
cohortDateRange = lifecycle::deprecated(),
limit = lifecycle::deprecated()
)
Arguments
cdm |
A cdm reference. |
name |
The name of the new cohort table to add to the cdm reference. |
atcName |
Names of ATC classification of interest. |
level |
ATC level. Can be one or more of "ATC 1st", "ATC 2nd", "ATC 3rd", "ATC 4th", and "ATC 5th" |
doseForm |
Only descendants codes with the specified dose form will be returned. If NULL, descendant codes will be returned regardless of dose form. |
gapEra |
Number of days between two continuous exposures to be considered in the same era. Records that have fewer days between them than this gap will be concatenated into the same cohort record. |
durationRange |
Deprecated. |
imputeDuration |
Deprecated. |
priorUseWashout |
Deprecated |
priorObservation |
Deprecated. |
cohortDateRange |
Deprecated. |
limit |
Deprecated. |
Value
The function returns the cdm reference provided with the addition of the new cohort table.
Examples
library(DrugUtilisation)
library(dplyr)
cdm <- mockDrugUtilisation()
cdm <- generateAtcCohortSet(
cdm = cdm,
atcName = "alimentary tract and metabolism",
name = "drugs"
)
cdm$drugs |>
glimpse()