Skip to content

Commit

Permalink
Prepare for v2.12.0 Release (#2130)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisknoll authored Oct 11, 2022
1 parent e4230e5 commit fad7c7c
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 33 deletions.
43 changes: 22 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.ohdsi</groupId>
<artifactId>WebAPI</artifactId>
<packaging>war</packaging>
<version>2.12.0-SNAPSHOT</version>
<version>2.12.0</version>
<name>WebAPI</name>
<properties>
<build.number>${BUILD_NUMBER}</build.number>
Expand Down Expand Up @@ -776,16 +776,11 @@
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
<!-- To have an explicit json-smart dependency in the dependencies block effective -->
<!-- For some reason it is not overriden as the other dependencies like jackson-databind -->
<exclusion>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- It is overriding a transitive dependency from the dependency above -->
<!-- After migrating to Spring Boot 2.x we should get rid of it -->
<!-- It is currently inefficient as com.nimbusds:nimbus-jose-jwt has hard bounds [1.3.1,2.3] -->
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
Expand Down Expand Up @@ -861,14 +856,6 @@
<groupId>com.microsoft.azure</groupId>
<artifactId>msal4j</artifactId>
<version>1.9.0</version>
<!-- To have an explicit json-smart dependency in the dependencies block effective -->
<!-- For some reason it is not overriden as the other dependencies like jackson-databind -->
<exclusions>
<exclusion>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
Expand Down Expand Up @@ -973,12 +960,6 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<!-- To have an explicit json-smart dependency in the dependencies block effective -->
<!-- For some reason it is not overriden as the other dependencies like jackson-databind -->
<exclusion>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -1561,6 +1542,26 @@
<artifactId>google-auth-library-credentials</artifactId>
<version>0.16.2</version>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>1.47.0</version>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<version>1.47.0</version>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-bigquerystorage-v1beta1</artifactId>
<version>0.66.0</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-contrib-http-util</artifactId>
<version>0.18.0</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/ohdsi/webapi/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/ohdsi/webapi/service/VocabularyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
16 changes: 15 additions & 1 deletion src/main/java/org/ohdsi/webapi/tag/TagSecurityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/resources/estimation/r/runAnalysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
25 changes: 18 additions & 7 deletions src/main/resources/resources/prediction/r/runAnalysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -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") )

Expand All @@ -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")
Expand All @@ -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 = {
Expand Down

0 comments on commit fad7c7c

Please sign in to comment.