瀏覽代碼

对接获取医学知识bug修正

zhaops 4 年之前
父節點
當前提交
75e30d7633

+ 34 - 21
src/main/java/com/diagbot/facade/ConceptInfoFacade.java

@@ -342,11 +342,25 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
 
         List<StaticKnowledgeHISDTO> retList = Lists.newArrayList();
         List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
+        List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
         Map<String, String> dicStaticTypeValNameMap =
                 EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
-        String typeName = dicStaticTypeValNameMap.get(staticKnowledgeHISVO.getType().toString());
-        List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
-        typeName = convertTypeName(typeName, 1, dicList);
+
+        List<String> typeNames = ListUtil.newArrayList();
+        List<Integer> types = ListUtil.newArrayList();
+        types.add(staticKnowledgeHISVO.getType());
+        if (staticKnowledgeHISVO.getType().equals(5)) {
+            types.add(6);
+        } else if (staticKnowledgeHISVO.getType().equals(6)) {
+            types.add(5);
+        }
+
+        for (Integer type : types) {
+            String typeName = dicStaticTypeValNameMap.get(type.toString());
+            typeName = convertTypeName(typeName, 1, dicList);
+            typeNames.add(typeName);
+        }
+
         //术语映射
         List<String> uniqueNameList = getUniqueNames(staticKnowledgeHISVO);
         if (ListUtil.isEmpty(uniqueNameList)) {
@@ -356,7 +370,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .in("name", uniqueNameList)
                 .eq("status", StatusEnum.Enable.getKey())
-                .eq("type", typeName);
+                .in("type", typeNames);
         List<ConceptInfo> conceptInfoList = this.list(conceptInfoQueryWrapper);
 
         if (ListUtil.isEmpty(conceptInfoList)) {
@@ -393,7 +407,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                 = EntityUtil.makeEntityListMap(detailList, "conceptId");
         for (StaticKnowledgeHISDTO staticKnowledgeDTO : retList) {
             staticKnowledgeDTO.setHisName(staticKnowledgeHISVO.getHisName());
-            staticKnowledgeDTO.setHisName(staticKnowledgeHISVO.getHisDetailName());
+            staticKnowledgeDTO.setHisDetailName(staticKnowledgeHISVO.getHisDetailName());
             List<StaticKnowledgeDetailDTO> subDetailList = conceptMap.get(staticKnowledgeDTO.getId());
             if (ListUtil.isNotEmpty(subDetailList)) {
                 List<StaticKnowledgeDetailDTO> introduceList = subDetailList
@@ -481,7 +495,8 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                 Map<String, Map<String, Long>> disConfigMap
                         = diseaseConfigFacade.getConfigMap(hospitalId,
                         ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
-                if (disConfigMap != null) {
+                if (disConfigMap != null
+                        && disConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
                     nameList = new ArrayList<>(disConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
                 }
                 break;
@@ -489,7 +504,8 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                 Map<String, Map<String, Long>> drugConfigMap
                         = drugConfigFacade.getConfigMapWithoutForm(hospitalId,
                         ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
-                if (drugConfigMap != null) {
+                if (drugConfigMap != null
+                        && drugConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
                     nameList = new ArrayList<>(drugConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
                 }
                 break;
@@ -511,26 +527,21 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                 }
                 break;
             case 5:
+            case 6:
                 Map<String, Map<String, Long>> pacsConfigMap
                         = pacsConfigFacade.getConfigMap(hospitalId,
                         ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
-                if (pacsConfigMap != null) {
+                if (pacsConfigMap != null
+                        && pacsConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
                     nameList = new ArrayList<>(pacsConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
                 }
                 break;
-            case 6:
-                Map<String, Map<String, Long>> subPacsConfigMap
-                        = pacsConfigFacade.getConfigMap(hospitalId,
-                        ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
-                if (subPacsConfigMap != null) {
-                    nameList = new ArrayList<>(subPacsConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
-                }
-                break;
             case 7:
                 Map<String, Map<String, Long>> operationConfigMap
                         = operationConfigFacade.getConfigMap(hospitalId,
                         ListUtil.arrayToList(new String[] { staticKnowledgeHISVO.getHisName() }), null);
-                if (operationConfigMap != null) {
+                if (operationConfigMap != null &&
+                        operationConfigMap.get(staticKnowledgeHISVO.getHisName()) != null) {
                     nameList = new ArrayList<>(operationConfigMap.get(staticKnowledgeHISVO.getHisName()).keySet());
                 }
                 break;
@@ -538,10 +549,12 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                 break;
 
         }
-        nameList = nameList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());
+        if (ListUtil.isNotEmpty(nameList)) {
+            nameList = nameList
+                    .stream()
+                    .distinct()
+                    .collect(Collectors.toList());
+        }
         return nameList;
     }
 

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

@@ -78,7 +78,7 @@ public class ConceptInfoController {
     }
 
     @ApiOperation(value = "对接获取静态知识[zhaops]",
-            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作 <br>" +
+            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、7-手术和操作 <br>" +
                     "contentTypes: 内容类型(多选):1-静态信息、2-注意事项、3-临床路径、4-治疗方案 <br>" +
                     "hisName: HIS大项名称<br>" +
                     "hisDetailName: HIS小项名称<br>")