|
@@ -5,6 +5,7 @@ import com.diagbot.client.AiptServiceClient;
|
|
|
import com.diagbot.client.bean.Response;
|
|
|
import com.diagbot.dto.SymptomFeatureDTO;
|
|
|
import com.diagbot.entity.QuestionInfo;
|
|
|
+import com.diagbot.enums.DisTypeEnum;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.QuestionTypeEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
@@ -28,6 +29,8 @@ public class FeatureFacade {
|
|
|
private AiptServiceClient aiptServiceClient;
|
|
|
@Autowired
|
|
|
private QuestionFacade questionFacade;
|
|
|
+ @Autowired
|
|
|
+ private DisTypeFacade disTypeFacade;
|
|
|
|
|
|
/**
|
|
|
* 症状关键词提取
|
|
@@ -54,14 +57,29 @@ public class FeatureFacade {
|
|
|
QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
|
questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
in("tag_name", symptomNameList).
|
|
|
- eq("type", QuestionTypeEnum.Symptom.getKey()).
|
|
|
+ and(i -> i.eq("type", QuestionTypeEnum.Symptom.getKey()).or().eq("type", QuestionTypeEnum.Disease.getKey())).
|
|
|
eq("item_type", 0);
|
|
|
List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
|
|
|
for (QuestionInfo questionInfo : questionInfoList) {
|
|
|
SymptomFeatureDTO symptomFeatureDTO = new SymptomFeatureDTO();
|
|
|
+ //特征提取出诊断
|
|
|
+ if (questionInfo.getType().equals(QuestionTypeEnum.Disease.getKey())) {
|
|
|
+ //判断是否有“复诊”关键字
|
|
|
+ if (symptomNameList.contains("复诊")) {
|
|
|
+ //判断是否为慢病
|
|
|
+ Boolean isChronic = disTypeFacade.judgeByDisName(questionInfo.getTagName(), DisTypeEnum.CHRONIC.getKey());
|
|
|
+ if (isChronic) {
|
|
|
+ symptomFeatureDTO.setDisType(DisTypeEnum.CHRONIC.getKey());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //没有提取到“复诊”这个特征,诊断不处理
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
symptomFeatureDTO.setId(questionInfo.getId());
|
|
|
symptomFeatureDTO.setTagName(questionInfo.getTagName());
|
|
|
symptomFeatureDTO.setName(questionInfo.getName());
|
|
|
+ symptomFeatureDTO.setType(questionInfo.getType());
|
|
|
symptomFeatureDTOList.add(symptomFeatureDTO);
|
|
|
}
|
|
|
return symptomFeatureDTOList;
|