|
@@ -28,13 +28,18 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Controller
|
|
|
@RequestMapping("/feature")
|
|
|
public class FeatureController extends BaseController<Feature, FeatureWrapper, Long> {
|
|
|
private String[] negative_words = Constants.negative_words;
|
|
|
-
|
|
|
+ //体征提取范围
|
|
|
+ private String featureNum;
|
|
|
private Map<String, String> propelSymptom = null;
|
|
|
private Map<String, String> propelDiag = null;
|
|
|
private Map<String, String> propelVital= null;
|
|
@@ -146,60 +151,64 @@ 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");*/
|
|
|
FeatureAnalyze sa = new FeatureAnalyze();
|
|
|
for (String featureType : featureTypes.split(",")) {
|
|
|
- for (Info info : docInfos) {
|
|
|
- switch (FeatureType.parse(featureType)) {
|
|
|
- case SYMPTOM:
|
|
|
- content = info.getPresent();
|
|
|
- propel = propelSymptom;
|
|
|
- break;
|
|
|
- case TIME:
|
|
|
- content = info.getPresent();
|
|
|
- propel = propelSymptom;
|
|
|
- break;
|
|
|
- case FEATURE:
|
|
|
- content = info.getPresent();
|
|
|
- propel = propelSymptom;
|
|
|
- break;
|
|
|
- case VITAL:
|
|
|
- content = info.getVital();
|
|
|
- propel = propelVital;
|
|
|
- break;
|
|
|
- case PACS:
|
|
|
- content = info.getPacs();
|
|
|
- propel = propelPacs;
|
|
|
- break;
|
|
|
- case LIS:
|
|
|
- content = info.getLis();
|
|
|
- propel = propelLis;
|
|
|
- break;
|
|
|
- case DIAG:
|
|
|
- content = info.getDiag();
|
|
|
- propel = propelDiag;
|
|
|
- break;
|
|
|
- }
|
|
|
- featureList = sa.start(content, FeatureType.parse(featureType));
|
|
|
-
|
|
|
- if (featureList == null) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- for (int i = 0; i < featureList.size(); i++) {
|
|
|
- featureMap = featureList.get(i);
|
|
|
- featureMap.put("rdn", info.getRdn());
|
|
|
- featureMap.put("age", StringUtils.isEmpty(info.getAge())?"0":info.getAge());
|
|
|
- featureMap.put("sex", info.getSex());
|
|
|
- featureMap.put("resource_type", info.getResourceType());
|
|
|
-
|
|
|
- if (propel.get(featureMap.get("feature_name")) == null) {
|
|
|
- featureMap.put("is_push", "0");
|
|
|
- } else {
|
|
|
- featureMap.put("is_push", "1");
|
|
|
+ for (String feature : featureNum.split(",")) {
|
|
|
+ /*sa.setFeatureNum(feature);*/
|
|
|
+ for (Info info : docInfos) {
|
|
|
+ switch (FeatureType.parse(featureType)) {
|
|
|
+ case SYMPTOM:
|
|
|
+ content = info.getPresent();
|
|
|
+ propel = propelSymptom;
|
|
|
+ break;
|
|
|
+ case TIME:
|
|
|
+ content = info.getPresent();
|
|
|
+ propel = propelSymptom;
|
|
|
+ break;
|
|
|
+ case FEATURE:
|
|
|
+ content = info.getPresent();
|
|
|
+ propel = propelSymptom;
|
|
|
+ break;
|
|
|
+ case VITAL:
|
|
|
+ content = info.getVital();
|
|
|
+ propel = propelVital;
|
|
|
+ break;
|
|
|
+ case PACS:
|
|
|
+ content = info.getPacs();
|
|
|
+ propel = propelPacs;
|
|
|
+ break;
|
|
|
+ case LIS:
|
|
|
+ content = info.getLis();
|
|
|
+ propel = propelLis;
|
|
|
+ break;
|
|
|
+ case DIAG:
|
|
|
+ content = info.getDiag();
|
|
|
+ propel = propelDiag;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ featureList = sa.start(content, FeatureType.parse(featureType));
|
|
|
+ if (featureList == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (int i = 0; i < featureList.size(); i++) {
|
|
|
+ featureMap = featureList.get(i);
|
|
|
+ featureMap.put("rdn", info.getRdn() + "_" + feature);
|
|
|
+ featureMap.put("age", StringUtils.isEmpty(info.getAge()) ? "0" : info.getAge());
|
|
|
+ featureMap.put("sex", info.getSex());
|
|
|
+ featureMap.put("resource_type", info.getResourceType());
|
|
|
+ if (propel.get(featureMap.get("feature_name")) == null) {
|
|
|
+ featureMap.put("is_push", "0");
|
|
|
+ } else {
|
|
|
+ featureMap.put("is_push", "1");
|
|
|
+ }
|
|
|
+ data.add(featureMap);
|
|
|
}
|
|
|
- data.add(featureMap);
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
MysqlJdbc jdbc = new MysqlJdbc(env.getProperty("spring.datasource.username"),
|