Skip to contents

[Experimental]

Usage

tableTreatment(
  result,
  header = c("cdm_name", "cohort_name"),
  groupColumn = "variable_name",
  type = "gt",
  hide = c("window_name", "mutually_exclusive")
)

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

Examples

# \donttest{
library(DrugUtilisation)

cdm <- mockDrugUtilisation()

result <- cdm$cohort1 |>
  summariseTreatment(
    treatmentCohortName = "cohort2",
    window = list(c(0, 30), c(31, 365))
  )
#>  Intersect with medications table (cohort2)
#>  Summarising medications.

tableTreatment(result)
cdm_name
DUS MOCK
censor_date cohort_table_name index_date treatment_cohort_name Treatment estimate_name
cohort_name
cohort_1 cohort_2 cohort_3
Medication from index date to 30 days after
NA cohort1 cohort_start_date cohort2 cohort_1 N (%) 0 (0.0 %) 0 (0.0 %) 1 (33.3 %)
NA cohort1 cohort_start_date cohort2 cohort_2 N (%) 0 (0.0 %) 1 (16.7 %) 1 (33.3 %)
NA cohort1 cohort_start_date cohort2 cohort_3 N (%) 0 (0.0 %) 1 (16.7 %) 0 (0.0 %)
NA cohort1 cohort_start_date cohort2 untreated N (%) 1 (100.0 %) 4 (66.7 %) 1 (33.3 %)
NA cohort1 cohort_start_date cohort2 not in observation N (%) 0 (0.0 %) 0 (0.0 %) 0 (0.0 %)
Medication from 31 days after to 365 days after the index date
NA cohort1 cohort_start_date cohort2 cohort_1 N (%) 0 (0.0 %) 1 (16.7 %) 1 (33.3 %)
NA cohort1 cohort_start_date cohort2 cohort_2 N (%) 0 (0.0 %) 1 (16.7 %) 1 (33.3 %)
NA cohort1 cohort_start_date cohort2 cohort_3 N (%) 0 (0.0 %) 0 (0.0 %) 0 (0.0 %)
NA cohort1 cohort_start_date cohort2 untreated N (%) 1 (100.0 %) 3 (50.0 %) 1 (33.3 %)
NA cohort1 cohort_start_date cohort2 not in observation N (%) 0 (0.0 %) 1 (16.7 %) 0 (0.0 %)
# }