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

A table containing individuals in a CDM reference.

indexDate

Name of a date column in x, or a single date to use for all rows, used as the reference date.

nameObservationPeriodId

Name of the observation-period ID column to add.

name

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

Value

Table with the current observation period id added.

Examples


library(PatientProfiles)

cdm <- mockPatientProfiles(source = "duckdb")

cdm$cohort1 |>
  addObservationPeriodId()




PatientProfiles documentation built on Aug. 22, 2026, 1:07 a.m.