addCohortIntersectCount {PatientProfiles}R Documentation

It creates columns to indicate number of occurrences of intersection with a cohort

Description

It creates columns to indicate number of occurrences of intersection with a cohort

Usage

addCohortIntersectCount(
  x,
  cdm = lifecycle::deprecated(),
  targetCohortTable,
  targetCohortId = NULL,
  indexDate = "cohort_start_date",
  censorDate = NULL,
  targetStartDate = "cohort_start_date",
  targetEndDate = "cohort_end_date",
  window = list(c(0, Inf)),
  nameStyle = "{cohort_name}_{window_name}"
)

Arguments

x

Table with individuals in the cdm.

cdm

Object that contains a cdm reference. Use CDMConnector to obtain a cdm reference.

targetCohortTable

name of the cohort that we want to check for overlap.

targetCohortId

vector of cohort definition ids to include.

indexDate

Variable in x that contains the date to compute the intersection.

censorDate

whether to censor overlap events at a specific date or a column date of x.

targetStartDate

date of reference in cohort table, either for start (in overlap) or on its own (for incidence).

targetEndDate

date of reference in cohort table, either for end (overlap) or NULL (if incidence).

window

window to consider events of.

nameStyle

naming of the added column or columns, should include required parameters.

Value

table with added columns with overlap information.

Examples


cdm <- mockPatientProfiles()

cdm$cohort1 %>%
  addCohortIntersectCount(
    targetCohortTable = "cohort2"
  )
CDMConnector::cdmDisconnect(cdm = cdm)



[Package PatientProfiles version 0.8.0 Index]