View source: R/addConceptEvent.R
| addConceptEventDays | R Documentation |
addConceptEventDays() finds the first or last event from a set of
concepts in each window. When no event is observed before the applicable
boundary, the event is reported as "end_of_observation" if the observation
period boundary is reached or "censor" if the window boundary or
censorDate is reached. The days value represents that boundary.
addConceptEventDays(
x,
conceptSet,
indexDate = "cohort_start_date",
censorDate = NULL,
targetDate = "event_start_date",
order = "first",
window = list(c(0, Inf)),
multipleEvents = NULL,
nameStyle = "{value}_{window_name}",
name = NULL,
type = "numeric"
)
x |
A table containing individuals in a CDM reference. |
conceptSet |
A named list of concept sets. |
indexDate |
Name of a date column in |
censorDate |
Date or name of a date column in |
targetDate |
Name or names of date columns in the target tables to use for the intersection. |
order |
Which record to use when multiple records occur in a window:
|
window |
Window or windows of time relative to |
multipleEvents |
How events occurring on the same date are handled. If
|
nameStyle |
Naming pattern for the added columns. It must contain
|
name |
Name of the new table. If |
type |
Type of the created column(s). Counts, days, age, and observation
durations can be |
x with an event column and a days column of the requested type,
relative to indexDate, for every window.
library(PatientProfiles)
cdm <- mockPatientProfiles(source = "duckdb")
cdm$cohort1 |>
addConceptEventDays(conceptSet = list(acetaminophen = 1125315L))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.