addIndication {DrugUtilisation} | R Documentation |
Add a variable indicating individuals indications
Description
Add a variable to a drug cohort indicating their presence in an indication cohort in a specified time window. If an individual is not in one of the indication cohorts, they will be considered to have an unknown indication if they are present in one of the specified OMOP CDM clinical tables. If they are neither in an indication cohort or a clinical table they will be considered as having no observed indication.
Usage
addIndication(
cohort,
indicationCohortName,
indicationCohortId = NULL,
indicationWindow = list(c(0, 0)),
unknownIndicationTable = NULL,
indexDate = "cohort_start_date",
censorDate = NULL,
mutuallyExclusive = TRUE,
nameStyle = NULL,
name = NULL
)
Arguments
cohort |
A cohort_table object. |
indicationCohortName |
Name of indication cohort table |
indicationCohortId |
target cohort Id to add indication |
indicationWindow |
time window of interests |
unknownIndicationTable |
Tables to search unknown indications |
indexDate |
Name of a column that indicates the date to start the analysis. |
censorDate |
Name of a column that indicates the date to stop the analysis, if NULL end of individuals observation is used. |
mutuallyExclusive |
Whether to consider mutually exclusive categories (one column per window) or not (one column per window and indication). |
nameStyle |
Name style for the indications. By default: 'indication_{window_name}' (mutuallyExclusive = TRUE), 'indication_{window_name}_{cohort_name}' (mutuallyExclusive = FALSE). |
name |
Name of the new computed cohort table, if NULL a temporary table will be created. |
Value
The original table with a variable added that summarises the individual“s indications.
Examples
library(DrugUtilisation)
library(CDMConnector)
library(dplyr)
cdm <- mockDrugUtilisation()
indications <- list("headache" = 378253, "asthma" = 317009)
cdm <- generateConceptCohortSet(
cdm = cdm, conceptSet = indications, name = "indication_cohorts"
)
cdm <- generateIngredientCohortSet(
cdm = cdm, name = "drug_cohort",
ingredient = "acetaminophen"
)
cdm$drug_cohort |>
addIndication(
indicationCohortName = "indication_cohorts",
indicationWindow = list(c(0, 0)),
unknownIndicationTable = "condition_occurrence"
) |>
glimpse()