Skip to contents

Importing data for study

This section provides a detailed explanation of how to use getDataForStudy function. For a general overview, refer to the Getting Started section. Regarding data sources, there are three options: providing existing data, running a saved study, or using the CDM as a data source.

getDataForStudy(cdm = cdm, studyEnv = studyEnv)

If the user opts out of using the previous configuration, the necessary inputs must be provided manually. Below is a sample with default values:

getDataForStudy(
  runSavedStudy = studyEnv$runSavedStudy,
  useCDM = studyEnv$useCDM,
  trajectoryDataObject = NULL,
  cdm = NULL,
  studyEnv = NULL,
  atlasStateCohorts = studyEnv$atlasStateCohorts,
  atlasTargetCohort = studyEnv$atlasTargetCohort,
  stateCohortLabels = studyEnv$stateCohortLabels,
  baseUrl = studyEnv$baseUrl,
  outOfCohortAllowed = studyEnv$outOfCohortAllowed,
  stateCohortMandatory = studyEnv$stateCohortMandatory,
  stateCohortPriorityOrder = studyEnv$stateCohortPriorityOrder,
  mergeStates = studyEnv$mergeStates,
  mergeThreshold = studyEnv$mergeThreshold,
  pathToData = NULL
)


Use CDM

To use the CDM as a data source, set the useCDM variable to TRUE. The cohorts specified in atlasStateCohorts and atlasTargetCohort will be used. It is recommended to set trajectoryDataObject, pathToData, and runSavedStudy to NULL.

getDataForStudy(
  runSavedStudy = NULL,
  useCDM = studyEnv$useCDM,
  trajectoryDataObject = NULL,
  cdm = NULL,
  studyEnv = NULL,
  atlasStateCohorts = studyEnv$atlasStateCohorts,
  atlasTargetCohort = studyEnv$atlasTargetCohort,
  stateCohortLabels = studyEnv$stateCohortLabels,
  baseUrl = studyEnv$baseUrl,
  outOfCohortAllowed = studyEnv$outOfCohortAllowed,
  stateCohortMandatory = studyEnv$stateCohortMandatory,
  stateCohortPriorityOrder = studyEnv$stateCohortPriorityOrder,
  mergeStates = studyEnv$mergeStates,
  mergeThreshold = studyEnv$mergeThreshold,
  pathToData = NULL
)


Without atlas support

To use the CDM without ATLAS support, ensure the required JSON files are located under studyName/JSON. In this case, set the baseUrl variable to NULL.

getDataForStudy(
  runSavedStudy = NULL,
  useCDM = studyEnv$useCDM,
  trajectoryDataObject = NULL,
  cdm = NULL,
  studyEnv = NULL,
  atlasStateCohorts = studyEnv$atlasStateCohorts,
  atlasTargetCohort = studyEnv$atlasTargetCohort,
  stateCohortLabels = studyEnv$stateCohortLabels,
  baseUrl = NULL,
  outOfCohortAllowed = studyEnv$outOfCohortAllowed,
  stateCohortMandatory = studyEnv$stateCohortMandatory,
  stateCohortPriorityOrder = studyEnv$stateCohortPriorityOrder,
  mergeStates = studyEnv$mergeStates,
  mergeThreshold = studyEnv$mergeThreshold,
  pathToData = NULL
)


Run saved study

If a saved study configuration is used, the previously set options are overridden by the saved settings. It is recommended to set trajectoryDataObject, pathToData, and useCDM to NULL.

getDataForStudy(
  runSavedStudy = studyEnv$runSavedStudy,
  useCDM = NULL,
  trajectoryDataObject = NULL,
  cdm = NULL,
  studyEnv = NULL,
  atlasStateCohorts = studyEnv$atlasStateCohorts,
  atlasTargetCohort = studyEnv$atlasTargetCohort,
  stateCohortLabels = studyEnv$stateCohortLabels,
  baseUrl = studyEnv$baseUrl,
  outOfCohortAllowed = studyEnv$outOfCohortAllowed,
  stateCohortMandatory = studyEnv$stateCohortMandatory,
  stateCohortPriorityOrder = studyEnv$stateCohortPriorityOrder,
  mergeStates = studyEnv$mergeStates,
  mergeThreshold = studyEnv$mergeThreshold,
  pathToData = NULL
)


Add data object or path to data

To add data manually, provide either the trajectoryDataObject or the pathToData as input. It is suggested to set both useCDM and runSavedStudy to NULL.

For appending personal data to existing datasets, refer to the create trajectories section.