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")
)

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).

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
overall overall number subjects N 6
ingredient_1125315_descendants overall number exposures missing N (%) 0 (0.0 %)
ingredient_1125315_descendants overall number exposures Mean (SD) 1.12 (0.35)
ingredient_1125315_descendants overall number exposures Median (Q25 - Q75) 1 (1 - 1)
ingredient_1125315_descendants overall time to exposure missing N (%) 0 (0.0 %)
ingredient_1125315_descendants overall time to exposure Mean (SD) 0.00 (0.00)
ingredient_1125315_descendants overall time to exposure Median (Q25 - Q75) 0 (0 - 0)
ingredient_1125315_descendants overall cumulative quantity missing N (%) 0 (0.0 %)
ingredient_1125315_descendants overall cumulative quantity Mean (SD) 55.62 (33.21)
ingredient_1125315_descendants overall cumulative quantity Median (Q25 - Q75) 52.50 (33.75 - 82.50)
ingredient_1125315_descendants overall initial quantity missing N (%) 0 (0.0 %)
ingredient_1125315_descendants overall initial quantity Mean (SD) 53.75 (33.03)
ingredient_1125315_descendants overall initial quantity Median (Q25 - Q75) 45.00 (33.75 - 82.50)
ingredient_1125315_descendants overall initial exposure duration missing N (%) 0 (0.0 %)
ingredient_1125315_descendants overall initial exposure duration Mean (SD) 1,637.38 (2,343.50)
ingredient_1125315_descendants overall initial exposure duration Median (Q25 - Q75) 489 (275 - 1,907)
ingredient_1125315_descendants overall number eras missing N (%) 0 (0.0 %)
ingredient_1125315_descendants overall number eras Mean (SD) 1.00 (0.00)
ingredient_1125315_descendants overall number eras Median (Q25 - Q75) 1 (1 - 1)
ingredient_1125315_descendants overall days exposed missing N (%) 0 (0.0 %)
ingredient_1125315_descendants overall days exposed Mean (SD) 1,846.88 (2,363.12)
ingredient_1125315_descendants overall days exposed Median (Q25 - Q75) 489 (275 - 3,164)
ingredient_1125315_descendants overall days prescribed missing N (%) 0 (0.0 %)
ingredient_1125315_descendants overall days prescribed Mean (SD) 1,952.12 (2,428.12)
ingredient_1125315_descendants overall days prescribed Median (Q25 - Q75) 489 (275 - 3,796)
ingredient_1125315_descendants acetaminophen cumulative dose milligram missing N (%) 0 (0.0 %)
ingredient_1125315_descendants acetaminophen cumulative dose milligram Mean (SD) 408,375.00 (433,248.26)
ingredient_1125315_descendants acetaminophen cumulative dose milligram Median (Q25 - Q75) 320,750.00 (15,750.00 - 792,000.00)
ingredient_1125315_descendants acetaminophen initial daily dose milligram missing N (%) 0 (0.0 %)
ingredient_1125315_descendants acetaminophen initial daily dose milligram Mean (SD) 682.73 (821.49)
ingredient_1125315_descendants acetaminophen initial daily dose milligram Median (Q25 - Q75) 409.25 (175.86 - 807.72)
# }