diff --git a/DESCRIPTION b/DESCRIPTION index 29b4ae9..53be620 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: Eunomia Type: Package Title: A Standard Dataset in the OMOP Common Data Model -Version: 1.0.1 -Date: 2020-10-21 +Version: 1.0.2 +Date: 2022-03-25 Authors@R: c( person("Frank", "DeFalco", , "fdefalco@ohdsi.org", role = c("aut", "cre")), person("Martijn", "Schuemie", , "schuemie@ohdsi.org", role = c("aut")), @@ -17,9 +17,10 @@ Depends: DatabaseConnector (>= 2.2.0) Imports: SqlRender, - RSQLite (> 2.1.1) + RSQLite (> 2.1.1), + readr Suggests: testthat Encoding: UTF-8 LazyData: true -RoxygenNote: 7.1.1 +RoxygenNote: 7.1.2 diff --git a/NAMESPACE b/NAMESPACE index 144a06c..242b519 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,6 +4,7 @@ export(createCohorts) export(exportToCsv) export(getEunomiaConnectionDetails) import(DatabaseConnector) +importFrom(readr,write_csv) importFrom(utils,read.csv) importFrom(utils,untar) importFrom(utils,unzip) diff --git a/NEWS.md b/NEWS.md index 1fb3f50..b41bed3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +Eunomia 1.0.2 +============= + +Changes +- switch to readr::write_csv for proper concept_id handling +- added gender concepts to concept table + Eunomia 1.0.1 ============= diff --git a/R/Connection.R b/R/Connection.R index 3a5b2a4..3fdc65a 100644 --- a/R/Connection.R +++ b/R/Connection.R @@ -39,7 +39,6 @@ getEunomiaConnectionDetails <- function(databaseFile = tempfile(fileext = ".sqli file <- xzfile(system.file("sqlite", "cdm.tar.xz", package = "Eunomia"), open = "rb") untar(file, exdir = extractFolder) close(file) - # unzip(zipfile = system.file("zip", "cdm.zip", package = "Eunomia"), exdir = extractFolder) file.rename(from = file.path(extractFolder, "cdm.sqlite"), to = databaseFile) details <- DatabaseConnector::createConnectionDetails(dbms = "sqlite", server = databaseFile) return(details) diff --git a/R/Eunomia.R b/R/Eunomia.R index d05ddd6..3fc1d6a 100644 --- a/R/Eunomia.R +++ b/R/Eunomia.R @@ -19,4 +19,5 @@ #' @import DatabaseConnector #' @importFrom utils unzip read.csv write.csv untar +#' @importFrom readr write_csv NULL diff --git a/R/Export.R b/R/Export.R index 1fd777c..df90319 100644 --- a/R/Export.R +++ b/R/Export.R @@ -63,7 +63,7 @@ exportToCsv <- function(outputFolder = file.path(getwd(), "csv"), fileName <- file.path(outputFolder, sprintf("%s.csv", table)) writeLines(sprintf("Saving table %s to file %s", table, fileName)) data <- DatabaseConnector::renderTranslateQuerySql(conn, "SELECT * FROM @table;", table = table) - write.csv(data, fileName, row.names = FALSE, na = "") + write_csv(data, fileName, na = "") return(NULL) } lapply(tables, saveCsv) diff --git a/inst/sqlite/cdm.tar.xz b/inst/sqlite/cdm.tar.xz index 5709b81..37498c4 100644 Binary files a/inst/sqlite/cdm.tar.xz and b/inst/sqlite/cdm.tar.xz differ