Skip to contents

Run benchmark of drug utilisation cohort generation

Usage

benchmarkDrugUtilisation(
  cdm,
  ingredient = "acetaminophen",
  alternativeIngredient = c("ibuprofen", "aspirin", "diclofenac"),
  indicationCohort = NULL
)

Arguments

cdm

A cdm_reference object.

ingredient

Name of ingredient to benchmark.

alternativeIngredient

Name of ingredients to use as alternative treatments.

indicationCohort

Name of a cohort in the cdm_reference object to use as indicatiomn.

Value

A summarise_result object.

Examples

# \donttest{
library(DrugUtilisation)
library(CDMConnector)
library(duckdb)
#> Loading required package: DBI

requireEunomia()
#>  `EUNOMIA_DATA_FOLDER` set to: /tmp/Rtmp6U1L3N.
#> 
#> Download completed!
con <- dbConnect(drv = duckdb(dbdir = eunomiaDir()))
#> Creating CDM database /tmp/Rtmp6U1L3N/GiBleed_5.3.zip
cdm <- cdmFromCon(con = con, cdmSchema = "main", writeSchema = "main")

timings <- benchmarkDrugUtilisation(cdm)
#> 13-05-2025 22:16:58 Benchmark get necessary concepts
#> 13-05-2025 22:16:58 Benchmark generateDrugUtilisation
#> 13-05-2025 22:17:01 Benchmark generateDrugUtilisation with numberExposures and
#> daysPrescribed
#> 13-05-2025 22:17:05 Benchmark require
#> 13-05-2025 22:17:07 Benchmark generateIngredientCohortSet
#> 13-05-2025 22:17:12 Benchmark summariseDrugUtilisation
#> 13-05-2025 22:17:18 Benchmark summariseDrugRestart
#> 13-05-2025 22:17:21 Benchmark summariseProportionOfPatientsCovered
#> 13-05-2025 22:17:25 Benchmark summariseTreatment
#> 13-05-2025 22:17:29 Benchmark drop created tables

timings
#> # A tibble: 10 × 13
#>    result_id cdm_name group_name group_level            strata_name strata_level
#>        <int> <chr>    <chr>      <chr>                  <chr>       <chr>       
#>  1         1 Synthea  task       get necessary concepts overall     overall     
#>  2         1 Synthea  task       generateDrugUtilisati… overall     overall     
#>  3         1 Synthea  task       generateDrugUtilisati… overall     overall     
#>  4         1 Synthea  task       require                overall     overall     
#>  5         1 Synthea  task       generateIngredientCoh… overall     overall     
#>  6         1 Synthea  task       summariseDrugUtilisat… overall     overall     
#>  7         1 Synthea  task       summariseDrugRestart   overall     overall     
#>  8         1 Synthea  task       summariseProportionOf… overall     overall     
#>  9         1 Synthea  task       summariseTreatment     overall     overall     
#> 10         1 Synthea  task       drop created tables    overall     overall     
#> # ℹ 7 more variables: variable_name <chr>, variable_level <chr>,
#> #   estimate_name <chr>, estimate_type <chr>, estimate_value <chr>,
#> #   additional_name <chr>, additional_level <chr>
# }