Skip to contents

Get the gapEra used to create a cohort

Usage

cohortGapEra(cohort, cohortId = NULL)

Arguments

cohort

A cohort_table object.

cohortId

Integer vector refering to cohortIds from cohort. If NULL all cohort definition ids in settings will be used.

Value

gapEra values for the specific cohortIds

Examples

# \donttest{
library(CDMConnector)
library(DrugUtilisation)
library(dplyr)

cdm <- mockDrugUtilisation()

druglist <- CodelistGenerator::getDrugIngredientCodes(
  cdm, c("acetaminophen", "metformin")
)

cdm <- generateDrugUtilisationCohortSet(
  cdm = cdm,
  name = "drug_cohorts",
  conceptSet = druglist,
  gapEra = 100
)
#>  Subsetting drug_exposure table
#>  Checking whether any record needs to be dropped.
#>  Collapsing overlaping records.
#>  Collapsing records with gapEra = 100 days.

cohortGapEra(cdm$drug_cohorts)
#> [1] 100 100
# }