This function executes a large set of SQL statements against the database in OMOP CDM format to extract the data needed to perform the analysis.

getPlpData(databaseDetails, covariateSettings, restrictPlpDataSettings)



The cdm database details created using createDatabaseDetails()


An object of type covariateSettings as created using the createCovariateSettings function in the FeatureExtraction package.


Extra settings to apply to the target population while extracting data. Created using createRestrictPlpDataSettings().


Returns an object of type plpData, containing information on the cohorts, their outcomes, and baseline covariates. Information about multiple outcomes can be captured at once for efficiency reasons. This object is a list with the following components:


A data frame listing the outcomes per person, including the time to event, and the outcome id. Outcomes are not yet filtered based on risk window, since this is done at a later stage.


A data frame listing the persons in each cohort, listing their exposure status as well as the time to the end of the observation period and time to the end of the cohort (usually the end of the exposure era).


An ffdf object listing the baseline covariates per person in the two cohorts. This is done using a sparse representation: covariates with a value of 0 are omitted to save space.


An ffdf object describing the covariates that have been extracted.


A list of objects with information on how the cohortMethodData object was constructed.

The generic () and summary() functions have been implemented for this object.


Based on the arguments, the at risk cohort data is retrieved, as well as outcomes occurring in these subjects. The at risk cohort is identified through user-defined cohorts in a cohort table either inside the CDM instance or in a separate schema. Similarly, outcomes are identified through user-defined cohorts in a cohort table either inside the CDM instance or in a separate schema. Covariates are automatically extracted from the appropriate tables within the CDM. If you wish to exclude concepts from covariates you will need to manually add the concept_ids and descendants to the excludedCovariateConceptIds of the covariateSettings argument.