File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
sormas-ui/src/main/java/de/symeda/sormas/ui/samples/environmentsample Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -369,10 +369,14 @@ private void addValidators() {
369
369
}
370
370
371
371
private Date getEarliestPathogenTestDate () {
372
- List <PathogenTestDto > pathogenTests = FacadeProvider .getPathogenTestFacade ().getAllByEnvironmentSample (getValue ().toReference ());
373
- if (pathogenTests .isEmpty ()) {
372
+ if (!isCreate ) {
373
+ List <PathogenTestDto > pathogenTests = FacadeProvider .getPathogenTestFacade ().getAllByEnvironmentSample (getValue ().toReference ());
374
+ if (pathogenTests .isEmpty ()) {
375
+ return null ;
376
+ }
377
+ return pathogenTests .stream ().map (PathogenTestDto ::getTestDateTime ).filter (Objects ::nonNull ).min (Date ::compareTo ).orElseGet (() -> null );
378
+ } else {
374
379
return null ;
375
380
}
376
- return pathogenTests .stream ().map (PathogenTestDto ::getTestDateTime ).filter (Objects ::nonNull ).min (Date ::compareTo ).orElseGet (() -> null );
377
381
}
378
382
}
You can’t perform that action at this time.
0 commit comments