Hello,
I’ve been using the PatientLevelPrediction through working with the “Building patient-level predictive models” vignette listed on the repository’s README.md but I am running into some errors on step 3.3 of the vignette where the package attempts to extract PLP data form the server by calling getDbPlpData in R. The error appears to come from the package, not SQL.
To me it seems that I may be misunderstanding the construction of outcome data, as well as how it pertains to use of the VISIT_OCCURRENCE table. Some tweaks that had to be done was that we opted to not use an “oracleTempSchema” argument for the getDbPlpData function. Also, when populating our VISIT_OCCURRENCE table, all patients were given the visit_concept_id of 42898160 for “Long Term Care Visit”. Furthermore, instead of creating the “rehospitalization” table as seen in the vignette example, we opted to instead try building a model using two distinct cohorts for both the cohortTable argument and the outcomeTable argument.
Below is my input for the getDbPlpData function, as well as the covariates settings applied through the createCovariateSettings function.
covariateSettings <- createCovariateSettings(useCovariateDemographics = TRUE,
useCovariateConditionOccurrence = TRUE,
useCovariateConditionOccurrence365d = FALSE,
useCovariateConditionOccurrence30d = TRUE,
useCovariateConditionOccurrenceInpt180d = FALSE,
useCovariateConditionEra = TRUE,
useCovariateConditionEraEver = TRUE,
useCovariateConditionEraOverlap = TRUE,
useCovariateConditionGroup = TRUE,
useCovariateDrugExposure = TRUE,
useCovariateDrugExposure365d = FALSE,
useCovariateDrugExposure30d = TRUE,
useCovariateDrugEra = TRUE,
useCovariateDrugEra365d = FALSE,
useCovariateDrugEra30d = TRUE,
useCovariateDrugEraOverlap = TRUE,
useCovariateDrugEraEver = TRUE,
useCovariateDrugGroup = TRUE,
useCovariateProcedureOccurrence = TRUE,
useCovariateProcedureOccurrence365d = FALSE,
useCovariateProcedureOccurrence30d = TRUE,
useCovariateProcedureGroup = TRUE,
useCovariateObservation = TRUE,
useCovariateObservation365d = FALSE,
useCovariateObservation30d = TRUE,
useCovariateObservationCount365d = FALSE,
useCovariateMeasurement = FALSE,
useCovariateMeasurement365d = FALSE,
useCovariateMeasurement30d = FALSE,
useCovariateMeasurementCount365d = FALSE,
useCovariateMeasurementBelow = FALSE,
useCovariateMeasurementAbove = FALSE,
useCovariateConceptCounts = TRUE,
useCovariateRiskScores = TRUE,
useCovariateRiskScoresCharlson = TRUE,
useCovariateRiskScoresDCSI = TRUE,
useCovariateRiskScoresCHADS2 = TRUE,
useCovariateRiskScoresCHADS2VASc = TRUE,
useCovariateInteractionYear = FALSE,
useCovariateInteractionMonth = FALSE,
excludedCovariateConceptIds = c(),
deleteCovariatesSmallCount = 100)
plpData <- getDbPlpData(connectionDetails = connectionDetails,
cdmDatabaseSchema = cdmDatabaseSchema,
cohortDatabaseSchema = cohortsDatabaseSchema,
cohortTable = "cohort",
cohortIds = 246866, # Validated Observations cohort
washoutWindow = 183,
useCohortEndDate = TRUE,
windowPersistence = 0,
covariateSettings = covariateSettings,
outcomeDatabaseSchema = cohortsDatabaseSchema,
outcomeTable = "cohort",
outcomeIds = 246865, # Fall Prediction cohort
firstOutcomeOnly = FALSE,
cdmVersion = cdmVersion)
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 3.2
year 2016
month 10
day 31
svn rev 71607
language R
version.string R version 3.3.2 (2016-10-31)
nickname Sincere Pumpkin Patch
When running through R, the following output is given through the PatientLevelPrediction package, ultimately providing the warning / error messages of no PLP data being returned:
Constructing cohorts of interest
|=====================================================================================================================================| 100%
Executing SQL took 0.417 secs
Fetching data from server
Loading took 0.124 secs
Constructing outcomes
|=====================================================================================================================================| 100%
Executing SQL took 0.0755 secs
Fetching data from server
Loading took 0.273 secs
Constructing default covariates
|=====================================================================================================================================| 100%
Executing SQL took 10.9 secs
Done
Fetching data from server
Loading took 0.237 secs
Removing redundant covariates
Removing redundant covariates took 0 secs
Normalizing covariates
Warning messages:
1: In lowLevelQuerySql.ffdf(connection, sql) :
Data has zero rows, returning an empty data frame
2: In lowLevelQuerySql.ffdf(connection, sql) :
Data has zero rows, returning an empty data frame
3: In getDbPlpData(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, :
No outcome data found
4: In lowLevelQuerySql.ffdf(connection, sql) :
Data has zero rows, returning an empty data frame
5: In PatientLevelPrediction::getDbCovariateData(connection = conn, :
No data found
Overall, I am stuck on how to address the 5 warning messages that come up saying there is no data found for PLP data. Any help or feedback would be greatly appreciated, and I would be happy to address any additional questions on how I have set up the tables, R functions, etc.
Thank you!
-Eric