Learn R Programming

DrugUtilisation (version 0.8.3)

addDrugRestart: Summarise the drug restart per window.

Description

[Experimental]

Usage

addDrugRestart(
  cohort,
  switchCohortTable,
  switchCohortId = NULL,
  followUpDays = Inf,
  censorDate = NULL,
  incident = TRUE,
  nameStyle = "drug_restart_{follow_up_days}"
)

Value

A summarised_result object with the percentages of restart, switch and not exposed per window.

Arguments

cohort

A cohort_table object.

switchCohortTable

A cohort table in the cdm that contains possible alternative treatments.

switchCohortId

The cohort ids to be used from switchCohortTable. If NULL all cohort definition ids are used.

followUpDays

A vector of number of days to follow up. It can be multiple values.

censorDate

Name of a column that indicates the date to stop the analysis, if NULL end of individuals observation is used.

incident

Whether the switch treatment has to be incident (start after discontinuation) or not (it can start before the discontinuation and last till after).

nameStyle

Character string to specify the nameStyle of the new columns.

Examples

Run this code
# \donttest{
library(DrugUtilisation)

cdm <- mockDrugUtilisation()

conceptlist <- list("a" = 1125360, "b" = c(1503297, 1503327))
cdm <- generateDrugUtilisationCohortSet(
  cdm = cdm,
  name = "switch_cohort",
  conceptSet = conceptlist
)

cdm$cohort1 |>
  addDrugRestart(switchCohortTable = "switch_cohort")

CDMConnector::cdmDisconnect(cdm = cdm)
# }

Run the code above in your browser using DataLab