R/CreateCohortExplorerApp.R
createCohortExplorerApp.Rd
Export person level data from OMOP CDM tables for eligible persons in the cohort. Creates a folder with files that are part of the Cohort Explorer 'shiny' app. This app may then be run to review person level profiles.
createCohortExplorerApp(
connectionDetails = NULL,
connection = NULL,
cohortDatabaseSchema = NULL,
cdmDatabaseSchema,
vocabularyDatabaseSchema = cdmDatabaseSchema,
tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
cohortTable = "cohort",
cohortDefinitionId,
cohortName = NULL,
doNotExportCohortData = FALSE,
sampleSize = 25,
personIds = NULL,
featureCohortDatabaseSchema = NULL,
featureCohortTable = NULL,
featureCohortDefinitionSet = NULL,
exportFolder,
databaseId,
shiftDates = FALSE,
assignNewId = FALSE
)
An object of type connectionDetails
as created using the
createConnectionDetails
function in the
DatabaseConnector package. Can be left NULL if connection
is
provided.
An object of type connection
as created using the
connect
function in the
DatabaseConnector package. Can be left NULL if connectionDetails
is provided, in which case a new connection will be opened at the start
of the function, and closed when the function finishes.
Schema name where your cohort tables reside. Note that for SQL Server, this should include both the database and schema name, for example 'scratch.dbo'.
Schema name where your OMOP CDM tables with person level data reside. Note that for SQL Server, this should include both the database and schema name, for example 'scratch.dbo'.
Schema name where your OMOP vocabulary tables reside. It maybe the cdmDatabaseSchema. Note that for SQL Server, this should include both the database and schema name, for example 'scratch.dbo'.
Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created.
The name of the cohort table.
The cohort id to extract records.
(optional) Cohort Name
(Optional) Do you want to not export cohort data? If set to true, parameters cohortDefinitionId, cohort, cohortDatabaseSchema, cohortName will be ignored. The persons entire observation period would be considered the cohort. Cohort Name will be 'Observation Period', cohort id will be set to 0.
(Optional, default = 20) The number of persons to randomly sample. Ignored, if personId is given.
(Optional) An array of personId's to look for in Cohort table and CDM.
The CohortDatabaseSchema where the feature cohort table exits.
The Cohort table where feature cohorts are instantiated.
The CohortDefinitionSet object corresponding to the cohorts to be used as features.
The folder where the output will be exported to. If this folder does not exist it will be created.
A short string for identifying the database (e.g. 'Synpuf'). This will be displayed in 'shiny' app to toggle between databases. Should not have space or underscore (_).
(Default = FALSE) Do you want to shift dates? This will help further de-identify data. The shift is the process of re calibrating dates such that all persons mi (observation_period_start_date) is 2000-01-01.
(Default = FALSE) Do you want to assign a newId for persons. This will replace the personId in the source with a randomly assigned newId.
if (FALSE) {
connectionDetails <- createConnectionDetails(
dbms = "postgresql",
server = "ohdsi.com",
port = 5432,
user = "me",
password = "secure"
)
createCohortExplorerApp(
connectionDetails = connectionDetails,
cohortDefinitionId = 1234
)
}