|
@@ -3,15 +3,18 @@ package com.diagbot.facade;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.diagbot.client.AiptServiceClient;
|
|
|
import com.diagbot.dto.ConceptRetrievalDTO;
|
|
|
+import com.diagbot.dto.OrderRetrivevalDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.dto.RetrievalDTO;
|
|
|
import com.diagbot.entity.QuestionInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.QuestionTypeEnum;
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.RespDTOUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.vo.GetStaticKnowledgeVO;
|
|
|
+import com.diagbot.vo.GetStaticVO;
|
|
|
import com.diagbot.vo.RetrievalVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -112,20 +115,24 @@ public class RetrievalFacade {
|
|
|
/**
|
|
|
* 静态知识标签检索
|
|
|
*
|
|
|
- * @param getStaticKnowledgeVO
|
|
|
+ * @param getStaticVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<RetrievalDTO> getStaticKnowledge(GetStaticKnowledgeVO getStaticKnowledgeVO){
|
|
|
+ public List<RetrievalDTO> getStaticKnowledge(GetStaticVO getStaticVO){
|
|
|
+ GetStaticKnowledgeVO getStaticKnowledgeVO = new GetStaticKnowledgeVO();
|
|
|
+ BeanUtil.copyProperties(getStaticVO,getStaticKnowledgeVO);
|
|
|
+ //标签类型
|
|
|
+ List<String> questionNames = new ArrayList<>();
|
|
|
+ List<Integer> typeList = new ArrayList<>();//规定标签类型,只取诊断,化验,辅检,药品类型
|
|
|
+ typeList.add(QuestionTypeEnum.Disease.getKey());
|
|
|
+ typeList.add(QuestionTypeEnum.Drug.getKey());
|
|
|
+ typeList.add(QuestionTypeEnum.Lis.getKey());
|
|
|
+ typeList.add(QuestionTypeEnum.Pacs.getKey());
|
|
|
+ getStaticKnowledgeVO.setTypes(typeList);
|
|
|
//调用aipt-service获取有静态知识的标签
|
|
|
RespDTO<List<RetrievalDTO>> retrievalDTOList = aiptServiceClient.getStaticKnowledge(getStaticKnowledgeVO);
|
|
|
RespDTOUtil.respNGDeal(retrievalDTOList,"获取静态知识失败");
|
|
|
if(ListUtil.isNotEmpty(retrievalDTOList.data)){
|
|
|
- List<String> questionNames = new ArrayList<>();
|
|
|
- List<Integer> typeList = new ArrayList<>();//规定标签类型,只取诊断,化验,辅检,药品类型
|
|
|
- typeList.add(QuestionTypeEnum.Disease.getKey());
|
|
|
- typeList.add(QuestionTypeEnum.Pacs.getKey());
|
|
|
- typeList.add(QuestionTypeEnum.Lis.getKey());
|
|
|
- typeList.add(QuestionTypeEnum.Drug.getKey());
|
|
|
for (RetrievalDTO retrievalDTOInfo : retrievalDTOList.data) {
|
|
|
if(typeList.contains(retrievalDTOInfo.getType())){
|
|
|
questionNames.add(retrievalDTOInfo.getName());
|
|
@@ -146,6 +153,22 @@ public class RetrievalFacade {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ List<OrderRetrivevalDTO> orderRetrivevalDTOS = BeanUtil.listCopyTo(retrievalDTOList.data,OrderRetrivevalDTO.class);
|
|
|
+ //设置排序编号
|
|
|
+ for (OrderRetrivevalDTO orderRetrivevalDTO : orderRetrivevalDTOS) {
|
|
|
+ if(orderRetrivevalDTO.getType().intValue() == QuestionTypeEnum.Disease.getKey()){//诊断
|
|
|
+ orderRetrivevalDTO.setOrderNo(1);
|
|
|
+ }else if(orderRetrivevalDTO.getType().intValue() == QuestionTypeEnum.Drug.getKey()){//药品
|
|
|
+ orderRetrivevalDTO.setOrderNo(2);
|
|
|
+ }else if(orderRetrivevalDTO.getType().intValue() == QuestionTypeEnum.Lis.getKey()){//化验
|
|
|
+ orderRetrivevalDTO.setOrderNo(3);
|
|
|
+ }else {//辅检
|
|
|
+ orderRetrivevalDTO.setOrderNo(4);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //给结果排序:诊断 > 药品 > 化验 > 辅检
|
|
|
+ orderRetrivevalDTOS.sort((OrderRetrivevalDTO o1, OrderRetrivevalDTO o2) -> o1.getOrderNo().compareTo(o2.getOrderNo()));
|
|
|
+ retrievalDTOList.data = BeanUtil.listCopyTo(orderRetrivevalDTOS,RetrievalDTO.class);
|
|
|
return retrievalDTOList.data;
|
|
|
}
|
|
|
}
|