|
@@ -2,6 +2,8 @@ package org.diagbot.nlp.controller;
|
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.diagbot.common.push.bean.RelevantFeature;
|
|
|
+import org.diagbot.common.push.cache.ApplicationCacheUtil;
|
|
|
import org.diagbot.nlp.common.NlpWebConstants;
|
|
|
import org.diagbot.nlp.dao.model.Feature;
|
|
|
import org.diagbot.nlp.dao.model.Info;
|
|
@@ -19,6 +21,7 @@ import org.diagbot.nlp.util.NlpCache;
|
|
|
import org.diagbot.nlp.util.NlpUtil;
|
|
|
import org.diagbot.pub.api.Response;
|
|
|
import org.diagbot.pub.jdbc.MysqlJdbc;
|
|
|
+import org.diagbot.pub.utils.PropertiesUtil;
|
|
|
import org.diagbot.pub.web.BaseController;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
@@ -45,6 +48,7 @@ public class FeatureController extends BaseController<Feature, FeatureWrapper, L
|
|
|
private Map<String, String> propelVital= null;
|
|
|
private Map<String, String> propelLis = null;
|
|
|
private Map<String, String> propelPacs = null;
|
|
|
+ private Map<String, RelevantFeature> relevant_feature_map = null;
|
|
|
|
|
|
{
|
|
|
listView = "pages/doc/feature/list";
|
|
@@ -151,12 +155,19 @@ public class FeatureController extends BaseController<Feature, FeatureWrapper, L
|
|
|
Map<String, String> propel = null;
|
|
|
List<Map<String, Object>> data = new ArrayList<>();
|
|
|
|
|
|
- /* PropertiesUtil propertiesUtil = new PropertiesUtil("nlp.properties");
|
|
|
- featureNum = propertiesUtil.getProperty("push.feature.num");*/
|
|
|
+ PropertiesUtil propertiesUtil = new PropertiesUtil("nlp.properties");
|
|
|
+ featureNum = propertiesUtil.getProperty("push.feature.num");
|
|
|
+ Boolean filter = false;//判断是否需要过滤
|
|
|
+ if(propertiesUtil.getProperty("extract.feature.filter").equals("1")){//配置为1时过滤
|
|
|
+ filter = true;
|
|
|
+ }
|
|
|
+ if (filter){
|
|
|
+ relevant_feature_map = ApplicationCacheUtil.get_relevant_feature();
|
|
|
+ }
|
|
|
FeatureAnalyze sa = new FeatureAnalyze();
|
|
|
for (String featureType : featureTypes.split(",")) {
|
|
|
for (String feature : featureNum.split(",")) {
|
|
|
- /*sa.setFeatureNum(feature);*/
|
|
|
+ sa.setFeatureNum(feature);
|
|
|
for (Info info : docInfos) {
|
|
|
switch (FeatureType.parse(featureType)) {
|
|
|
case SYMPTOM:
|
|
@@ -203,7 +214,17 @@ public class FeatureController extends BaseController<Feature, FeatureWrapper, L
|
|
|
} else {
|
|
|
featureMap.put("is_push", "1");
|
|
|
}
|
|
|
- data.add(featureMap);
|
|
|
+ if(filter){//过滤过的结果
|
|
|
+ if(relevant_feature_map != null){
|
|
|
+ if(relevant_feature_map.get(info.getDiag()) != null){//获取对应疾病特征信息
|
|
|
+ if(relevant_feature_map.get(info.getDiag()).getFeature().equals(featureMap.get("feature_name"))){//与特征信息作对比
|
|
|
+ data.add(featureMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ data.add(featureMap);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|