addInObservation: Indicate if a certain record is within the observation period

View source: R/addDemographics.R

addInObservationR Documentation

Indicate if a certain record is within the observation period

Description

Indicate if a certain record is within the observation period

Usage

addInObservation(
  x,
  indexDate = "cohort_start_date",
  window = c(0, 0),
  completeInterval = FALSE,
  nameStyle = "in_observation",
  name = NULL
)

Arguments

x

Table with individuals in the cdm.

indexDate

Variable in x that contains the date to compute the observation flag.

window

window to consider events of.

completeInterval

If the individuals are in observation for the full window.

nameStyle

Name of the new columns to create, it must contain "window_name" if multiple windows are provided.

name

Name of the new table, if NULL a temporary table is returned.

Value

cohort table with the added binary column assessing inObservation.

Examples


cdm <- mockPatientProfiles()
cdm$cohort1 %>%
  addInObservation()
mockDisconnect(cdm = cdm)



PatientProfiles documentation built on Oct. 30, 2024, 9:13 a.m.