View source: R/addTableIntersect.R
| addTableIntersectField | R Documentation |
Intersecting the cohort with columns of an OMOP table of user's choice. It will add an extra column to the cohort, indicating the intersected entries with the target columns in a window of the user's choice.
addTableIntersectField(
x,
tableName,
field,
indexDate = "cohort_start_date",
censorDate = NULL,
window = list(c(0, Inf)),
targetDate = startDateColumn(tableName),
inObservation = TRUE,
order = "first",
allowDuplicates = FALSE,
nameStyle = "{table_name}_{field}_{window_name}",
name = NULL,
type = "auto"
)
x |
A table containing individuals in a CDM reference. |
tableName |
Names of one or more OMOP CDM tables to intersect with. |
field |
Name or names of columns in the target tables to add to |
indexDate |
Name of a date column in |
censorDate |
Date or name of a date column in |
window |
Window or windows of time relative to |
targetDate |
Name or names of date columns in the target tables to use for the intersection. |
inObservation |
If |
order |
Which record to use when multiple records occur in a window:
|
allowDuplicates |
Whether to allow multiple records for the same person,
target, and date. If |
nameStyle |
Naming pattern for the added column or columns. It should
include the required formatting variables. If more than one |
name |
Name of the new table. If |
type |
Type of the created column(s). Counts, days, age, and observation
durations can be |
table with added columns with intersect information.
library(PatientProfiles)
cdm <- mockPatientProfiles(source = "duckdb")
cdm$cohort1 |>
addTableIntersectField(
tableName = "visit_occurrence",
field = "visit_concept_id",
order = "last",
window = c(-Inf, -1)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.