View source: R/addConceptIntersect.R
| addConceptIntersectDays | R Documentation |
It creates column to indicate the days of difference from an index date to a concept
addConceptIntersectDays(
x,
conceptSet,
indexDate = "cohort_start_date",
censorDate = NULL,
window = list(c(0, Inf)),
targetDate = "event_start_date",
order = "first",
inObservation = TRUE,
nameStyle = "{concept_name}_{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 |
window |
Window or windows of time relative to |
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:
|
inObservation |
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 overlap information
library(PatientProfiles)
library(omopgenerics, warn.conflicts = TRUE)
library(dplyr, warn.conflicts = TRUE)
cdm <- mockPatientProfiles(source = "duckdb")
concept <- tibble(
concept_id = c(1125315),
domain_id = "Drug",
vocabulary_id = NA_character_,
concept_class_id = "Ingredient",
standard_concept = "S",
concept_code = NA_character_,
valid_start_date = as.Date("1900-01-01"),
valid_end_date = as.Date("2099-01-01"),
invalid_reason = NA_character_
) |>
mutate(concept_name = paste0("concept: ", .data$concept_id))
cdm <- insertTable(cdm, "concept", concept)
cdm$cohort1 |>
addConceptIntersectDays(conceptSet = list("acetaminophen" = 1125315))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.