-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from medizininformatik-initiative/release-1.0.0.2
Release 1.0.0.2
- Loading branch information
Showing
60 changed files
with
2,161 additions
and
876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...k_initiative/feasibility_dsf_process/FeasibilityProcessPluginDeploymentStateListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package de.medizininformatik_initiative.feasibility_dsf_process; | ||
|
||
import ca.uhn.fhir.rest.client.api.IGenericClient; | ||
import de.medizininformatik_initiative.feasibility_dsf_process.client.flare.FlareWebserviceClient; | ||
import dev.dsf.bpe.v1.ProcessPluginDeploymentStateListener; | ||
import org.hl7.fhir.r4.model.CapabilityStatement; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.InitializingBean; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
import static de.medizininformatik_initiative.feasibility_dsf_process.variables.ConstantsFeasibility.FEASIBILITY_EXECUTE_PROCESS_ID; | ||
import static java.util.Objects.requireNonNull; | ||
|
||
/** | ||
* After process deployment starts a connection test if the <i>feasibilityExecute</i> process is active. | ||
* <p> | ||
* The configured {@link EvaluationStrategy} determines which client is used for the connection test. | ||
* </p> | ||
* | ||
* @author <a href="mailto:math2306@hotmail.com">Mathias Rühle</a> | ||
*/ | ||
public class FeasibilityProcessPluginDeploymentStateListener | ||
implements ProcessPluginDeploymentStateListener, InitializingBean { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(FeasibilityProcessPluginDeploymentStateListener.class); | ||
|
||
private EvaluationStrategy strategy; | ||
private IGenericClient storeClient; | ||
private FlareWebserviceClient flareWebserviceClient; | ||
|
||
public FeasibilityProcessPluginDeploymentStateListener(EvaluationStrategy strategy, IGenericClient storeClient, | ||
FlareWebserviceClient flareWebserviceClient) { | ||
this.strategy = strategy; | ||
this.storeClient = storeClient; | ||
this.flareWebserviceClient = flareWebserviceClient; | ||
} | ||
|
||
@Override | ||
public void onProcessesDeployed(List<String> processes) { | ||
if (processes.contains(FEASIBILITY_EXECUTE_PROCESS_ID)) { | ||
if (strategy.equals(EvaluationStrategy.CQL)) { | ||
try { | ||
CapabilityStatement statement = storeClient.capabilities().ofType(CapabilityStatement.class) | ||
.execute(); | ||
logger.info("Connection test OK ({} - {})", statement.getSoftware().getName(), | ||
statement.getSoftware().getVersion()); | ||
} catch (RuntimeException e) { | ||
logger.warn("Connection test FAILED - error: {} - {}", e.getClass().getName(), e.getMessage()); | ||
} | ||
} else { | ||
try { | ||
flareWebserviceClient.testConnection(); | ||
logger.info("Connection test OK (flare)"); | ||
} catch (IOException e) { | ||
logger.warn("Connection test FAILED (flare) - error: {} - {}", e.getClass().getName(), | ||
e.getMessage()); | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void afterPropertiesSet() throws Exception { | ||
requireNonNull(storeClient); | ||
requireNonNull(flareWebserviceClient); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.