diff --git a/frontend/src/components/modifyOrder/ModifyOrder.js b/frontend/src/components/modifyOrder/ModifyOrder.js index 38b88c0770..30797abb49 100644 --- a/frontend/src/components/modifyOrder/ModifyOrder.js +++ b/frontend/src/components/modifyOrder/ModifyOrder.js @@ -11,9 +11,11 @@ function ModifyOrder() { return ( <> +
+
); } diff --git a/src/main/java/org/openelisglobal/systemuser/service/UserServiceImpl.java b/src/main/java/org/openelisglobal/systemuser/service/UserServiceImpl.java index d55a6f5c2f..72b8388fb5 100644 --- a/src/main/java/org/openelisglobal/systemuser/service/UserServiceImpl.java +++ b/src/main/java/org/openelisglobal/systemuser/service/UserServiceImpl.java @@ -172,7 +172,7 @@ public List getUserTestSections(String systemUserId, String roleId) return userTestSections; } } - + @Override public List getUserSampleTypes(String systemUserId, String roleName) { String resultsRoleId = roleService.getRoleByName(roleName).getId(); @@ -181,22 +181,26 @@ public List getUserSampleTypes(String systemUserId, String roleName if (testSections != null) { testSections.forEach(testSection -> testUnitIds.add(Integer.valueOf(testSection.getId()))); } - + List allTests = testService.getTestsByTestSectionIds(testUnitIds); Set sampleIds = new HashSet<>(); // clear cache to create a fresh Map of testId To TypeOfSample List userSampleTypes = new ArrayList<>(); - if (allTests != null ) { + if (allTests != null) { typeOfSampleService.clearCache(); - allTests.forEach(test -> sampleIds.addAll(typeOfSampleService.getTypeOfSampleForTest(test.getId()).stream() - .map(e -> e.getId()).collect(Collectors.toList()))); + allTests.forEach(test -> { + List sampleTypes = typeOfSampleService.getTypeOfSampleForTest(test.getId()); + if (sampleTypes != null) { + sampleIds.addAll(sampleTypes.stream().map(e -> e.getId()).collect(Collectors.toList())); + } + }); } - - sampleIds.forEach( id -> { + + sampleIds.forEach(id -> { TypeOfSample type = typeOfSampleService.get(id); - if(type != null){ - userSampleTypes.add(new IdValuePair(type.getId(), type.getLocalizedName())); + if (type != null) { + userSampleTypes.add(new IdValuePair(type.getId(), type.getLocalizedName())); } });