addTableIntersectDays {PatientProfiles}R Documentation

Compute time to intersect with an omop table.

Description

Compute time to intersect with an omop table.

Usage

addTableIntersectDays(
  x,
  tableName,
  indexDate = "cohort_start_date",
  censorDate = NULL,
  window = list(c(0, Inf)),
  targetDate = startDateColumn(tableName),
  order = "first",
  nameStyle = "{table_name}_{window_name}"
)

Arguments

x

Table with individuals in the cdm.

tableName

Name of the table to intersect with. Options: visit_occurrence, condition_occurrence, drug_exposure, procedure_occurrence, device_exposure, measurement, observation, drug_era, condition_era, specimen.

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.

window

window to consider events in.

targetDate

Target date in tableName.

order

which record is considered in case of multiple records (only required for date and days options).

nameStyle

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

Value

table with added columns with intersect information.

Examples


cdm <- mockPatientProfiles()

cdm$cohort1 %>%
  addTableIntersectDays(tableName = "visit_occurrence")

CDMConnector::cdmDisconnect(cdm = cdm)



[Package PatientProfiles version 0.8.0 Index]