|
@@ -8,11 +8,20 @@ import com.diagbot.dto.WordCrfDTO;
|
|
import com.diagbot.enums.StandConvertEnum;
|
|
import com.diagbot.enums.StandConvertEnum;
|
|
import com.diagbot.process.PushProcess;
|
|
import com.diagbot.process.PushProcess;
|
|
import com.diagbot.util.ListUtil;
|
|
import com.diagbot.util.ListUtil;
|
|
-import com.diagbot.vo.*;
|
|
|
|
|
|
+import com.diagbot.vo.BillNeoVO;
|
|
|
|
+import com.diagbot.vo.IndicationPushVO;
|
|
|
|
+import com.diagbot.vo.NeoPushVO;
|
|
|
|
+import com.diagbot.vo.PushVO;
|
|
|
|
+import com.diagbot.vo.StandConvert;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Arrays;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.HashSet;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -32,6 +41,7 @@ public class PushFacade {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 推送业务
|
|
* 推送业务
|
|
|
|
+ *
|
|
* @param
|
|
* @param
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -50,28 +60,36 @@ public class PushFacade {
|
|
NeoPushVO pushVO = commonFacade.generatePushInput(wordCrfDTO);
|
|
NeoPushVO pushVO = commonFacade.generatePushInput(wordCrfDTO);
|
|
//图谱推送数据
|
|
//图谱推送数据
|
|
List<NeoPushDTO> push = neoFacade.getPush(pushVO);
|
|
List<NeoPushDTO> push = neoFacade.getPush(pushVO);
|
|
- if(ListUtil.isNotEmpty(push)){
|
|
|
|
|
|
+ if (ListUtil.isNotEmpty(push)) {
|
|
NeoPushDTO neoPushDTO = push.get(0);
|
|
NeoPushDTO neoPushDTO = push.get(0);
|
|
- if(neoPushDTO != null){
|
|
|
|
|
|
+ if (neoPushDTO != null) {
|
|
int length = pushVo.getLength();
|
|
int length = pushVo.getLength();
|
|
// 症状
|
|
// 症状
|
|
if (ruleTypeList.contains("1") && ListUtil.isNotEmpty(neoPushDTO.getSymptoms())) {
|
|
if (ruleTypeList.contains("1") && ListUtil.isNotEmpty(neoPushDTO.getSymptoms())) {
|
|
- List<PushBaseDTO> filterSymptoms = neoPushDTO.getSymptoms().stream().filter(x -> !typeWords.get(StandConvertEnum.clinical.getName()).contains(x.getName())).collect(Collectors.toList());
|
|
|
|
|
|
+ List<PushBaseDTO> filterSymptoms = neoPushDTO.getSymptoms()
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(x -> !typeWords.get(StandConvertEnum.clinical.getName()).contains(x.getName())).collect(Collectors.toList());
|
|
pushDTO.setSymptom(filterSymptoms.subList(0, filterSymptoms.size() >= length ? length : filterSymptoms.size()));
|
|
pushDTO.setSymptom(filterSymptoms.subList(0, filterSymptoms.size() >= length ? length : filterSymptoms.size()));
|
|
}
|
|
}
|
|
// 查体
|
|
// 查体
|
|
if (ruleTypeList.contains("4") && ListUtil.isNotEmpty(neoPushDTO.getVitals())) {
|
|
if (ruleTypeList.contains("4") && ListUtil.isNotEmpty(neoPushDTO.getVitals())) {
|
|
- List<PushBaseDTO> filtervitals = neoPushDTO.getVitals().stream().filter(x -> !typeWords.get(StandConvertEnum.vital.getName()).contains(x.getName())).collect(Collectors.toList());
|
|
|
|
|
|
+ List<PushBaseDTO> filtervitals = neoPushDTO.getVitals()
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(x -> !typeWords.get(StandConvertEnum.vital.getName()).contains(x.getName())).collect(Collectors.toList());
|
|
pushDTO.setVital(filtervitals.subList(0, filtervitals.size() >= length ? length : filtervitals.size()));
|
|
pushDTO.setVital(filtervitals.subList(0, filtervitals.size() >= length ? length : filtervitals.size()));
|
|
}
|
|
}
|
|
// 化验
|
|
// 化验
|
|
if (ruleTypeList.contains("5") && ListUtil.isNotEmpty(neoPushDTO.getLis())) {
|
|
if (ruleTypeList.contains("5") && ListUtil.isNotEmpty(neoPushDTO.getLis())) {
|
|
- List<PushBaseDTO> filterlis = neoPushDTO.getLis().stream().filter(x -> !typeWords.get(StandConvertEnum.lis.getName()).contains(x.getName())).collect(Collectors.toList());
|
|
|
|
|
|
+ List<PushBaseDTO> filterlis = neoPushDTO.getLis()
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(x -> !typeWords.get(StandConvertEnum.lis.getName()).contains(x.getName())).collect(Collectors.toList());
|
|
pushDTO.setLis(filterlis.subList(0, filterlis.size() >= length ? length : filterlis.size()));
|
|
pushDTO.setLis(filterlis.subList(0, filterlis.size() >= length ? length : filterlis.size()));
|
|
}
|
|
}
|
|
// 辅检
|
|
// 辅检
|
|
if (ruleTypeList.contains("6") && ListUtil.isNotEmpty(neoPushDTO.getPacs())) {
|
|
if (ruleTypeList.contains("6") && ListUtil.isNotEmpty(neoPushDTO.getPacs())) {
|
|
- List<PushBaseDTO> filterpacs = neoPushDTO.getPacs().stream().filter(x -> !typeWords.get(StandConvertEnum.pacs.getName()).contains(x.getName())).collect(Collectors.toList());
|
|
|
|
|
|
+ List<PushBaseDTO> filterpacs = neoPushDTO.getPacs()
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(x -> !typeWords.get(StandConvertEnum.pacs.getName()).contains(x.getName())).collect(Collectors.toList());
|
|
pushDTO.setPacs(filterpacs.subList(0, filterpacs.size() >= length ? length : filterpacs.size()));
|
|
pushDTO.setPacs(filterpacs.subList(0, filterpacs.size() >= length ? length : filterpacs.size()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -137,17 +155,17 @@ public class PushFacade {
|
|
return billNeoVO;
|
|
return billNeoVO;
|
|
}
|
|
}
|
|
|
|
|
|
- public Map<String,List<String>> typeWords( Map<String, Map<String, String>> standConvertMap){
|
|
|
|
- Map<String,List<String>> typeWordsMap = new HashMap<>();
|
|
|
|
- for (Map.Entry<String, Map<String, String>> s:standConvertMap.entrySet()) {
|
|
|
|
|
|
+ public Map<String, List<String>> typeWords(Map<String, Map<String, String>> standConvertMap) {
|
|
|
|
+ Map<String, List<String>> typeWordsMap = new HashMap<>();
|
|
|
|
+ for (Map.Entry<String, Map<String, String>> s : standConvertMap.entrySet()) {
|
|
List<String> words = new ArrayList<>();
|
|
List<String> words = new ArrayList<>();
|
|
String type = s.getKey();
|
|
String type = s.getKey();
|
|
Map<String, String> value = s.getValue();
|
|
Map<String, String> value = s.getValue();
|
|
- value.forEach((name,standName)->{
|
|
|
|
|
|
+ value.forEach((name, standName) -> {
|
|
words.add(name);
|
|
words.add(name);
|
|
words.add(standName);
|
|
words.add(standName);
|
|
});
|
|
});
|
|
- typeWordsMap.put(type,new ArrayList<>(new HashSet<>(words)));
|
|
|
|
|
|
+ typeWordsMap.put(type, new ArrayList<>(new HashSet<>(words)));
|
|
}
|
|
}
|
|
|
|
|
|
return typeWordsMap;
|
|
return typeWordsMap;
|