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{
CDMConnector::requireEunomia()
#>  `EUNOMIA_DATA_FOLDER` set to: /tmp/Rtmpf7rXXh.
#> 
#> Download completed!
con <- duckdb::dbConnect(duckdb::duckdb(), CDMConnector::eunomiaDir())
#> Creating CDM database /tmp/Rtmpf7rXXh/GiBleed_5.3.zip
cdm <- CDMConnector::cdmFromCon(con = con, cdmSchema = "main", writeSchema = "main")

timings <- benchmarkDrugUtilisation(cdm)
#> 16-04-2025 11:19:27 Benchmark get necessary concepts
#> 16-04-2025 11:19:27 Benchmark generateDrugUtilisation
#> 16-04-2025 11:19:30 Benchmark generateDrugUtilisation with numberExposures and
#> daysPrescribed
#> 16-04-2025 11:19:33 Benchmark require
#> 16-04-2025 11:19:36 Benchmark generateIngredientCohortSet
#> 16-04-2025 11:19:41 Benchmark summariseDrugUtilisation
#> 16-04-2025 11:19:47 Benchmark summariseDrugRestart
#> 16-04-2025 11:19:49 Benchmark summariseProportionOfPatientsCovered
#> 16-04-2025 11:19:54 Benchmark summariseTreatment
#> 16-04-2025 11:19:58 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>
# }