Skip to content

Commit

Permalink
updates and fixes
Browse files Browse the repository at this point in the history
switched to readr for csv writing fixes #13
added gender concepts to concept table fixes #21 fixes #19
  • Loading branch information
fdefalco committed Mar 25, 2022
1 parent b1c2070 commit e330860
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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")),
Expand All @@ -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
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
=============

Expand Down
1 change: 0 additions & 1 deletion R/Connection.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions R/Eunomia.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@

#' @import DatabaseConnector
#' @importFrom utils unzip read.csv write.csv untar
#' @importFrom readr write_csv
NULL
2 changes: 1 addition & 1 deletion R/Export.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Binary file modified inst/sqlite/cdm.tar.xz
Binary file not shown.

0 comments on commit e330860

Please sign in to comment.