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/RtmpFXODKG.
#> 
#> Download completed!
con <- dbConnect(drv = duckdb(dbdir = eunomiaDir()))
#> Creating CDM database /tmp/RtmpFXODKG/GiBleed_5.3.zip
cdm <- cdmFromCon(con = con, cdmSchema = "main", writeSchema = "main")

timings <- benchmarkDrugUtilisation(cdm)
#> 29-05-2025 15:11:13 Benchmark get necessary concepts
#> 29-05-2025 15:11:14 Benchmark generateDrugUtilisation
#> 29-05-2025 15:11:17 Benchmark generateDrugUtilisation with numberExposures and
#> daysPrescribed
#> 29-05-2025 15:11:20 Benchmark require
#> 29-05-2025 15:11:22 Benchmark generateIngredientCohortSet
#> 29-05-2025 15:11:27 Benchmark summariseDrugUtilisation
#> 29-05-2025 15:11:33 Benchmark summariseDrugRestart
#> 29-05-2025 15:11:35 Benchmark summariseProportionOfPatientsCovered
#> 29-05-2025 15:11:40 Benchmark summariseTreatment
#> 29-05-2025 15:11:44 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>
# }