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

View source: R/addObservationPeriodId.R

addObservationPeriodIdQueryR Documentation

Add the ordinal number of the observation period associated that a given date is in. Result is not computed, only query is added.

Description

Add the ordinal number of the observation period associated that a given date is in. Result is not computed, only query is added.

Usage

addObservationPeriodIdQuery(
  x,
  indexDate = "cohort_start_date",
  nameObservationPeriodId = "observation_period_id"
)

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 column.

Value

Table with the current observation period id added.

Examples


library(PatientProfiles)

cdm <- mockPatientProfiles(source = "duckdb")

cdm$cohort1 |>
  addObservationPeriodIdQuery()




PatientProfiles documentation built on Nov. 5, 2025, 7:05 p.m.