浏览代码

数据服务模式相关接口

Zhaops 6 年之前
父节点
当前提交
ec8404ba1b
共有 19 个文件被更改,包括 206 次插入116 次删除
  1. 3 3
      config-server/src/main/resources/shared/icss-service-dev.yml
  2. 2 2
      config-server/src/main/resources/shared/icss-service-local.yml
  3. 2 2
      config-server/src/main/resources/shared/icss-service-pro.yml
  4. 2 2
      config-server/src/main/resources/shared/icss-service-test.yml
  5. 4 4
      icss-service/src/main/java/com/diagbot/client/AIServiceClient.java
  6. 4 4
      icss-service/src/main/java/com/diagbot/client/HighRiskServiceClient.java
  7. 4 4
      icss-service/src/main/java/com/diagbot/client/SymptomFeatureClient.java
  8. 8 1
      icss-service/src/main/java/com/diagbot/client/TranServiceClient.java
  9. 3 3
      icss-service/src/main/java/com/diagbot/client/hystrix/AIServiceHystrix.java
  10. 3 3
      icss-service/src/main/java/com/diagbot/client/hystrix/HighRiskServiceHystrix.java
  11. 4 4
      icss-service/src/main/java/com/diagbot/client/hystrix/SymptomFeatureHystrix.java
  12. 16 7
      icss-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java
  13. 3 3
      icss-service/src/main/java/com/diagbot/facade/FeatureFacade.java
  14. 72 29
      icss-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java
  15. 18 3
      icss-service/src/main/java/com/diagbot/facade/LisMappingFacade.java
  16. 25 38
      icss-service/src/main/java/com/diagbot/facade/PushFacade.java
  17. 1 0
      icss-service/src/main/java/com/diagbot/vo/EMRIntroduceVO.java
  18. 5 4
      icss-service/src/main/java/com/diagbot/web/EMRController.java
  19. 27 0
      tran-service/src/main/java/com/diagbot/web/DataServiceController.java

+ 3 - 3
config-server/src/main/resources/shared/icss-service-dev.yml

@@ -98,7 +98,7 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
-ai:
+bigdata:
   server:
     address: http://192.168.2.234:5008
 
@@ -106,6 +106,6 @@ graph:
   server:
     address: http://192.168.2.234:5003
 
-symptom:
+nlp:
   server:
-    address: http://192.168.2.234:5002
+    address: http://192.168.2.234:5002

+ 2 - 2
config-server/src/main/resources/shared/icss-service-local.yml

@@ -98,7 +98,7 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
-ai:
+bigdata:
   server:
     address: http://192.168.2.234:5008
 
@@ -106,6 +106,6 @@ graph:
   server:
     address: http://192.168.2.234:5003
 
-symptom:
+nlp:
   server:
     address: http://192.168.2.234:5002

+ 2 - 2
config-server/src/main/resources/shared/icss-service-pro.yml

@@ -98,7 +98,7 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
-ai:
+bigdata:
   server:
     address: http://192.168.2.234:5008
 
@@ -106,7 +106,7 @@ graph:
   server:
     address: http://192.168.2.234:5003
 
-symptom:
+nlp:
   server:
     address: http://192.168.2.234:5002
 

+ 2 - 2
config-server/src/main/resources/shared/icss-service-test.yml

@@ -98,7 +98,7 @@ mybatis-plus:
     map-underscore-to-camel-case: true
     cache-enabled: false
 
-ai:
+bigdata:
   server:
     address: http://192.168.2.234:5008
 
@@ -106,6 +106,6 @@ graph:
   server:
     address: http://192.168.2.234:5003
 
-symptom:
+nlp:
   server:
     address: http://192.168.2.234:5002

+ 4 - 4
icss-service/src/main/java/com/diagbot/client/AIServiceClient.java

@@ -3,18 +3,18 @@ package com.diagbot.client;
 import com.diagbot.client.bean.Response;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.client.bean.SearchData;
-import com.diagbot.client.hystrix.AIServiceHystrix;
+import com.diagbot.client.hystrix.BigDataServiceHystrix;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
 /**
- * @Description:
+ * @Description:调用大数据对接层服务
  * @Author:zhaops
  * @time: 2018/11/20 13:15
  */
-@FeignClient(name = "AI", url = "${ai.server.address}", fallback = AIServiceHystrix.class)
-public interface AIServiceClient {
+@FeignClient(name = "BigData", url = "${bigdata.server.address}", fallback = BigDataServiceHystrix.class)
+public interface BigDataServiceClient {
     @PostMapping(value = "/push-web/algorithm/neural")
     Response<ResponseData> bayesPageData(@RequestBody SearchData searchData);
 }

+ 4 - 4
icss-service/src/main/java/com/diagbot/client/HighRiskServiceClient.java

@@ -3,18 +3,18 @@ package com.diagbot.client;
 import com.diagbot.client.bean.GdbResponse;
 import com.diagbot.client.bean.Response;
 import com.diagbot.client.bean.SearchData;
-import com.diagbot.client.hystrix.HighRiskServiceHystrix;
+import com.diagbot.client.hystrix.GraphServiceHystrix;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
 /**
- * @Description:
+ * @Description:调用知识图谱对接层服务
  * @Author:zhaops
  * @time: 2018/12/21 11:38
  */
-@FeignClient(name = "HighRisk", url = "${graph.server.address}", fallback = HighRiskServiceHystrix.class)
-public interface HighRiskServiceClient {
+@FeignClient(name = "Graph", url = "${graph.server.address}", fallback = GraphServiceHystrix.class)
+public interface GraphServiceClient {
     @PostMapping(value = "/graph-web/graph/highRisk")
     Response<GdbResponse> highRiskPageData(@RequestBody SearchData searchData);
 }

+ 4 - 4
icss-service/src/main/java/com/diagbot/client/SymptomFeatureClient.java

@@ -1,7 +1,7 @@
 package com.diagbot.client;
 
 import com.diagbot.client.bean.Response;
-import com.diagbot.client.hystrix.SymptomFeatureHystrix;
+import com.diagbot.client.hystrix.NLPServiceHystrix;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -10,12 +10,12 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @Description:
+ * @Description:调用NLP对接层服务
  * @Author:zhaops
  * @time: 2019/2/26 10:33
  */
-@FeignClient(name = "SymptomFeature", url = "${symptom.server.address}", fallback = SymptomFeatureHystrix.class)
-public interface SymptomFeatureClient {
+@FeignClient(name = "NLP", url = "${nlp.server.address}", fallback = NLPServiceHystrix.class)
+public interface NLPServiceClient {
     @PostMapping(value = "/nlp-web/feature/find_symptom_feature")
     Response<List<Map<String, Object>>> symptomFeaturePageData(@RequestParam("text") String text);
 }

+ 8 - 1
icss-service/src/main/java/com/diagbot/client/TranServiceClient.java

@@ -147,7 +147,6 @@ public interface TranServiceClient {
     RespDTO<Boolean> saveInquiryToHis(@RequestBody SaveInquiryToHisVO saveInquiryToHisVO);
 
 
-
     /**
      * 根据医院编码获取化验公表映射关系-itemName不为空
      *
@@ -192,4 +191,12 @@ public interface TranServiceClient {
      */
     @PostMapping("/diseaseIcd/getDiseaseIcdByHosCode")
     RespDTO<Map<String, String>> getDiseaseIcdByHosCode(@RequestBody HosCodeVO hosCodeVO);
+
+    /**
+     * 数据服务模式是否对外对接
+     *
+     * @return
+     */
+    @PostMapping("/dataService/isDocking")
+    RespDTO<Boolean> isDocking();
 }

+ 3 - 3
icss-service/src/main/java/com/diagbot/client/hystrix/AIServiceHystrix.java

@@ -1,6 +1,6 @@
 package com.diagbot.client.hystrix;
 
-import com.diagbot.client.AIServiceClient;
+import com.diagbot.client.BigDataServiceClient;
 import com.diagbot.client.bean.Response;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.client.bean.SearchData;
@@ -8,13 +8,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
 /**
- * @Description:
+ * @Description:调用大数据对接层服务
  * @Author:zhaops
  * @time: 2018/11/20 13:15
  */
 @Component
 @Slf4j
-public class AIServiceHystrix implements AIServiceClient {
+public class BigDataServiceHystrix implements BigDataServiceClient {
     @Override
     public Response<ResponseData> bayesPageData(SearchData searchData) {
         log.error("【hystrix】调用{}异常", "bayesPageData");

+ 3 - 3
icss-service/src/main/java/com/diagbot/client/hystrix/HighRiskServiceHystrix.java

@@ -1,6 +1,6 @@
 package com.diagbot.client.hystrix;
 
-import com.diagbot.client.HighRiskServiceClient;
+import com.diagbot.client.GraphServiceClient;
 import com.diagbot.client.bean.GdbResponse;
 import com.diagbot.client.bean.Response;
 import com.diagbot.client.bean.SearchData;
@@ -8,13 +8,13 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
 /**
- * @Description:
+ * @Description:调用知识图谱对接层服务
  * @Author:zhaops
  * @time: 2018/12/21 11:48
  */
 @Component
 @Slf4j
-public class HighRiskServiceHystrix implements HighRiskServiceClient {
+public class GraphServiceHystrix implements GraphServiceClient {
     @Override
     public Response<GdbResponse> highRiskPageData(SearchData searchData) {
         log.error("【hystrix】调用{}异常", "highRiskPageData");

+ 4 - 4
icss-service/src/main/java/com/diagbot/client/hystrix/SymptomFeatureHystrix.java

@@ -1,6 +1,6 @@
 package com.diagbot.client.hystrix;
 
-import com.diagbot.client.SymptomFeatureClient;
+import com.diagbot.client.NLPServiceClient;
 import com.diagbot.client.bean.Response;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
@@ -10,16 +10,16 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @Description:
+ * @Description:调用NLP对接层服务
  * @Author:zhaops
  * @time: 2019/2/26 10:33
  */
 @Component
 @Slf4j
-public class SymptomFeatureHystrix implements SymptomFeatureClient {
+public class NLPServiceHystrix implements NLPServiceClient {
 
     @Override
-    public  Response<List<Map<String, Object>>> symptomFeaturePageData(@RequestParam("text") String text) {
+    public Response<List<Map<String, Object>>> symptomFeaturePageData(@RequestParam("text") String text) {
         log.error("【hystrix】调用{}异常", "symptomFeaturePageData");
         return null;
     }

+ 16 - 7
icss-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java

@@ -105,13 +105,11 @@ public class TranServiceHystrix implements TranServiceClient {
         return null;
     }
 
-	@Override
-	public RespDTO<Boolean> saveInquiryToHis(SaveInquiryToHisVO saveInquiryToHisVO) {
-		 log.error("【hystrix】调用{}异常", "saveInquiryToHis");
-		return null;
-	}
-    
-    
+    @Override
+    public RespDTO<Boolean> saveInquiryToHis(SaveInquiryToHisVO saveInquiryToHisVO) {
+        log.error("【hystrix】调用{}异常", "saveInquiryToHis");
+        return null;
+    }
 
 
     //    @Override
@@ -179,4 +177,15 @@ public class TranServiceHystrix implements TranServiceClient {
         log.error("【hystrix】调用{}异常", "getDiseaseIcdByHosCode");
         return null;
     }
+
+    /**
+     * 数据服务模式是否对外对接
+     *
+     * @return
+     */
+    @Override
+    public RespDTO<Boolean> isDocking() {
+        log.error("【hystrix】调用{}异常", "isDocking");
+        return null;
+    }
 }

+ 3 - 3
icss-service/src/main/java/com/diagbot/facade/FeatureFacade.java

@@ -1,7 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.diagbot.client.SymptomFeatureClient;
+import com.diagbot.client.NLPServiceClient;
 import com.diagbot.client.bean.Response;
 import com.diagbot.dto.SymptomFeatureDTO;
 import com.diagbot.entity.QuestionInfo;
@@ -25,7 +25,7 @@ import java.util.Map;
 @Component
 public class FeatureFacade {
     @Autowired
-    private SymptomFeatureClient symptomFeatureClient;
+    private NLPServiceClient NLPServiceClient;
     @Autowired
     private QuestionFacade questionFacade;
 
@@ -37,7 +37,7 @@ public class FeatureFacade {
      */
     public List<SymptomFeatureDTO> getSymptomFeature(String text) {
         List<SymptomFeatureDTO> symptomFeatureDTOList = Lists.newLinkedList();
-        Response<List<Map<String, Object>>> res = symptomFeatureClient.symptomFeaturePageData(text);
+        Response<List<Map<String, Object>>> res = NLPServiceClient.symptomFeaturePageData(text);
         if (null == res || null == res.getData()) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "AI没有返回结果");
         }

+ 72 - 29
icss-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java

@@ -26,6 +26,7 @@ import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.Arrays;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -45,6 +46,8 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
     QuestionFacade questionFacade;
     @Autowired
     TranServiceClient tranServiceClient;
+    @Autowired
+    LisMappingFacade lisMappingFacade;
 
     /**
      * 根据标签id获取提示信息
@@ -156,6 +159,7 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
      * @return
      */
     public List<EMRIntroduceDetailDTO> getIntroduceByEMR(EMRIntroduceVO emrIntroduceVO) {
+        Boolean isDocking = tranServiceClient.isDocking().data;
         //入参处理
         HosCodeVO hosCodeVO = new HosCodeVO();
         hosCodeVO.setHosCode(emrIntroduceVO.getHosCode());
@@ -165,47 +169,81 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         if (type.equals(QuestionTypeEnum.Lis.getKey())) {
             if (StringUtil.isNotBlank(emrIntroduceVO.getName())) {
                 if (StringUtil.isNotBlank(emrIntroduceVO.getDetailName())) {
-                    RespDTO<Map<String, Map<String, String>>> respLisConfigMap = tranServiceClient.getLisConfigByHosCode_NotEmptyItemName(hosCodeVO);
-                    if (RespDTOUtil.respIsNG(respLisConfigMap)) {
-                        throw new CommonException(CommonErrorCode.RPC_ERROR);
+                    Map<String, Map<String, String>> lisConfigMap = new LinkedHashMap<>();
+                    if (isDocking) {
+                        RespDTO<Map<String, Map<String, String>>> respLisConfigMap = tranServiceClient.getLisConfigByHosCode_NotEmptyItemName(hosCodeVO);
+                        if (RespDTOUtil.respIsNG(respLisConfigMap)) {
+                            throw new CommonException(CommonErrorCode.RPC_ERROR);
+                        }
+                        lisConfigMap = respLisConfigMap.data;
+                    } else {
+                        lisConfigMap = lisMappingFacade.getLisMapping_NotEmptyItemName();
                     }
-                    Map<String, Map<String, String>> lisConfigMap = respLisConfigMap.data;
+
                     uniqueName = lisConfigMap.get(emrIntroduceVO.getName()).get(emrIntroduceVO.getDetailName());
                 } else {
-                    RespDTO<Map<String, String>> respLisConfigMap_emptyItemName = tranServiceClient.getLisConfigByHosCode_EmptyItemName(hosCodeVO);
-                    if (RespDTOUtil.respIsNG(respLisConfigMap_emptyItemName)) {
-                        throw new CommonException(CommonErrorCode.RPC_ERROR);
+                    Map<String, String> lisConfigMap_emptyItemName = new LinkedHashMap<>();
+                    if (isDocking) {
+                        RespDTO<Map<String, String>> respLisConfigMap_emptyItemName = tranServiceClient.getLisConfigByHosCode_EmptyItemName(hosCodeVO);
+                        if (RespDTOUtil.respIsNG(respLisConfigMap_emptyItemName)) {
+                            throw new CommonException(CommonErrorCode.RPC_ERROR);
+                        }
+                        lisConfigMap_emptyItemName = respLisConfigMap_emptyItemName.data;
+                    } else {
+                        lisConfigMap_emptyItemName = lisMappingFacade.getLisConfig_EmptyItemName();
                     }
-                    Map<String, String> lisConfigMap_emptyItemName = respLisConfigMap_emptyItemName.data;
                     uniqueName = lisConfigMap_emptyItemName.get(emrIntroduceVO.getName());
                 }
             }
         } else if (type.equals(QuestionTypeEnum.Pacs.getKey())) {
-            RespDTO<Map<String, String>> respPacsConfigMap = tranServiceClient.getPacsConfigByHosCode(hosCodeVO);
-            if (RespDTOUtil.respIsNG(respPacsConfigMap)) {
-                throw new CommonException(CommonErrorCode.RPC_ERROR);
+            if (isDocking) {
+                RespDTO<Map<String, String>> respPacsConfigMap = tranServiceClient.getPacsConfigByHosCode(hosCodeVO);
+                if (RespDTOUtil.respIsNG(respPacsConfigMap)) {
+                    throw new CommonException(CommonErrorCode.RPC_ERROR);
+                }
+                Map<String, String> pacsConfigMap = respPacsConfigMap.data;
+                uniqueName = pacsConfigMap.get(emrIntroduceVO.getName());
+            } else {
+                uniqueName = emrIntroduceVO.getName();
+            }
+        } else if (type.equals(QuestionTypeEnum.Disease.getKey())) {
+            if (isDocking) {
+                RespDTO<Map<String, String>> respDisMap = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO);
+                if (RespDTOUtil.respIsNG(respDisMap)) {
+                    throw new CommonException(CommonErrorCode.RPC_ERROR);
+                }
+                Map<String, String> disMap = respDisMap.data;
+                uniqueName = disMap.get(emrIntroduceVO.getName());
+            } else {
+                uniqueName = emrIntroduceVO.getName();
             }
-            Map<String, String> pacsConfigMap = respPacsConfigMap.data;
-            uniqueName = pacsConfigMap.get(emrIntroduceVO.getName());
         }
 
-        //未找到公表映射项目
+        //未找到映射标签名称
         if (uniqueName == null || StringUtil.isBlank(uniqueName)) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "项目未找到");
         }
 
-        RespDTO<Map<String, String>> respTitleMappingMap = tranServiceClient.getTitleMappingHosCode(hosCodeVO);
-        Map<String, String> titleMappingMap = respTitleMappingMap.data;
         String[] titles = emrIntroduceVO.getTitles();
+        //对接标题映射
         Map<String, String> titleMapping = new LinkedHashMap<>();
         List<String> uniqueTitleList = Lists.newLinkedList();
         if (ArrayUtil.isNotEmpty(titles)) {
-            for (String title : titles) {
-                String uniqueTitle = titleMappingMap.get(title);
-                titleMapping.put(title, uniqueTitle);
-                if (StringUtil.isNotBlank(uniqueTitle)) {
-                    uniqueTitleList.add(uniqueTitle);
+            if (isDocking) {
+                RespDTO<Map<String, String>> respTitleMappingMap = tranServiceClient.getTitleMappingHosCode(hosCodeVO);
+                if (RespDTOUtil.respIsNG(respTitleMappingMap)) {
+                    throw new CommonException(CommonErrorCode.RPC_ERROR);
+                }
+                Map<String, String> titleMappingMap = respTitleMappingMap.data;
+                for (String title : titles) {
+                    String uniqueTitle = titleMappingMap.get(title);
+                    titleMapping.put(title, uniqueTitle);
+                    if (StringUtil.isNotBlank(uniqueTitle)) {
+                        uniqueTitleList.add(uniqueTitle);
+                    }
                 }
+            } else {
+                uniqueTitleList = Arrays.asList(titles);
             }
         }
 
@@ -244,17 +282,22 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         List<IntroduceDetail> introduceDetailList = introduceDetailFacade.list(introduceDetailQueryWrapper);
         List<EMRIntroduceDetailDTO> retList = Lists.newLinkedList();
         if (ArrayUtil.isNotEmpty(emrIntroduceVO.getTitles())) {
-            for (Map.Entry<String, String> entry : titleMapping.entrySet()) {
-                EMRIntroduceDetailDTO detailDTO = new EMRIntroduceDetailDTO();
-                detailDTO.setTitle(entry.getKey());
-                if (StringUtil.isNotBlank(entry.getValue())) {
-                    for (IntroduceDetail introduceDetail : introduceDetailList) {
-                        if (entry.getValue().equals(introduceDetail.getTitle())) {
-                            detailDTO.setText(introduceDetail.getText());
+            //对接模式,返回原标题
+            if (isDocking) {
+                for (Map.Entry<String, String> entry : titleMapping.entrySet()) {
+                    EMRIntroduceDetailDTO detailDTO = new EMRIntroduceDetailDTO();
+                    detailDTO.setTitle(entry.getKey());
+                    if (StringUtil.isNotBlank(entry.getValue())) {
+                        for (IntroduceDetail introduceDetail : introduceDetailList) {
+                            if (entry.getValue().equals(introduceDetail.getTitle())) {
+                                detailDTO.setText(introduceDetail.getText());
+                            }
                         }
                     }
+                    retList.add(detailDTO);
                 }
-                retList.add(detailDTO);
+            } else {
+                retList = BeanUtil.listCopyTo(introduceDetailList, EMRIntroduceDetailDTO.class);
             }
         } else {
             retList = BeanUtil.listCopyTo(introduceDetailList, EMRIntroduceDetailDTO.class);

+ 18 - 3
icss-service/src/main/java/com/diagbot/facade/LisMappingFacade.java

@@ -20,14 +20,15 @@ import java.util.Map;
 public class LisMappingFacade extends LisMappingServiceImpl {
 
     /**
-     * 获取化验公表映射关系 Map<mealName,Map<itemName,uniqueName>>
+     * 获取化验公表映射关系-itemName不为空 Map<mealName,Map<itemName,uniqueName>>
      *
      * @return
      */
-    public Map<String, Map<String, String>> getLisMapping() {
+    public Map<String, Map<String, String>> getLisMapping_NotEmptyItemName() {
         Map<String, Map<String, String>> retMap = new LinkedHashMap<>();
         QueryWrapper<LisMapping> lisMappingQueryWrapper = new QueryWrapper<>();
-        lisMappingQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+        lisMappingQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
+                isNotNull("item_name").and(i->i.ne("item_name",""));
         List<LisMapping> lisMappingList = this.list(lisMappingQueryWrapper);
         Map<String, List<LisMapping>> lisMappingMap = EntityUtil.makeEntityListMap(lisMappingList, "mealName");
         for (Map.Entry<String, List<LisMapping>> entry : lisMappingMap.entrySet()) {
@@ -40,6 +41,20 @@ public class LisMappingFacade extends LisMappingServiceImpl {
         return retMap;
     }
 
+    /**
+     * 根据医院编码获取化验公表映射关系-itemName为空 Map<mealName,uniqueName>
+     *
+     * @return
+     */
+    public Map<String, String> getLisConfig_EmptyItemName() {
+        QueryWrapper<LisMapping> lisMappingQueryWrapper = new QueryWrapper<>();
+        lisMappingQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
+                isNull("item_name").or(i -> i.eq("item_name", ""));
+        List<LisMapping> lisMappingList = this.list(lisMappingQueryWrapper);
+        Map<String, String> retMap = EntityUtil.makeMapWithKeyValue(lisMappingList, "mealName", "uniqueName");
+        return retMap;
+    }
+
     /**
      * 化验公表映射关系  Map<uniqueName,List<mealName>>
      *

+ 25 - 38
icss-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -2,8 +2,8 @@ package com.diagbot.facade;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.diagbot.client.AIServiceClient;
-import com.diagbot.client.HighRiskServiceClient;
+import com.diagbot.client.BigDataServiceClient;
+import com.diagbot.client.GraphServiceClient;
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.client.bean.FeatureRate;
 import com.diagbot.client.bean.GdbResponse;
@@ -14,7 +14,6 @@ import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.PushEMRDTO;
 import com.diagbot.dto.PushKYJDTO;
 import com.diagbot.dto.QuestionDTO;
-import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.entity.DeptVital;
 import com.diagbot.entity.QuestionInfo;
@@ -58,7 +57,7 @@ import java.util.stream.Collectors;
 @Component
 public class PushFacade {
     @Autowired
-    private AIServiceClient aiServiceClient;
+    private BigDataServiceClient bigDataServiceClient;
     @Autowired
     private QuestionFacade questionFacade;
     @Autowired
@@ -68,7 +67,7 @@ public class PushFacade {
     @Autowired
     private TreatmentFacade treatmentFacade;
     @Autowired
-    private HighRiskServiceClient highRiskServiceClient;
+    private GraphServiceClient graphServiceClient;
     @Autowired
     private LisMappingFacade lisMappingFacade;
     @Autowired
@@ -105,7 +104,7 @@ public class PushFacade {
 
         //化验项映射,转公表
         if (pushVO.getLis().size() > 0) {
-            Map<String, Map<String, String>> lisConfigMap = lisMappingFacade.getLisMapping();
+            Map<String, Map<String, String>> lisConfigMap = lisMappingFacade.getLisMapping_NotEmptyItemName();
             for (LisResultVO lisResultVO : pushVO.getLis()) {
                 //source=0 icss页面数据,source=1 外部导入数据
                 if (!lisResultVO.getSource().equals(LisSourceEnum.Inner.getKey())) {
@@ -126,7 +125,7 @@ public class PushFacade {
         searchData.setSysCode("1");
         searchData.setLength(10);
 
-        Response<ResponseData> res = aiServiceClient.bayesPageData(searchData);
+        Response<ResponseData> res = bigDataServiceClient.bayesPageData(searchData);
         if (null == res || null == res.getData()) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "AI没有返回结果");
         }
@@ -203,7 +202,7 @@ public class PushFacade {
             highRiskMap.put("disease", String.join(",", diseaseNameList));
             SearchData searchData = new SearchData();
             searchData.setDiag(String.join(",", diseaseNameList));
-            Response<GdbResponse> graphRes = highRiskServiceClient.highRiskPageData(searchData);
+            Response<GdbResponse> graphRes = graphServiceClient.highRiskPageData(searchData);
             if (graphRes != null) {
                 Map<String, String> graphResult = graphRes.getData().getResult();
                 if (graphResult.size() > 0) {
@@ -452,37 +451,17 @@ public class PushFacade {
                 vitalDTO.add(questionDTO);
             }
         }
-        /*if (deptVitalList.size() > 0) {
-            Map<Long, DeptVital> deptVitalMap = EntityUtil.makeEntityMap(deptVitalList, "vitalId");
-            //排序
-            QueryWrapper<VitalOrder> vitalOrderQueryWrapper = new QueryWrapper<>();
-            vitalOrderQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
-                    in("question_id", deptVitalMap.keySet()).
-                    orderByAsc("order_no");
-            List<VitalOrder> vitalOrderList = vitalOrderFacade.list(vitalOrderQueryWrapper);
-            Map<Long, VitalOrder> vitalOrderMap = EntityUtil.makeEntityMap(vitalOrderList, "questionId");
-            //标签列表
-            for (Map.Entry<Long, VitalOrder> entry : vitalOrderMap.entrySet()) {
-                QuestionVO questionVO = new QuestionVO();
-                questionVO.setAge(pushVO.getAge());
-                questionVO.setSexType(pushVO.getSex());
-                questionVO.setId(entry.getKey());
-                QuestionDTO questionDTO = questionFacade.getById(questionVO);
-                if (questionDTO != null) {
-                    vitalDTO.add(questionDTO);
-                }
-            }
-        }*/
         return vitalDTO;
     }
 
     /**
-     * 电子病历评级推理
+     * 电子病历评级-数据服务模式推理
      *
      * @param emrPushVO
      * @return
      */
     public PushEMRDTO pushEMR(EMRPushVO emrPushVO) {
+        Boolean isDocking = tranServiceClient.isDocking().data;
         PushEMRDTO pushEMRDTO = new PushEMRDTO();
         HosCodeVO hosCodeVO = new HosCodeVO();
         hosCodeVO.setHosCode(emrPushVO.getHosCode());
@@ -490,10 +469,15 @@ public class PushFacade {
         BeanUtil.copyProperties(emrPushVO, pushVO);
         //化验项转公表内容,参数处理
         if (ListUtil.isNotEmpty(pushVO.getLis())) {
-            RespDTO<Map<String, Map<String, String>>> respLisConfigMap = tranServiceClient.getLisConfigByHosCode_NotEmptyItemName(hosCodeVO);
-            Map<String, Map<String, String>> lisConfigMap = respLisConfigMap.data;
-            RespDTO<Map<String, String>> respLisConfigMap_emptyItemName = tranServiceClient.getLisConfigByHosCode_EmptyItemName(hosCodeVO);
-            Map<String, String> lisConfigMap_emptyItemName = respLisConfigMap_emptyItemName.data;
+            Map<String, Map<String, String>> lisConfigMap = new LinkedHashMap<>();
+            Map<String, String> lisConfigMap_emptyItemName = new LinkedHashMap<>();
+            if (isDocking) {
+                lisConfigMap = tranServiceClient.getLisConfigByHosCode_NotEmptyItemName(hosCodeVO).data;
+                lisConfigMap_emptyItemName = tranServiceClient.getLisConfigByHosCode_EmptyItemName(hosCodeVO).data;
+            } else {
+                lisConfigMap = lisMappingFacade.getLisMapping_NotEmptyItemName();
+                lisConfigMap_emptyItemName = lisMappingFacade.getLisConfig_EmptyItemName();
+            }
             List<LisResultVO> lisResultVOList = pushVO.getLis();
             for (LisResultVO lisResultVO : lisResultVOList) {
                 if (StringUtil.isNotBlank(lisResultVO.getName())) {
@@ -528,8 +512,7 @@ public class PushFacade {
         if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Disease.getKey()))) {
             List<FeatureRate> dis = data.getDis();
             Map<String, List<String>> retDisMap = new LinkedHashMap<>();
-            RespDTO<Map<String, String>> respDisDTO = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO);
-            Map<String, String> disMap = respDisDTO.data;
+            Map<String, String> disMap = tranServiceClient.getDiseaseIcdByHosCode(hosCodeVO).data;
 
             //诊断分类
             for (FeatureRate featureRate : dis) {
@@ -542,8 +525,12 @@ public class PushFacade {
                     if (retDisMap.get(disClass) != null) {
                         retDisList = retDisMap.get(disClass);
                     }
-                    //转icd10名称
-                    retDisList.add(disMap.get(featureRate.getFeatureName()));
+                    if (isDocking) {
+                        //对接模式转icd10名称
+                        retDisList.add(disMap.get(featureRate.getFeatureName()));
+                    } else {
+                        retDisList.add(featureRate.getFeatureName());
+                    }
                     retDisMap.put(disClass, retDisList);
                 }
             }

+ 1 - 0
icss-service/src/main/java/com/diagbot/vo/EMRIntroduceVO.java

@@ -21,4 +21,5 @@ public class EMRIntroduceVO {
     private String name;
     private String detailName;
     private String[] titles;
+    private String icdCode; //诊断icd10编码
 }

+ 5 - 4
icss-service/src/main/java/com/diagbot/web/EMRController.java

@@ -36,10 +36,11 @@ public class EMRController {
 
     @ApiOperation(value = "电子病历解读[by:zhaops]",
             notes = "hosCode: 医院编码,必填,String<br>" +
-                    "type: 检验检查类型,5-检验,6-检查,单选必填,Integer<br>" +
-                    "name: 套餐名称(检验检查),必填,String<br>" +
+                    "type: 检验检查类型,5-检验,6-检查,7-诊断,单选必填,Integer<br>" +
+                    "name: 名称(检验检查诊断),必填,String<br>" +
                     "detailName: 项目名称(检验选填,检查不填),String<br>" +
-                    "titles: 提示信息标题列表,String数组<br>")
+                    "titles: 提示信息标题列表,String数组<br>"+
+                    "icdCode: 诊断icd10编码,String<br>")
     @PostMapping("/getIntroduceByEMR")
     public RespDTO<List<EMRIntroduceDetailDTO>> getIntroduceByEMR(@RequestBody EMRIntroduceVO emrIntroduceVO) {
         List<EMRIntroduceDetailDTO> data = introduceInfoFacade.getIntroduceByEMR(emrIntroduceVO);
@@ -65,7 +66,7 @@ public class EMRController {
                     "lis:source:数据来源(必填)0-内部来源,1-外部来源,Integer<br>" +
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
-                    "featureType:类型(多选必填),5:检验,6:检查,String<br>")
+                    "featureType:类型(多选必填),5:检验,6:检查,7:诊断,String<br>")
     @PostMapping("/pushEMR")
     @SysLogger("pushEMR")
     public RespDTO<PushEMRDTO> pushEMR(@RequestBody @Valid EMRPushVO emrPushVO) {

+ 27 - 0
tran-service/src/main/java/com/diagbot/web/DataServiceController.java

@@ -0,0 +1,27 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/19 10:30
+ */
+@RestController
+@RequestMapping("/dataService")
+@Api(value = "数据服务对外接口相关API", tags = { "数据服务对外接口相关API" })
+public class DataServiceController {
+
+    @ApiOperation(value = "是否对接:[by:zhaops]")
+    @PostMapping("/isDocking")
+    @SysLogger("isDocking")
+    public RespDTO<Boolean> isDocking() {
+        return RespDTO.onSuc(false);
+    }
+}