EHDEN / CdmInspection

R Package to support quality control inspection of an OMOP-CDM instance
Apache License 2.0
11 stars 16 forks source link

Error: `x` must be a string of length 1 #59

Closed filipmaljkovic closed 3 years ago

filipmaljkovic commented 3 years ago

When trying to generate the results document within the Inspection report, I get the following error: Error: `x` must be a string of length 1 This happens both client-side and server-side.

Since I can't attach R and RDS files, here is the inspection_report.R inline:


fftempdir <- if (Sys.getenv("FFTEMP_DIR") == "") "~/fftemp" else Sys.getenv("FFTEMP_DIR")
options(fftempdir = fftempdir)

cdmDatabaseSchema <- "cdm"
resultsDatabaseSchema <- "results"
vocabDatabaseSchema <- cdmDatabaseSchema
oracleTempSchema <- NULL
runVocabularyChecks <- TRUE
runDataTablesChecks <- TRUE
runPerformanceChecks <- TRUE
runWebAPIChecks <- TRUE
sqlOnly <- FALSE
verboseMode <- TRUE
smallCellCount <- 5
baseUrl <- "http://localhost:8080/WebAPI"
outputFolder <- "/root/filip/sandbox/kcs"
outputFolderCdmI <- paste0(outputFolder, "/cdmi")
authors <- "Filip Maljkovic"
databaseId <- "HELIANT"
databaseName <- "Heliant Health"
databaseDescription <- "Heliant Health is a Health information system (HIS), with capabilities of EHR (electronic health record) and follows many hospital business processes, from patient care, financial information, to drug and material maintenance."

library(CdmInspection)

results <- CdmInspection::cdmInspection(connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, resultsDatabaseSchema = resultsDatabaseSchema, vocabDatabaseSchema = vocabDatabaseSchema, oracleTempSchema = oracleTempSchema, databaseName = databaseName, runVocabularyChecks = TRUE, runDataTablesChecks = TRUE, runPerformanceChecks = TRUE, runWebAPIChecks = TRUE, smallCellCount = smallCellCount, baseUrl = baseUrl, sqlOnly = FALSE, outputFolder = outputFolderCdmI, verboseMode = verboseMode)

CdmInspection::generateResultsDocument(results = results, outputFolder = outputFolderCdmI, authors = authors, databaseDescription = databaseDescription, databaseName = databaseName, databaseId = databaseId, smallCellCount = smallCellCount)
PRijnbeek commented 3 years ago

See the message in teams @filipmaljkovic

filipmaljkovic commented 3 years ago

The problem was in the fact that the vocabulary table was loaded twice, so the row with ID "None" was in the table two times, which caused the error in question. The problem was solved by truncating the vocabulary table and reloading the CSV file generated by Athena.