From fad7c7c553cf9f21f37b4619a9d96610c4185893 Mon Sep 17 00:00:00 2001 From: Chris Knoll Date: Tue, 11 Oct 2022 16:02:33 -0400 Subject: [PATCH] Prepare for v2.12.0 Release (#2130) --- pom.xml | 43 ++++++++++--------- src/main/java/org/ohdsi/webapi/Constants.java | 2 +- .../webapi/service/VocabularyService.java | 4 +- .../ohdsi/webapi/tag/TagSecurityUtils.java | 16 ++++++- .../resources/estimation/r/runAnalysis.R | 4 +- .../resources/prediction/r/runAnalysis.R | 25 ++++++++--- 6 files changed, 61 insertions(+), 33 deletions(-) diff --git a/pom.xml b/pom.xml index 2bea1684ea..3aa96ac5ee 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.ohdsi WebAPI war - 2.12.0-SNAPSHOT + 2.12.0 WebAPI ${BUILD_NUMBER} @@ -776,16 +776,11 @@ com.vaadin.external.google android-json - - - - net.minidev - json-smart - + net.minidev json-smart @@ -861,14 +856,6 @@ com.microsoft.azure msal4j 1.9.0 - - - - - net.minidev - json-smart - - com.opencsv @@ -973,12 +960,6 @@ com.fasterxml.jackson.core jackson-databind - - - - net.minidev - json-smart - @@ -1561,6 +1542,26 @@ google-auth-library-credentials 0.16.2 + + com.google.api + gax + 1.47.0 + + + com.google.api + gax-grpc + 1.47.0 + + + com.google.api.grpc + proto-google-cloud-bigquerystorage-v1beta1 + 0.66.0 + + + io.opencensus + opencensus-contrib-http-util + 0.18.0 + diff --git a/src/main/java/org/ohdsi/webapi/Constants.java b/src/main/java/org/ohdsi/webapi/Constants.java index 50fccfe064..2069ed108d 100644 --- a/src/main/java/org/ohdsi/webapi/Constants.java +++ b/src/main/java/org/ohdsi/webapi/Constants.java @@ -56,7 +56,7 @@ interface Params { String COHORT_CHARACTERIZATION_ID = "cohort_characterization_id"; String PATHWAY_ANALYSIS_ID = "pathway_analysis_id"; String PREDICTION_ANALYSIS_ID = "prediction_analysis_id"; - String PREDICTION_SKELETON_VERSION = "v0.0.6"; + String PREDICTION_SKELETON_VERSION = "v0.0.1"; String ESTIMATION_ANALYSIS_ID = "estimation_analysis_id"; String UPDATE_PASSWORD = "update_password"; String SOURCE_ID = "source_id"; diff --git a/src/main/java/org/ohdsi/webapi/service/VocabularyService.java b/src/main/java/org/ohdsi/webapi/service/VocabularyService.java index 20ff14ab12..7864a78842 100644 --- a/src/main/java/org/ohdsi/webapi/service/VocabularyService.java +++ b/src/main/java/org/ohdsi/webapi/service/VocabularyService.java @@ -576,9 +576,9 @@ protected PreparedStatementRenderer prepareExecuteSearch(ConceptSearch search, S if (!search.query.isEmpty()) { String queryFilter = "LOWER(CONCEPT_NAME) LIKE '%@query%' or LOWER(CONCEPT_CODE) LIKE '%@query%'"; if (StringUtils.isNumeric(search.query)) { - queryFilter += "or CONCEPT_ID = @query"; + queryFilter += " or CONCEPT_ID = CAST(@query as int)"; } - filters += "AND (" + queryFilter + ")"; + filters += " AND (" + queryFilter + ")"; variableNameList.add("query"); variableValueList.add(search.query.toLowerCase()); } diff --git a/src/main/java/org/ohdsi/webapi/tag/TagSecurityUtils.java b/src/main/java/org/ohdsi/webapi/tag/TagSecurityUtils.java index e55a542beb..ec04c877d8 100644 --- a/src/main/java/org/ohdsi/webapi/tag/TagSecurityUtils.java +++ b/src/main/java/org/ohdsi/webapi/tag/TagSecurityUtils.java @@ -9,6 +9,8 @@ import org.ohdsi.webapi.pathway.domain.PathwayAnalysisEntity; import org.ohdsi.webapi.reusable.domain.Reusable; +import javax.ws.rs.BadRequestException; + public class TagSecurityUtils { public static String COHORT_DEFINITION = "cohortdefinition"; public static String CONCEPT_SET = "conceptset"; @@ -40,7 +42,19 @@ public static boolean checkPermission(final String asset, final String method) { return false; } - final String permission = String.format("%s:*:protectedtag:*:%s", asset, method); + final String template; + switch (method) { + case "post": + template = "%s:*:protectedtag:post"; + break; + case "delete": + template = "%s:*:protectedtag:*:delete"; + break; + default: + throw new BadRequestException(String.format("Unsupported method: %s", method)); + + } + final String permission = String.format(template, asset); return SecurityUtils.getSubject().isPermitted(permission); } diff --git a/src/main/resources/resources/estimation/r/runAnalysis.R b/src/main/resources/resources/estimation/r/runAnalysis.R index e28c842f94..a8ec97de2d 100644 --- a/src/main/resources/resources/estimation/r/runAnalysis.R +++ b/src/main/resources/resources/estimation/r/runAnalysis.R @@ -56,7 +56,9 @@ tryCatch({ runAnalyses = TRUE, packageResults = TRUE, maxCores = maxCores, - minCellCount = 5) + minCellCount = 5, + # a workaround as renv.lock file is unreachable after the analysis package has been installed + verifyDependencies = FALSE) }, finally = { remove.packages('@packageName') }) diff --git a/src/main/resources/resources/prediction/r/runAnalysis.R b/src/main/resources/resources/prediction/r/runAnalysis.R index e688b827b1..e64877e568 100644 --- a/src/main/resources/resources/prediction/r/runAnalysis.R +++ b/src/main/resources/resources/prediction/r/runAnalysis.R @@ -21,8 +21,9 @@ tryCatch({ user <- Sys.getenv("DBMS_USERNAME") pwd <- Sys.getenv("DBMS_PASSWORD") cdmDatabaseSchema <- Sys.getenv("DBMS_SCHEMA") + cdmDatabaseName <- Sys.getenv("DATA_SOURCE_NAME") resultsDatabaseSchema <- Sys.getenv("RESULT_SCHEMA") - cohortsDatabaseSchema <- Sys.getenv("TARGET_SCHEMA") + cohortDatabaseSchema <- Sys.getenv("TARGET_SCHEMA") cohortTable <- Sys.getenv("COHORT_TARGET_TABLE") driversPath <- (function(path) if (path == "") NULL else path)( Sys.getenv("JDBC_DRIVER_PATH") ) @@ -32,6 +33,19 @@ tryCatch({ password = pwd, pathToDriver = driversPath) + databaseDetails <- PatientLevelPrediction::createDatabaseDetails(connectionDetails = connectionDetails, + cdmDatabaseSchema = cdmDatabaseSchema, + cdmDatabaseName = cdmDatabaseName, + cohortDatabaseSchema = cohortDatabaseSchema, + cohortTable = cohortTable, + outcomeDatabaseSchema = cohortDatabaseSchema, + outcomeTable = cohortTable, + cdmVersion = 5) + + logSettings <- PatientLevelPrediction::createLogSettings(verbosity = "INFO", + timeStamp = T, + logName = 'skeletonPlp') + # Evaluating can't use global environment in child threads connectionDetails$user <- function() Sys.getenv("DBMS_USERNAME") connectionDetails$password <- function() Sys.getenv("DBMS_PASSWORD") @@ -41,18 +55,15 @@ tryCatch({ dir.create(outputFolder) PatientLevelPrediction::setPythonEnvironment(envname = 'PLP', envtype = 'conda') - execute(connectionDetails = connectionDetails, - cdmDatabaseSchema = cdmDatabaseSchema, - cohortDatabaseSchema = cohortsDatabaseSchema, - cohortTable = cohortTable, + execute(databaseDetails = databaseDetails, outputFolder = outputFolder, createCohorts = T, runAnalyses = T, createValidationPackage = F, packageResults = T, minCellCount = 5, - cdmVersion = 5, - createShiny = T) + viewShiny = T, + logSettings = logSettings) # To run PLP Viewer shiny app call: # PatientLevelPrediction::viewMultiplePlp(outputFolder) }, finally = {