diff --git a/health-services/plan-service/src/main/java/digit/config/ServiceConstants.java b/health-services/plan-service/src/main/java/digit/config/ServiceConstants.java index 06a2bbf31e..69d0986f96 100644 --- a/health-services/plan-service/src/main/java/digit/config/ServiceConstants.java +++ b/health-services/plan-service/src/main/java/digit/config/ServiceConstants.java @@ -366,13 +366,13 @@ public class ServiceConstants { public static final String FACILITY_TYPE_SEARCH_PARAMETER_KEY = "facilityType"; - public static final String TERRAIN_CONDITION_SEARCH_PARAMETER_KEY = "accessibilityDetails.terrain.code"; + public static final String TERRAIN_CONDITION_SEARCH_PARAMETER_KEY = "accessibilityDetails|terrain|code"; - public static final String ROAD_CONDITION_SEARCH_PARAMETER_KEY = "accessibilityDetails.roadCondition.code"; + public static final String ROAD_CONDITION_SEARCH_PARAMETER_KEY = "accessibilityDetails|roadCondition|code"; - public static final String SECURITY_Q1_SEARCH_PARAMETER_KEY = "securityDetails.1.code"; + public static final String SECURITY_Q1_SEARCH_PARAMETER_KEY = "securityDetails|1|code"; - public static final String SECURITY_Q2_SEARCH_PARAMETER_KEY = "securityDetails.2.code"; + public static final String SECURITY_Q2_SEARCH_PARAMETER_KEY = "securityDetails|2|code"; public static final String COMMA_DELIMITER = ","; 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 643f45a79e..070f442a89 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 @@ -109,21 +109,9 @@ public String preparePartialJsonStringFromFilterMap(Map filterMa if (key.contains(DOT_SEPARATOR)) { String[] keyArray = key.split(DOT_REGEX); Map nestedQueryMap = new HashMap<>(); - - // Recursively build the nested structure based on the key hierarchy. prepareNestedQueryMap(0, keyArray, nestedQueryMap, filterMap.get(key)); - - // Merge the newly created nested structure into the main query map. - queryMap.merge(keyArray[0], nestedQueryMap.get(keyArray[0]), (existing, newValue) -> { - // If both existing and new values are maps, merge them to prevent overwriting. - if (existing instanceof Map && newValue instanceof Map) { - mergeMaps((Map) existing, (Map) newValue); - return existing; - } - return newValue; - }); + queryMap.put(keyArray[0], nestedQueryMap.get(keyArray[0])); } else { - // If no nesting, directly put the key-value pair into the query map. queryMap.put(key, filterMap.get(key)); } }); @@ -182,31 +170,6 @@ public String getPaginatedQuery(String query, List preparedStmtList) { return paginatedQuery.toString(); } - /** - * Recursively merges two maps, combining their nested structures while preserving existing values. - * - * @param existing The final map that will contain the merged result. - * @param newMap The source map whose contents will be merged into the existing map. - * - * Example: - * existing = {"a": {"b": "value1"}} - * newMap = {"a": {"c": "value2"}} - * Result: {"a": {"b": "value1", "c": "value2"}} - */ - private void mergeMaps(Map existing, Map newMap) { - newMap.forEach((key, value) -> { - existing.merge(key, value, (oldValue, newValue) -> { - // If both values are maps, recursively merge them - if (oldValue instanceof Map && newValue instanceof Map) { - mergeMaps((Map) oldValue, (Map) newValue); - return oldValue; - } - // If either value is not a map, use the new value - return newValue; - }); - }); - } - /** * This method is used to extract and parse JSON data into a JsonNode object * diff --git a/health-services/plan-service/src/main/java/digit/web/models/census/Census.java b/health-services/plan-service/src/main/java/digit/web/models/census/Census.java index 2b989edb10..ad052ca93c 100644 --- a/health-services/plan-service/src/main/java/digit/web/models/census/Census.java +++ b/health-services/plan-service/src/main/java/digit/web/models/census/Census.java @@ -49,8 +49,7 @@ public class Census { private String boundaryCode = null; @JsonProperty("assignee") - @Size(max = 64) - private String assignee = null; + private List assignee = null; @JsonProperty("status") @Size(max = 64)