|
@@ -70,7 +70,9 @@ public class ClinicalFacade {
|
|
|
SearchVo sData = searchVo;
|
|
|
Map<String, List<Map<String, String>>> standWord = getStandWord();
|
|
|
Response<List<Lexeme>> resp = nlpServiceClient.split(sData.getSymptom());
|
|
|
- addStandWord(resp.getData(), standWord, sData);
|
|
|
+ if (null != resp && null != resp.getData()) {
|
|
|
+ addStandWord(resp.getData(), standWord, sData);
|
|
|
+ }
|
|
|
|
|
|
sData.setLisArr(processLis(sData.getLisArr()));
|
|
|
|
|
@@ -149,7 +151,6 @@ public class ClinicalFacade {
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public List<ScaleContent> getContent(String scaleName, String pushContent) {
|
|
|
List<ScaleContent> list = scaleContentService.getContentByName(scaleName);
|
|
|
for (ScaleContent scaleContent : list) {
|
|
@@ -203,11 +204,7 @@ public class ClinicalFacade {
|
|
|
//根据收集到的分词结果把体征指标和对应体征指标值(数字)拼接
|
|
|
List<String> featureType = new ArrayList<>();
|
|
|
for (int i = 0; i < feature.size(); i++) {
|
|
|
- if (i < feature.size() - 1) {
|
|
|
- if (feature.get(i).getProperty().contains("33") && feature.get(i + 1).getProperty().contains("28")) {
|
|
|
- featureType.add(feature.get(i).getText() + "\t" + feature.get(i + 1).getText());
|
|
|
- }
|
|
|
- }
|
|
|
+ boolean featureTypeState = true;
|
|
|
if (i < feature.size() - 2) {
|
|
|
if ((feature.get(i).getProperty().contains("33") && feature.get(i + 1).getProperty().contains("28")
|
|
|
&& feature.get(i + 2).getProperty().contains("2"))
|
|
@@ -215,6 +212,12 @@ public class ClinicalFacade {
|
|
|
&& feature.get(i + 2).getProperty().contains("9"))) {
|
|
|
featureType.add(feature.get(i).getText() + "\t" + feature.get(i + 1).getText() + "\t"
|
|
|
+ feature.get(i + 2).getText());
|
|
|
+ featureTypeState = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (i < feature.size() - 1 && featureTypeState) {
|
|
|
+ if (feature.get(i).getProperty().contains("33") && feature.get(i + 1).getProperty().contains("28")) {
|
|
|
+ featureType.add(feature.get(i).getText() + "\t" + feature.get(i + 1).getText());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -253,21 +256,17 @@ public class ClinicalFacade {
|
|
|
if (features[1].contains("/")) {
|
|
|
if (standWordMap.get("value").contains("/")) {
|
|
|
String[] feature = features[1].split("/");
|
|
|
- Integer featuresSBP = Integer.valueOf(feature[0]); //收缩压
|
|
|
- Integer featuresDBP = Integer.valueOf(feature[1]); //舒张压
|
|
|
+ Integer featuresSBP = Integer.valueOf(feature[0]); //分词特征收缩压
|
|
|
+ Integer featuresDBP = Integer.valueOf(feature[1]); //分词特征舒张压
|
|
|
|
|
|
String[] values = standWordMap.get("value").split("/");
|
|
|
- Integer standWordSBP = Integer.valueOf(values[0]); //收缩压
|
|
|
- Integer standWordDBP = Integer.valueOf(values[1]); //舒张压
|
|
|
+ Integer standWordSBP = Integer.valueOf(values[0]); //标准词收缩压
|
|
|
+ Integer standWordDBP = Integer.valueOf(values[1]); //标准词舒张压
|
|
|
if (featuresSBP > standWordSBP && featuresDBP > standWordDBP) {
|
|
|
String standWord = standWordKey + standWordMap.get("op") + standWordMap.get("value") + standWordMap.get("unit") + "。";
|
|
|
sData.setSymptom(sData.getSymptom() + standWord);
|
|
|
System.out.println(sData.getSymptom());
|
|
|
- } else {
|
|
|
- return;
|
|
|
}
|
|
|
- } else {
|
|
|
- return;
|
|
|
}
|
|
|
} else {
|
|
|
String num = getNum(standWordMap.get("value"));
|
|
@@ -296,11 +295,7 @@ public class ClinicalFacade {
|
|
|
String standWord = standWordKey + standWordMap.get("op") + standWordMap.get("value") + standWordMap.get("unit") + "。";
|
|
|
sData.setSymptom(sData.getSymptom() + standWord);
|
|
|
System.out.println(sData.getSymptom());
|
|
|
- } else {
|
|
|
- return;
|
|
|
}
|
|
|
- } else {
|
|
|
- return;
|
|
|
}
|
|
|
} else {
|
|
|
String num = getNum(standWordMap.get("value"));
|
|
@@ -332,15 +327,15 @@ public class ClinicalFacade {
|
|
|
Map<String, List<Map<String, String>>> standWordObj = new HashMap<>();
|
|
|
List<List<Lexeme>> splitStandWords = new ArrayList<>();
|
|
|
List<Lexeme> data = null;
|
|
|
- File file = null;
|
|
|
BufferedReader reader = null;
|
|
|
+ InputStream inputStream = null;
|
|
|
String line = "";
|
|
|
try {
|
|
|
//file = ResourceUtils.getFile("classpath:standword.txt");
|
|
|
-// Resource resource = new ClassPathResource("standword.txt");
|
|
|
+ // Resource resource = new ClassPathResource("standword.txt");
|
|
|
ClassPathResource classPathResource = new ClassPathResource("standword.txt");
|
|
|
- InputStream inputStream =classPathResource.getInputStream();
|
|
|
-// file = resource.getFile();
|
|
|
+ inputStream = classPathResource.getInputStream();
|
|
|
+ // file = resource.getFile();
|
|
|
reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
|
|
|
while ((line = reader.readLine()) != null) {
|
|
|
data = nlpServiceClient.split(line).getData();
|
|
@@ -354,6 +349,7 @@ public class ClinicalFacade {
|
|
|
} finally {
|
|
|
try {
|
|
|
reader.close();
|
|
|
+ inputStream.close();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -372,7 +368,6 @@ public class ClinicalFacade {
|
|
|
}
|
|
|
if (lexeme.getProperty().contains("1") || lexeme.getProperty().contains("5")
|
|
|
|| lexeme.getProperty().contains("33")) {
|
|
|
-
|
|
|
if (!standWordObj.containsKey(lexeme.getText())) {
|
|
|
standWordObj.put(lexeme.getText(), standWordObjValList);
|
|
|
} else {
|