From 29dc6dd608f4af15d8298fb3aac1bac81275cfba Mon Sep 17 00:00:00 2001 From: Adam Black Date: Wed, 18 Sep 2024 10:20:19 +0200 Subject: [PATCH] add workaround for gibleed condition_occurrence csv column ordering --- R/EunomiaData.R | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/R/EunomiaData.R b/R/EunomiaData.R index d6d5fb6..cb8c1eb 100644 --- a/R/EunomiaData.R +++ b/R/EunomiaData.R @@ -218,8 +218,10 @@ loadDataFiles <- function(dataPath, message(dataFileMessage, appendLF = TRUE) } + # The GiBleed condition occurrence csv file has a column ordering that does + # not match the spec so for now we ignore types in this file if (inputFormat == "csv") { - if (tableName %in% unique(spec$cdmTableName)) { + if (tableName %in% unique(spec$cdmTableName) && tableName != "condition_occurrence") { # in the GiBleed dataset there is a cohort_attribute table which is not in the cdm spec csv file # In the cases of tables not in the cdm spec we will use readr's guess for the R datatype colTypes <- paste(spec[spec$cdmTableName == tableName,]$readrTypes, collapse = "") @@ -259,10 +261,10 @@ loadDataFiles <- function(dataPath, } if (verbose) { - message("saving table: ",tableName," (rows: ", nrow(tableData), ")",appendLF = TRUE) + message("saving table: ", tableName," (rows: ", nrow(tableData), ")", appendLF = TRUE) } - DBI::dbWriteTable(conn = connection, name = tableName, value = tableData, append=TRUE) + DBI::dbWriteTable(conn = connection, name = tableName, value = tableData, append = TRUE) } }