diff --git a/frontend/src/components/addOrder/Index.js b/frontend/src/components/addOrder/Index.js
index b08db9666c..c84f1cdac4 100755
--- a/frontend/src/components/addOrder/Index.js
+++ b/frontend/src/components/addOrder/Index.js
@@ -64,6 +64,15 @@ const Index = () => {
};
const handleSubmitOrderForm = (e) => {
e.preventDefault();
+ if ("years" in orderFormValues.patientProperties) {
+ delete orderFormValues.patientProperties.years;
+ }
+ if ("months" in orderFormValues.patientProperties) {
+ delete orderFormValues.patientProperties.months;
+ }
+ if ("days" in orderFormValues.patientProperties) {
+ delete orderFormValues.patientProperties.days;
+ }
console.log(JSON.stringify(orderFormValues))
postToOpenElisServer(
"/rest/SamplePatientEntry",
diff --git a/frontend/src/components/admin/reflexTests/AutoComplete.js b/frontend/src/components/admin/reflexTests/AutoComplete.js
deleted file mode 100644
index 7eb1e397e5..0000000000
--- a/frontend/src/components/admin/reflexTests/AutoComplete.js
+++ /dev/null
@@ -1,159 +0,0 @@
-import React, { useState } from "react";
-
-import { FormattedMessage } from "react-intl";
-import "./ReflexStyles.css";
-import { TextInput } from "@carbon/react";
-
-function Autocomplete(props) {
- const [activeSuggestion, setActiveSuggestion] = useState(0);
- const [filteredSuggestions, setFilteredSuggestions] = useState([]);
- const [showSuggestions, setShowSuggestions] = useState(false);
- const [userInput, setUserInput] = useState("");
- const [invalid, setInvalid] = useState(false);
-
- const onChange = (e) => {
- const {
- suggestions,
- index,
- item_index,
- handleChange,
- field,
- name,
- addError,
- } = props;
- const userInput = e.currentTarget.value;
-
- const filteredSuggestions = suggestions.filter(
- (suggestion) =>
- suggestion.label.toLowerCase().indexOf(userInput.toLowerCase()) > -1,
- );
-
- setActiveSuggestion(0);
- setFilteredSuggestions(filteredSuggestions);
- setShowSuggestions(true);
- setUserInput(e.currentTarget.value);
-
- addError({
- name: name + "-" + index + "-" + item_index,
- error: "Invaid Test",
- });
- const nameValue = {
- target: { name: name, value: e.currentTarget.value },
- };
-
- handleChange(nameValue, index, item_index, field);
- if (filteredSuggestions.length) {
- setInvalid(true);
- }
- };
-
- const onClick = (e, id, testDetails) => {
- const {
- index,
- item_index,
- handleChange,
- field,
- name,
- idField,
- onSelect,
- clearError,
- } = props;
- setActiveSuggestion(0);
- setShowSuggestions(false);
- setFilteredSuggestions([]);
- setUserInput(e.currentTarget.innerText);
- setInvalid(false);
-
- clearError(name + "-" + index + "-" + item_index);
- const nameValue = {
- target: { name: name, value: e.currentTarget.innerText },
- };
-
- const nameId = {
- target: { name: idField, value: id },
- };
-
- handleChange(nameValue, index, item_index, field);
- handleChange(nameId, index, item_index, field);
- if (typeof onSelect === "function") {
- onSelect(index, item_index, testDetails);
- }
- };
-
- const onKeyDown = (e) => {
- if (e.keyCode === 13) {
- setActiveSuggestion(0);
- setShowSuggestions(false);
- setUserInput(filteredSuggestions[activeSuggestion]);
- } else if (e.keyCode === 38) {
- if (activeSuggestion === 0) {
- return;
- }
- setActiveSuggestion(activeSuggestion - 1);
- }
- // User pressed the down arrow, increment the index
- else if (e.keyCode === 40) {
- if (activeSuggestion - 1 === filteredSuggestions.length) {
- return;
- }
- setActiveSuggestion(activeSuggestion + 1);
- }
- };
-
- let suggestionsListComponent;
-
- if (showSuggestions && userInput) {
- if (filteredSuggestions.length) {
- suggestionsListComponent = (
-
- {filteredSuggestions.map((suggestion, index) => {
- let className;
-
- // Flag the active suggestion with a class
- if (index === activeSuggestion) {
- className = "suggestion-active";
- }
- return (
- - onClick(e, suggestion.value, suggestion)}
- >
- {suggestion.label}
-
- );
- })}
-
- );
- } else {
- suggestionsListComponent = (
-
-
-
-
-
- );
- }
- }
-
- return (
- <>
- }
- />
- {suggestionsListComponent}
- >
- );
-}
-
-export default Autocomplete;
diff --git a/frontend/src/components/admin/reflexTests/ReflexRuleForm.js b/frontend/src/components/admin/reflexTests/ReflexRuleForm.js
index 35d7a4f086..1c441c44ba 100644
--- a/frontend/src/components/admin/reflexTests/ReflexRuleForm.js
+++ b/frontend/src/components/admin/reflexTests/ReflexRuleForm.js
@@ -3,6 +3,7 @@ import {
Form,
Stack,
TextInput,
+ TextArea,
Select,
SelectItem,
Button,
@@ -15,7 +16,7 @@ import {
ModalWrapper,
} from "@carbon/react";
import { Add, Subtract } from "@carbon/react/icons";
-import Autocomplete from "./AutoComplete";
+import AutoComplete from "../../common/AutoComplete.js";
import RuleBuilderFormValues from "../../formModel/innitialValues/RuleBuilderFormValues";
import { getFromOpenElisServer, postToOpenElisServer } from "../../utils/Utils";
import { NotificationContext } from "../../layout/Layout";
@@ -109,7 +110,7 @@ function ReflexRule() {
rule.conditions.forEach(function (condition, conditionIndex) {
if (condition.sampleId) {
getFromOpenElisServer(
- "/rest/test-details?sampleType=" + condition.sampleId,
+ "/rest/test-display-beans?sampleType=" + condition.sampleId,
(resp) =>
fetchDeafultTests(
resp,
@@ -126,7 +127,7 @@ function ReflexRule() {
rule.actions.forEach(function (action, actionIndex) {
if (action.sampleId) {
getFromOpenElisServer(
- "/rest/test-details?sampleType=" + action.sampleId,
+ "/rest/test-display-beans?sampleType=" + action.sampleId,
(resp) =>
fetchDeafultTests(
resp,
@@ -161,7 +162,7 @@ function ReflexRule() {
if (condition.value) {
const test = defaultSampleTests.conditions[index][item_index].find(
(test) => {
- if (test.value.trim() === condition.testId) {
+ if (test.id.trim() === condition.testId) {
return true;
}
},
@@ -213,12 +214,29 @@ function ReflexRule() {
setRuleList(list);
};
+ const handleAutoCompleteRuleFieldItemChange = (
+ value,
+ name,
+ index,
+ itemIndex,
+ field,
+ ) => {
+ const list = [...ruleList];
+ list[index][field][itemIndex][name] = value;
+ setRuleList(list);
+ };
+
const handleAddNotificationChange = (value, index, itemIndex, field) => {
const e = { target: { name: "addNotification", value: value } };
handleRuleFieldItemChange(e, index, itemIndex, field);
};
- const handleTestSelected = (index, item_index, testDetails) => {
+ const handleTestSelected = (id, index, item_index, field) => {
+ var testDetails = {resultList : [] ,resultType :"N"};
+ if (sampleTestList[field]) {
+ testDetails = sampleTestList[field][index][item_index].find(
+ (test) => test.id == id)
+ }
const results = { ...testResultList };
if (!results[index]) {
results[index] = {};
@@ -242,8 +260,9 @@ function ReflexRule() {
const handleSampleSelected = (e, index, item_index, field) => {
const { value } = e.target;
- getFromOpenElisServer("/rest/test-details?sampleType=" + value, (resp) =>
- fetchTests(resp, index, item_index, field),
+ getFromOpenElisServer(
+ "/rest/test-display-beans?sampleType=" + value,
+ (resp) => fetchTests(resp, index, item_index, field),
);
};
@@ -544,19 +563,34 @@ function ReflexRule() {
-
{
+ handleAutoCompleteRuleFieldItemChange(
+ id,
+ "testId",
+ index,
+ condition_index,
+ FIELD.conditions,
+ );
+ handleTestSelected(
+ id,
+ index,
+ condition_index,
+ FIELD.conditions,
+ );
+ }}
name="testName"
- idField="testId"
label={
}
class="autocomplete"
- item_index={condition_index}
- field={FIELD.conditions}
suggestions={
sampleTestList[FIELD.conditions][index]
? sampleTestList[FIELD.conditions][index][
@@ -565,8 +599,6 @@ function ReflexRule() {
: []
}
required
- addError={addError}
- clearError={clearError}
/>
@@ -673,8 +705,8 @@ function ReflexRule() {
condition_value_index,
) => (
),
@@ -924,20 +956,25 @@ function ReflexRule() {
-
{
+ handleAutoCompleteRuleFieldItemChange(
+ id,
+ "reflexTestId",
+ index,
+ action_index,
+ FIELD.actions,
+ );
+ }}
label={
}
name="reflexTestName"
- idField="reflexTestId"
- item_index={action_index}
- field={FIELD.actions}
+ value={action.reflexTestId}
class="autocomplete"
- addError={addError}
- clearError={clearError}
suggestions={
sampleTestList[FIELD.actions][index]
? sampleTestList[FIELD.actions][index][
@@ -949,9 +986,13 @@ function ReflexRule() {
*/}
{rule.actions.length - 1 === action_index && (
@@ -1105,9 +1150,6 @@ function ReflexRule() {
{ruleList.length !== 1 && (
- //
- //
- //
diff --git a/src/main/java/org/openelisglobal/common/rest/DisplayListController.java b/src/main/java/org/openelisglobal/common/rest/DisplayListController.java
index d37789a7d8..54d5bc7b0b 100644
--- a/src/main/java/org/openelisglobal/common/rest/DisplayListController.java
+++ b/src/main/java/org/openelisglobal/common/rest/DisplayListController.java
@@ -14,6 +14,7 @@
import org.apache.commons.lang3.StringUtils;
import org.openelisglobal.common.action.IActionConstants;
import org.openelisglobal.common.constants.Constants;
+import org.openelisglobal.common.rest.provider.bean.TestDisplayBean;
import org.openelisglobal.common.services.DisplayListService;
import org.openelisglobal.common.services.DisplayListService.ListType;
import org.openelisglobal.common.services.IStatusService;
@@ -23,6 +24,8 @@
import org.openelisglobal.common.util.ConfigurationProperties.Property;
import org.openelisglobal.common.util.DateUtil;
import org.openelisglobal.common.util.IdValuePair;
+import org.openelisglobal.dictionary.service.DictionaryService;
+import org.openelisglobal.dictionary.valueholder.Dictionary;
import org.openelisglobal.localization.service.LocalizationService;
import org.openelisglobal.organization.service.OrganizationService;
import org.openelisglobal.organization.valueholder.Organization;
@@ -38,6 +41,8 @@
import org.openelisglobal.test.service.TestService;
import org.openelisglobal.test.service.TestServiceImpl;
import org.openelisglobal.test.valueholder.Test;
+import org.openelisglobal.testresult.service.TestResultService;
+import org.openelisglobal.testresult.valueholder.TestResult;
import org.openelisglobal.typeofsample.service.TypeOfSampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -84,6 +89,12 @@ public class DisplayListController extends BaseRestController{
@Autowired
private SiteInformationService siteInformationService;
+ @Autowired
+ private TestResultService testResultService;
+
+ @Autowired
+ DictionaryService dictionaryService;
+
private static boolean HAS_NFS_PANEL = false;
static {
@@ -419,5 +430,41 @@ public List
getDepartmentsForReferingSite(@RequestParam String reff
return list;
}
+
+ @GetMapping(value = "test-display-beans", produces = MediaType.APPLICATION_JSON_VALUE)
+ @ResponseBody
+ public List getTestBeansBySample(@RequestParam(required = false) String sampleType) {
+ List testItems = new ArrayList<>();
+ List testList = new ArrayList<>();
+ if (StringUtils.isNotBlank(sampleType)) {
+ testList = typeOfSampleService.getActiveTestsBySampleTypeId(sampleType, false);
+ } else {
+ return testItems;
+ }
+
+ for (Test test : testList) {
+ TestDisplayBean testDisplayBean = new TestDisplayBean(test.getId(),
+ TestServiceImpl.getLocalizedTestNameWithType(test), testService.getResultType(test));
+ List resultList = new ArrayList<>();
+ List results = testResultService.getActiveTestResultsByTest(test.getId());
+ results.forEach(result -> {
+ if (result.getValue() != null) {
+ Dictionary dict = dictionaryService.getDictionaryById(result.getValue());
+ resultList.add(new IdValuePair(dict.getId(), dict.getLocalizedName()));
+ }
+ });
+ testDisplayBean.setResultList(resultList);
+ testItems.add(testDisplayBean);
+
+ Collections.sort(testItems, new Comparator() {
+
+ @Override
+ public int compare(TestDisplayBean o1, TestDisplayBean o2) {
+ return o1.getValue().compareTo(o2.getValue());
+ }
+ });
+ }
+ return testItems;
+ }
}
diff --git a/src/main/java/org/openelisglobal/testcalculated/action/bean/TestDisplayBeanItem.java b/src/main/java/org/openelisglobal/common/rest/provider/bean/TestDisplayBean.java
similarity index 74%
rename from src/main/java/org/openelisglobal/testcalculated/action/bean/TestDisplayBeanItem.java
rename to src/main/java/org/openelisglobal/common/rest/provider/bean/TestDisplayBean.java
index 12be4c1a93..cbccd3cac0 100644
--- a/src/main/java/org/openelisglobal/testcalculated/action/bean/TestDisplayBeanItem.java
+++ b/src/main/java/org/openelisglobal/common/rest/provider/bean/TestDisplayBean.java
@@ -1,14 +1,14 @@
-package org.openelisglobal.testcalculated.action.bean;
+package org.openelisglobal.common.rest.provider.bean;
import java.util.List;
import org.openelisglobal.common.util.IdValuePair;
-public class TestDisplayBeanItem extends IdValuePair {
+public class TestDisplayBean extends IdValuePair {
String resultType ;
List resultList;
- public TestDisplayBeanItem(String id, String value , String resultType) {
+ public TestDisplayBean(String id, String value , String resultType) {
super(id, value);
this.resultType = resultType;
}
diff --git a/src/main/java/org/openelisglobal/test/beanItems/TestDisplayBean.java b/src/main/java/org/openelisglobal/test/beanItems/TestDisplayBean.java
deleted file mode 100644
index d8b3fbef27..0000000000
--- a/src/main/java/org/openelisglobal/test/beanItems/TestDisplayBean.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.openelisglobal.test.beanItems;
-
-import java.util.List;
-
-import org.openelisglobal.common.util.LabelValuePair;
-
-public class TestDisplayBean {
- String label;
- String value;
- String resultType;
- List resultList;
-
- public String getLabel() {
- return label;
- }
-
- public void setLabel(String label) {
- this.label = label;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String getResultType() {
- return resultType;
- }
-
- public void setResultType(String resultType) {
- this.resultType = resultType;
- }
-
- public List getResultList() {
- return resultList;
- }
-
- public void setResultList(List resultList) {
- this.resultList = resultList;
- }
-
-}
diff --git a/src/main/java/org/openelisglobal/testcalculated/controller/rest/CalculatedValueRestController.java b/src/main/java/org/openelisglobal/testcalculated/controller/rest/CalculatedValueRestController.java
index e595570773..7b94da0c1f 100644
--- a/src/main/java/org/openelisglobal/testcalculated/controller/rest/CalculatedValueRestController.java
+++ b/src/main/java/org/openelisglobal/testcalculated/controller/rest/CalculatedValueRestController.java
@@ -1,27 +1,17 @@
package org.openelisglobal.testcalculated.controller.rest;
-import java.util.ArrayList;
import java.util.Collections;
-import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.lang3.StringUtils;
import org.openelisglobal.common.util.IdValuePair;
import org.openelisglobal.dictionary.service.DictionaryService;
-import org.openelisglobal.dictionary.valueholder.Dictionary;
import org.openelisglobal.patient.service.PatientService;
import org.openelisglobal.result.service.ResultService;
-import org.openelisglobal.test.service.TestService;
-import org.openelisglobal.test.service.TestServiceImpl;
-import org.openelisglobal.test.valueholder.Test;
-import org.openelisglobal.testcalculated.action.bean.TestDisplayBeanItem;
import org.openelisglobal.testcalculated.service.ResultCalculationService;
import org.openelisglobal.testcalculated.service.TestCalculationService;
import org.openelisglobal.testcalculated.valueholder.Calculation;
import org.openelisglobal.testcalculated.valueholder.Operation;
-import org.openelisglobal.testresult.service.TestResultService;
-import org.openelisglobal.testresult.valueholder.TestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@@ -30,7 +20,6 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.openelisglobal.typeofsample.service.TypeOfSampleService;
@@ -42,15 +31,9 @@ public class CalculatedValueRestController {
@Autowired
TypeOfSampleService typeOfSampleService;
- @Autowired
- private TestService testService;
-
@Autowired
TestCalculationService testCalculationService;
-
- @Autowired
- private TestResultService testResultService;
-
+
@Autowired
DictionaryService dictionaryService;
@@ -92,41 +75,6 @@ public List getReflexRules(HttpServletRequest request) {
return !calculations.isEmpty() ? calculations : Collections. emptyList();
}
- @GetMapping(value = "test-display-beans", produces = MediaType.APPLICATION_JSON_VALUE)
- @ResponseBody
- public List getTestsBySample(@RequestParam(required = false) String sampleType) {
- List testItems = new ArrayList<>();
- List testList = new ArrayList<>();
- if (StringUtils.isNotBlank(sampleType)) {
- testList = typeOfSampleService.getActiveTestsBySampleTypeId(sampleType, false);
- } else {
- return testItems;
- }
-
- for (Test test : testList) {
- TestDisplayBeanItem testDisplayBean = new TestDisplayBeanItem(test.getId(),
- TestServiceImpl.getLocalizedTestNameWithType(test), testService.getResultType(test));
- List resultList = new ArrayList<>();
- List results = testResultService.getActiveTestResultsByTest(test.getId());
- results.forEach(result -> {
- if (result.getValue() != null) {
- Dictionary dict = dictionaryService.getDictionaryById(result.getValue());
- resultList.add(new IdValuePair(dict.getId(), dict.getLocalizedName()));
- }
- });
- testDisplayBean.setResultList(resultList);
- testItems.add(testDisplayBean);
-
- Collections.sort(testItems, new Comparator() {
-
- @Override
- public int compare(TestDisplayBeanItem o1, TestDisplayBeanItem o2) {
- return o1.getValue().compareTo(o2.getValue());
- }
- });
- }
- return testItems;
- }
@GetMapping(value = "math-functions", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
diff --git a/src/main/java/org/openelisglobal/testreflex/action/util/TestReflexUtil.java b/src/main/java/org/openelisglobal/testreflex/action/util/TestReflexUtil.java
index b9fb13594f..19b6263822 100644
--- a/src/main/java/org/openelisglobal/testreflex/action/util/TestReflexUtil.java
+++ b/src/main/java/org/openelisglobal/testreflex/action/util/TestReflexUtil.java
@@ -652,6 +652,23 @@ private Optional addReflexTest(TestReflex reflex, Result result, Strin
notes.add(note);
}
}
+ if(StringUtils.isNotBlank(reflex.getInternalNote())){
+ Note note = noteService.createSavableNote(newAnalysis, NoteType.INTERNAL,
+ reflex.getInternalNote(),
+ "Reflex Rule Internal Note", "1");
+ if (!noteService.duplicateNoteExists(note)) {
+ notes.add(note);
+ }
+ }
+
+ if(StringUtils.isNotBlank(reflex.getExternalNote())){
+ Note note = noteService.createSavableNote(newAnalysis, NoteType.EXTERNAL,
+ reflex.getExternalNote(),
+ "Reflex Rule External Note", "1");
+ if (!noteService.duplicateNoteExists(note)) {
+ notes.add(note);
+ }
+ }
noteService.saveAll(notes);
return Optional.of(newAnalysis);
}
diff --git a/src/main/java/org/openelisglobal/testreflex/controller/rest/TestReflexRuleRestController.java b/src/main/java/org/openelisglobal/testreflex/controller/rest/TestReflexRuleRestController.java
index 5f3c0d2af3..ad2f44b09f 100644
--- a/src/main/java/org/openelisglobal/testreflex/controller/rest/TestReflexRuleRestController.java
+++ b/src/main/java/org/openelisglobal/testreflex/controller/rest/TestReflexRuleRestController.java
@@ -2,26 +2,17 @@
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.lang3.StringUtils;
import org.openelisglobal.common.util.LabelValuePair;
import org.openelisglobal.dictionary.service.DictionaryService;
-import org.openelisglobal.dictionary.valueholder.Dictionary;
-import org.openelisglobal.test.beanItems.TestDisplayBean;
-import org.openelisglobal.test.service.TestService;
-import org.openelisglobal.test.valueholder.Test;
-import org.openelisglobal.test.service.TestServiceImpl;
import org.openelisglobal.testreflex.action.bean.ReflexRule;
import org.openelisglobal.testreflex.action.bean.ReflexRuleOptionsDisplayItem;
import org.openelisglobal.testreflex.action.bean.ReflexRuleOptions;
import org.openelisglobal.testreflex.service.TestReflexService;
-import org.openelisglobal.testresult.service.TestResultService;
-import org.openelisglobal.testresult.valueholder.TestResult;
import org.openelisglobal.typeofsample.service.TypeOfSampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
@@ -31,7 +22,6 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@@ -41,10 +31,6 @@ public class TestReflexRuleRestController {
@Autowired
TestReflexService reflexService;
@Autowired
- private TestService testService;
- @Autowired
- private TestResultService testResultService;
- @Autowired
DictionaryService dictionaryService;
@Autowired
TypeOfSampleService typeOfSampleService;
@@ -90,42 +76,4 @@ public ReflexRuleOptionsDisplayItem getReflexRuleOptions() {
options.setNumericRelationOptions(numericRelationOptions);
return options;
}
-
- @GetMapping(value = "test-details", produces = MediaType.APPLICATION_JSON_VALUE)
- @ResponseBody
- public List getTestList(HttpServletRequest request, @RequestParam(required = false) String sampleType) {
- ArrayList tests = new ArrayList<>();
- List testList = new ArrayList<>();
- if (StringUtils.isNotBlank(sampleType)) {
- testList = typeOfSampleService.getActiveTestsBySampleTypeId(sampleType, false);
- } else {
- testList = testService.getAllActiveTests(false);
- }
- for (Test test : testList) {
- TestDisplayBean testObj = new TestDisplayBean();
- testObj.setLabel(TestServiceImpl.getLocalizedTestNameWithType(test));
- testObj.setValue(test.getId());
- testObj.setResultType(testService.getResultType(test));
- List resultList = new ArrayList<>();
- List results = testResultService.getActiveTestResultsByTest(test.getId());
- results.forEach(result -> {
- if (result.getValue() != null) {
- Dictionary dict = dictionaryService.getDictionaryById(result.getValue());
- resultList.add(new LabelValuePair(dict.getLocalizedName(), dict.getId()));
- }
- });
- testObj.setResultList(resultList);
- tests.add(testObj);
-
- Collections.sort(tests, new Comparator() {
- @Override
- public int compare(TestDisplayBean o1, TestDisplayBean o2) {
- return o1.getValue().compareTo(o2.getValue());
- }
- });
- }
-
- return tests;
- }
-
}
diff --git a/src/main/java/org/openelisglobal/testreflex/service/TestReflexServiceImpl.java b/src/main/java/org/openelisglobal/testreflex/service/TestReflexServiceImpl.java
index 1aa6c6227f..70d9dd1ac2 100644
--- a/src/main/java/org/openelisglobal/testreflex/service/TestReflexServiceImpl.java
+++ b/src/main/java/org/openelisglobal/testreflex/service/TestReflexServiceImpl.java
@@ -285,6 +285,8 @@ private void setTestReflexTest(Test triggerTest, ReflexRuleCondition condition,
reflex.setRelation(condition.getRelation());
reflex.setTestAnalyte(testAnalyte);
reflex.setTest(triggerTest);
+ reflex.setInternalNote(action.getInternalNote());
+ reflex.setExternalNote(action.getExternalNote());
if (testAndSampleMatches(action.getReflexTestId(), action.getSampleId())) {
Test reflexTest = testService.getTestById(action.getReflexTestId());
reflex.setAddedTest(reflexTest);
diff --git a/src/main/java/org/openelisglobal/testreflex/valueholder/TestReflex.java b/src/main/java/org/openelisglobal/testreflex/valueholder/TestReflex.java
index 123498f17c..afbb0c745c 100644
--- a/src/main/java/org/openelisglobal/testreflex/valueholder/TestReflex.java
+++ b/src/main/java/org/openelisglobal/testreflex/valueholder/TestReflex.java
@@ -63,6 +63,10 @@ public class TestReflex extends EnumValueItemImpl {
private ReflexRuleOptions.NumericRelationOptions relation;
+ private String internalNote;
+
+ private String externalNote;
+
public TestReflex() {
super();
this.testResult = new ValueHolder();
@@ -265,4 +269,19 @@ public void setRelation(ReflexRuleOptions.NumericRelationOptions relation) {
this.relation = relation;
}
+ public String getInternalNote() {
+ return internalNote;
+ }
+
+ public void setInternalNote(String internalNote) {
+ this.internalNote = internalNote;
+ }
+
+ public String getExternalNote() {
+ return externalNote;
+ }
+
+ public void setExternalNote(String externalNote) {
+ this.externalNote = externalNote;
+ }
}
diff --git a/src/main/resources/hibernate/hbm/TestReflex.hbm.xml b/src/main/resources/hibernate/hbm/TestReflex.hbm.xml
index 1f7c2c7101..52b39529b4 100644
--- a/src/main/resources/hibernate/hbm/TestReflex.hbm.xml
+++ b/src/main/resources/hibernate/hbm/TestReflex.hbm.xml
@@ -55,6 +55,12 @@
true
+
+
+
+
+
+
diff --git a/src/main/resources/liquibase/2.8.x.x/reflex_rule.xml b/src/main/resources/liquibase/2.8.x.x/reflex_rule.xml
index afe421325f..8a9326bded 100644
--- a/src/main/resources/liquibase/2.8.x.x/reflex_rule.xml
+++ b/src/main/resources/liquibase/2.8.x.x/reflex_rule.xml
@@ -109,4 +109,19 @@
+
+
+
+
+
+
+
+ add InternalNote and External Column to test_reflex table
+
+
+
+
+
+
+
\ No newline at end of file