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",
  type = "numeric"
)

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.

futureObservationName

Name of the future-observation column to add.

futureObservationType

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

type

Type of the created column(s). Counts, days, age, and observation durations can be "numeric" or "integer". Flag columns can also be "logical". Field columns can use "auto" to preserve the source type, or can be converted to "numeric", "integer", "logical", or "character".

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 Aug. 22, 2026, 1:07 a.m.