addDrugUtilisation {DrugUtilisation} | R Documentation |
Add new columns with drug use related information
Description
Add new columns with drug use related information
Usage
addDrugUtilisation(
cohort,
gapEra,
conceptSet = NULL,
ingredientConceptId = NULL,
indexDate = "cohort_start_date",
censorDate = "cohort_end_date",
restrictIncident = TRUE,
numberExposures = TRUE,
numberEras = TRUE,
exposedTime = TRUE,
timeToExposure = TRUE,
initialQuantity = TRUE,
cumulativeQuantity = TRUE,
initialDailyDose = TRUE,
cumulativeDose = TRUE,
nameStyle = "{value}_{concept_name}_{ingredient}",
name = NULL
)
Arguments
cohort |
Cohort in the cdm |
gapEra |
Number of days between two continuous exposures to be considered in the same era. |
conceptSet |
List of concepts to be included. If NULL all the descendants of ingredient concept id will be used. |
ingredientConceptId |
Ingredient OMOP concept that we are interested for the study. It is a compulsory input, no default value is provided. |
indexDate |
Name of a column that indicates the date to start the analysis. |
censorDate |
Name of a column that indicates the date to stop the analysis, if NULL end of individuals observation is used. |
restrictIncident |
Whether to include only incident prescriptions in the analysis. If FALSE all prescriptions that overlap with the study period will be included. |
numberExposures |
Whether to add a column with the number of exposures. |
numberEras |
Whether to add a column with the number of eras. |
exposedTime |
Whether to add a column with the number of exposed days. |
timeToExposure |
Whether to add a column with the number of days between indexDate and start of the first exposure. |
initialQuantity |
Whether to add a column with the initial quantity. |
cumulativeQuantity |
Whether to add a column with the cumulative quantity of the identified prescription. |
initialDailyDose |
Whether to add a column with the initial daily dose. |
cumulativeDose |
Whether to add a column with the cumulative dose. |
nameStyle |
Character string to specify the nameStyle of the new columns. |
name |
Name of the new computed cohort table, if NULL a temporary tables is created. |
Value
The same cohort with the added columns.
Examples
library(DrugUtilisation)
cdm <- mockDrugUtilisation()
codelist <- CodelistGenerator::getDrugIngredientCodes(
cdm,
name = "acetaminophen"
)
cdm <- generateDrugUtilisationCohortSet(cdm, "dus_cohort", codelist)
cdm[["dus_cohort"]] |>
addDrugUtilisation(ingredientConceptId = 1125315, gapEra = 30)