Przeglądaj źródła

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

zhoutg 6 lat temu
rodzic
commit
5fb35dcaf5

+ 6 - 0
aipt-service/src/main/java/com/diagbot/facade/ClinicalFacade.java

@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -55,6 +56,11 @@ public class ClinicalFacade {
 
         sData.setLisArr(processLis(sData.getLisArr()));
 
+        if (ListUtil.isNotEmpty(sData.getLisArr())) {
+            List<String> otherVal = sData.getLisArr().stream().map(lisArr -> lisArr.getOtherValue()).collect(Collectors.toList());
+            sData.setLis(String.join(",", otherVal));
+        }
+
         Response<ResponseData> res = aiServiceClient.bayesPageData(sData);
         if (res == null || res.getData() == null) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "AI没有返回结果");

+ 1 - 5
icss-service/src/main/java/com/diagbot/facade/CalculateFacade.java

@@ -2,8 +2,6 @@ package com.diagbot.facade;
 
 import com.diagbot.client.AiptServiceClient;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.CalculateVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,9 +21,7 @@ public class CalculateFacade {
 
     public Map<String, Object> calculate(CalculateVO calculateVO) {
         RespDTO<Map<String, Object>> res = aiptServiceClient.scaleCalc(calculateVO);
-        if (RespDTOUtil.respIsNG(res)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "计算没有结果返回");
-        }
+        RespDTOUtil.respNGDealCover(res, "计算没有结果返回");
         Map<String, Object> map = res.data;
         return map;
     }

+ 5 - 9
icss-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java

@@ -7,8 +7,6 @@ import com.diagbot.dto.HospitalDeptInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.DeptInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.RespDTOUtil;
@@ -27,6 +25,7 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
 
     @Autowired
     TranServiceClient tranServiceClient;
+
     /**
      * 获取科室信息
      *
@@ -35,18 +34,15 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
      */
     public DeptInfoDTO getDeptInfo(DeptInfoVO deptInfoVO) {
         HospitalDeptInfoVO hospitalDeptInfoVO = new HospitalDeptInfoVO();
-        BeanUtil.copyProperties(deptInfoVO,hospitalDeptInfoVO);
+        BeanUtil.copyProperties(deptInfoVO, hospitalDeptInfoVO);
         RespDTO<HospitalDeptInfoDTO> hospitalDeptInfoDTORespDTO = tranServiceClient.getHospitalDeptInfo(hospitalDeptInfoVO);
-        if (RespDTOUtil.respIsNG(hospitalDeptInfoDTORespDTO)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "获取科室信息失败");
-        }
+        RespDTOUtil.respNGDealCover(hospitalDeptInfoDTORespDTO, "获取科室信息失败");
         QueryWrapper<DeptInfo> deptInfoDTOQueryWrapper = new QueryWrapper<>();
         deptInfoDTOQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("name",hospitalDeptInfoDTORespDTO.data.getIcssDeptName());
+                .eq("name", hospitalDeptInfoDTORespDTO.data.getIcssDeptName());
         DeptInfo deptInfo = this.getOne(deptInfoDTOQueryWrapper);
         DeptInfoDTO deptInfoDTO = new DeptInfoDTO();
-        BeanUtil.copyProperties(deptInfo,deptInfoDTO);
+        BeanUtil.copyProperties(deptInfo, deptInfoDTO);
         deptInfoDTO.setId(deptInfo.getId());
         return deptInfoDTO;
     }

+ 14 - 21
icss-service/src/main/java/com/diagbot/facade/DoctorInfoFacade.java

@@ -1,19 +1,16 @@
 package com.diagbot.facade;
 
-import java.util.List;
-import java.util.Map;
-
-import com.diagbot.util.RespDTOUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.DoctorInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DoctorInfo;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
+import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.DoctorInfoVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Description:
@@ -24,6 +21,7 @@ import com.diagbot.vo.DoctorInfoVO;
 public class DoctorInfoFacade {
     @Autowired
     private TranServiceClient tranServiceClient;
+
     /**
      * 获取医生信息
      *
@@ -32,25 +30,20 @@ public class DoctorInfoFacade {
      */
     public List<DoctorInfoDTO> getDoctorInfo(DoctorInfoVO doctorInfoVo) {
         RespDTO<List<DoctorInfoDTO>> doctorInfoDTOList = tranServiceClient.getDoctorInfo(doctorInfoVo);
-        if (RespDTOUtil.respIsNG(doctorInfoDTOList)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "获取医生信息失败");
-        }
+        RespDTOUtil.respNGDealCover(doctorInfoDTOList, "获取医生信息失败");
         return doctorInfoDTOList.data;
     }
-    
+
     /**
      * 根据ids获取医生信息map
+     *
      * @param ids 医生ids
      * @return 医生信息
      */
     public Map<Long, DoctorInfo> doctorInfoMapByIds(List<Long> ids) {
-    	 RespDTO<Map<Long, DoctorInfo>> retData = tranServiceClient.doctorInfoMapByIds(ids);
-         if (RespDTOUtil.respIsNG(retData)) {
-             throw new CommonException(CommonErrorCode.RPC_ERROR,
-                     "获取医生信息失败");
-         }
-         return retData.data;
+        RespDTO<Map<Long, DoctorInfo>> retData = tranServiceClient.doctorInfoMapByIds(ids);
+        RespDTOUtil.respNGDealCover(retData, "获取医生信息失败");
+        return retData.data;
     }
-    
+
 }

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

@@ -2,7 +2,6 @@ package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.AiptServiceClient;
-import com.diagbot.client.bean.Response;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.SymptomFeatureDTO;
 import com.diagbot.entity.QuestionInfo;
@@ -43,9 +42,7 @@ public class FeatureFacade {
     public List<SymptomFeatureDTO> getSymptomFeature(String text) {
         List<SymptomFeatureDTO> symptomFeatureDTOList = Lists.newLinkedList();
         RespDTO<List<Map<String, Object>>> res = aiptServiceClient.symptomFeaturePageData(text);
-        if (RespDTOUtil.respIsNG(res)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "AI没有返回结果");
-        }
+        RespDTOUtil.respNGDealCover(res, "AI没有返回结果");
         List<Map<String, Object>> symptomFeatureList = res.data;
         List<String> symptomNameList = Lists.newLinkedList();
         for (Map<String, Object> symptomFeature : symptomFeatureList) {

+ 1 - 5
icss-service/src/main/java/com/diagbot/facade/HospitalInfoFacade.java

@@ -5,7 +5,6 @@ import com.diagbot.dto.HospitalInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
-import com.diagbot.util.ListUtil;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.HospitalInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,10 +31,7 @@ public class HospitalInfoFacade {
      */
     public List<HospitalInfoDTO> getHospitalInfo(HospitalInfoVO hospitalInfoVO) {
         RespDTO<List<HospitalInfoDTO>> hospitalInfoDTOList = tranServiceClient.getHospitalInfo(hospitalInfoVO);
-        if (RespDTOUtil.respIsNG(hospitalInfoDTOList)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "获取医院信息失败");
-        }
+        RespDTOUtil.respNGDealCover(hospitalInfoDTOList, "获取医院信息失败");
         return hospitalInfoDTOList.data;
     }
 

+ 5 - 15
icss-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java

@@ -172,9 +172,7 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
                     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);
-                        }
+                        RespDTOUtil.respNGDealCover(respLisConfigMap, CommonErrorCode.RPC_ERROR.getMsg());
                         lisConfigMap = respLisConfigMap.data;
                     } else {
                         lisConfigMap = lisMappingFacade.getLisMapping_NotEmptyItemName();
@@ -185,9 +183,7 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
                     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);
-                        }
+                        RespDTOUtil.respNGDealCover(respLisConfigMap_emptyItemName, CommonErrorCode.RPC_ERROR.getMsg());
                         lisConfigMap_emptyItemName = respLisConfigMap_emptyItemName.data;
                     } else {
                         lisConfigMap_emptyItemName = lisMappingFacade.getLisConfig_EmptyItemName();
@@ -198,9 +194,7 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         } else if (type.equals(QuestionTypeEnum.Pacs.getKey())) {
             if (isDocking) {
                 RespDTO<Map<String, String>> respPacsConfigMap = tranServiceClient.getPacsConfigByHosCode(hosCodeVO);
-                if (RespDTOUtil.respIsNG(respPacsConfigMap)) {
-                    throw new CommonException(CommonErrorCode.RPC_ERROR);
-                }
+                RespDTOUtil.respNGDealCover(respPacsConfigMap, CommonErrorCode.RPC_ERROR.getMsg());
                 Map<String, String> pacsConfigMap = respPacsConfigMap.data;
                 uniqueName = pacsConfigMap.get(emrIntroduceVO.getName());
             } else {
@@ -209,9 +203,7 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         } 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);
-                }
+                RespDTOUtil.respNGDealCover(respDisMap, CommonErrorCode.RPC_ERROR.getMsg());
                 Map<String, String> disMap = respDisMap.data;
                 uniqueName = disMap.get(emrIntroduceVO.getName());
             } else {
@@ -231,9 +223,7 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         if (ArrayUtil.isNotEmpty(titles)) {
             if (isDocking) {
                 RespDTO<Map<String, String>> respTitleMappingMap = tranServiceClient.getTitleMappingHosCode(hosCodeVO);
-                if (RespDTOUtil.respIsNG(respTitleMappingMap)) {
-                    throw new CommonException(CommonErrorCode.RPC_ERROR);
-                }
+                RespDTOUtil.respNGDealCover(respTitleMappingMap, CommonErrorCode.RPC_ERROR.getMsg());
                 Map<String, String> titleMappingMap = respTitleMappingMap.data;
                 for (String title : titles) {
                     String uniqueTitle = titleMappingMap.get(title);

+ 4 - 4
icss-service/src/main/java/com/diagbot/facade/ModuleFacade.java

@@ -60,13 +60,13 @@ public class ModuleFacade extends ModuleInfoServiceImpl {
         } else if (moduleVO.getMouduleType().intValue() == 2) {
             //根据慢病筛选如果没有返回通用模板
             list = getModuleInfoByDisType(moduleVO.getMouduleType(), moduleVO.getRelationId());
-            if (ListUtil.isNotEmpty(list)) {
+            //if (ListUtil.isNotEmpty(list)) {
                 ids = list.stream()
                         .map(moduleDeptMapping -> moduleDeptMapping.getId())
                         .collect(Collectors.toList());
-            } else {
-                isDefault = true;
-            }
+            //} else {
+                //isDefault = true;
+            //}
         } else {
             isDefault = true;
         }

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

@@ -9,8 +9,6 @@ import com.diagbot.entity.DeptInfo;
 import com.diagbot.entity.DoctorPageMode;
 import com.diagbot.entity.PatientInfo;
 import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
@@ -44,10 +42,7 @@ public class PatientInfoFacade {
      */
     public PatientInfoDTO getPatientInfo(PatientInfoVO patientInfoVO) {
         RespDTO<PatientInfoDTO> patientInfoDTO = tranServiceClient.getPatientInfo(patientInfoVO);
-        if (RespDTOUtil.respIsNG(patientInfoDTO)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "获取患者信息失败");
-        }
+        RespDTOUtil.respNGDealCover(patientInfoDTO, "获取患者信息失败");
         return patientInfoDTO.data;
     }
 
@@ -59,10 +54,7 @@ public class PatientInfoFacade {
      */
     public GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
         RespDTO<GetTopPatientInfoDTO> respDTO = tranServiceClient.getTopPatientInfo(getTopPatientInfoVO);
-        if (RespDTOUtil.respIsNG(respDTO)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "页面顶部病人医生科室信息");
-        }
+        RespDTOUtil.respNGDealCover(respDTO, "页面顶部病人医生科室信息");
 
         GetTopPatientInfoDTO getTopPatientInfoDTO = respDTO.data;
 
@@ -94,10 +86,7 @@ public class PatientInfoFacade {
      */
     public Map<Long, PatientInfo> patientInfoMapByIds(List<Long> ids) {
         RespDTO<Map<Long, PatientInfo>> retData = tranServiceClient.patientInfoMapByIds(ids);
-        if (RespDTOUtil.respIsNG(retData)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "获取患者信息失败");
-        }
+        RespDTOUtil.respNGDealCover(retData, "获取患者信息失败");
         return retData.data;
     }
 

+ 2 - 9
icss-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -9,7 +9,6 @@ import com.diagbot.client.bean.FeatureRate;
 import com.diagbot.client.bean.GdbResponse;
 import com.diagbot.client.bean.MedicalIndication;
 import com.diagbot.client.bean.MedicalIndicationDetail;
-import com.diagbot.client.bean.Response;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.client.bean.SearchData;
 import com.diagbot.dto.EMRQuestionDTO;
@@ -158,11 +157,7 @@ public class PushFacade {
      */
     public ResponseData pushAipt(SearchData searchData) {
         RespDTO<ResponseData> res = aiptServiceClient.aiptData(searchData);
-        if (null == res) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "中间层没有返回结果");
-        } else if (null == res.data) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, res.msg);
-        }
+        RespDTOUtil.respNGDeal(res, "中间层没有返回结果");
         return res.data;
     }
 
@@ -174,9 +169,7 @@ public class PushFacade {
      */
     public Map<String, Object> scale(SearchData searchData) {
         RespDTO<Map<String, Object>> res = aiptServiceClient.scale(searchData);
-        if (RespDTOUtil.respIsNG(res)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "量表数据暂无内容");
-        }
+        RespDTOUtil.respNGDealCover(res, "量表数据暂无内容");
         return res.data;
     }
 

+ 7 - 10
icss-service/src/main/java/com/diagbot/facade/TranDiseaseIcdFacade.java

@@ -39,31 +39,28 @@ public class TranDiseaseIcdFacade {
      * @return
      */
     public List<GetDiseaseIcdDTO> getDiseaseIcds(GetDiseaseIcdVO getDiseaseIcdVO) {
-        RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcdsList =  tranServiceClient.getDiseaseIcds(getDiseaseIcdVO);
-        if (RespDTOUtil.respIsNG(getDiseaseIcdsList)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "获取icd编码失败");
-        }
+        RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcdsList = tranServiceClient.getDiseaseIcds(getDiseaseIcdVO);
+        RespDTOUtil.respNGDealCover(getDiseaseIcdsList, "获取icd编码失败");
 
         List<GetDiseaseIcdDTO> res = new ArrayList<>();
 
         List<String> questionNames
                 = getDiseaseIcdsList.data.stream().map(getDiseaseIcdDTO -> getDiseaseIcdDTO.getIcssQuestionName()).collect(Collectors.toList());
-        if (ListUtil.isEmpty(questionNames)){
+        if (ListUtil.isEmpty(questionNames)) {
             return res;
         }
 
         QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
         questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("type", QuestionTypeEnum.Disease.getKey())
-                .in("name",questionNames);
+                .in("name", questionNames);
 
         List<String> icssQuestionNames
                 = questionFacade.list(questionInfoQueryWrapper).stream()
                 .map(r -> r.getName()).collect(Collectors.toList());
-        if (ListUtil.isNotEmpty(icssQuestionNames)){
-            for (GetDiseaseIcdDTO getDiseaseIcdDTO: getDiseaseIcdsList.data) {
-                if (icssQuestionNames.contains(getDiseaseIcdDTO.getIcssQuestionName())){
+        if (ListUtil.isNotEmpty(icssQuestionNames)) {
+            for (GetDiseaseIcdDTO getDiseaseIcdDTO : getDiseaseIcdsList.data) {
+                if (icssQuestionNames.contains(getDiseaseIcdDTO.getIcssQuestionName())) {
                     res.add(getDiseaseIcdDTO);
                 }
             }

+ 1 - 6
icss-service/src/main/java/com/diagbot/facade/TranFieldInfoFacade.java

@@ -3,8 +3,6 @@ package com.diagbot.facade;
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.TranFieldInfoDTO;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.TranFieldInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,10 +29,7 @@ public class TranFieldInfoFacade {
      */
     public List<TranFieldInfoDTO> getInfoByUuid(TranFieldInfoVO info) {
         RespDTO<List<TranFieldInfoDTO>> tranFieldInfoDTOList = tranServiceClient.getInfoByUuid(info);
-        if (RespDTOUtil.respIsNG(tranFieldInfoDTOList)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR,
-                    "获取医生信息失败");
-        }
+        RespDTOUtil.respNGDealCover(tranFieldInfoDTOList, "获取医生信息失败");
         return tranFieldInfoDTOList.data;
     }
 }