Skip to content

Commit 535ef5f

Browse files
committed
More tolerant PVL parsing
1 parent af55c44 commit 535ef5f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

SivStudies/src/org/labkey/sivstudies/query/ViralLoadsTriggerFactory.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,14 @@ private void inspectResultValue(@NotNull Map<String, Object> row, ValidationExce
8787
if (NumberUtils.isCreatable(val))
8888
{
8989
row.put("result", val);
90+
return;
9091
}
91-
else if (val.toLowerCase().contains("below"))
92+
93+
val = val.toLowerCase();
94+
if (val.contains("below"))
9295
{
9396
val = StringUtils.trimToNull(val);
97+
val = StringUtils.replaceIgnoreCase(val, "below lod of", "");
9498
val = StringUtils.replaceIgnoreCase(val, "below", "");
9599
val = StringUtils.trimToNull(val);
96100
if (NumberUtils.isCreatable(val))
@@ -103,7 +107,7 @@ else if (val.toLowerCase().contains("below"))
103107

104108
if (!NumberUtils.isCreatable(val))
105109
{
106-
errors.addError(new SimpleValidationError("Non-numeric VL: ["+ row.get("result") + "]", "result", ValidationException.SEVERITY.ERROR));
110+
errors.addError(new SimpleValidationError("Non-numeric VL: [" + row.get("result") + "]", "result", ValidationException.SEVERITY.ERROR));
107111
}
108112
}
109113
}

0 commit comments

Comments
 (0)