Skip to contents

Build base cohorts

conceptCohort()
Create cohorts based on a concept set
demographicsCohort()
Create cohorts based on patient demographics
measurementCohort()
Create cohorts measurement based cohorts
requireInDateRange()
Require that an index date is within a date range
requireIsEntry()
Restrict cohort to specific entry
requireIsFirstEntry()
Restrict cohort to first entry
requireIsLastEntry()
Restrict cohort to last entry per person
requireMinCohortCount()
Filter cohorts to keep only records for those with a minimum amount of subjects

Impose singular demographic requirements on existing cohorts

requireAge()
Restrict cohort on age
requireFutureObservation()
Restrict cohort on future observation
requirePriorObservation()
Restrict cohort on prior observation
requireSex()
Restrict cohort on sex

Impose multiple demographic requirements on existing cohorts

requireDemographics()
Restrict cohort on patient demographics

Impose requirements of presence or absence in other cohorts, concept sets, or table

requireCohortIntersect()
Require cohort subjects are present (or absence) in another cohort
requireConceptIntersect()
Require cohort subjects to have (or not have) events of a concept list
requireTableIntersect()
Require cohort subjects are present in another clinical table

Impose presence or absence of a death record within a time window

requireDeathFlag()
Require cohort subjects have (or do not have) a death record

Update cohort start and end dates

entryAtFirstDate()
Update cohort start date to be the first date from of a set of column dates
entryAtLastDate()
Set cohort start date to the last of a set of column dates
exitAtDeath()
Set cohort end date to death date
exitAtFirstDate()
Set cohort end date to the first of a set of column dates
exitAtLastDate()
Set cohort end date to the last of a set of column dates
exitAtObservationEnd()
Set cohort end date to end of observation
padCohortStart()
Add days to cohort start
trimDemographics()
Restrict cohort on patient demographics
trimToDateRange()
Trim cohort dates to be within a date range

Concatanate cohort entries

collapseCohorts()
Collapse cohort entries using a certain gap to concatenate records.

Filter cohorts

sampleCohorts()
Sample a cohort table for a given number of individuals.
subsetCohorts()
Generate a cohort table keeping a subset of cohorts.

Split cohorts

stratifyCohorts()
Create a new cohort table from stratifying an existing one
yearCohorts()
Generate a new cohort table restricting cohort entries to certain years

Combine cohorts

intersectCohorts()
Generate a combination cohort set between the intersection of different cohorts.
unionCohorts()
Generate cohort from the union of different cohorts

Match cohorts

matchCohorts()
Generate a new cohort matched cohort

Mock data

mockCohortConstructor()
Function to create a mock cdm reference for CohortConstructor