Skip to contents

[Experimental]

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

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{
library(DrugUtilisation)

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
cohort_table_name incident switch_cohort_table Treatment estimate_name
cohort_name
cohort_1 cohort_2 cohort_3
Drug restart till end of observation
cohort1 TRUE switch_cohort restart N (%) 0 (0.0 %) 0 (0.0 %) 0 (0.0 %)
cohort1 TRUE switch_cohort switch N (%) 1 (25.0 %) 0 (0.0 %) 0 (0.0 %)
cohort1 TRUE switch_cohort restart and switch N (%) 0 (0.0 %) 0 (0.0 %) 0 (0.0 %)
cohort1 TRUE switch_cohort untreated N (%) 3 (75.0 %) 2 (100.0 %) 4 (100.0 %)
CDMConnector::cdmDisconnect(cdm = cdm) # }