Kaynağa Gözat

静态知识检索

zhaops 4 yıl önce
ebeveyn
işleme
37c5184835

+ 45 - 0
src/main/java/com/diagbot/dto/StaticKnowledgeDTO.java

@@ -0,0 +1,45 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/20 15:51
+ */
+@Getter
+@Setter
+public class StaticKnowledgeDTO {
+    /**
+     * 标准术语id
+     */
+    private Long id;
+    /**
+     * 标准术语
+     */
+    private String name;
+
+    /**
+     * 词性
+     */
+    private String type;
+
+    /**
+     * 临床路径名称
+     */
+    private String clinicalPathwayName;
+
+    /**
+     * 注意事项名称
+     */
+    private String noticeName;
+
+    /**
+     * 静态知识明细
+     */
+    private Map<String, List<StaticKnowledgeDetailDTO>> details;
+}

+ 43 - 0
src/main/java/com/diagbot/dto/StaticKnowledgeDetailDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/20 15:52
+ */
+@Getter
+@Setter
+public class StaticKnowledgeDetailDTO {
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 提示明细标题
+     */
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    private String text;
+
+    /**
+     * 提示明细序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
+     */
+    private String contentType;
+}

+ 13 - 0
src/main/java/com/diagbot/facade/KlConceptStaticFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.KlConceptStaticServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/2/23 16:14
+ */
+@Component
+public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
+}

+ 40 - 0
src/main/java/com/diagbot/facade/MedRetrievalFacade.java

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import com.diagbot.dto.DictionaryInfoDTO;
 import com.diagbot.dto.DiseaseInfoDTO;
 import com.diagbot.dto.DrugInfoDTO;
 import com.diagbot.dto.IndexDTO;
@@ -8,6 +9,7 @@ import com.diagbot.dto.OperationInfoDTO;
 import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.dto.StaticKnowledgeIndexDTO;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.MedRetrievalVO;
@@ -19,7 +21,9 @@ import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -31,6 +35,8 @@ import java.util.stream.Collectors;
 public class MedRetrievalFacade {
     @Autowired
     private KlConceptFacade klConceptFacade;
+    @Autowired
+    private DictionaryFacade dictionaryFacade;
 
     /**
      * 检索
@@ -154,6 +160,10 @@ public class MedRetrievalFacade {
 
         List<Integer> types = staticKnowledgeIndexVO.getTypes();
 
+        List<DictionaryInfoDTO> dicType = dictionaryFacade.getListByGroupType(10);
+        Map<String, String> dicTypeMap = EntityUtil.makeMapWithKeyValue(dicType, "name", "val");
+        List<DictionaryInfoDTO> dicTypeName = dictionaryFacade.getListByGroupType(13);
+
         //检索类型(多选):0-全部、1-诊断、2-药品、3-检验、4-检查、5-手术和操作
         if (ListUtil.isEmpty(types)
                 || (ListUtil.isNotEmpty(types) && types.contains(0))) {
@@ -179,6 +189,36 @@ public class MedRetrievalFacade {
         }
 
         List<StaticKnowledgeIndexDTO> retList = klConceptFacade.staticIndex(staticKnowledgeIndexVO);
+
+        retList.forEach(i -> {
+            i.setTypeName(convertTypeName(i.getTypeName(), 2, dicTypeName));
+            if (dicTypeMap.containsKey(i.getTypeName())) {
+                i.setType(Integer.valueOf(dicTypeMap.get(i.getTypeName())));
+            }
+        });
         return retList;
     }
+
+    /**
+     * 页面显示词性和标准词性转换
+     *
+     * @param typeName
+     * @param flag     1-页面词性转标准词性,2- 标准词性转页面词性
+     * @param dicList
+     * @return
+     */
+    public String convertTypeName(String typeName, Integer flag, List<DictionaryInfoDTO> dicList) {
+        if (ListUtil.isNotEmpty(dicList)) {
+            Map<String, String> nameValMap = new HashMap<>();
+            if (flag.equals(1)) {
+                nameValMap = EntityUtil.makeMapWithKeyValue(dicList, "name", "val");
+            } else if (flag.equals(2)) {
+                nameValMap = EntityUtil.makeMapWithKeyValue(dicList, "val", "name");
+            }
+            if (nameValMap.containsKey(typeName)) {
+                return nameValMap.get(typeName);
+            }
+        }
+        return typeName;
+    }
 }