瀏覽代碼

静态知识类型移到字典

zhaops 4 年之前
父節點
當前提交
47fa50172e

+ 7 - 4
src/main/java/com/diagbot/enums/StaticTypeEnum.java

@@ -1,13 +1,16 @@
+/*
 package com.diagbot.enums;
 
 import com.diagbot.core.KeyedNamed;
 import lombok.Setter;
 
+*/
 /**
  * @Description:
  * @Author:zhaops
  * @time: 2020/8/18 16:30
- */
+ *//*
+
 public enum StaticTypeEnum implements KeyedNamed {
     All(0, "全部"),
     Disease(1, "诊断"),
@@ -15,8 +18,8 @@ public enum StaticTypeEnum implements KeyedNamed {
     LisPack(3, "检验套餐"),
     Lis(4, "检验细项"),
     Pacs(5, "检查"),
-    Opeartion(6, "手术和操作"),
-    PacsSubName(7, "检查子项");
+    PacsSubName(6, "检查子项"),
+    Opeartion(7, "手术和操作");
 
     @Setter
     private int key;
@@ -66,4 +69,4 @@ public enum StaticTypeEnum implements KeyedNamed {
     public String getName() {
         return name;
     }
-}
+}*/

+ 48 - 18
src/main/java/com/diagbot/facade/ConceptInfoFacade.java

@@ -15,7 +15,6 @@ import com.diagbot.dto.StaticKnowledgeIndexDTO;
 import com.diagbot.entity.ConceptDetail;
 import com.diagbot.entity.ConceptInfo;
 import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.enums.StaticTypeEnum;
 import com.diagbot.enums.StatusEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -38,7 +37,6 @@ import com.diagbot.vo.StaticKnowledgeHISVO;
 import com.diagbot.vo.StaticKnowledgeIndexVO;
 import com.diagbot.vo.StaticKnowledgeVO;
 import com.google.common.collect.Lists;
-import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
@@ -127,6 +125,8 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         List<DictionaryInfoDTO> dicStaticIndexList = dictionaryFacade.getListByGroupType(7);
         //页面术语类型和图谱映射
         List<DictionaryInfoDTO> dicTypeMappingList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
 
         List<StaticKnowledgeIndexDTO> staticKnowledgeIndexDTOList = Lists.newLinkedList();
         RespDTO<List<StaticKnowledgeIndexDTO>> respDTO = cdssCoreClient.staticKnowledgeIndex(staticKnowledgeIndexVO);
@@ -204,20 +204,24 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
             //排序
             Map<String, List<StaticKnowledgeIndexDTO>> map
                     = EntityUtil.makeEntityListMap(staticKnowledgeIndexDTOList, "typeName");
+            Map<Integer, String> staticTypeDicMap =
+                    EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
             for (DictionaryInfoDTO dic : dicStaticIndexList) {
                 if (dic.getName().equals("检验")) {
-                    if (map.containsKey(StaticTypeEnum.LisPack.getName())) {
-                        retList.addAll(map.get(StaticTypeEnum.LisPack.getName()));
+                    //3-检验套餐、4-检验细项
+                    if (map.containsKey(staticTypeDicMap.get(3))) {
+                        retList.addAll(map.get(staticTypeDicMap.get(3)));
                     }
-                    if (map.containsKey(StaticTypeEnum.Lis.getName())) {
-                        retList.addAll(map.get(StaticTypeEnum.Lis.getName()));
+                    if (map.containsKey(staticTypeDicMap.get(4))) {
+                        retList.addAll(map.get(staticTypeDicMap.get(4)));
                     }
                 } else if (dic.getName().equals("检查")) {
-                    if (map.containsKey(StaticTypeEnum.Pacs.getName())) {
-                        retList.addAll(map.get(StaticTypeEnum.Pacs.getName()));
+                    //5-检查、6-检查子项
+                    if (map.containsKey(staticTypeDicMap.get(5))) {
+                        retList.addAll(map.get(staticTypeDicMap.get(5)));
                     }
-                    if (map.containsKey(StaticTypeEnum.PacsSubName.getName())) {
-                        retList.addAll(map.get(StaticTypeEnum.PacsSubName.getName()));
+                    if (map.containsKey(staticTypeDicMap.get(6))) {
+                        retList.addAll(map.get(staticTypeDicMap.get(6)));
                     }
                 } else if (map.containsKey(dic.getName())) {
                     retList.addAll(map.get(dic.getName()));
@@ -236,7 +240,10 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
      */
     public StaticKnowledgeDTO getStaticKnowledge(StaticKnowledgeVO staticKnowledgeVO) {
         StaticKnowledgeDTO staticKnowledgeDTO = new StaticKnowledgeDTO();
-        String typeName = StaticTypeEnum.getName(staticKnowledgeVO.getType());
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        String typeName = dicStaticTypeValNameMap.get(staticKnowledgeVO.getType());
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
         typeName = convertTypeName(typeName, 1, dicList);
 
@@ -334,7 +341,10 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
     public List<StaticKnowledgeHISDTO> getStaticKnowledgeForHIS(StaticKnowledgeHISVO staticKnowledgeHISVO) {
 
         List<StaticKnowledgeHISDTO> retList = Lists.newArrayList();
-        String typeName = StaticTypeEnum.getName(staticKnowledgeHISVO.getType());
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        String typeName = dicStaticTypeValNameMap.get(staticKnowledgeHISVO.getType());
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
         typeName = convertTypeName(typeName, 1, dicList);
 
@@ -537,9 +547,14 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
      */
     public IPage<ConceptInfoDTO> getPage(ConceptInfoPageVO conceptInfoPageVO) {
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
         if (StringUtil.isNotBlank(conceptInfoPageVO.getType())) {
             String typeName
-                    = convertTypeName(StaticTypeEnum.getName(Integer.valueOf(conceptInfoPageVO.getType())), 1, dicList);
+                    = convertTypeName(dicStaticTypeValNameMap.get(conceptInfoPageVO.getType()), 1, dicList);
             conceptInfoPageVO.setTypeName(typeName);
         }
         IPage<ConceptInfoDTO> page = super.getPage(conceptInfoPageVO);
@@ -548,7 +563,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
             records.forEach(record -> {
                 String typeName = convertTypeName(record.getType(), 2, dicList);
                 record.setTypeName(typeName);
-                record.setType(String.valueOf(StaticTypeEnum.getKey(typeName)));
+                record.setType(String.valueOf(dicStaticTypeNameValMap.get(typeName)));
             });
         }
         page.setRecords(records);
@@ -564,9 +579,14 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
     public Boolean saveOrUpdateRecord(ConceptInfoVO conceptInfoVO) {
         String userId = SysUserUtils.getCurrentPrincipleID();
         Date now = DateUtil.now();
+        //术语类型映射
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
         //术语类型转换
-        String typeName = convertTypeName(StaticTypeEnum.getName(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
+        String typeName = convertTypeName(dicStaticTypeValNameMap.get(conceptInfoVO.getType()), 1, dicList);
         conceptInfoVO.setTypeName(typeName);
         ConceptInfo conceptInfo = new ConceptInfo();
 
@@ -683,8 +703,12 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
      */
     public Boolean isExist(ConceptInfoVO conceptInfoVO) {
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
         //术语类型转换
-        String typeName = convertTypeName(StaticTypeEnum.getName(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
+        String typeName = convertTypeName(dicStaticTypeValNameMap.get(conceptInfoVO.getType()), 1, dicList);
         conceptInfoVO.setTypeName(typeName);
         QueryWrapper<ConceptInfo> conceptInfoQueryWrapper = new QueryWrapper<>();
         conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -712,6 +736,12 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
      */
     public ConceptInfoDTO getRecordById(IdVO idVO) {
         List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
         ConceptInfoDTO conceptInfoDTO = new ConceptInfoDTO();
         ConceptInfo conceptInfo = this.getById(idVO.getId());
         if (conceptInfo == null) {
@@ -729,7 +759,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
             //启用状态、修改人、修改时间为明细的内容
             String typeName = convertTypeName(conceptInfoDTO.getType(), 2, dicList);
             conceptInfoDTO.setTypeName(typeName);
-            conceptInfoDTO.setType(String.valueOf(StaticTypeEnum.getKey(typeName)));
+            conceptInfoDTO.setType(String.valueOf(dicStaticTypeNameValMap.get(typeName)));
             conceptInfoDTO.setModifier(conceptDetailList.get(0).getModifier());
             conceptInfoDTO.setGmtModified(conceptDetailList.get(0).getGmtModified());
         }
@@ -761,7 +791,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
             QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
             conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                     .in("concept_id", conceptIds);
-            if(ListUtil.isNotEmpty(contentTypes)) {
+            if (ListUtil.isNotEmpty(contentTypes)) {
                 conceptDetailQueryWrapper.and(sql -> {
                     for (int i = 0; i < contentTypes.size(); i++) {
                         if (i > 0) {

+ 28 - 7
src/main/java/com/diagbot/facade/PushFacade.java

@@ -2,6 +2,7 @@ package com.diagbot.facade;
 
 import com.diagbot.client.CdssCoreClient;
 import com.diagbot.dto.BillMsg;
+import com.diagbot.dto.DictionaryInfoDTO;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.PushBaseDTO;
 import com.diagbot.dto.PushDTO;
@@ -9,8 +10,8 @@ import com.diagbot.dto.PushPlanDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.TreatDTO;
 import com.diagbot.entity.ConceptDetail;
-import com.diagbot.enums.StaticTypeEnum;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.util.StringUtil;
@@ -43,6 +44,8 @@ public class PushFacade {
     private CdssCoreClient cdssCoreClient;
     @Autowired
     private ConceptInfoFacade conceptInfoFacade;
+    @Autowired
+    private DictionaryFacade dictionaryFacade;
 
     /**
      * 基础推理-症状、查体、化验、辅检、诊断
@@ -124,6 +127,13 @@ public class PushFacade {
     public PushDTO getStaticKnoledge(PushDTO pushDTO) {
         List<String> conceptNameList = Lists.newLinkedList();
         List<PushBaseDTO> conceptBaseList = Lists.newArrayList();
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
+
         if (ListUtil.isNotEmpty(pushDTO.getLis())) {
             conceptBaseList.addAll(pushDTO.getLis());
         }
@@ -153,7 +163,7 @@ public class PushFacade {
                 for (Map.Entry<String, List<PushBaseDTO>> entry : pushDTO.getDis().entrySet()) {
                     if (ListUtil.isNotEmpty(entry.getValue())) {
                         entry.getValue().forEach(item -> {
-                            if (conceptDetailMap.containsKey(item.getName() + "_" + StaticTypeEnum.getName(1))) {
+                            if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get(1))) {
                                 item.setHasInfo(1);
                             }
                         });
@@ -162,28 +172,33 @@ public class PushFacade {
             }
             if (ListUtil.isNotEmpty(pushDTO.getLis())) {
                 pushDTO.getLis().forEach(item -> {
-                    if (conceptDetailMap.containsKey(item.getName() + "_" + StaticTypeEnum.getName(3))) {
+                    if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get(3))) {
                         item.setHasInfo(1);
                     }
                 });
             }
             if (ListUtil.isNotEmpty(pushDTO.getPacs())) {
                 pushDTO.getPacs().forEach(item -> {
-                    if (conceptDetailMap.containsKey(item.getName() + "_" + StaticTypeEnum.getName(5))) {
+                    if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get(5))) {
                         item.setHasInfo(1);
                     }
+                    /*if (item.getHasInfo().equals(0)) {
+                        if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get(6))) {
+                            item.setHasInfo(1);
+                        }
+                    }*/
                 });
             }
             if (ListUtil.isNotEmpty(pushDTO.getMedicines())) {
                 pushDTO.getMedicines().forEach(item -> {
-                    if (conceptDetailMap.containsKey(item.getName() + "_" + StaticTypeEnum.getName(2))) {
+                    if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get(2))) {
                         item.setHasInfo(1);
                     }
                 });
             }
             if (ListUtil.isNotEmpty(pushDTO.getOperations())) {
                 pushDTO.getOperations().forEach(item -> {
-                    if (conceptDetailMap.containsKey(item.getName() + "_" + StaticTypeEnum.getName(6))) {
+                    if (conceptDetailMap.containsKey(item.getName() + "_" + dicStaticTypeValNameMap.get(7))) {
                         item.setHasInfo(1);
                     }
                 });
@@ -201,6 +216,12 @@ public class PushFacade {
      */
     public List<TreatDTO> retGeneraTreat(PushDTO pushDTO, Long hospitalId) {
         List<TreatDTO> retGeneraTreat = pushDTO.getTreat();
+        //静态知识类型
+        List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        Map<Integer, String> dicStaticTypeValNameMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
         if (ListUtil.isNotEmpty(retGeneraTreat)) {
             List<String> conceptNameList = retGeneraTreat.stream()
                     .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
@@ -212,7 +233,7 @@ public class PushFacade {
             }
             for (TreatDTO treatDTO : retGeneraTreat) {
                 if (StringUtil.isNotBlank(treatDTO.getUniqueName())) {
-                    String key = treatDTO.getUniqueName() + "_" + StaticTypeEnum.getName(1);
+                    String key = treatDTO.getUniqueName() + "_" + dicStaticTypeValNameMap.get(1);
                     if (conceptDetailMap.containsKey(key)) {
                         List<ConceptDetail> conceptDetailList = conceptDetailMap.get(key);
                         treatDTO.setGeneraTreat(conceptDetailList

+ 1 - 1
src/main/java/com/diagbot/vo/StaticKnowledgeVO.java

@@ -22,7 +22,7 @@ public class StaticKnowledgeVO {
     /**
      * 术语类型
      */
-    @NotNull(message = "请输入术语类型")
+    @NotNull(message = "请输入术语类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作")
     private Integer type;
     /**
      * 内容类型:1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案

+ 5 - 5
src/main/java/com/diagbot/web/ConceptInfoController.java

@@ -67,7 +67,7 @@ public class ConceptInfoController {
     }
 
     @ApiOperation(value = "页面获取静态知识[zhaops]",
-            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细、5-检查、6-手术和操作 <br>" +
+            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细、5-检查、6-检查子项、7-手术和操作 <br>" +
                     "contentTypes: 内容类型(多选):1-静态信息、2-注意事项、3-临床路径、4-治疗方案<br>" +
                     "name: 标准术语名称<br>")
     @PostMapping("/getStaticKnowledge")
@@ -78,7 +78,7 @@ public class ConceptInfoController {
     }
 
     @ApiOperation(value = "对接获取静态知识[zhaops]",
-            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细、5-检查、6-手术和操作 <br>" +
+            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细、5-检查、6-检查子项、7-手术和操作 <br>" +
                     "contentTypes: 内容类型(多选):1-静态信息、2-注意事项、3-临床路径、4-治疗方案 <br>" +
                     "hisName: HIS大项名称<br>" +
                     "hisDetailName: HIS小项名称<br>")
@@ -90,7 +90,7 @@ public class ConceptInfoController {
     }
 
     @ApiOperation(value = "获取静态知识列表[zhaops]",
-            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细、5-检查、6-手术和操作 <br>" +
+            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细、5-检查、6-检查子项、7-手术和操作 <br>" +
                     "name: 术语名称<br>" +
                     "isDeleted: 启用状态:N-启用中、Y-已删除<br>")
     @PostMapping("/getPage")
@@ -103,7 +103,7 @@ public class ConceptInfoController {
     @ApiOperation(value = "保存静态知识-新增或修改[zhaops]",
             notes = "id: id <br>" +
                     "name: 术语名称 <br>" +
-                    "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细、5-检查、6-手术和操作 <br>" +
+                    "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细、5-检查、6-检查子项、7-手术和操作 <br>" +
                     "clinicalPathwayName: 临床路径名称<br>" +
                     "noticeName: 注意事项名称<br>" +
                     "details: 明细<br>")
@@ -128,7 +128,7 @@ public class ConceptInfoController {
 
     @ApiOperation(value = "静态知识是否存在[zhaops]",
             notes = "name: 术语名称 <br>" +
-                    "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细、5-检查、6-手术和操作 <br>")
+                    "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细、5-检查、6-检查子项、7-手术和操作 <br>")
     @PostMapping("/isExist")
     @SysLogger("isExist")
     public RespDTO<Boolean> isExist(@Valid @RequestBody ConceptInfoVO conceptInfoVO) {