|
@@ -9,6 +9,7 @@ import com.diagbot.dto.DiagnoseDTO;
|
|
|
import com.diagbot.dto.NeoPushDTO;
|
|
|
import com.diagbot.dto.PushBaseDTO;
|
|
|
import com.diagbot.dto.PushDTO;
|
|
|
+import com.diagbot.dto.ReverseDTO;
|
|
|
import com.diagbot.dto.RuleBaseDTO;
|
|
|
import com.diagbot.dto.TreatDTO;
|
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
@@ -25,6 +26,7 @@ import com.diagbot.enums.PushRelationTypeEnum;
|
|
|
import com.diagbot.enums.RedisEnum;
|
|
|
import com.diagbot.enums.StandConvertEnum;
|
|
|
import com.diagbot.facade.CommonFacade;
|
|
|
+import com.diagbot.facade.ConceptInfoFacade;
|
|
|
import com.diagbot.facade.KlDiagnoseFacade;
|
|
|
import com.diagbot.facade.KlRelationFacade;
|
|
|
import com.diagbot.facade.NeoFacade;
|
|
@@ -43,6 +45,7 @@ import com.diagbot.vo.DiseaseItemVO;
|
|
|
import com.diagbot.vo.IcssVo;
|
|
|
import com.diagbot.vo.NeoPushVO;
|
|
|
import com.diagbot.vo.PushVO;
|
|
|
+import com.diagbot.vo.ReverseVO;
|
|
|
import com.diagbot.vo.neoPushEntity.Diag;
|
|
|
import com.diagbot.vo.neoPushEntity.DiagVo;
|
|
|
import com.google.common.collect.Lists;
|
|
@@ -58,8 +61,8 @@ import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Collections;
|
|
|
import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
import java.util.LinkedHashMap;
|
|
|
+import java.util.LinkedHashSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -96,6 +99,8 @@ public class PushProcess {
|
|
|
VitalRule vitalRule;
|
|
|
@Autowired
|
|
|
GroupRule groupRule;
|
|
|
+ @Autowired
|
|
|
+ ConceptInfoFacade conceptInfoFacade;
|
|
|
|
|
|
|
|
|
public PushDTO processIcss(PushVO pushVo) {
|
|
@@ -354,12 +359,14 @@ public class PushProcess {
|
|
|
*/
|
|
|
public PushDTO process(PushVO pushVo, Map<String, Map<String, String>> standConvertMap, WordCrfDTO wordCrfDTO) {
|
|
|
int length = pushVo.getLength();
|
|
|
- PushDTO pushDTO = new PushDTO();
|
|
|
- // 推送诊断
|
|
|
- pushDiagnose(wordCrfDTO, pushDTO);
|
|
|
- // List<String> ruleTypeList = Arrays.asList(pushVo.getFeatureType().split(","));
|
|
|
- // Map<String, List<String>> typeWords = typeWords(standConvertMap);
|
|
|
- // Map<String, List<PushBaseDTO>> dis = new HashMap<>();
|
|
|
+ // TODO 聚合诊断依据推送的诊断和大数据推送的可能诊断
|
|
|
+ PushDTO pushDTO = pushDiagnose(wordCrfDTO);
|
|
|
+ List<String> ruleTypeList = Arrays.asList(pushVo.getFeatureType().split(","));
|
|
|
+ Map<String, List<String>> typeWords = typeWords(standConvertMap);
|
|
|
+
|
|
|
+ // 根据诊断反推(根据性别和年龄过滤,并根据界面已有信息过滤,根据长度截取)
|
|
|
+ reversePushPackage(pushDTO, ruleTypeList, typeWords, wordCrfDTO, length);
|
|
|
+
|
|
|
// if (ListUtil.isNotEmpty(push)) {
|
|
|
// //先把所有疾病推出来
|
|
|
// if (ruleTypeList.contains("7")) {
|
|
@@ -384,7 +391,8 @@ public class PushProcess {
|
|
|
* 根据诊断依据推送疾病
|
|
|
* @param wordCrfDTO
|
|
|
*/
|
|
|
- public void pushDiagnose(WordCrfDTO wordCrfDTO, PushDTO pushDTO) {
|
|
|
+ public PushDTO pushDiagnose(WordCrfDTO wordCrfDTO) {
|
|
|
+ PushDTO pushDTO = new PushDTO();
|
|
|
// 读取所有的诊断依据规则——已去重
|
|
|
List<BaseDiagnoseDTO> diagnoselist = redisUtil.get(RedisEnum.allBaseDiagnose.getName());
|
|
|
// 匹配的诊断依据规则
|
|
@@ -395,7 +403,7 @@ public class PushProcess {
|
|
|
List<Clinical> clinicals = commonFacade.getClinicalSource(wordCrfDTO);
|
|
|
/**---------------------------数据统一处理结束--------------------------------- */
|
|
|
|
|
|
- // TODO 规则处理
|
|
|
+ // 规则处理
|
|
|
for (BaseDiagnoseDTO base : diagnoselist) {
|
|
|
RuleBaseDTO ruleBaseDTO = new RuleBaseDTO();
|
|
|
BeanUtil.copyProperties(base, ruleBaseDTO);
|
|
@@ -406,11 +414,12 @@ public class PushProcess {
|
|
|
case Symptom: // 症状
|
|
|
commonRule.compareNameWithPush(clinicals, ruleBaseDTO, baseIdList, baseIds);
|
|
|
break;
|
|
|
- case VitalResult: // 体格检查结果
|
|
|
- break;
|
|
|
case Disease: // 疾病【病史】
|
|
|
commonRule.compareNameWithPush(wordCrfDTO.getPastLabel().getDiags(), ruleBaseDTO, baseIdList, baseIds);
|
|
|
break;
|
|
|
+ case VitalResult: // 体格检查结果
|
|
|
+ vitalRule.push(wordCrfDTO.getVitalLabel(), ruleBaseDTO, baseIdList, baseIds);
|
|
|
+ break;
|
|
|
case Group: // 人群
|
|
|
groupRule.push(wordCrfDTO, ruleBaseDTO, baseIdList, baseIds);
|
|
|
break;
|
|
@@ -428,6 +437,7 @@ public class PushProcess {
|
|
|
ageRule.push(wordCrfDTO, ruleBaseDTO, baseIdList, baseIds);
|
|
|
break;
|
|
|
case Vital: // 体格检查项目
|
|
|
+ vitalRule.push(wordCrfDTO.getVitalLabel(), ruleBaseDTO, baseIdList, baseIds);
|
|
|
break;
|
|
|
}
|
|
|
break;
|
|
@@ -446,6 +456,7 @@ public class PushProcess {
|
|
|
pushDTO.getDebug().put("诊断依据ID列表", StringUtils.join(baseIdList, ","));
|
|
|
Map<String, List<PushBaseDTO>> pushDiagnoseDTO = setPushDiagnose(wordCrfDTO, baseIdList);
|
|
|
pushDTO.setDis(pushDiagnoseDTO);
|
|
|
+ return pushDTO;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -515,14 +526,28 @@ public class PushProcess {
|
|
|
words.add(name);
|
|
|
words.add(standName);
|
|
|
});
|
|
|
- typeWordsMap.put(type, new ArrayList<>(new HashSet<>(words)));
|
|
|
+ typeWordsMap.put(type, new ArrayList<>(new LinkedHashSet<>(words)));
|
|
|
}
|
|
|
|
|
|
return typeWordsMap;
|
|
|
}
|
|
|
|
|
|
- private void reversePushPackage(){
|
|
|
+ /**
|
|
|
+ * 6.0 根据诊断反推其他信息
|
|
|
+ *
|
|
|
+ * @param pushDTO
|
|
|
+ * @param ruleTypeList
|
|
|
+ * @param typeWords
|
|
|
+ * @param length
|
|
|
+ */
|
|
|
+ private void reversePushPackage(PushDTO pushDTO, List<String> ruleTypeList, Map<String, List<String>> typeWords, WordCrfDTO wordCrfDTO, int length){
|
|
|
+ // TODO 拼接查询数据的入参
|
|
|
+ ReverseVO reverseVO = new ReverseVO();
|
|
|
+
|
|
|
+ // TODO 查询数据
|
|
|
+ List<ReverseDTO> reverseDTOList = conceptInfoFacade.getReverseFac(reverseVO);
|
|
|
|
|
|
+ // TODO 放到对应位置
|
|
|
}
|
|
|
|
|
|
private void reversePushPackage(int length, PushDTO pushDTO, List<String> ruleTypeList, Map<String, List<String>> typeWords, NeoPushVO pushVO, Map<String, List<PushBaseDTO>> dis) {
|