|
@@ -55,12 +55,12 @@ import com.diagbot.vo.neoPushEntity.Diag;
|
|
|
import com.diagbot.vo.neoPushEntity.DiagVo;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
@@ -77,6 +77,7 @@ import java.util.stream.Collectors;
|
|
|
* @time 19:42
|
|
|
*/
|
|
|
@Component
|
|
|
+@Slf4j
|
|
|
public class PushProcess {
|
|
|
|
|
|
@Autowired
|
|
@@ -405,11 +406,30 @@ public class PushProcess {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 根据诊断依据推送疾病
|
|
|
+ * 根据诊断依据推送疾病总入口
|
|
|
*
|
|
|
* @param wordCrfDTO
|
|
|
+ * @return
|
|
|
*/
|
|
|
public PushDTO pushDiagnose(WordCrfDTO wordCrfDTO) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ PushDTO pushDTO = null;
|
|
|
+ try {
|
|
|
+ pushDTO = pushDiagnoseProcess(wordCrfDTO);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("【诊断依据推理出错】", e);
|
|
|
+ CoreUtil.getDebugStr("【诊断依据推理出错】", e, pushDTO.getDebug());
|
|
|
+ }
|
|
|
+ CoreUtil.getDebugStr(start, "推送诊断耗时_诊断依据", pushDTO.getDebug());
|
|
|
+ return pushDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据诊断依据推送疾病
|
|
|
+ *
|
|
|
+ * @param wordCrfDTO
|
|
|
+ */
|
|
|
+ public PushDTO pushDiagnoseProcess(WordCrfDTO wordCrfDTO) {
|
|
|
PushDTO pushDTO = new PushDTO();
|
|
|
// 读取所有的诊断依据规则——已去重
|
|
|
List<BaseDiagnoseDTO> diagnoselist = redisUtil.get(RedisEnum.allBaseDiagnose.getName());
|
|
@@ -495,6 +515,7 @@ public class PushProcess {
|
|
|
List<PushBaseDTO> protocolList = new ArrayList<>(); // 拟诊
|
|
|
List<PushBaseDTO> definiteList = new ArrayList<>(); // 确诊
|
|
|
List<PushBaseDTO> vigilantList = new ArrayList<>(); // 警惕
|
|
|
+
|
|
|
for (DiagnoseDTO diagnoseDTO : diagnoseDTOList) {
|
|
|
PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
pushBaseDTO.setName(diagnoseDTO.getLibName());
|
|
@@ -510,11 +531,14 @@ public class PushProcess {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if (ListUtil.isNotEmpty(protocolList)) {
|
|
|
- pushDiagnoseDTO.put("拟诊", protocolList);
|
|
|
- }
|
|
|
- if (ListUtil.isNotEmpty(definiteList)) {
|
|
|
- pushDiagnoseDTO.put("确诊", definiteList);
|
|
|
+ // 有界面诊断,不需要拟诊和确诊
|
|
|
+ if (hasDisease(wordCrfDTO)) {
|
|
|
+ if (ListUtil.isNotEmpty(protocolList)) {
|
|
|
+ pushDiagnoseDTO.put("拟诊", protocolList);
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(definiteList)) {
|
|
|
+ pushDiagnoseDTO.put("确诊", definiteList);
|
|
|
+ }
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(vigilantList)) {
|
|
|
pushDiagnoseDTO.put("警惕", vigilantList);
|
|
@@ -735,6 +759,19 @@ public class PushProcess {
|
|
|
return reverseVO;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 是否有界面诊断
|
|
|
+ *
|
|
|
+ * @param wordCrfDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Boolean hasDisease(WordCrfDTO wordCrfDTO) {
|
|
|
+ if (ListUtil.isNotEmpty(wordCrfDTO.getDiag())) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
private void reversePushPackage(int length, PushDTO pushDTO, List<String> ruleTypeList, Map<String, List<String>> typeWords, NeoPushVO pushVO, Map<String, List<PushBaseDTO>> dis) {
|
|
|
NeoPushDTO reversePush = neoFacade.getReversePush(pushVO);
|
|
|
// 症状
|