
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{
cdm <- mockDrugUtilisation()
cdm$cohort1 |>
addInitialDailyDose(ingredientConceptId = 1125315)
#> # Source: table<og_098_1743086337> [?? x 4]
#> # Database: DuckDB v1.2.1 [unknown@Linux 6.8.0-1021-azure:R 4.4.3/:memory:]
#> cohort_definition_id subject_id cohort_start_date cohort_end_date
#> <int> <int> <date> <date>
#> 1 2 1 2011-01-06 2012-08-18
#> 2 1 2 2014-06-12 2014-11-04
#> 3 1 3 1982-05-02 2006-09-27
#> 4 1 4 2002-01-25 2002-03-09
#> 5 2 5 2003-05-01 2003-09-15
#> 6 2 6 1976-06-27 1986-09-25
#> 7 2 7 2012-03-07 2013-08-21
#> 8 2 8 2017-02-01 2017-03-21
#> 9 1 9 1991-09-12 1992-02-27
#> 10 1 10 2005-08-26 2009-09-28
# }