`r lifecycle::badge("experimental")` Same as `addDemographics()`, except query is not computed to a table.
addDemographicsQuery(
x,
indexDate = "cohort_start_date",
age = TRUE,
ageName = "age",
ageMissingMonth = 1,
ageMissingDay = 1,
ageImposeMonth = FALSE,
ageImposeDay = FALSE,
ageGroup = NULL,
missingAgeGroupValue = "None",
sex = TRUE,
sexName = "sex",
missingSexValue = "None",
priorObservation = TRUE,
priorObservationName = "prior_observation",
priorObservationType = "days",
futureObservation = TRUE,
futureObservationName = "future_observation",
futureObservationType = "days",
dateOfBirth = FALSE,
dateOfBirthName = "date_of_birth"
)
cohort table with the added demographic information columns.
Table with individuals in the cdm.
Variable in x that contains the date to compute the demographics characteristics.
TRUE or FALSE. If TRUE, age will be calculated relative to indexDate.
Age variable name.
Month of the year assigned to individuals with missing month of birth.
day of the month assigned to individuals with missing day of birth.
TRUE or FALSE. Whether the month of the date of birth will be considered as missing for all the individuals.
TRUE or FALSE. Whether the day of the date of birth will be considered as missing for all the individuals.
if not NULL, a list of ageGroup vectors.
Value to include if missing age.
TRUE or FALSE. If TRUE, sex will be identified.
Sex variable name.
Value to include if missing sex.
TRUE or FALSE. If TRUE, days of between the start of the current observation period and the indexDate will be calculated.
Prior observation variable name.
Whether to return a "date" or the number of "days".
TRUE or FALSE. If TRUE, days between the indexDate and the end of the current observation period will be calculated.
Future observation variable name.
Whether to return a "date" or the number of "days".
TRUE or FALSE, if true the date of birth will be return.
dateOfBirth column name.
# \donttest{
library(PatientProfiles)
cdm <- mockPatientProfiles()
cdm$cohort1 |>
addDemographicsQuery()
mockDisconnect(cdm = cdm)
# }
Run the code above in your browser using DataLab