Browse Source

Merge remote-tracking branch 'origin/dev/cdssman20200727_init' into dev/cdssman20200727_init

wangfeng 4 years ago
parent
commit
e20b6ced32

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/DrugConfig.java

@@ -84,7 +84,7 @@ public class DrugConfig implements Serializable {
     /**
      * 剂型
      */
-    @Excel(name = "药品剂型(不填、注射剂、片剂、缓释片、胶囊剂、滴丸剂)", width = 60, orderNum = "3", isImportField = "true")
+    @Excel(name = "药品剂型", width = 60, orderNum = "3", isImportField = "true")
     private String form;
 
     public Long getId() {

+ 7 - 3
cdssman-service/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,7 +18,8 @@ public enum StaticTypeEnum implements KeyedNamed {
     LisPack(3, "检验套餐"),
     Lis(4, "检验细项"),
     Pacs(5, "检查"),
-    Opeartion(6, "手术和操作");
+    PacsSubName(6, "检查子项"),
+    Opeartion(7, "手术和操作");
 
     @Setter
     private int key;
@@ -65,4 +69,4 @@ public enum StaticTypeEnum implements KeyedNamed {
     public String getName() {
         return name;
     }
-}
+}*/

+ 46 - 10
cdssman-service/src/main/java/com/diagbot/facade/ConceptInfoFacade.java

@@ -12,7 +12,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;
@@ -90,6 +89,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);
@@ -167,13 +168,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("检验套餐")) {
-                        retList.addAll(map.get("检验套餐"));
+                    //3-检验套餐、4-检验细项
+                    if (map.containsKey(staticTypeDicMap.get("3"))) {
+                        retList.addAll(map.get(staticTypeDicMap.get("3")));
                     }
-                    if (map.containsKey("检验明细")) {
-                        retList.addAll(map.get("检验明细"));
+                    if (map.containsKey(staticTypeDicMap.get("4"))) {
+                        retList.addAll(map.get(staticTypeDicMap.get("4")));
+                    }
+                } else if (dic.getName().equals("检查")) {
+                    //5-检查、6-检查子项
+                    if (map.containsKey(staticTypeDicMap.get("5"))) {
+                        retList.addAll(map.get(staticTypeDicMap.get("5")));
+                    }
+                    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()));
@@ -214,9 +226,15 @@ 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);
@@ -225,7 +243,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);
@@ -242,8 +260,14 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         String userId = UserUtils.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");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
         //术语类型转换
-        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();
 
@@ -360,8 +384,14 @@ 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");
+        Map<String, Integer> dicStaticTypeNameValMap =
+                EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
         //术语类型转换
-        String typeName = convertTypeName(StaticTypeEnum.getName(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
+        String typeName = convertTypeName(dicStaticTypeValNameMap.get(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
         conceptInfoVO.setTypeName(typeName);
         QueryWrapper<ConceptInfo> conceptInfoQueryWrapper = new QueryWrapper<>();
         conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -389,6 +419,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) {
@@ -406,7 +442,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());
         }

+ 28 - 3
cdssman-service/src/main/java/com/diagbot/facade/DrugConfigFacade.java

@@ -261,7 +261,7 @@ public class DrugConfigFacade {
      * @param hospitalIdVO
      */
     public void importExcel(MultipartFile file, HospitalIdVO hospitalIdVO) {
-        List<DrugConfig> drugConfigList = ExcelUtils.importExcel(file, 0, 1, DrugConfig.class);
+        List<DrugConfig> drugConfigList = ExcelUtils.importExcel(file, 1, 1, DrugConfig.class);
         if (ListUtil.isNotEmpty(drugConfigList)) {
             drugConfigList.forEach(drugConfig -> {
                 drugConfig.setHospitalId(hospitalIdVO.getHospitalId());
@@ -586,7 +586,7 @@ public class DrugConfigFacade {
                 .eq("hospital_id", hospitalIdVO.getHospitalId());
         List<DrugConfig> records = drugConfigService.list(queryWrapper);
         String fileName = "药品映射.xls";
-        ExcelUtils.exportExcel(records, null, "sheet1", DrugConfig.class, fileName, response, 12.8f);
+        ExcelUtils.exportExcel(records, getFrom(), "sheet1", DrugConfig.class, fileName, response, 12.8f);
     }
 
     /**
@@ -606,6 +606,31 @@ public class DrugConfigFacade {
      */
     public void exportExcelModule(HttpServletResponse response) {
         String fileName = "药品映射模板.xls";
-        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", DrugConfig.class, fileName, response, 12.8f);
+        ExcelUtils.exportExcel(new ArrayList<>(), getFrom(), "sheet1", DrugConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 剂型说明
+     *
+     * @return
+     */
+    private String getFrom() {
+        String from = "药品模板——药品剂型填写说明[不填";
+        //药品剂型
+        List<DictionaryInfoDTO> dicTypeMappingList = dictionaryFacade.getListByGroupType(9);
+        List<String> formList = dicTypeMappingList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getName()))
+                .map(i -> i.getName())
+                .distinct()
+                .collect(Collectors.toList());
+        if (ListUtil.isNotEmpty(formList)) {
+            for (String s : formList) {
+                if (StringUtil.isNotBlank(s)) {
+                    from += "、" + s;
+                }
+            }
+        }
+        from += "]";
+        return from;
     }
 }

+ 3 - 1
cdssman-service/src/main/java/com/diagbot/facade/HospitalInfoFacade.java

@@ -94,8 +94,8 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
         hospitalInfo.setModifier(userId);
         hospitalInfo.setGmtModified(now);
         QueryWrapper<HospitalInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
         if (StringUtil.isNotBlank(hospitalInfo.getName())) {
+            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
             queryWrapper.eq("name", hospitalInfo.getName());
             HospitalInfo oldRecord = this.getOne(queryWrapper, false);
             if (hospitalInfo.getId() == null
@@ -109,6 +109,8 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
             }
         }
         if (StringUtil.isNotBlank(hospitalInfo.getCode())) {
+            queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
             queryWrapper.eq("code", hospitalInfo.getCode());
             HospitalInfo oldRecord = this.getOne(queryWrapper, false);
             if (hospitalInfo.getId() == null