To add a new column with the initial daily dose. To add multiple columns use addDrugUtilisation()
for efficiency.
Source: R/addDrugUtilisation.R
addInitialDailyDose.Rd
To add a new column with the initial daily dose. To add multiple columns use
addDrugUtilisation()
for efficiency.
Usage
addInitialDailyDose(
cohort,
ingredientConceptId,
conceptSet = NULL,
indexDate = "cohort_start_date",
censorDate = "cohort_end_date",
restrictIncident = TRUE,
nameStyle = "initial_daily_dose_{concept_name}_{ingredient}",
name = NULL
)
Arguments
- cohort
A cohort_table object.
- ingredientConceptId
Ingredient OMOP concept that we are interested for the study.
- conceptSet
List of concepts to be included.
- 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.
- nameStyle
Character string to specify the nameStyle of the new columns.
- name
Name of the new computed cohort table, if NULL a temporary table will be created.
Examples
# \donttest{
library(DrugUtilisation)
cdm <- mockDrugUtilisation()
cdm$cohort1 |>
addInitialDailyDose(ingredientConceptId = 1125315)
#> # Source: table<og_109_1734614281> [?? x 5]
#> # Database: DuckDB v1.1.3 [unknown@Linux 6.8.0-1017-azure:R 4.4.2/:memory:]
#> cohort_definition_id subject_id cohort_start_date cohort_end_date
#> <int> <int> <date> <date>
#> 1 2 4 2017-02-06 2018-05-31
#> 2 3 1 2005-11-14 2007-05-18
#> 3 1 2 2008-08-28 2008-10-09
#> 4 2 3 2012-02-13 2012-07-02
#> 5 2 5 2013-09-11 2019-05-07
#> 6 3 6 2005-03-29 2005-07-11
#> 7 2 7 2018-01-20 2019-05-31
#> 8 1 8 2018-09-28 2018-12-10
#> 9 1 9 2022-03-15 2022-05-05
#> 10 2 10 1997-12-13 1999-11-02
#> # ℹ 1 more variable:
#> # initial_daily_dose_ingredient_1125315_descendants_1125315 <dbl>
# }