|
@@ -1,10 +1,14 @@
|
|
|
package org.diagbot.rule.lis;
|
|
|
|
|
|
+import org.diagbot.common.push.bean.SearchData;
|
|
|
import org.diagbot.nlp.rule.module.PreResult;
|
|
|
+import org.diagbot.nlp.util.Constants;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @Description:
|
|
@@ -16,26 +20,41 @@ public class LisApplication {
|
|
|
private static String down = "降低";
|
|
|
private static String normal = "正常";
|
|
|
|
|
|
- public List<PreResult> lisConvert(List<PreResult> preResultList) {
|
|
|
+ public void lisConvert(List<PreResult> preResultList, SearchData searchData) {
|
|
|
if (preResultList != null) {
|
|
|
for (PreResult result : preResultList) {
|
|
|
- if (isNumber(result.getValue())) {
|
|
|
- if (!StringUtils.isEmpty(result.getMaxValue()) && !StringUtils.isEmpty(result.getMinValue())
|
|
|
- && isNormal(result.getValue(), result.getMaxValue(), result.getMinValue())) {
|
|
|
- result.setOtherValue(result.getUniqueName() + normal);
|
|
|
- } else if (!StringUtils.isEmpty(result.getMaxValue())
|
|
|
- && compareMax(result.getValue(), result.getMaxValue())) {
|
|
|
- result.setOtherValue(result.getUniqueName() + up);
|
|
|
- } else if (!StringUtils.isEmpty(result.getMinValue())
|
|
|
- && compareMin(result.getValue(), result.getMinValue())) {
|
|
|
- result.setOtherValue(result.getUniqueName() + down);
|
|
|
+ String covertValue = "";
|
|
|
+ if (!StringUtils.isEmpty(result.getUniqueName())) {
|
|
|
+ //value是数值类型则进行转换
|
|
|
+ if (!StringUtils.isEmpty(result.getValue()) && isNumber(result.getValue())) {
|
|
|
+ if (!StringUtils.isEmpty(result.getMaxValue()) && !StringUtils.isEmpty(result.getMinValue())
|
|
|
+ && isNormal(result.getValue(), result.getMaxValue(), result.getMinValue())) {
|
|
|
+ covertValue = result.getUniqueName() + normal;
|
|
|
+ } else if (!StringUtils.isEmpty(result.getMaxValue())
|
|
|
+ && compareMax(result.getValue(), result.getMaxValue())) {
|
|
|
+ covertValue = result.getUniqueName() + up;
|
|
|
+ } else if (!StringUtils.isEmpty(result.getMinValue())
|
|
|
+ && compareMin(result.getValue(), result.getMinValue())) {
|
|
|
+ covertValue = result.getUniqueName() + down;
|
|
|
+ }
|
|
|
+ } else if (!StringUtils.isEmpty(result.getOtherValue())){
|
|
|
+ //otherValue是文本类型则直接与UniqueName拼接
|
|
|
+ covertValue = result.getUniqueName() + result.getOtherValue();
|
|
|
}
|
|
|
- } else {
|
|
|
- result.setOtherValue(result.getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("featureType", Constants.feature_type_lis);
|
|
|
+ map.put("featureName", covertValue);
|
|
|
+ map.put("property", Constants.word_property_LIS_Result);
|
|
|
+ map.put("concept", covertValue);
|
|
|
+ //全是有
|
|
|
+ map.put("negative", Constants.default_negative);
|
|
|
+ if (searchData.getInputs().get(map.get("featureName")) == null) {
|
|
|
+ searchData.getInputs().put(map.get("featureName"), map);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return preResultList;
|
|
|
}
|
|
|
|
|
|
|