addObservationPeriodId: Add the ordinal number of the observation period associated...

View source: R/addObservationPeriodId.R

addObservationPeriodIdR Documentation

Add the ordinal number of the observation period associated that a given date is in.

Description

Add the ordinal number of the observation period associated that a given date is in.

Usage

addObservationPeriodId(
  x,
  indexDate = "cohort_start_date",
  nameObservationPeriodId = "observation_period_id",
  name = NULL
)

Arguments

x

Table with individuals in the cdm.

indexDate

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

nameObservationPeriodId

Name of the new colum.

name

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

Value

Table with the current observation period id added.

Examples


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



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