Browse Source

经典病例后台功能添加

xiewei 10 months ago
parent
commit
9b987fb4bc

+ 73 - 13
src/main/java/com/diagbot/facade/MedRetrievalFacade.java

@@ -1,11 +1,6 @@
 package com.diagbot.facade;
 
-import com.diagbot.dto.DictionaryInfoDTO;
-import com.diagbot.dto.IndexDTO;
-import com.diagbot.dto.LisDetailDTO;
-import com.diagbot.dto.RetrievalConceptDTO;
-import com.diagbot.dto.RetrievalDTO;
-import com.diagbot.dto.StaticKnowledgeIndexDTO;
+import com.diagbot.dto.*;
 import com.diagbot.enums.LexiconEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -37,6 +32,8 @@ public class MedRetrievalFacade {
     private KlConceptFacade klConceptFacade;
     @Autowired
     private DictionaryFacade dictionaryFacade;
+    @Autowired
+    private KlDictionaryInfoFacade klDictionaryInfoFacade;
 
     /**
      * 检索
@@ -59,7 +56,7 @@ public class MedRetrievalFacade {
         List<IndexDTO> indexList = Lists.newLinkedList();
 
         /**
-         * 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、15-药品剂型、16-给药途径
+         * 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、15-药品剂型、16-给药途径、17-物理治疗
          */
 
         switch (retrievalVO.getType()) {
@@ -214,6 +211,14 @@ public class MedRetrievalFacade {
                     retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
                 }
                 break;
+            case 17:
+                medRetrievalVO.setTypeId(LexiconEnum.Physicotherapy.getKey());
+                medRetrievalVO.getTypeIds().add(LexiconEnum.Physicotherapy.getKey());
+                indexList = klConceptFacade.index(medRetrievalVO);
+                if (ListUtil.isNotEmpty(indexList)) {
+                    retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
+                }
+                break;
         }
         return retrievalDTO;
     }
@@ -231,10 +236,13 @@ public class MedRetrievalFacade {
         }
 
         List<Integer> types = staticKnowledgeIndexVO.getTypes();
-
-        List<DictionaryInfoDTO> dicType = dictionaryFacade.getListByGroupType(10);
+        List<DictionaryInfoDTO> dicType = klDictionaryInfoFacade.getListByGroupType(10);
         Map<String, String> dicTypeMap = EntityUtil.makeMapWithKeyValue(dicType, "name", "val");
-        List<DictionaryInfoDTO> dicTypeName = dictionaryFacade.getListByGroupType(13);
+        List<DictionaryInfoDTO> dicTypeName = klDictionaryInfoFacade.getListByGroupType(13);
+
+        List<DictionaryInfoDTO> dicType_back = dictionaryFacade.getListByGroupType(10);
+        Map<String, String> dicTypeMap_back = EntityUtil.makeMapWithKeyValue(dicType_back, "name", "val");
+        List<DictionaryInfoDTO> dicTypeName_back = dictionaryFacade.getListByGroupType(13);
 
         //检索类型(多选):0-全部、1-诊断、2-药品、3-检验、5-检查、6-手术和操作、8-量表、9-护理
         if (ListUtil.isEmpty(types)
@@ -281,9 +289,61 @@ 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())));
+            //前端展示
+            if (staticKnowledgeIndexVO.getHasInfo().equals(1)) {
+                i.setTypeName(convertTypeName(i.getTypeName(), 2, dicTypeName));
+                if (dicTypeMap.containsKey(i.getTypeName())) {
+                    i.setType(Integer.valueOf(dicTypeMap.get(i.getTypeName())));
+                }
+            } else {
+                i.setTypeName(convertTypeName(i.getTypeName(), 2, dicTypeName_back));
+                if (dicTypeMap_back.containsKey(i.getTypeName())) {
+                    i.setType(Integer.valueOf(dicTypeMap_back.get(i.getTypeName())));
+                }
+            }
+        });
+        return retList;
+    }
+
+    /**
+     * 经典病例检索
+     *
+     * @param staticKnowledgeIndexVO
+     * @return
+     */
+    public List<ClassicCaseIndexDTO> classicCaseIndex(StaticKnowledgeIndexVO staticKnowledgeIndexVO) {
+        staticKnowledgeIndexVO.setTypeIds(new ArrayList<>());
+        if (staticKnowledgeIndexVO.getSize() == null) {
+            staticKnowledgeIndexVO.setSize(100);
+        }
+
+        List<Integer> types = staticKnowledgeIndexVO.getTypes();
+
+        List<DictionaryInfoDTO> dicType = klDictionaryInfoFacade.getListByGroupType(10);
+        Map<String, String> dicTypeMap = EntityUtil.makeMapWithKeyValue(dicType, "name", "val");
+        List<DictionaryInfoDTO> dicTypeName = klDictionaryInfoFacade.getListByGroupType(13);
+
+        List<DictionaryInfoDTO> dicType_back = dictionaryFacade.getListByGroupType(10);
+        Map<String, String> dicTypeMap_back = EntityUtil.makeMapWithKeyValue(dicType_back, "name", "val");
+        List<DictionaryInfoDTO> dicTypeName_back = dictionaryFacade.getListByGroupType(13);
+
+        //类型检索
+        staticKnowledgeIndexVO.getTypeIds().add(LexiconEnum.ClassicCase.getKey());
+
+        List<ClassicCaseIndexDTO> retList = klConceptFacade.caseIndex(staticKnowledgeIndexVO);
+
+        retList.forEach(i -> {
+            //前端展示
+            if (staticKnowledgeIndexVO.getHasInfo().equals(1)) {
+                i.setTypeName(convertTypeName(i.getTypeName(), 2, dicTypeName));
+                if (dicTypeMap.containsKey(i.getTypeName())) {
+                    i.setType(Integer.valueOf(dicTypeMap.get(i.getTypeName())));
+                }
+            } else {
+                i.setTypeName(convertTypeName(i.getTypeName(), 2, dicTypeName_back));
+                if (dicTypeMap_back.containsKey(i.getTypeName())) {
+                    i.setType(Integer.valueOf(dicTypeMap_back.get(i.getTypeName())));
+                }
             }
         });
         return retList;

+ 3 - 5
src/main/java/com/diagbot/mapper/KlConceptMapper.java

@@ -1,11 +1,7 @@
 package com.diagbot.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.diagbot.dto.GetAllForRelationDTO;
-import com.diagbot.dto.IndexBatchDTO;
-import com.diagbot.dto.IndexDTO;
-import com.diagbot.dto.KllisDetailDTO;
-import com.diagbot.dto.StaticKnowledgeIndexDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.KlConcept;
 import com.diagbot.vo.*;
 
@@ -27,6 +23,8 @@ public interface KlConceptMapper extends BaseMapper<KlConcept> {
 
     List<StaticKnowledgeIndexDTO> staticIndex(StaticKnowledgeIndexVO staticKnowledgeIndexVO);
 
+    List<ClassicCaseIndexDTO> caseIndex(StaticKnowledgeIndexVO staticKnowledgeIndexVO);
+
     List<KllisDetailDTO> getLisDetaisByNames(KllisDetailVO kllisDetailVO);
 
     List<GetAllForRelationDTO> searchByTypeAndName(SearchConceptVO searchConceptVO);

+ 3 - 5
src/main/java/com/diagbot/service/KlConceptService.java

@@ -1,11 +1,7 @@
 package com.diagbot.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.dto.GetAllForRelationDTO;
-import com.diagbot.dto.IndexBatchDTO;
-import com.diagbot.dto.IndexDTO;
-import com.diagbot.dto.KllisDetailDTO;
-import com.diagbot.dto.StaticKnowledgeIndexDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.KlConcept;
 import com.diagbot.vo.*;
 
@@ -27,6 +23,8 @@ public interface KlConceptService extends IService<KlConcept> {
 
     List<StaticKnowledgeIndexDTO> staticIndex(StaticKnowledgeIndexVO staticKnowledgeIndexVO);
 
+    List<ClassicCaseIndexDTO> caseIndex(StaticKnowledgeIndexVO staticKnowledgeIndexVO);
+
     List<KllisDetailDTO> getLisDetaisByNames(KllisDetailVO kllisDetailVO);
 
     //查找(修改)

+ 6 - 5
src/main/java/com/diagbot/service/impl/KlConceptServiceImpl.java

@@ -2,11 +2,7 @@ package com.diagbot.service.impl;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.dto.GetAllForRelationDTO;
-import com.diagbot.dto.IndexBatchDTO;
-import com.diagbot.dto.IndexDTO;
-import com.diagbot.dto.KllisDetailDTO;
-import com.diagbot.dto.StaticKnowledgeIndexDTO;
+import com.diagbot.dto.*;
 import com.diagbot.entity.KlConcept;
 import com.diagbot.mapper.KlConceptMapper;
 import com.diagbot.service.KlConceptService;
@@ -42,6 +38,11 @@ public class KlConceptServiceImpl extends ServiceImpl<KlConceptMapper, KlConcept
         return baseMapper.staticIndex(staticKnowledgeIndexVO);
     }
 
+    @Override
+    public List<ClassicCaseIndexDTO> caseIndex(StaticKnowledgeIndexVO staticKnowledgeIndexVO) {
+        return baseMapper.caseIndex(staticKnowledgeIndexVO);
+    }
+
     @Override
     public List<KllisDetailDTO> getLisDetaisByNames(KllisDetailVO kllisDetailVO) {
         return baseMapper.getLisDetaisByNames(kllisDetailVO);

+ 10 - 5
src/main/java/com/diagbot/web/RetrievalController.java

@@ -1,10 +1,6 @@
 package com.diagbot.web;
 
-import com.diagbot.dto.IndexBatchDTO;
-import com.diagbot.dto.KllisDetailDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.RetrievalDTO;
-import com.diagbot.dto.StaticKnowledgeIndexDTO;
+import com.diagbot.dto.*;
 import com.diagbot.facade.KlConceptFacade;
 import com.diagbot.facade.MedRetrievalFacade;
 import com.diagbot.vo.ConceptVO;
@@ -62,6 +58,15 @@ public class RetrievalController {
         return RespDTO.onSuc(data);
     }
 
+    @ApiOperation(value = "经典病例检索",
+            notes = "types: 类型:11-经典病例 <br>" +
+                    "inputStr: 检索内容<br>")
+    @PostMapping("/classicCaseIndex")
+    public RespDTO<List<ClassicCaseIndexDTO>> classicCaseIndex(@Valid @RequestBody StaticKnowledgeIndexVO staticKnowledgeIndexVO) {
+        List<ClassicCaseIndexDTO> data = medRetrievalFacade.classicCaseIndex(staticKnowledgeIndexVO);
+        return RespDTO.onSuc(data);
+    }
+
     @ApiOperation(value = "术语批量查询[zhaops]",
             notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉、15-药品剂型、16-给药途径<br>" +
                     "ids: 术语id列表<br>" +

+ 3 - 3
src/main/resources/application-dev.yml

@@ -92,7 +92,7 @@ spring:
         cdss:
           driver-class-name: com.mysql.cj.jdbc.Driver
           platform: mysql
-          url: jdbc:mysql://173.18.12.191:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true
+          url: jdbc:mysql://173.18.12.194:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true
           username: root
           password: dsYun8!@#
           druid:
@@ -100,7 +100,7 @@ spring:
         med:
           driver-class-name: com.mysql.cj.jdbc.Driver
           platform: mysql
-          url: jdbc:mysql://173.18.12.191:3306/med_2021?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true
+          url: jdbc:mysql://173.18.12.194:3306/med_2021?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true
           username: root
           password: dsYun8!@#
           druid:
@@ -115,7 +115,7 @@ spring:
     database:
       cache: 11 # cache索引
       similar: 11 # similar索引
-    host: 173.18.12.191  #Redis服务器地址
+    host: 173.18.12.194  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: # Redis服务器连接密码(默认为空)
     lettuce:

+ 5 - 0
src/main/resources/mapper/KlConceptMapper.xml

@@ -801,6 +801,11 @@
                 </when>
             </choose>
         </if>
+        <if test="typeIds != null and typeIds.size > 0">
+            <foreach item="typeId" collection="typeIds" open="and(" separator="or" close=")">
+                t2.type_id =#{typeId}
+            </foreach>
+        </if>
         <if test="size!=null">
             LIMIT #{size}
         </if>