|
17 | 17 | import org.slf4j.LoggerFactory; |
18 | 18 | import org.springframework.util.StringUtils; |
19 | 19 |
|
| 20 | +import java.math.BigDecimal; |
20 | 21 | import java.util.*; |
21 | 22 | import java.util.stream.Collectors; |
22 | 23 |
|
@@ -285,19 +286,19 @@ public T withConceptsFilter(List<Concept> concept) { |
285 | 286 | if (c.getDataType().equalsIgnoreCase("NUMERIC")) { |
286 | 287 | if (c.getWidget() != null && c.getWidget().equalsIgnoreCase("RANGE")) { |
287 | 288 | if (!StringUtils.isEmpty(c.getMinValue())) { |
288 | | - Float value = Float.parseFloat(c.getMinValue()); |
| 289 | + BigDecimal value = new BigDecimal(c.getMinValue()); |
289 | 290 | String param = "numericValueMin" + ci; |
290 | 291 | addParameter(param, value); |
291 | 292 | whereClauses.add(generateWhereClause(getFilterForSearchScope(c.getSearchScope()),"cast(" + tableAlias + ".observations ->> :" + conceptUuidParam + " as numeric) >= :" + param)); |
292 | 293 | } |
293 | 294 | if (!StringUtils.isEmpty(c.getMaxValue())) { |
294 | | - Float value = Float.parseFloat(c.getMaxValue()); |
| 295 | + BigDecimal value = new BigDecimal(c.getMaxValue()); |
295 | 296 | String param = "numericValueMax" + ci; |
296 | 297 | addParameter(param, value); |
297 | 298 | whereClauses.add(generateWhereClause(getFilterForSearchScope(c.getSearchScope()),"cast(" + tableAlias + ".observations ->>:" + conceptUuidParam + " as numeric) <= :" + param)); |
298 | 299 | } |
299 | 300 | } else { |
300 | | - Float value = Float.parseFloat(c.getMinValue()); |
| 301 | + BigDecimal value = new BigDecimal(c.getMinValue()); |
301 | 302 | String param = "numericValueMin" + ci; |
302 | 303 | addParameter(param, value); |
303 | 304 | whereClauses.add(generateWhereClause(getFilterForSearchScope(c.getSearchScope()),"cast(" + tableAlias + ".observations ->>:" + conceptUuidParam + " as numeric) = :" + param)); |
|
0 commit comments