diff --git a/install/installerTemplate/linux/setup_OpenELIS.py b/install/installerTemplate/linux/setup_OpenELIS.py index 0ba26f009..af0b0c2b8 100644 --- a/install/installerTemplate/linux/setup_OpenELIS.py +++ b/install/installerTemplate/linux/setup_OpenELIS.py @@ -82,6 +82,7 @@ DOCKER_FHIR_API_CONTAINER_NAME = "external-fhir-api" DOCKER_NGINX_CONTAINER_NAME = "openelisglobal-proxy" DOCKER_FRONTEND_CONTAINER_NAME = "openelisglobal-frontend" +DOCKER_ASTM_BRIDGE_CONTAINER_NAME = "astm-http-bridge" DOCKER_AUTOHEAL_CONTAINER_NAME = "autoheal-oe" DOCKER_DB_CONTAINER_NAME = "openelisglobal-database" DOCKER_DB_BACKUPS_DIR = "/backups/" # path in docker container @@ -871,6 +872,11 @@ def uninstall_docker_images(): cmd = 'docker rm $(docker stop $(docker ps -a -q --filter="name=' + DOCKER_FRONTEND_CONTAINER_NAME + '" --format="{{.ID}}"))' os.system(cmd) + if ASTM_PROXY: + log("removing astm-bridge image...", PRINT_TO_CONSOLE) + cmd = 'docker rm $(docker stop $(docker ps -a -q --filter="name=' + DOCKER_ASTM_BRIDGE_CONTAINER_NAME + '" --format="{{.ID}}"))' + os.system(cmd) + log("removing autoheal image...", PRINT_TO_CONSOLE) cmd = 'docker rm $(docker stop $(docker ps -a -q --filter="name=' + DOCKER_AUTOHEAL_CONTAINER_NAME + '" --format="{{.ID}}"))' os.system(cmd) diff --git a/src/main/java/org/openelisglobal/dataexchange/fhir/FhirUtil.java b/src/main/java/org/openelisglobal/dataexchange/fhir/FhirUtil.java index 16f9099be..421ba7794 100644 --- a/src/main/java/org/openelisglobal/dataexchange/fhir/FhirUtil.java +++ b/src/main/java/org/openelisglobal/dataexchange/fhir/FhirUtil.java @@ -33,8 +33,7 @@ public class FhirUtil implements FhirClientFetcher { @Override public IGenericClient getFhirClient(String fhirStorePath) { IGenericClient fhirClient = fhirContext.newRestfulGenericClient(fhirStorePath); - if (!GenericValidator.isBlankOrNull(fhirConfig.getUsername()) - && !fhirConfig.getLocalFhirStorePath().equals(fhirStorePath)) { + if (!GenericValidator.isBlankOrNull(fhirConfig.getUsername())) { IClientInterceptor authInterceptor = new BasicAuthInterceptor(fhirConfig.getUsername(), fhirConfig.getPassword()); fhirClient.registerInterceptor(authInterceptor); @@ -45,6 +44,11 @@ public IGenericClient getFhirClient(String fhirStorePath) { public IGenericClient getLocalFhirClient() { IGenericClient fhirClient = fhirContext.newRestfulGenericClient(fhirConfig.getLocalFhirStorePath()); + if (!GenericValidator.isBlankOrNull(fhirConfig.getUsername())) { + IClientInterceptor authInterceptor = new BasicAuthInterceptor(fhirConfig.getUsername(), + fhirConfig.getPassword()); + fhirClient.registerInterceptor(authInterceptor); + } return fhirClient; } diff --git a/src/main/java/org/openelisglobal/dataexchange/fhir/service/FhirApiWorkFlowServiceImpl.java b/src/main/java/org/openelisglobal/dataexchange/fhir/service/FhirApiWorkFlowServiceImpl.java index d22ed6945..d2a214758 100644 --- a/src/main/java/org/openelisglobal/dataexchange/fhir/service/FhirApiWorkFlowServiceImpl.java +++ b/src/main/java/org/openelisglobal/dataexchange/fhir/service/FhirApiWorkFlowServiceImpl.java @@ -81,8 +81,11 @@ public class FhirApiWorkFlowServiceImpl implements FhirApiWorkflowService { @Value("${org.openelisglobal.remote.source.updateStatus}") private Optional remoteStoreUpdateStatus; - @Scheduled(initialDelay = 10 * 1000, fixedRate = 2 * 60 * 1000) + @Value("${org.openelisglobal.remote.source.identifier:}#{T(java.util.Collections).emptyList()}") + private List remoteStoreIdentifier; + @Override + @Scheduled(initialDelay = 10 * 1000, fixedRateString = "${org.openelisglobal.remote.poll.frequency:120000}") public void pollForRemoteTasks() { processWorkflow(ResourceType.Task); } @@ -472,7 +475,7 @@ private void processTaskImportOrder(Task remoteTask, String remoteStorePath, IGe remoteTask.setStatus(taskStatus); sourceFhirClient.update().resource(remoteTask).execute(); } - IGenericClient localFhirClient = fhirContext.newRestfulGenericClient(localFhirStorePath); + IGenericClient localFhirClient = fhirUtil.getFhirClient(localFhirStorePath); localFhirClient.update().resource(localObjects.task).execute(); // taskBasedOnRemoteTask.setStatus(taskStatus); // localFhirClient.update().resource(taskBasedOnRemoteTask).execute();