Skip to content

Commit

Permalink
Now a pathology has a version until Exareme is completely replaced by…
Browse files Browse the repository at this point in the history
… Exareme2 the portalbackend will ignore the version for the algorithms that run on Exareme.
  • Loading branch information
KFilippopolitis committed Jul 22, 2022
1 parent 0a6f68f commit 4c987a1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public MIPEngineAlgorithmRequestDTO(UUID experimentUUID, List<ExaremeAlgorithmRe
inputData.setData_model(parameter.getValue());
break;
case "filter":
if (!parameter.getValue().equals(""))
if (parameter.getValue() != null && !parameter.getValue().equals(""))
inputData.setFilters(JsonConverters.convertJsonStringToObject(parameter.getValue(), MIPEngineAlgorithmRequestDTO.Filter.class));
break;
default:
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/eu/hbp/mip/models/DTOs/PathologyDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public class PathologyDTO {
@SerializedName("code")
private String code;

@SerializedName("version")
private String version;


@SerializedName("label")
private String label;

Expand Down
15 changes: 14 additions & 1 deletion src/main/java/eu/hbp/mip/services/ExperimentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,20 @@ private ExaremeAlgorithmResultDTO runExaremeExperiment(ExperimentDTO experimentD
String algorithmEndpoint = queryExaremeUrl + "/" + algorithmName;
List<ExaremeAlgorithmRequestParamDTO> algorithmParameters
= experimentDTO.getAlgorithm().getParameters();
String algorithmBody = gson.toJson(algorithmParameters);
List<ExaremeAlgorithmRequestParamDTO> algorithmParametersWithoutPathologyVersion = new ArrayList<>();

for (ExaremeAlgorithmRequestParamDTO algorithmParameter : algorithmParameters)
{
if (algorithmParameter.getName().equals("pathology")) {
List<String> pathology_info = Arrays.asList(algorithmParameter.getValue().split(":", 2));
String pathology_code = pathology_info.get(0);
algorithmParameter.setValue(pathology_code);
}
algorithmParametersWithoutPathologyVersion.add(algorithmParameter);

}

String algorithmBody = gson.toJson(algorithmParametersWithoutPathologyVersion);
logger.LogUserAction("Exareme algorithm execution. Endpoint: " + algorithmEndpoint);
logger.LogUserAction("Exareme algorithm execution. Body: " + algorithmBody);

Expand Down

0 comments on commit 4c987a1

Please sign in to comment.