getPlpData | R Documentation |
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 = NULL)
databaseDetails |
The cdm database details created using |
covariateSettings |
An object of type |
restrictPlpDataSettings |
Extra settings to apply to the target population while extracting data.
Created using |
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.
'r plpDataObjectDoc()'
# use Eunomia database
connectionDetails <- Eunomia::getEunomiaConnectionDetails()
Eunomia::createCohorts(connectionDetails)
outcomeId <- 3 # GIbleed
databaseDetails <- createDatabaseDetails(
connectionDetails = connectionDetails,
cdmDatabaseSchema = "main",
cdmDatabaseName = "main",
cohortDatabaseSchema = "main",
cohortTable = "cohort",
outcomeDatabaseSchema = "main",
outcomeTable = "cohort",
targetId = 1,
outcomeIds = outcomeId,
cdmVersion = 5
)
covariateSettings <- FeatureExtraction::createCovariateSettings(
useDemographicsAge = TRUE,
useDemographicsGender = TRUE,
useConditionOccurrenceAnyTimePrior = TRUE
)
plpData <- getPlpData(
databaseDetails = databaseDetails,
covariateSettings = covariateSettings,
restrictPlpDataSettings = createRestrictPlpDataSettings()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.