addFutureObservationQuery: Query to add the number of days till the end of the...

View source: R/addDemographicsQuery.R

addFutureObservationQueryR Documentation

Query to add the number of days till the end of the observation period at a certain date

Description

Same as addFutureObservation(), except query is not computed to a table.

Usage

addFutureObservationQuery(
  x,
  indexDate = "cohort_start_date",
  futureObservationName = "future_observation",
  futureObservationType = "days"
)

Arguments

x

Table with individuals in the cdm.

indexDate

Variable in x that contains the date to compute the demographics characteristics.

futureObservationName

Future observation variable name.

futureObservationType

Whether to return a "date" or the number of "days".

Value

cohort table with added column containing future observation of the individuals.

Examples


library(PatientProfiles)

cdm <- mockPatientProfiles(source = "duckdb")

cdm$cohort1 |>
  addFutureObservationQuery()



PatientProfiles documentation built on Feb. 24, 2026, 5:10 p.m.