diff --git a/pom.xml b/pom.xml index 1bd5cbeb..0eeee36e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.odysseusinc.athena athena - 1.8.0 + 1.9.0 jar @@ -34,7 +34,7 @@ 1.4 4.3.7.RELEASE hub.arachnenetwork.com - 1.13.0-SNAPSHOT + 1.13.0 3.3.6 3.0 ${BUILD_NUMBER} diff --git a/properties/dev/application.properties b/properties/dev/application.properties index b8e51cfa..86b68244 100644 --- a/properties/dev/application.properties +++ b/properties/dev/application.properties @@ -107,6 +107,8 @@ athena.security.saml.attributes.middle_name=middleName arachne.portal.url=https://localhost:8080 arachne.portal.professionalTypesPath=/api/v1/user-management/professional-types +arachne.portal.countriesPath=/api/v1/user-management/countries/search +arachne.portal.provincePath=/api/v1/user-management/state-province/search arachne.portal.registerPath=/api/v1/auth/registration arachne.portal.remindPasswordPath=/api/v1/auth/remind-password arachne.portal.resetPasswordPath=/api/v1/auth/reset-password diff --git a/properties/prod/application.properties b/properties/prod/application.properties index 88f69cc3..eefd7996 100644 --- a/properties/prod/application.properties +++ b/properties/prod/application.properties @@ -103,6 +103,8 @@ athena.security.saml.attributes.middle_name=middleName arachne.portal.url= arachne.portal.professionalTypesPath=/api/v1/user-management/professional-types +arachne.portal.countriesPath=/api/v1/user-management/countries/search +arachne.portal.provincePath=/api/v1/user-management/state-province/search arachne.portal.registerPath=/api/v1/auth/registration arachne.portal.remindPasswordPath=/api/v1/auth/remind-password arachne.portal.resetPasswordPath=/api/v1/auth/reset-password diff --git a/properties/qa/application.properties b/properties/qa/application.properties index 7b5f45ff..8fdd86d7 100644 --- a/properties/qa/application.properties +++ b/properties/qa/application.properties @@ -103,6 +103,8 @@ athena.security.saml.attributes.middle_name=middleName arachne.portal.url= arachne.portal.professionalTypesPath=/api/v1/user-management/professional-types +arachne.portal.countriesPath=/api/v1/user-management/countries/search +arachne.portal.provincePath=/api/v1/user-management/state-province/search arachne.portal.registerPath=/api/v1/auth/registration arachne.portal.remindPasswordPath=/api/v1/auth/remind-password arachne.portal.resetPasswordPath=/api/v1/auth/reset-password diff --git a/properties/test/application.properties b/properties/test/application.properties index 26e2ca5b..b16442b7 100644 --- a/properties/test/application.properties +++ b/properties/test/application.properties @@ -103,6 +103,8 @@ athena.security.saml.attributes.middle_name=middleName arachne.portal.url=https://test.arachnenetwork.com arachne.portal.professionalTypesPath=/api/v1/user-management/professional-types +arachne.portal.countriesPath=/api/v1/user-management/countries/search +arachne.portal.provincePath=/api/v1/user-management/state-province/search arachne.portal.registerPath=/api/v1/auth/registration arachne.portal.remindPasswordPath=/api/v1/auth/remind-password arachne.portal.resetPasswordPath=/api/v1/auth/reset-password diff --git a/src/main/docker/cpt4_4_5/cpt.bat b/src/main/docker/cpt4_4_5/cpt.bat index aab173fe..44fdfe3e 100644 --- a/src/main/docker/cpt4_4_5/cpt.bat +++ b/src/main/docker/cpt4_4_5/cpt.bat @@ -1,2 +1,29 @@ @echo off -java -Dumls-user=xxx -Dumls-password=xxx -jar cpt4.jar 4 \ No newline at end of file +rem Argument counting code from http://www.testdeveloper.com/2010/09/26/how-to-count-arguments-to-a-dos-batch-file-without-using-your-fingers-and-toes +set _exitStatus=0 +set _argcActual=0 +set _argcExpected=2 +for %%i in (%*) do set /A _argcActual+=1 +if %_argcActual% NEQ %_argcExpected% ( + call :_ShowUsage %0%, "Need to include login name and password for UMLS Terminology Services." + set _exitStatus=1 + goto:_EOF +) + +FOR /f tokens^=2-5^ delims^=.-_^" %%j IN ('java -fullversion 2^>^&1') DO SET "jver=%%j%%k" +IF %jver% GTR 18 ( +java -Dumls-user=%1 -Dumls-password=%2 --add-modules=java.xml.ws -jar cpt4.jar 4 +) ELSE ( +java -Dumls-user=%1 -Dumls-password=%2 -jar cpt4.jar 4 +) +set _exitStatus=%ERRORLEVEL% +goto:_EOF +:_ShowUsage +echo [USAGE]: %~1 login password +if NOT "%~2" == "" ( + echo %~2 +) +goto:eof +:_EOF +echo The exit status is %_exitStatus% +cmd /c exit %_exitStatus% diff --git a/src/main/docker/cpt4_5/cpt.bat b/src/main/docker/cpt4_5/cpt.bat index ac5d1de3..a7f3452c 100644 --- a/src/main/docker/cpt4_5/cpt.bat +++ b/src/main/docker/cpt4_5/cpt.bat @@ -1,2 +1,29 @@ @echo off -java -Dumls-user=xxx -Dumls-password=xxx -jar cpt4.jar 5 \ No newline at end of file +rem Argument counting code from http://www.testdeveloper.com/2010/09/26/how-to-count-arguments-to-a-dos-batch-file-without-using-your-fingers-and-toes +set _exitStatus=0 +set _argcActual=0 +set _argcExpected=2 +for %%i in (%*) do set /A _argcActual+=1 +if %_argcActual% NEQ %_argcExpected% ( + call :_ShowUsage %0%, "Need to include login name and password for UMLS Terminology Services." + set _exitStatus=1 + goto:_EOF +) + +FOR /f tokens^=2-5^ delims^=.-_^" %%j IN ('java -fullversion 2^>^&1') DO SET "jver=%%j%%k" +IF %jver% GTR 18 ( +java -Dumls-user=%1 -Dumls-password=%2 --add-modules=java.xml.ws -jar cpt4.jar 5 +) ELSE ( +java -Dumls-user=%1 -Dumls-password=%2 -jar cpt4.jar 5 +) +set _exitStatus=%ERRORLEVEL% +goto:_EOF +:_ShowUsage +echo [USAGE]: %~1 login password +if NOT "%~2" == "" ( + echo %~2 +) +goto:eof +:_EOF +echo The exit status is %_exitStatus% +cmd /c exit %_exitStatus% diff --git a/src/main/java/com/odysseusinc/athena/api/v1/controller/UserController.java b/src/main/java/com/odysseusinc/athena/api/v1/controller/UserController.java index e9ce4fe1..b55b6121 100644 --- a/src/main/java/com/odysseusinc/athena/api/v1/controller/UserController.java +++ b/src/main/java/com/odysseusinc/athena/api/v1/controller/UserController.java @@ -71,6 +71,12 @@ public class UserController { @Value("${arachne.portal.professionalTypesPath}") private String professionalTypesPath; + @Value("${arachne.portal.countriesPath}") + private String countriesPath; + + @Value("${arachne.portal.provincePath}") + private String provincePath; + @Value("${arachne.portal.registerPath}") private String registerPath; @@ -128,6 +134,51 @@ public JsonResult listProfessionalTypes() throws URISyntaxException { return responseEntity.getBody(); } + @RequestMapping(value = "/countries", method = GET) + public JsonResult searchCountries( + @RequestParam("query") String query, + @RequestParam("limit") Integer limit, + @RequestParam(value = "includeId", required = false) Long includeId + ) { + String uri = UriComponentsBuilder + .fromUriString(arachneUrl) + .replacePath(countriesPath) + .queryParam("query", query) + .queryParam("limit", limit) + .queryParam("includeId", includeId) + .toUriString(); + ResponseEntity responseEntity = restTemplate.exchange( + uri, + HttpMethod.GET, + null, + JsonResult.class + ); + return responseEntity.getBody(); + } + + @RequestMapping(value = "/provinces", method = GET) + public JsonResult searchProvinces( + @RequestParam("countryId") String countryIdParam, + @RequestParam("query") String query, + @RequestParam("limit") Integer limit, + @RequestParam(value = "includeId", required = false) String includeIdParam + ) { + String uri = UriComponentsBuilder + .fromUriString(arachneUrl) + .replacePath(provincePath) + .queryParam("countryId", countryIdParam) + .queryParam("query", query) + .queryParam("limit", limit) + .queryParam("includeId", includeIdParam) + .toUriString(); + ResponseEntity responseEntity = restTemplate.exchange( + uri, + HttpMethod.GET, + null, + JsonResult.class); + return responseEntity.getBody(); + } + @RequestMapping(method = RequestMethod.POST) public ResponseEntity register(@RequestBody CommonUserRegistrationDTO dto) throws PermissionDeniedException { diff --git a/src/main/java/com/odysseusinc/athena/service/saver/v4/InvalidConceptCPT4V4Saver.java b/src/main/java/com/odysseusinc/athena/service/saver/v4/InvalidConceptCPT4V4Saver.java index 5f723e70..f2127bac 100644 --- a/src/main/java/com/odysseusinc/athena/service/saver/v4/InvalidConceptCPT4V4Saver.java +++ b/src/main/java/com/odysseusinc/athena/service/saver/v4/InvalidConceptCPT4V4Saver.java @@ -47,7 +47,7 @@ public String fileName() { @Override protected String query() { - return "SELECT * FROM concept WHERE vocabulary_id in (?) AND invalid_reason is not null"; + return "SELECT * FROM concept WHERE vocabulary_id in (?) AND valid_end_date <= now()"; } @Override diff --git a/src/main/java/com/odysseusinc/athena/service/saver/v5/InvalidConceptCPT4V5Saver.java b/src/main/java/com/odysseusinc/athena/service/saver/v5/InvalidConceptCPT4V5Saver.java index 951aa641..2998e483 100644 --- a/src/main/java/com/odysseusinc/athena/service/saver/v5/InvalidConceptCPT4V5Saver.java +++ b/src/main/java/com/odysseusinc/athena/service/saver/v5/InvalidConceptCPT4V5Saver.java @@ -45,7 +45,7 @@ public String fileName() { @Override protected String query() { - return "SELECT * FROM concept WHERE vocabulary_id in (?) AND invalid_reason is not null"; + return "SELECT * FROM concept WHERE vocabulary_id in (?) AND valid_end_date <= now()"; } @Override