OHDSI / CohortDiagnostics

An R package for performing various cohort diagnostics.
https://ohdsi.github.io/CohortDiagnostics
40 stars 45 forks source link

Add warning if no results found by `createMergedResultsFile` #1045

Open MaximMoinat opened 1 year ago

MaximMoinat commented 1 year ago

Description

If there is no results zip in the given dataFolder when running createMergedResultsFile, it will show that it connects to a database and then exits (see screenshot). This does create a .sqlite file with all necessary results tables, but no records are loaded. Then, when running the Shiny app, I just get the error 'Object databases not found'. This is especially confusing when the result csv's are in the given folder, but for some reason there is no zip of the results.

image

(Using version 3.1.0)

Suggested fix

Display a warning "No result zip files found", on line 197 here: https://github.com/OHDSI/CohortDiagnostics/blob/0e3764fd7a223838315d9ef2d9cd6cb7f5772870/R/Shiny.R#L197-L212

azimov commented 1 year ago

Agreed - but i think stopping/throwing an error is better as it will avoid leaving an empty database file in the folder