Skip to content

Commit

Permalink
Release v0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonysena authored Jul 14, 2024
2 parents e3efad6 + e5b6a91 commit dc3bde3
Show file tree
Hide file tree
Showing 125 changed files with 4,525 additions and 581 deletions.
6 changes: 6 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
^\.Rproj\.user$
^\.idea$
^\.github$
_pkgdown\.yml
compare_versions
deploy.sh
docs
extras
man-roxygen
29 changes: 22 additions & 7 deletions .github/workflows/R_CMD_check_Hades.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: '4.2.3', rtools: '42', rspm: "https://cloud.r-project.org"}
- {os: macOS-latest, r: '4.2.3', rtools: '42', rspm: "https://cloud.r-project.org"}
- {os: ubuntu-20.04, r: '4.2.3', rtools: '42', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: windows-latest, r: 'release', rtools: '', rspm: "https://cloud.r-project.org"}
- {os: macOS-latest, r: 'release', rtools: '', rspm: "https://cloud.r-project.org"}
- {os: ubuntu-20.04, r: 'release', rtools: '', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
Expand Down Expand Up @@ -50,9 +47,23 @@ jobs:
CDM5_REDSHIFT_PASSWORD: ${{ secrets.CDM5_REDSHIFT_PASSWORD }}
CDM5_REDSHIFT_SERVER: ${{ secrets.CDM5_REDSHIFT_SERVER }}
CDM5_REDSHIFT_USER: ${{ secrets.CDM5_REDSHIFT_USER }}
CDM_SNOWFLAKE_CDM53_SCHEMA: ${{ secrets.CDM_SNOWFLAKE_CDM53_SCHEMA }}
CDM_SNOWFLAKE_OHDSI_SCHEMA: ${{ secrets.CDM_SNOWFLAKE_OHDSI_SCHEMA }}
CDM_SNOWFLAKE_PASSWORD: ${{ secrets.CDM_SNOWFLAKE_PASSWORD }}
CDM_SNOWFLAKE_CONNECTION_STRING: ${{ secrets.CDM_SNOWFLAKE_CONNECTION_STRING }}
CDM_SNOWFLAKE_USER: ${{ secrets.CDM_SNOWFLAKE_USER }}
CDM5_SPARK_USER: ${{ secrets.CDM5_SPARK_USER }}
CDM5_SPARK_PASSWORD: ${{ secrets.CDM5_SPARK_PASSWORD }}
CDM5_SPARK_CONNECTION_STRING: ${{ secrets.CDM5_SPARK_CONNECTION_STRING }}
CDM5_SPARK_CDM_SCHEMA: ${{ secrets.CDM5_SPARK_CDM_SCHEMA }}
CDM5_SPARK_OHDSI_SCHEMA: ${{ secrets.CDM5_SPARK_OHDSI_SCHEMA }}
CDM_BIG_QUERY_CONNECTION_STRING: ${{ secrets.CDM_BIG_QUERY_CONNECTION_STRING }}
CDM_BIG_QUERY_KEY_FILE: ${{ secrets.CDM_BIG_QUERY_KEY_FILE }}
CDM_BIG_QUERY_CDM_SCHEMA: ${{ secrets.CDM_BIG_QUERY_CDM_SCHEMA }}
CDM_BIG_QUERY_OHDSI_SCHEMA: ${{ secrets.CDM_BIG_QUERY_OHDSI_SCHEMA }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand Down Expand Up @@ -91,17 +102,21 @@ jobs:
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Reconfigure Java
- name: Setup Java
if: runner.os == 'macOS'
run: R CMD javareconf

uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '8'

- name: Install libssh
if: runner.os == 'Linux'
run: |
sudo apt-get install libssh-dev
- name: Install dependencies
run: |
install.packages("cachem")
remotes::install_deps(dependencies = TRUE, INSTALL_opts=c("--no-multiarch"))
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/R_CMD_check_main_weekly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,41 @@ jobs:
GITHUB_PAT: ${{ secrets.GH_TOKEN }}
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
CDM5_ORACLE_CDM_SCHEMA: ${{ secrets.CDM5_ORACLE_CDM_SCHEMA }}
CDM5_ORACLE_CDM_SCHEMA: ${{ secrets.CDM5_ORACLE_CDM54_SCHEMA }}
CDM5_ORACLE_OHDSI_SCHEMA: ${{ secrets.CDM5_ORACLE_OHDSI_SCHEMA }}
CDM5_ORACLE_PASSWORD: ${{ secrets.CDM5_ORACLE_PASSWORD }}
CDM5_ORACLE_SERVER: ${{ secrets.CDM5_ORACLE_SERVER }}
CDM5_ORACLE_USER: ${{ secrets.CDM5_ORACLE_USER }}
CDM5_POSTGRESQL_CDM_SCHEMA: ${{ secrets.CDM5_POSTGRESQL_CDM_SCHEMA }}
CDM5_POSTGRESQL_CDM_SCHEMA: ${{ secrets.CDM5_POSTGRESQL_CDM54_SCHEMA }}
CDM5_POSTGRESQL_OHDSI_SCHEMA: ${{ secrets.CDM5_POSTGRESQL_OHDSI_SCHEMA }}
CDM5_POSTGRESQL_PASSWORD: ${{ secrets.CDM5_POSTGRESQL_PASSWORD }}
CDM5_POSTGRESQL_SERVER: ${{ secrets.CDM5_POSTGRESQL_SERVER }}
CDM5_POSTGRESQL_USER: ${{ secrets.CDM5_POSTGRESQL_USER }}
CDM5_SQL_SERVER_CDM_SCHEMA: ${{ secrets.CDM5_SQL_SERVER_CDM_SCHEMA }}
CDM5_SQL_SERVER_CDM_SCHEMA: ${{ secrets.CDM5_SQL_SERVER_CDM54_SCHEMA }}
CDM5_SQL_SERVER_OHDSI_SCHEMA: ${{ secrets.CDM5_SQL_SERVER_OHDSI_SCHEMA }}
CDM5_SQL_SERVER_PASSWORD: ${{ secrets.CDM5_SQL_SERVER_PASSWORD }}
CDM5_SQL_SERVER_SERVER: ${{ secrets.CDM5_SQL_SERVER_SERVER }}
CDM5_SQL_SERVER_USER: ${{ secrets.CDM5_SQL_SERVER_USER }}
CDM5_REDSHIFT_CDM_SCHEMA: ${{ secrets.CDM5_REDSHIFT_CDM_SCHEMA }}
CDM5_REDSHIFT_CDM_SCHEMA: ${{ secrets.CDM5_REDSHIFT_CDM54_SCHEMA }}
CDM5_REDSHIFT_OHDSI_SCHEMA: ${{ secrets.CDM5_REDSHIFT_OHDSI_SCHEMA }}
CDM5_REDSHIFT_PASSWORD: ${{ secrets.CDM5_REDSHIFT_PASSWORD }}
CDM5_REDSHIFT_SERVER: ${{ secrets.CDM5_REDSHIFT_SERVER }}
CDM5_REDSHIFT_USER: ${{ secrets.CDM5_REDSHIFT_USER }}
CDM_SNOWFLAKE_CDM53_SCHEMA: ${{ secrets.CDM_SNOWFLAKE_CDM53_SCHEMA }}
CDM_SNOWFLAKE_OHDSI_SCHEMA: ${{ secrets.CDM_SNOWFLAKE_OHDSI_SCHEMA }}
CDM_SNOWFLAKE_PASSWORD: ${{ secrets.CDM_SNOWFLAKE_PASSWORD }}
CDM_SNOWFLAKE_CONNECTION_STRING: ${{ secrets.CDM_SNOWFLAKE_CONNECTION_STRING }}
CDM_SNOWFLAKE_USER: ${{ secrets.CDM_SNOWFLAKE_USER }}
CDM5_SPARK_USER: ${{ secrets.CDM5_SPARK_USER }}
CDM5_SPARK_PASSWORD: ${{ secrets.CDM5_SPARK_PASSWORD }}
CDM5_SPARK_CONNECTION_STRING: ${{ secrets.CDM5_SPARK_CONNECTION_STRING }}

CDM5_SPARK_CDM_SCHEMA: ${{ secrets.CDM5_SPARK_CDM_SCHEMA }}
CDM5_SPARK_OHDSI_SCHEMA: ${{ secrets.CDM5_SPARK_OHDSI_SCHEMA }}
CDM_BIG_QUERY_CONNECTION_STRING: ${{ secrets.CDM_BIG_QUERY_CONNECTION_STRING }}
CDM_BIG_QUERY_KEY_FILE: ${{ secrets.CDM_BIG_QUERY_KEY_FILE }}
CDM_BIG_QUERY_CDM_SCHEMA: ${{ secrets.CDM_BIG_QUERY_CDM_SCHEMA }}
CDM_BIG_QUERY_OHDSI_SCHEMA: ${{ secrets.CDM_BIG_QUERY_OHDSI_SCHEMA }}

steps:
- uses: actions/checkout@v2

Expand Down
17 changes: 10 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: CohortGenerator
Type: Package
Title: An R Package for Cohort Generation Against the OMOP CDM
Version: 0.9.0
Date: 2024-05-28
Version: 0.10.0
Date: 2024-07-14
Authors@R: c(
person("Anthony", "Sena", email = "[email protected]", role = c("aut", "cre")),
person("Jamie", "Gilbert", role = c("aut")),
Expand All @@ -22,25 +22,28 @@ Imports:
digest,
dplyr,
lubridate,
methods,
ParallelLogger (>= 3.0.0),
readr (>= 2.1.0),
rlang,
RJSONIO,
jsonlite,
ResultModelManager,
SqlRender (>= 1.11.1),
stringi (>= 1.7.6)
stringi (>= 1.7.6),
tibble
Suggests:
CirceR (>= 1.1.1),
Eunomia,
knitr,
rmarkdown,
ROhdsiWebApi,
testthat,
withr
withr,
zip
Remotes:
ohdsi/CirceR,
ohdsi/Eunomia,
ohdsi/ROhdsiWebApi
ohdsi/ResultModelManager,
ohdsi/ROhdsiWebApi,
License: Apache License
VignetteBuilder: knitr
URL: https://ohdsi.github.io/CohortGenerator/, https://github.com/OHDSI/CohortGenerator
Expand Down
10 changes: 9 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,42 @@ export(createDemographicSubset)
export(createEmptyCohortDefinitionSet)
export(createEmptyNegativeControlOutcomeCohortSet)
export(createLimitSubset)
export(createResultsDataModel)
export(createSubsetCohortWindow)
export(dropCohortStatsTables)
export(exportCohortStatsTables)
export(generateCohortSet)
export(generateNegativeControlOutcomeCohorts)
export(getCohortCounts)
export(getCohortDefinitionSet)
export(getCohortInclusionRules)
export(getCohortStats)
export(getCohortTableNames)
export(getDataMigrator)
export(getRequiredTasks)
export(getResultsDataModelSpecifications)
export(getSubsetDefinitions)
export(insertInclusionRuleNames)
export(isCamelCase)
export(isCohortDefinitionSet)
export(isFormattedForDatabaseUpload)
export(isSnakeCase)
export(isTaskRequired)
export(migrateDataModel)
export(readCsv)
export(recordTasksDone)
export(runCohortGeneration)
export(sampleCohortDefinitionSet)
export(saveCohortDefinitionSet)
export(saveCohortSubsetDefinition)
export(saveIncremental)
export(uploadResults)
export(writeCsv)
import(DatabaseConnector)
import(R6)
importFrom(dplyr,"%>%")
import(dplyr)
importFrom(grDevices,rgb)
importFrom(methods,is)
importFrom(rlang,':=')
importFrom(rlang,.data)
importFrom(stats,aggregate)
Expand Down
17 changes: 17 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
CohortGenerator 0.10.0
=======================
New Features
- Add `runCohortGeneration` function (Issue #165)
- Adopt ResultModelManager for handling results data models & uploading. Extend results data model to include information on cohort subsets(#154, #162)
- Remove REMOTES entries for CirceR and Eunomia which are now in CRAN (#145)
- Unit tests now running on all OHDSI DB Platforms (#151)

Bug Fixes
- Negation of cohort subset operator must join on `subject_id` AND `start_date` (#167)
- Allow integer as cohort ID (#146)
- Use native messaging functions for output vs. ParallelLogger (#97)
- Prevent upload of inclusion rule information (#78)
- Expose `colTypes` when working with .csv files (#59)
- Remove `bit64` from package (mostly) (#152)
- Updated documentation for cohort subset negate feature (#111)

CohortGenerator 0.9.0
=======================
- Random sample functionality (for development only) (Issue #129)
Expand Down
3 changes: 2 additions & 1 deletion R/CohortConstruction.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ generateCohortSet <- function(connectionDetails = NULL,
"sql"
)
)
assertLargeInteger(cohortDefinitionSet$cohortId)
# Verify that cohort IDs are not repeated in the cohort definition
# set before generating
if (length(unique(cohortDefinitionSet$cohortId)) != length(cohortDefinitionSet$cohortId)) {
Expand Down Expand Up @@ -249,7 +250,7 @@ generateCohort <- function(cohortId = NULL,
connection <- DatabaseConnector::connect(connectionDetails)
on.exit(DatabaseConnector::disconnect(connection))
}
ParallelLogger::logInfo(i, "/", nrow(cohortDefinitionSet), "- Generating cohort: ", cohortName, " (id = ", cohortId, ")")
rlang::inform(paste0(i, "/", nrow(cohortDefinitionSet), "- Generating cohort: ", cohortName, " (id = ", cohortId, ")"))
sql <- cohortDefinitionSet$sql[i]

if (!isSubset) {
Expand Down
16 changes: 9 additions & 7 deletions R/CohortCount.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ getCohortCounts <- function(connectionDetails = NULL,
if (tolower(cohortTable) %in% tablesInServer) {
counts <- DatabaseConnector::querySql(connection, sql, snakeCaseToCamelCase = TRUE)
delta <- Sys.time() - start
ParallelLogger::logInfo(paste("Counting cohorts took", signif(delta, 3), attr(delta, "units")))
rlang::inform(paste("Counting cohorts took", signif(delta, 3), attr(delta, "units")))
if (!is.null(cohortDefinitionSet)) {
# If the user has NOT specified a list of cohortIds
# to use to filter the cohortDefinitionSet, then
Expand All @@ -77,15 +77,17 @@ getCohortCounts <- function(connectionDetails = NULL,
}
counts <- merge(
x = counts,
y = cohortDefinitionSet[cohortDefinitionSet$cohortId %in% cohortIds, ],
y = cohortDefinitionSet[cohortDefinitionSet$cohortId %in% cohortIds, , drop = FALSE],
by = "cohortId",
all.y = TRUE
)
counts <- transform(
counts,
cohortEntries = ifelse(is.na(cohortEntries), 0L, cohortEntries),
cohortSubjects = ifelse(is.na(cohortSubjects), 0L, cohortSubjects)
)
counts <- with(counts, {
transform(
counts,
cohortEntries = ifelse(is.na(cohortEntries), 0L, cohortEntries),
cohortSubjects = ifelse(is.na(cohortSubjects), 0L, cohortSubjects)
)
})
}
if (!is.null(databaseId)) {
counts$databaseId <- databaseId
Expand Down
Loading

0 comments on commit dc3bde3

Please sign in to comment.