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

timings <- benchmarkDrugUtilisation(cdm)
#> 19-12-2024 13:18:55 Benchmark get necessary concepts
#> 19-12-2024 13:18:55 Benchmark generateDrugUtilisation
#> 19-12-2024 13:18:58 Benchmark generateDrugUtilisation with numberExposures and
#> daysPrescribed
#> 19-12-2024 13:19:01 Benchmark require
#> 19-12-2024 13:19:03 Benchmark generateIngredientCohortSet
#> 19-12-2024 13:19:08 Benchmark summariseDrugUtilisation
#> 19-12-2024 13:19:14 Benchmark summariseDrugRestart
#> 19-12-2024 13:19:16 Benchmark summariseProportionOfPatientsCovered
#> 19-12-2024 13:19:21 Benchmark summariseTreatment
#> 19-12-2024 13:19:26 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 synthetic … task       get necess… overall     overall     
#>  2         1 Synthea synthetic … task       generateDr… overall     overall     
#>  3         1 Synthea synthetic … task       generateDr… overall     overall     
#>  4         1 Synthea synthetic … task       require     overall     overall     
#>  5         1 Synthea synthetic … task       generateIn… overall     overall     
#>  6         1 Synthea synthetic … task       summariseD… overall     overall     
#>  7         1 Synthea synthetic … task       summariseD… overall     overall     
#>  8         1 Synthea synthetic … task       summariseP… overall     overall     
#>  9         1 Synthea synthetic … task       summariseT… overall     overall     
#> 10         1 Synthea synthetic … task       drop creat… 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>
# }