Skip to contents

Format a drug_restart object into a visual table.

Usage

tableDrugRestart(
  result,
  header = c("cdm_name", "cohort_name"),
  groupColumn = "variable_name",
  type = "gt",
  hide = c("censor_date", "restrict_to_first_discontinuation", "follow_up_days",
    "cohort_table_name", "incident", "switch_cohort_table")
)

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 summariseDrugRestart() results.

Examples

# \donttest{
cdm <- mockDrugUtilisation()

conceptlist <- list("a" = 1125360, "b" = c(1503297, 1503327))
cdm <- generateDrugUtilisationCohortSet(
  cdm = cdm,
  name = "switch_cohort",
  conceptSet = conceptlist
)
#>  Subsetting drug_exposure table
#>  Checking whether any record needs to be dropped.
#>  Collapsing overlaping records.
#>  Collapsing records with gapEra = 1 days.

result <- cdm$cohort1 |>
  summariseDrugRestart(switchCohortTable = "switch_cohort")

tableDrugRestart(result)
cdm_name
DUS MOCK
Treatment estimate_name
cohort_name
cohort_1 cohort_2 cohort_3
Drug restart till end of observation
restart N (%) 0 (0.0 %) 0 (0.0 %) 0 (0.0 %)
switch N (%) 0 (0.0 %) 0 (0.0 %) 0 (0.0 %)
restart and switch N (%) 0 (0.0 %) 0 (0.0 %) 0 (0.0 %)
untreated N (%) 3 (100.0 %) 3 (100.0 %) 4 (100.0 %)
# }