Skip to content

Commit

Permalink
Merge pull request #39 from HBPMedical/dev/remove_hardcoded_datasets_…
Browse files Browse the repository at this point in the history
…column_filters

Filters about datasets and columns are now moved to the MIP-Engine
  • Loading branch information
KFilippopolitis authored May 16, 2022
2 parents 9d9b389 + bacf553 commit 0a6f68f
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,32 @@ public MIPEngineAlgorithmRequestDTO(UUID experimentUUID, List<ExaremeAlgorithmRe
MIPEngineAlgorithmRequestDTO.InputData inputData = new MIPEngineAlgorithmRequestDTO.InputData();
HashMap<String, Object> mipEngineParameters = new HashMap<>();

List<Object> rules = new ArrayList<>();
exaremeAlgorithmRequestParamDTOs.forEach(parameter -> {

switch (parameter.getName()) {
case "x":
List<String> x = Arrays.asList(parameter.getValue().split(","));
x.forEach(column -> rules.add(new ExaremeAlgorithmDTO.Rule(column, parameter.getColumnValuesSQLType(), "is_not_null", null)));
inputData.setX(x);
break;
case "y":
List<String> y = Arrays.asList(parameter.getValue().split(","));
y.forEach(column -> rules.add(new ExaremeAlgorithmDTO.Rule(column, parameter.getColumnValuesSQLType(), "is_not_null", null)));
inputData.setY(y);
break;
case "dataset":
List<String> datasets = Arrays.asList(parameter.getValue().split(","));
rules.add(new ExaremeAlgorithmDTO.Rule("dataset", "string", "in", datasets));
inputData.setDatasets(datasets);
break;
case "pathology":
inputData.setData_model(parameter.getValue());
break;
case "filter":
if (!parameter.getValue().equals(""))
rules.add(JsonConverters.convertJsonStringToObject(parameter.getValue(), MIPEngineAlgorithmRequestDTO.Filter.class));
inputData.setFilters(JsonConverters.convertJsonStringToObject(parameter.getValue(), MIPEngineAlgorithmRequestDTO.Filter.class));
break;
default:
mipEngineParameters.put(parameter.getName(), convertStringToMultipleValues(parameter.getValue()));
}
});
MIPEngineAlgorithmRequestDTO.Filter filter = new MIPEngineAlgorithmRequestDTO.Filter("AND", rules);
inputData.setFilters(filter);
this.inputdata = inputData;
this.parameters = mipEngineParameters;
}
Expand Down

0 comments on commit 0a6f68f

Please sign in to comment.