|
@@ -68,7 +68,9 @@ public class ParamsDataProxy {
|
|
|
//所有信息参与推送
|
|
|
// searchData.setSymptom(searchData.getSymptom() + searchData.getVital()
|
|
|
// + searchData.getLis() + searchData.getPacs() + searchData.getPast() + searchData.getOther() + searchData.getIndications());
|
|
|
- searchData.setSymptom(searchData.getSymptom().trim());
|
|
|
+ if (StringUtils.isNotEmpty(searchData.getSymptom())) {
|
|
|
+ searchData.setSymptom(searchData.getSymptom().trim());
|
|
|
+ }
|
|
|
//一次推送多个类别信息
|
|
|
String[] featureTypes = searchData.getFeatureType().split(",");
|
|
|
//featureType统一转换
|
|
@@ -81,37 +83,45 @@ public class ParamsDataProxy {
|
|
|
|
|
|
//获取入参中的特征信息
|
|
|
FeatureAnalyze fa = new FeatureAnalyze();
|
|
|
-
|
|
|
+ List<Map<String, Object>> featuresList = new ArrayList<>();
|
|
|
if (!StringUtils.isEmpty(searchData.getSymptom())) {
|
|
|
//提取现病史
|
|
|
- List<Map<String, Object>> featuresList = fa.start(searchData.getSymptom(), FeatureType.FEATURE);
|
|
|
+ featuresList = fa.start(searchData.getSymptom(), FeatureType.FEATURE);
|
|
|
paramFeatureInit(searchData, featuresList);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(searchData.getVital())) {
|
|
|
//提取体征
|
|
|
featuresList = fa.start(searchData.getVital(), FeatureType.FEATURE);
|
|
|
paramFeatureInit(searchData, featuresList);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(searchData.getPast())) {
|
|
|
//提取既往史
|
|
|
featuresList = fa.start(searchData.getPast(), FeatureType.FEATURE);
|
|
|
paramFeatureInit(searchData, featuresList);
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(searchData.getOther()) || !StringUtils.isEmpty(searchData.getIndications())) {
|
|
|
//提取其他史等
|
|
|
- featuresList = fa.start(searchData.getOther() + searchData.getIndications(), FeatureType.FEATURE);
|
|
|
+ featuresList = fa.start(searchData.getOther() == null ? "" : searchData.getOther() + searchData.getIndications() == null ? "" : searchData.getIndications(), FeatureType.FEATURE);
|
|
|
paramFeatureInit(searchData, featuresList);
|
|
|
-
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(searchData.getPacs())) {
|
|
|
featuresList = fa.start(searchData.getPacs(), FeatureType.PACS);
|
|
|
paramFeatureInit(searchData, featuresList);
|
|
|
-
|
|
|
+ }
|
|
|
+ if (!StringUtils.isEmpty(searchData.getLis())) {
|
|
|
featuresList = fa.start(searchData.getLis(), FeatureType.LIS);
|
|
|
paramFeatureInit(searchData, featuresList);
|
|
|
-
|
|
|
- // 清洗特征词,去除词性不匹配的词
|
|
|
- searchData = cleanFeature(featuresList, fa, searchData);
|
|
|
-
|
|
|
+ }
|
|
|
+ // 清洗特征词,去除词性不匹配的词
|
|
|
+ searchData = cleanFeature(featuresList, fa, searchData);
|
|
|
+ if (!StringUtils.isEmpty(searchData.getOther())) {
|
|
|
//如果既往史中诊断信息,需要提取这个特征
|
|
|
featuresList = fa.start(searchData.getOther(), FeatureType.DIAG);
|
|
|
paramFeatureInit(searchData, featuresList);
|
|
|
}
|
|
|
|
|
|
if (!StringUtils.isEmpty(searchData.getDiag()) && StringUtils.isEmpty(searchData.getSymptom())) {
|
|
|
- List<Map<String, Object>> featuresList = fa.start(searchData.getDiag(), FeatureType.DIAG);
|
|
|
+ featuresList = fa.start(searchData.getDiag(), FeatureType.DIAG);
|
|
|
paramFeatureInit(searchData, featuresList);
|
|
|
}
|
|
|
}
|
|
@@ -324,15 +334,15 @@ public class ParamsDataProxy {
|
|
|
for (Map<String, String> standWordMap : standWordList) {
|
|
|
if (standWordMap.containsKey("unit") && standWordMap.containsKey("value")) {
|
|
|
if (features.length == 2) {
|
|
|
- newStandWord = judgment(features, standWordMap,newStandWord);
|
|
|
+ newStandWord = judgment(features, standWordMap, newStandWord,sData);
|
|
|
} else {
|
|
|
if (standWordMap.get("unit").equals(features[2].toLowerCase())) {
|
|
|
- newStandWord = judgment(features, standWordMap,newStandWord);
|
|
|
+ newStandWord = judgment(features, standWordMap, newStandWord,sData);
|
|
|
}
|
|
|
}
|
|
|
} else if (standWordMap.containsKey("value")) {
|
|
|
if (features.length == 2) {
|
|
|
- newStandWord = judgment(features, standWordMap,newStandWord);
|
|
|
+ newStandWord = judgment(features, standWordMap, newStandWord,sData);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -341,21 +351,17 @@ public class ParamsDataProxy {
|
|
|
String addStandWords = "";
|
|
|
String smallerStandWord = "";
|
|
|
boolean flag = true;
|
|
|
- for (String standWord:newStandWord.split(",")) {
|
|
|
- if (!"".equals(standWord) || standWord.length() > 0){
|
|
|
- if (!standWord.contains("/")){
|
|
|
- addStandWords += "," +standWord;
|
|
|
+ for (String standWord : newStandWord.split(",")) {
|
|
|
+ if (!"".equals(standWord) || standWord.length() > 0) {
|
|
|
+ if (standWord.contains("<") || standWord.contains("<=") || standWord.contains("小于")) {
|
|
|
+ smallerStandWord = "," + standWord;
|
|
|
} else {
|
|
|
- if (standWord.contains("<") || standWord.contains("<=")|| standWord.contains("小于")){
|
|
|
- smallerStandWord = "," +standWord;
|
|
|
- } else {
|
|
|
- addStandWords += "," +standWord;
|
|
|
- flag = false;
|
|
|
- }
|
|
|
+ addStandWords += "," + standWord;
|
|
|
+ flag = false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (flag){
|
|
|
+ if (flag) {
|
|
|
addStandWords += smallerStandWord;
|
|
|
}
|
|
|
sData.setSymptom(sData.getSymptom() + "," + addStandWords);
|
|
@@ -364,7 +370,7 @@ public class ParamsDataProxy {
|
|
|
}
|
|
|
|
|
|
//将标准词中体征指标值(数字)与分词结果中体征指标值(数字)比较
|
|
|
- private String judgment(String[] features, Map<String, String> standWordMap,String standWord) {
|
|
|
+ private String judgment(String[] features, Map<String, String> standWordMap, String standWord,SearchData sData) {
|
|
|
if (hasDigit(features[1])) {
|
|
|
try {
|
|
|
if (">".equals(standWordMap.get("op"))) {
|
|
@@ -385,7 +391,7 @@ public class ParamsDataProxy {
|
|
|
} else {
|
|
|
String num = getNum(standWordMap.get("value"));
|
|
|
if (Double.valueOf(getNum(features[1])) > Double.valueOf(num)) {
|
|
|
- standWord += "," + standWordMap.get("standword");
|
|
|
+ sData.setSymptom(sData.getSymptom() + "," + standWordMap.get("standword"));
|
|
|
}
|
|
|
}
|
|
|
} else if ("<".equals(standWordMap.get("op"))) {
|
|
@@ -406,7 +412,7 @@ public class ParamsDataProxy {
|
|
|
} else {
|
|
|
String num = getNum(standWordMap.get("value"));
|
|
|
if (Double.valueOf(getNum(features[1])) < Double.valueOf(num)) {
|
|
|
- standWord += "," + standWordMap.get("standword");
|
|
|
+ sData.setSymptom(sData.getSymptom() + "," + standWordMap.get("standword"));
|
|
|
}
|
|
|
}
|
|
|
} else if (">=".equals(standWordMap.get("op"))) {
|
|
@@ -427,10 +433,10 @@ public class ParamsDataProxy {
|
|
|
} else {
|
|
|
String num = getNum(standWordMap.get("value"));
|
|
|
if (Double.valueOf(getNum(features[1])) >= Double.valueOf(num)) {
|
|
|
- standWord += "," + standWordMap.get("standword");
|
|
|
+ sData.setSymptom(sData.getSymptom() + "," + standWordMap.get("standword"));
|
|
|
}
|
|
|
}
|
|
|
- }else if ("<=".equals(standWordMap.get("op"))) {
|
|
|
+ } else if ("<=".equals(standWordMap.get("op"))) {
|
|
|
//单独处理 血压小于90/60mmHg 类似情况
|
|
|
if (standWordMap.get("value").contains("/")) {
|
|
|
if (features[1].contains("/")) {
|
|
@@ -448,7 +454,7 @@ public class ParamsDataProxy {
|
|
|
} else {
|
|
|
String num = getNum(standWordMap.get("value"));
|
|
|
if (Double.valueOf(getNum(features[1])) <= Double.valueOf(num)) {
|
|
|
- standWord += "," + standWordMap.get("standword");
|
|
|
+ sData.setSymptom(sData.getSymptom() + "," + standWordMap.get("standword"));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -525,4 +531,4 @@ public class ParamsDataProxy {
|
|
|
return searchData;
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|