From d376dc70ae3e95a60b1839c9b80706a0914e559d Mon Sep 17 00:00:00 2001 From: Mutesasira Moses Date: Thu, 27 Jul 2023 00:11:52 +0200 Subject: [PATCH] Update Calculation Implementation --- .../testcalculated/action/util/TestCalculatedUtil.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/openelisglobal/testcalculated/action/util/TestCalculatedUtil.java b/src/main/java/org/openelisglobal/testcalculated/action/util/TestCalculatedUtil.java index eae491bc8..2db8fcb24 100644 --- a/src/main/java/org/openelisglobal/testcalculated/action/util/TestCalculatedUtil.java +++ b/src/main/java/org/openelisglobal/testcalculated/action/util/TestCalculatedUtil.java @@ -208,6 +208,8 @@ private Analysis createCalculatedResult(ResultCalculation resultCalculation, Res if ("D".equals(resultType)) { if (Boolean.valueOf(value)) { result.setValue(calculation.getResult()); + }else{ + return null; } } else { result.setValue(value); @@ -236,13 +238,13 @@ private void createInternalNote(Result result, Analysis newAnalysis, Analysis cu String systemUserId) { List notes = new ArrayList<>(); Note note = noteService.createSavableNote(newAnalysis, NoteType.INTERNAL, - "Result Calculated From Calculation Rule :" + calculatioName, CALCULATION_SUBJECT, systemUserId); + "Result Succesfully Calculated From Calculation Rule :" + calculatioName, CALCULATION_SUBJECT, systemUserId); if (!noteService.duplicateNoteExists(note)) { notes.add(note); } Note note2 = noteService.createSavableNote(newAnalysis, NoteType.INTERNAL, - "Calculated From " + currentAnalysis.getTest().getLocalizedReportingName().getLocalizedValue(), + "Calculation Parameters include Result of Test " + currentAnalysis.getTest().getLocalizedReportingName().getLocalizedValue(), CALCULATION_SUBJECT, systemUserId); if (!noteService.duplicateNoteExists(note2)) { notes.add(note2); @@ -260,7 +262,7 @@ private void createMissingValueInternalNote(Result result, Analysis newAnalysis, notes.add(note); } Note note2 = noteService.createSavableNote(newAnalysis, NoteType.INTERNAL, - "Calculated From " + currentAnalysis.getTest().getLocalizedReportingName().getLocalizedValue(), + "Calculation Parameters include Result of Test : " + currentAnalysis.getTest().getLocalizedReportingName().getLocalizedValue(), CALCULATION_SUBJECT, systemUserId); if (!noteService.duplicateNoteExists(note2)) { notes.add(note2);