Skip to contents

Format a drug_utilisation object into a visual table.

Usage

tableDrugUtilisation(
  result,
  header = c("cdm_name"),
  groupColumn = c("cohort_name", strataColumns(result)),
  type = "gt",
  hide = c("variable_level", "censor_date", "cohort_table_name", "gap_era", "index_date",
    "restrict_incident"),
  .options = list()
)

Arguments

result

A summarised_result object.

header

Columns to use as header. See options with availableTableColumns(result).

groupColumn

Columns to group by. See options with availableTableColumns(result).

type

Type of table. Check supported types with visOmopResults::tableType().

hide

Columns to hide from the visualisation. See options with availableTableColumns(result).

.options

A named list with additional formatting options. visOmopResults::tableOptions() shows allowed arguments and their default values.

Value

A table with a formatted version of summariseIndication() results.

Examples

# \donttest{
cdm <- mockDrugUtilisation()
codelist <- CodelistGenerator::getDrugIngredientCodes(cdm, "acetaminophen")
cdm <- generateDrugUtilisationCohortSet(cdm, "dus_cohort", codelist)
#>  Subsetting drug_exposure table
#>  Checking whether any record needs to be dropped.
#>  Collapsing overlaping records.
#>  Collapsing records with gapEra = 1 days.

drugUse <- cdm$dus_cohort |>
  summariseDrugUtilisation(ingredientConceptId = 1125315)

tableDrugUtilisation(drugUse)
Concept set Ingredient Variable name Estimate name
CDM name
DUS MOCK
161_acetaminophen
overall overall number records N 8
number subjects N 6
ingredient_1125315_descendants overall number exposures missing N (%) 0 (0.00 %)
Mean (SD) 1.12 (0.35)
Median (Q25 - Q75) 1 (1 - 1)
time to exposure missing N (%) 0 (0.00 %)
Mean (SD) 0.00 (0.00)
Median (Q25 - Q75) 0 (0 - 0)
cumulative quantity missing N (%) 0 (0.00 %)
Mean (SD) 55.62 (33.21)
Median (Q25 - Q75) 52.50 (33.75 - 82.50)
initial quantity missing N (%) 0 (0.00 %)
Mean (SD) 53.75 (33.03)
Median (Q25 - Q75) 45.00 (33.75 - 82.50)
initial exposure duration missing N (%) 0 (0.00 %)
Mean (SD) 1,637.38 (2,343.50)
Median (Q25 - Q75) 489 (275 - 1,907)
number eras missing N (%) 0 (0.00 %)
Mean (SD) 1.00 (0.00)
Median (Q25 - Q75) 1 (1 - 1)
days exposed missing N (%) 0 (0.00 %)
Mean (SD) 1,846.88 (2,363.12)
Median (Q25 - Q75) 489 (275 - 3,164)
days prescribed missing N (%) 0 (0.00 %)
Mean (SD) 1,952.12 (2,428.12)
Median (Q25 - Q75) 489 (275 - 3,796)
acetaminophen cumulative dose milligram missing N (%) 0 (0.00 %)
Mean (SD) 408,375.00 (433,248.26)
Median (Q25 - Q75) 320,750.00 (15,750.00 - 792,000.00)
initial daily dose milligram missing N (%) 0 (0.00 %)
Mean (SD) 682.73 (821.49)
Median (Q25 - Q75) 409.25 (175.86 - 807.72)
# }