Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rule Builder #1114

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix Rule Builder
mozzy11 committed Jun 18, 2024
commit 92c73429a3e548f0f2b14d11020e24549f1d2769
Original file line number Diff line number Diff line change
@@ -113,20 +113,27 @@ public List<Analysis> addNewTestsToDBForCalculatedTests(
map.put(Integer.valueOf(test.getId()), null);
});
// insert innitial result value
map.put(
Integer.valueOf(resultSet.result.getTestResult().getTest().getId()),
Integer.valueOf(resultSet.result.getId()));
if (resultSet.result.getTestResult().getTest().getId() != null
&& resultSet.result.getId() != null) {
map.put(
Integer.valueOf(resultSet.result.getTestResult().getTest().getId()),
Integer.valueOf(resultSet.result.getId()));
}
calc.setTestResultMap(map);
resultcalculationService.insert(calc);
}

} else {
for (ResultCalculation resultCalculation : resultCalculations) {
resultCalculation
.getTestResultMap()
.put(
Integer.valueOf(resultSet.result.getTestResult().getTest().getId()),
Integer.valueOf(resultSet.result.getId()));
if (resultSet.result.getTestResult().getTest().getId() != null
&& resultSet.result.getId() != null) {
resultCalculation
.getTestResultMap()
.put(
Integer.valueOf(resultSet.result.getTestResult().getTest().getId()),
Integer.valueOf(resultSet.result.getId()));
}

resultcalculationService.update(resultCalculation);
}
}
@@ -181,7 +188,7 @@ public List<Analysis> addNewTestsToDBForCalculatedTests(
function.append(number).append(" ");
}
} catch (NumberFormatException e) {

}
break;
case MATH_FUNCTION:
@@ -530,9 +537,18 @@ private Analysis createCalculatedAnalysis(
generatedAnalysis.setSysUserId(systemUserId);
generatedAnalysis.setResultCalculated(resultCalculated);
if (existingAnalysis != null) {
analysisService.update(generatedAnalysis);
try {
analysisService.update(generatedAnalysis);
} catch (Exception e) {
return null;
}

} else {
analysisService.insert(generatedAnalysis);
try {
analysisService.insert(generatedAnalysis);
} catch (Exception e) {
return null;
}
}
if (resultCalculated) {
createInternalNote(
Original file line number Diff line number Diff line change
@@ -704,8 +704,12 @@ private Optional<Analysis> addReflexTest(
currentAnalysis.setSysUserId(sysUserId);
currentAnalysis.setTriggeredReflex(Boolean.TRUE);

analysisService.insert(newAnalysis);
analysisService.update(currentAnalysis);
try {
analysisService.insert(newAnalysis);
analysisService.update(currentAnalysis);
} catch (Exception e) {
return Optional.empty();
}

List<Note> notes = new ArrayList<>();
notes.add(