diff --git a/health-services/plan-service/src/main/java/digit/util/QueryUtil.java b/health-services/plan-service/src/main/java/digit/util/QueryUtil.java index 070f442a89..3333400e3f 100644 --- a/health-services/plan-service/src/main/java/digit/util/QueryUtil.java +++ b/health-services/plan-service/src/main/java/digit/util/QueryUtil.java @@ -102,7 +102,7 @@ public String addOrderByClause(String query, String orderByClause) { * @param filterMap * @return */ - public String preparePartialJsonStringFromFilterMap(Map filterMap) { + public String preparePartialJsonStringFromFilterMap(Map> filterMap) { Map queryMap = new HashMap<>(); filterMap.keySet().forEach(key -> { @@ -129,16 +129,16 @@ public String preparePartialJsonStringFromFilterMap(Map filterMa * @param index * @param nestedKeyArray * @param currentQueryMap - * @param value + * @param values */ - private void prepareNestedQueryMap(int index, String[] nestedKeyArray, Map currentQueryMap, String value) { + private void prepareNestedQueryMap(int index, String[] nestedKeyArray, Map currentQueryMap, Set values) { // Return when all levels have been reached. if (index == nestedKeyArray.length) return; // For the final level simply put the value in the map. else if (index == nestedKeyArray.length - 1) { - currentQueryMap.put(nestedKeyArray[index], value); + currentQueryMap.put(nestedKeyArray[index], values); return; } @@ -146,7 +146,7 @@ else if (index == nestedKeyArray.length - 1) { currentQueryMap.put(nestedKeyArray[index], new HashMap<>()); // Make a recursive call to enrich data in next level. - prepareNestedQueryMap(index + 1, nestedKeyArray, (Map) currentQueryMap.get(nestedKeyArray[index]), value); + prepareNestedQueryMap(index + 1, nestedKeyArray, (Map) currentQueryMap.get(nestedKeyArray[index]), values); } /**