Browse Source

Merge remote-tracking branch 'origin/debug' into debug

MarkHuang 6 years ago
parent
commit
ec21c61299
77 changed files with 2212 additions and 81 deletions
  1. 10 0
      common/src/main/java/com/diagbot/util/ArrayUtil.java
  2. 41 0
      common/src/main/java/com/diagbot/util/RespDTOUtil.java
  3. 0 0
      docs/006.20190304慢病基于icss增量脚本/init_icss_NCD.sql
  4. 3 0
      docs/07.20190318对接相关修改/icss_tran.sql
  5. 73 11
      icss-service/src/main/java/com/diagbot/client/TranServiceClient.java
  6. 93 23
      icss-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java
  7. 19 0
      icss-service/src/main/java/com/diagbot/dto/DisDTO.java
  8. 19 0
      icss-service/src/main/java/com/diagbot/dto/DisScaleDTO.java
  9. 20 0
      icss-service/src/main/java/com/diagbot/dto/DisTypeDTO.java
  10. 17 0
      icss-service/src/main/java/com/diagbot/dto/EMRIntroduceDTO.java
  11. 16 0
      icss-service/src/main/java/com/diagbot/dto/EMRIntroduceDetailDTO.java
  12. 4 0
      icss-service/src/main/java/com/diagbot/dto/GetDiseaseIcdDTO.java
  13. 20 0
      icss-service/src/main/java/com/diagbot/dto/PushEMRDTO.java
  14. 78 0
      icss-service/src/main/java/com/diagbot/entity/DisScale.java
  15. 73 0
      icss-service/src/main/java/com/diagbot/entity/DisType.java
  16. 15 1
      icss-service/src/main/java/com/diagbot/entity/DiseaseIcd.java
  17. 12 10
      icss-service/src/main/java/com/diagbot/entity/HospitalDept.java
  18. 15 2
      icss-service/src/main/java/com/diagbot/entity/InquiryDetail.java
  19. 51 0
      icss-service/src/main/java/com/diagbot/enums/DisTypeEnum.java
  20. 2 1
      icss-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java
  21. 25 0
      icss-service/src/main/java/com/diagbot/facade/DisScaleFacade.java
  22. 43 0
      icss-service/src/main/java/com/diagbot/facade/DisTypeFacade.java
  23. 12 0
      icss-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java
  24. 126 0
      icss-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java
  25. 2 1
      icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java
  26. 84 0
      icss-service/src/main/java/com/diagbot/facade/PushFacade.java
  27. 18 0
      icss-service/src/main/java/com/diagbot/facade/TranDiseaseIcdFacade.java
  28. 20 0
      icss-service/src/main/java/com/diagbot/mapper/DisScaleMapper.java
  29. 21 0
      icss-service/src/main/java/com/diagbot/mapper/DisTypeMapper.java
  30. 25 0
      icss-service/src/main/java/com/diagbot/service/DisScaleService.java
  31. 25 0
      icss-service/src/main/java/com/diagbot/service/DisTypeService.java
  32. 27 0
      icss-service/src/main/java/com/diagbot/service/impl/DisScaleServiceImpl.java
  33. 28 0
      icss-service/src/main/java/com/diagbot/service/impl/DisTypeServiceImpl.java
  34. 15 0
      icss-service/src/main/java/com/diagbot/vo/DisScaleVO.java
  35. 24 0
      icss-service/src/main/java/com/diagbot/vo/EMRIntroduceVO.java
  36. 18 0
      icss-service/src/main/java/com/diagbot/vo/EMRPushVO.java
  37. 15 0
      icss-service/src/main/java/com/diagbot/vo/HosCodeVO.java
  38. 6 0
      icss-service/src/main/java/com/diagbot/vo/SaveInquiryDetailVO.java
  39. 21 0
      icss-service/src/main/java/com/diagbot/vo/SaveInquiryToHisVO.java
  40. 41 0
      icss-service/src/main/java/com/diagbot/web/DisScaleController.java
  41. 38 0
      icss-service/src/main/java/com/diagbot/web/DisTypeController.java
  42. 74 0
      icss-service/src/main/java/com/diagbot/web/EMRController.java
  43. 25 0
      icss-service/src/main/resources/mapper/DisScaleMapper.xml
  44. 22 0
      icss-service/src/main/resources/mapper/DisTypeMapper.xml
  45. 1 0
      icss-service/src/main/resources/mapper/InquiryDetailMapper.xml
  46. 2 2
      icss-service/src/test/java/com/diagbot/CodeGeneration.java
  47. 1 1
      icssman-service/src/main/java/com/diagbot/facade/QuestionFacade.java
  48. 15 1
      tran-service/src/main/java/com/diagbot/entity/DiseaseIcd.java
  49. 11 9
      tran-service/src/main/java/com/diagbot/entity/HospitalDept.java
  50. 146 0
      tran-service/src/main/java/com/diagbot/entity/IntroduceTitleConfig.java
  51. 154 0
      tran-service/src/main/java/com/diagbot/entity/PacsConfig.java
  52. 50 0
      tran-service/src/main/java/com/diagbot/enums/TypeEnum.java
  53. 22 0
      tran-service/src/main/java/com/diagbot/facade/DiseaseIcdFacade.java
  54. 13 0
      tran-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java
  55. 33 0
      tran-service/src/main/java/com/diagbot/facade/IntroduceTitleConfigFacade.java
  56. 33 0
      tran-service/src/main/java/com/diagbot/facade/PacsConfigFacade.java
  57. 18 1
      tran-service/src/main/java/com/diagbot/facade/TranDiseaseIcdFacade.java
  58. 43 6
      tran-service/src/main/java/com/diagbot/facade/TranLisConfigFacade.java
  59. 16 0
      tran-service/src/main/java/com/diagbot/mapper/IntroduceTitleConfigMapper.java
  60. 16 0
      tran-service/src/main/java/com/diagbot/mapper/PacsConfigMapper.java
  61. 16 0
      tran-service/src/main/java/com/diagbot/service/IntroduceTitleConfigService.java
  62. 16 0
      tran-service/src/main/java/com/diagbot/service/PacsConfigService.java
  63. 20 0
      tran-service/src/main/java/com/diagbot/service/impl/IntroduceTitleConfigServiceImpl.java
  64. 20 0
      tran-service/src/main/java/com/diagbot/service/impl/PacsConfigServiceImpl.java
  65. 15 0
      tran-service/src/main/java/com/diagbot/vo/HosCodeVO.java
  66. 21 0
      tran-service/src/main/java/com/diagbot/vo/SaveInquiryToHisVO.java
  67. 45 0
      tran-service/src/main/java/com/diagbot/web/InquiryInfoController.java
  68. 36 0
      tran-service/src/main/java/com/diagbot/web/IntroduceTitleConfigController.java
  69. 37 0
      tran-service/src/main/java/com/diagbot/web/PacsConfigController.java
  70. 11 1
      tran-service/src/main/java/com/diagbot/web/TranDiseaseIcdController.java
  71. 20 3
      tran-service/src/main/java/com/diagbot/web/TranLisConfigController.java
  72. 2 1
      tran-service/src/main/resources/mapper/DiseaseIcdMapper.xml
  73. 1 1
      tran-service/src/main/resources/mapper/HospitalDeptMapper.xml
  74. 18 0
      tran-service/src/main/resources/mapper/IntroduceTitleConfigMapper.xml
  75. 18 0
      tran-service/src/main/resources/mapper/PacsConfigMapper.xml
  76. 1 1
      tran-service/src/main/resources/mapper/PatientInfoMapper.xml
  77. 5 5
      tran-service/src/test/java/com/diagbot/CodeGeneration.java

+ 10 - 0
common/src/main/java/com/diagbot/util/ArrayUtil.java

@@ -18,6 +18,16 @@ public class ArrayUtil {
         return ArrayUtils.isEmpty(array);
     }
 
+    /**
+     * 判断数组是否不为空
+     *
+     * @param array 数组
+     * @return 是否为空
+     */
+    public static boolean isNotEmpty(Object[] array) {
+        return !ArrayUtils.isEmpty(array);
+    }
+
     /**
      * 数组合并
      *

+ 41 - 0
common/src/main/java/com/diagbot/util/RespDTOUtil.java

@@ -0,0 +1,41 @@
+package com.diagbot.util;
+
+import com.diagbot.dto.RespDTO;
+import com.diagbot.exception.CommonErrorCode;
+
+/**
+ * @Description: 结果验证工具类
+ * @author: gaodm
+ * @time: 2019/3/12 18:25
+ */
+public class RespDTOUtil {
+
+    /**
+     * 远程调度是否成功
+     * @param respDTO 返回结果
+     * @param <T> 泛型
+     * @return 是否成功
+     */
+    public static <T> boolean respIsOK(RespDTO<T> respDTO){
+        if (respDTO == null
+                || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
+            return false;
+        }
+        return true;
+    }
+
+
+    /**
+     * 远程调度是否不成功
+     * @param respDTO 返回结果
+     * @param <T> 泛型
+     * @return 是否成功
+     */
+    public static <T> boolean respIsNG(RespDTO<T> respDTO){
+        if (respDTO == null
+                || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
+            return true;
+        }
+        return false;
+    }
+}

+ 0 - 0
docs/006.20190304慢病基于icss增量脚本/init_icss_NCD.sql


+ 3 - 0
docs/07.20190318对接相关修改/icss_tran.sql

@@ -0,0 +1,3 @@
+use `sys-icss`;
+ALTER TABLE `icss_inquiry_detail`
+ADD COLUMN `content_value`  text NULL COMMENT '内容字符串纯文本' AFTER `content`;

+ 73 - 11
icss-service/src/main/java/com/diagbot/client/TranServiceClient.java

@@ -1,12 +1,5 @@
 package com.diagbot.client;
 
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-
 import com.diagbot.client.hystrix.TranServiceHystrix;
 import com.diagbot.dto.DoctorInfoDTO;
 import com.diagbot.dto.GetDiseaseIcdDTO;
@@ -23,11 +16,19 @@ import com.diagbot.entity.PatientInfo;
 import com.diagbot.vo.DoctorInfoVO;
 import com.diagbot.vo.GetDiseaseIcdVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
+import com.diagbot.vo.HosCodeVO;
 import com.diagbot.vo.HospitalDeptInfoVO;
 import com.diagbot.vo.HospitalInfoVO;
 import com.diagbot.vo.LisHospitalCodeVO;
 import com.diagbot.vo.PatientInfoVO;
+import com.diagbot.vo.SaveInquiryToHisVO;
 import com.diagbot.vo.TranFieldInfoVO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Description: 调用信息对接层服务
@@ -45,9 +46,10 @@ public interface TranServiceClient {
      */
     @PostMapping("/doctorInfo/getDoctorInfo")
     RespDTO<List<DoctorInfoDTO>> getDoctorInfo(@RequestBody DoctorInfoVO doctorInfoVo);
-    
+
     /**
      * 根据ids获取医生信息map
+     *
      * @param ids
      * @return
      */
@@ -62,9 +64,10 @@ public interface TranServiceClient {
      */
     @PostMapping("/hospitalDeptInfo/getHospitalDeptInfo")
     RespDTO<HospitalDeptInfoDTO> getHospitalDeptInfo(@RequestBody HospitalDeptInfoVO hospitalDeptInfoVO);
-    
+
     /**
      * 根据ids获取科室信息map
+     *
      * @param ids
      * @return
      */
@@ -79,8 +82,10 @@ public interface TranServiceClient {
      */
     @PostMapping("/hospitalInfo/getHospitalInfo")
     RespDTO<List<HospitalInfoDTO>> getHospitalInfo(@RequestBody HospitalInfoVO hospitalInfoVO);
+
     /**
      * 匹配公表名
+     *
      * @param lisHospitalCodeVO
      * @return
      */
@@ -104,9 +109,10 @@ public interface TranServiceClient {
      */
     @PostMapping("/patientInfo/getTopPatientInfo")
     RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO);
-    
+
     /**
      * 根据ids获取病人信息
+     *
      * @param ids
      * @return
      */
@@ -130,4 +136,60 @@ public interface TranServiceClient {
      */
     @PostMapping("/diseaseIcd/getDiseaseIcds")
     RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcds(@RequestBody GetDiseaseIcdVO getDiseaseIcdVO);
-}
+
+    /**
+     * 将问诊保存的一些相关信息发送到对接层
+     *
+     * @param saveInquiryToHisVO
+     * @return
+     */
+    @PostMapping("/inquiryInfo/saveInquiryToHis")
+    RespDTO<Boolean> saveInquiryToHis(@RequestBody SaveInquiryToHisVO saveInquiryToHisVO);
+
+
+
+    /**
+     * 根据医院编码获取化验公表映射关系-itemName不为空
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    @PostMapping("/tranLisConfig/getLisConfigByHosCode_NotEmptyItemName")
+    RespDTO<Map<String, Map<String, String>>> getLisConfigByHosCode_NotEmptyItemName(@RequestBody HosCodeVO hosCodeVO);
+
+    /**
+     * 根据医院编码获取化验公表映射关系-itemName为空
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    @PostMapping("/tranLisConfig/getLisConfigByHosCode_EmptyItemName")
+    RespDTO<Map<String, String>> getLisConfigByHosCode_EmptyItemName(@RequestBody HosCodeVO hosCodeVO);
+
+    /**
+     * 根据医院编码获取辅检公表映射关系
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    @PostMapping("/pacsConfig/getPacsConfigByHosCode")
+    RespDTO<Map<String, String>> getPacsConfigByHosCode(@RequestBody HosCodeVO hosCodeVO);
+
+    /**
+     * 根据医院编码获取提示信息标题映射关系
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    @PostMapping("/introduceTitleConfig/getTitleMappingHosCode")
+    RespDTO<Map<String, String>> getTitleMappingHosCode(@RequestBody HosCodeVO hosCodeVO);
+
+    /**
+     * 根据医院编码查询诊断icd映射
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    @PostMapping("/diseaseIcd/getDiseaseIcdByHosCode")
+    RespDTO<Map<String, String>> getDiseaseIcdByHosCode(@RequestBody HosCodeVO hosCodeVO);
+}

+ 93 - 23
icss-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java

@@ -16,14 +16,16 @@ import com.diagbot.entity.PatientInfo;
 import com.diagbot.vo.DoctorInfoVO;
 import com.diagbot.vo.GetDiseaseIcdVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
+import com.diagbot.vo.HosCodeVO;
 import com.diagbot.vo.HospitalDeptInfoVO;
 import com.diagbot.vo.HospitalInfoVO;
 import com.diagbot.vo.LisHospitalCodeVO;
-
 import com.diagbot.vo.PatientInfoVO;
+import com.diagbot.vo.SaveInquiryToHisVO;
 import com.diagbot.vo.TranFieldInfoVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.validation.Valid;
 import java.util.List;
@@ -44,12 +46,12 @@ public class TranServiceHystrix implements TranServiceClient {
     }
 
     @Override
-	public RespDTO<Map<Long, DoctorInfo>> doctorInfoMapByIds(List<Long> ids) {
-    	log.error("【hystrix】调用{}异常", "doctorInfoMapByIds");
-		return null;
-	}
+    public RespDTO<Map<Long, DoctorInfo>> doctorInfoMapByIds(List<Long> ids) {
+        log.error("【hystrix】调用{}异常", "doctorInfoMapByIds");
+        return null;
+    }
 
-	@Override
+    @Override
     public RespDTO<List<HospitalInfoDTO>> getHospitalInfo(HospitalInfoVO hospitalInfoVO) {
         log.error("【hystrix】调用{}异常", "getHospitalInfo");
         return null;
@@ -60,14 +62,14 @@ public class TranServiceHystrix implements TranServiceClient {
         log.error("【hystrix】调用{}异常", "getHospitalDeptInfo");
         return null;
     }
-    
+
     @Override
-	public RespDTO<Map<Long, HospitalDept>> hospitalDeptInfoMapByIds(List<Long> ids) {
-    	 log.error("【hystrix】调用{}异常", "hospitalDeptInfoMapByIds");
-		return null;
-	}
+    public RespDTO<Map<Long, HospitalDept>> hospitalDeptInfoMapByIds(List<Long> ids) {
+        log.error("【hystrix】调用{}异常", "hospitalDeptInfoMapByIds");
+        return null;
+    }
 
-	@Override
+    @Override
     public RespDTO<List<LisConfigDTO>> getLisConfigByhospitalId(LisHospitalCodeVO lisHospitalCodeVO) {
         log.error("【hystrix】调用{}异常", "getLisConfigByhospitalId");
         return null;
@@ -84,14 +86,14 @@ public class TranServiceHystrix implements TranServiceClient {
         log.error("【hystrix】调用{}异常", "getTopPatientInfo");
         return null;
     }
-    
+
     @Override
-	public RespDTO<Map<Long, PatientInfo>> patientInfoMapByIds(List<Long> ids) {
-    	log.error("【hystrix】调用{}异常", "patientInfoMapByIds");
-		return null;
-	}
+    public RespDTO<Map<Long, PatientInfo>> patientInfoMapByIds(List<Long> ids) {
+        log.error("【hystrix】调用{}异常", "patientInfoMapByIds");
+        return null;
+    }
 
-	@Override
+    @Override
     public RespDTO<List<TranFieldInfoDTO>> getInfoByUuid(TranFieldInfoVO tranFieldInfoVO) {
         log.error("【hystrix】调用{}异常", "getInfoByUuid");
         return null;
@@ -103,10 +105,78 @@ public class TranServiceHystrix implements TranServiceClient {
         return null;
     }
 
+	@Override
+	public RespDTO<Boolean> saveInquiryToHis(SaveInquiryToHisVO saveInquiryToHisVO) {
+		 log.error("【hystrix】调用{}异常", "saveInquiryToHis");
+		return null;
+	}
+    
+    
+
+
+    //    @Override
+    //    public Response<ResponseData> bayesPageData(SearchData searchData) {
+    //        log.error("【hystrix】调用{}异常", "bayesPageData");
+    //        return null;
+    //    }
+
+    /**
+     * 根据医院编码获取化验公表映射关系-itemName不为空
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, Map<String, String>>> getLisConfigByHosCode_NotEmptyItemName(@RequestBody HosCodeVO hosCodeVO) {
+        log.error("【hystrix】调用{}异常", "getLisConfigByHosCode_NotEmptyItemName");
+        return null;
+    }
+
+    /**
+     * 根据医院编码获取化验公表映射关系-itemName为空
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, String>> getLisConfigByHosCode_EmptyItemName(@RequestBody HosCodeVO hosCodeVO) {
+        log.error("【hystrix】调用{}异常", "getLisConfigByHosCode_EmptyItemName");
+        return null;
+    }
+
+    /**
+     * 根据医院编码获取辅检公表映射关系
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, String>> getPacsConfigByHosCode(@RequestBody HosCodeVO hosCodeVO) {
+        log.error("【hystrix】调用{}异常", "getPacsConfigByHosCode");
+        return null;
+    }
+
+    /**
+     * 根据医院编码获取提示信息标题映射关系
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, String>> getTitleMappingHosCode(@RequestBody HosCodeVO hosCodeVO) {
+        log.error("【hystrix】调用{}异常", "getTitleMappingHosCode");
+        return null;
+    }
 
-//    @Override
-//    public Response<ResponseData> bayesPageData(SearchData searchData) {
-//        log.error("【hystrix】调用{}异常", "bayesPageData");
-//        return null;
-//    }
+    /**
+     * 根据医院编码查询诊断icd映射
+     *
+     * @param hosCodeVO
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, String>> getDiseaseIcdByHosCode(@RequestBody HosCodeVO hosCodeVO) {
+        log.error("【hystrix】调用{}异常", "getDiseaseIcdByHosCode");
+        return null;
+    }
 }

+ 19 - 0
icss-service/src/main/java/com/diagbot/dto/DisDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 返回诊断基本信息
+ * @Author: ztg
+ * @Date: 2018/10/24 16:11
+ */
+@Getter
+@Setter
+public class DisDTO {
+
+    private Long id;// id
+    private String name;//内容
+    private Integer type;//类型(0:慢病,1:急诊)
+    private Integer tagType; //标签标识
+}

+ 19 - 0
icss-service/src/main/java/com/diagbot/dto/DisScaleDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 返回诊断量表信息
+ * @Author: ztg
+ * @Date: 2018/10/24 16:11
+ */
+@Getter
+@Setter
+public class DisScaleDTO {
+
+    private Long id;// id
+    private String name;//内容
+    private Integer tagType; //标签标识
+    private Integer orderNo; //排序
+}

+ 20 - 0
icss-service/src/main/java/com/diagbot/dto/DisTypeDTO.java

@@ -0,0 +1,20 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: 返回诊断类型
+ * @Author: ztg
+ * @Date: 2018/10/24 16:11
+ */
+@Getter
+@Setter
+public class DisTypeDTO {
+
+    private List<DisDTO> chronic = new ArrayList<>();
+    private List<DisDTO> emergency = new ArrayList<>();
+}

+ 17 - 0
icss-service/src/main/java/com/diagbot/dto/EMRIntroduceDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/11 14:00
+ */
+@Getter
+@Setter
+public class EMRIntroduceDTO {
+    private List<EMRIntroduceDetailDTO> details;
+}

+ 16 - 0
icss-service/src/main/java/com/diagbot/dto/EMRIntroduceDetailDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/12 11:16
+ */
+@Getter
+@Setter
+public class EMRIntroduceDetailDTO {
+    private String title;
+    private String text;
+}

+ 4 - 0
icss-service/src/main/java/com/diagbot/dto/GetDiseaseIcdDTO.java

@@ -12,4 +12,8 @@ import lombok.Setter;
 @Getter
 @Setter
 public class GetDiseaseIcdDTO extends DiseaseIcd {
+    /**
+     * 疾病id
+     */
+    private Long questionId;
 }

+ 20 - 0
icss-service/src/main/java/com/diagbot/dto/PushEMRDTO.java

@@ -0,0 +1,20 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:推理返回数据
+ * @Author:zhaops
+ * @time: 2019/3/11 16:36
+ */
+@Getter
+@Setter
+public class PushEMRDTO {
+    private List<String> lisList;
+    private List<String> pacsList;
+    private Map<String, List<String>> dis;
+}

+ 78 - 0
icss-service/src/main/java/com/diagbot/entity/DisScale.java

@@ -0,0 +1,78 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 诊断量表映射表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-03-11
+ */
+@TableName("icss_dis_scale")
+@Getter
+@Setter
+public class DisScale implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 诊断标签id
+     */
+    private Long disId;
+
+    /**
+     * 量表标签id
+     */
+    private Long scaleId;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 73 - 0
icss-service/src/main/java/com/diagbot/entity/DisType.java

@@ -0,0 +1,73 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 诊断类型表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-03-08
+ */
+@TableName("icss_dis_type")
+@Getter
+@Setter
+public class DisType implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 诊断标签id
+     */
+    private Long disId;
+
+    /**
+     * 0:慢病,1:急诊
+     */
+    private Integer type;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 15 - 1
icss-service/src/main/java/com/diagbot/entity/DiseaseIcd.java

@@ -73,6 +73,19 @@ public class DiseaseIcd implements Serializable {
      */
     private String remark;
 
+    /**
+     * 疾病名称(内)
+     */
+    private String icssQuestionName;
+
+    public String getIcssQuestionName() {
+        return icssQuestionName;
+    }
+
+    public void setIcssQuestionName(String icssQuestionName) {
+        this.icssQuestionName = icssQuestionName;
+    }
+
     public Long getId() {
         return id;
     }
@@ -165,6 +178,7 @@ public class DiseaseIcd implements Serializable {
         ", icd=" + icd +
         ", status=" + status +
         ", remark=" + remark +
-        "}";
+        ",icssQuestionName" + icssQuestionName +
+                "}";
     }
 }

+ 12 - 10
icss-service/src/main/java/com/diagbot/entity/HospitalDept.java

@@ -1,12 +1,12 @@
 package com.diagbot.entity;
 
-import java.io.Serializable;
-import java.util.Date;
-
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 
+import java.io.Serializable;
+import java.util.Date;
+
 /**
  * <p>
  * 医院科室信息表
@@ -72,9 +72,9 @@ public class HospitalDept implements Serializable {
     private String hospitalName;
 
     /**
-     * icss科室id
+     * icss科室名称
      */
-    private Long deptId;
+    private String icssDeptName;
 
     /**
      * 状态:0.禁用1.启用
@@ -156,13 +156,15 @@ public class HospitalDept implements Serializable {
     public void setHospitalName(String hospitalName) {
         this.hospitalName = hospitalName;
     }
-    public Long getDeptId() {
-        return deptId;
+
+    public String getIcssDeptName() {
+        return icssDeptName;
     }
 
-    public void setDeptId(Long deptId) {
-        this.deptId = deptId;
+    public void setIcssDeptName(String icssDeptName) {
+        this.icssDeptName = icssDeptName;
     }
+
     public Integer getStatus() {
         return status;
     }
@@ -191,7 +193,7 @@ public class HospitalDept implements Serializable {
         ", name=" + name +
         ", hospitalCode=" + hospitalCode +
         ", hospitalName=" + hospitalName +
-        ", deptId=" + deptId +
+        ", deptId=" + icssDeptName +
         ", status=" + status +
         ", remark=" + remark +
         "}";

+ 15 - 2
icss-service/src/main/java/com/diagbot/entity/InquiryDetail.java

@@ -12,8 +12,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
  * 问诊记录明细表
  * </p>
  *
- * @author rengb
- * @since 2018-11-23
+ * @author zhoutg
+ * @since 2019-03-18
  */
 @TableName("icss_inquiry_detail")
 public class InquiryDetail implements Serializable {
@@ -66,6 +66,11 @@ public class InquiryDetail implements Serializable {
      */
     private String content;
 
+    /**
+     * 内容字符串纯文本
+     */
+    private String contentValue;
+
     /**
      * 备注
      */
@@ -134,6 +139,13 @@ public class InquiryDetail implements Serializable {
     public void setContent(String content) {
         this.content = content;
     }
+    public String getContentValue() {
+        return contentValue;
+    }
+
+    public void setContentValue(String contentValue) {
+        this.contentValue = contentValue;
+    }
     public String getRemark() {
         return remark;
     }
@@ -154,6 +166,7 @@ public class InquiryDetail implements Serializable {
         ", inquiryId=" + inquiryId +
         ", type=" + type +
         ", content=" + content +
+        ", contentValue=" + contentValue +
         ", remark=" + remark +
         "}";
     }

+ 51 - 0
icss-service/src/main/java/com/diagbot/enums/DisTypeEnum.java

@@ -0,0 +1,51 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * 
+ * @author zhoutg
+ * @Description: 诊断类型
+ * @date 2018年11月21日 下午2:31:42
+ */
+public enum DisTypeEnum implements KeyedNamed {
+    CHRONIC(0, "慢病"),
+    EMERGENCY(1, "急诊");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    DisTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static DisTypeEnum getEnum(Integer key) {
+        for (DisTypeEnum item : DisTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        DisTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 2 - 1
icss-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java

@@ -43,10 +43,11 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
         }
         QueryWrapper<DeptInfo> deptInfoDTOQueryWrapper = new QueryWrapper<>();
         deptInfoDTOQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id",hospitalDeptInfoDTORespDTO.data.getDeptId());
+                .eq("name",hospitalDeptInfoDTORespDTO.data.getIcssDeptName());
         DeptInfo deptInfo = this.getOne(deptInfoDTOQueryWrapper);
         DeptInfoDTO deptInfoDTO = new DeptInfoDTO();
         BeanUtil.copyProperties(deptInfo,deptInfoDTO);
+        deptInfoDTO.setId(deptInfo.getId());
         return deptInfoDTO;
     }
 }

+ 25 - 0
icss-service/src/main/java/com/diagbot/facade/DisScaleFacade.java

@@ -0,0 +1,25 @@
+package com.diagbot.facade;
+
+import com.diagbot.dto.DisScaleDTO;
+import com.diagbot.service.impl.DisScaleServiceImpl;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description: 诊断量表
+ * @author: zhoutg
+ * @time: 2018/11/19 13:19
+ */
+@Component
+public class DisScaleFacade extends DisScaleServiceImpl {
+
+    /**
+     * 返回诊断量表列表
+     *
+     * @return
+     */
+    public List<DisScaleDTO> getDisScaleFac(Long disId) {
+        return getDisScale(disId);
+    }
+}

+ 43 - 0
icss-service/src/main/java/com/diagbot/facade/DisTypeFacade.java

@@ -0,0 +1,43 @@
+package com.diagbot.facade;
+
+import com.diagbot.dto.DisDTO;
+import com.diagbot.dto.DisTypeDTO;
+import com.diagbot.enums.DisTypeEnum;
+import com.diagbot.service.impl.DisTypeServiceImpl;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 诊断类型
+ * @author: zhoutg
+ * @time: 2018/11/19 13:19
+ */
+@Component
+public class DisTypeFacade extends DisTypeServiceImpl {
+
+    /**
+     * 返回诊断类型
+     *
+     * @return
+     */
+    public DisTypeDTO getDisTypeFac() {
+        DisTypeDTO res = new DisTypeDTO();
+        List<DisDTO> data = this.getDisType();
+        Map<String, List<DisDTO>> map = EntityUtil.makeEntityListMap(data, "type");
+        if (map != null) {
+            List<DisDTO> chr = map.get(DisTypeEnum.CHRONIC.getKey()); //放入慢病列表
+            if (ListUtil.isNotEmpty(chr)) {
+                res.setChronic(chr);
+            }
+            List<DisDTO> eme = map.get(DisTypeEnum.EMERGENCY.getKey()); //放入急诊列表
+            if (ListUtil.isNotEmpty(eme)) {
+                res.setEmergency(eme);
+            }
+        }
+        return res;
+    }
+}

+ 12 - 0
icss-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -13,6 +13,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.GetInquiryDetailDTO;
 import com.diagbot.dto.GetLastOtherDTO;
 import com.diagbot.dto.HisInquiryDTO;
@@ -36,6 +37,7 @@ import com.diagbot.vo.HisInquirysVO;
 import com.diagbot.vo.PatientInfoVO;
 import com.diagbot.vo.ReadInquiryVO;
 import com.diagbot.vo.SaveInquiryDetailVO;
+import com.diagbot.vo.SaveInquiryToHisVO;
 import com.diagbot.vo.SaveInquiryVO;
 
 /**
@@ -56,6 +58,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
     private DoctorInfoFacade doctorInfoFacade;
     @Autowired
     private HospitalDeptFacade hospitalDeptFacade;
+    @Autowired
+    private TranServiceClient tranServiceClient;
 
     /**
      * 问诊记录保存
@@ -104,19 +108,27 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         }
 
         List<InquiryDetail> inquiryDetailList = new ArrayList<>();
+        List<String> contentList = new ArrayList<>();
         for (SaveInquiryDetailVO i : saveInquiryVO.getDetailList()) {
             InquiryDetail inquiryDetail = new InquiryDetail();
             inquiryDetail.setInquiryId(inquiryId);
             inquiryDetail.setType(i.getType());
             inquiryDetail.setContent(i.getContent());
+            inquiryDetail.setContentValue(i.getContentValue());
             inquiryDetail.setGmtCreate(now);
             inquiryDetailList.add(inquiryDetail);
+            contentList.add(i.getContentValue());
         }
         if (inquiryDetailList.size() > 0) {
             inquiryDetailFacade.saveInquiryDetails(inquiryDetailList);
         }
 
         saveInquiryDTO.setInquiryId(inquiryId);
+        
+        SaveInquiryToHisVO saveInquiryToHisVO = new SaveInquiryToHisVO();
+        saveInquiryToHisVO.setContentList(contentList);
+        tranServiceClient.saveInquiryToHis(saveInquiryToHisVO);
+        
         return saveInquiryDTO;
     }
 

+ 126 - 0
icss-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java

@@ -1,7 +1,10 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.EMRIntroduceDetailDTO;
 import com.diagbot.dto.IntroduceDTO;
+import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.IntroduceDetail;
 import com.diagbot.entity.IntroduceInfo;
 import com.diagbot.entity.IntroduceMap;
@@ -11,13 +14,21 @@ import com.diagbot.enums.QuestionTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.IntroduceInfoServiceImpl;
+import com.diagbot.util.ArrayUtil;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
 import com.diagbot.util.StringUtil;
+import com.diagbot.vo.EMRIntroduceVO;
+import com.diagbot.vo.HosCodeVO;
 import com.diagbot.vo.IntroduceByQuestionVO;
+import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Description:
@@ -32,6 +43,8 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
     IntroduceDetailFacade introduceDetailFacade;
     @Autowired
     QuestionFacade questionFacade;
+    @Autowired
+    TranServiceClient tranServiceClient;
 
     /**
      * 根据标签id获取提示信息
@@ -135,4 +148,117 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
     public IntroduceDTO getRecordById(Long id) {
         return getRecordByIdAndPosition(id, null);
     }
+
+    /**
+     * 获取电子病历评级提示信息
+     *
+     * @param emrIntroduceVO
+     * @return
+     */
+    public List<EMRIntroduceDetailDTO> getIntroduceByEMR(EMRIntroduceVO emrIntroduceVO) {
+        //入参处理
+        HosCodeVO hosCodeVO = new HosCodeVO();
+        hosCodeVO.setHosCode(emrIntroduceVO.getHosCode());
+        //公表转换
+        String uniqueName = "";
+        Integer type = emrIntroduceVO.getType();
+        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 = 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 = 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);
+            }
+            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);
+                }
+            }
+        }
+
+        QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
+        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("tag_name", uniqueName)
+                .eq("type", type);
+        QuestionInfo questionInfo = questionFacade.getOne(questionInfoQueryWrapper);
+        if (questionInfo == null) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "公表标签不存在");
+        }
+
+
+        QueryWrapper<IntroduceMap> introduceMapQueryWrapper = new QueryWrapper<>();
+        introduceMapQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
+                eq("type", type).
+                eq("question_id", questionInfo.getId());
+        IntroduceMap introduceMap = introduceMapFacade.getOne(introduceMapQueryWrapper);
+        if (introduceMap == null) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息未维护");
+        }
+
+        QueryWrapper<IntroduceDetail> introduceDetailQueryWrapper = new QueryWrapper<>();
+        introduceDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
+                eq("introduce_id", introduceMap.getIntroduceId()).
+                orderByAsc("order_no");
+        //如果标题列表未传,全部返回
+        if (ArrayUtil.isNotEmpty(emrIntroduceVO.getTitles())) {
+            if (ListUtil.isNotEmpty(uniqueTitleList)) {
+                introduceDetailQueryWrapper.in("title", uniqueTitleList);
+            } else {
+                //标题未匹配上,不返回数据,加一个不成立的条件
+                introduceDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.Y.getKey());
+            }
+        }
+        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());
+                        }
+                    }
+                }
+                retList.add(detailDTO);
+            }
+        } else {
+            retList = BeanUtil.listCopyTo(introduceDetailList, EMRIntroduceDetailDTO.class);
+        }
+        return retList;
+    }
 }

+ 2 - 1
icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -69,10 +69,11 @@ public class PatientInfoFacade {
 
         QueryWrapper<DeptInfo> deptInfoQ = new QueryWrapper<>();
         deptInfoQ.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("id", getTopPatientInfoDTO.getSelfDeptId());
+                .eq("name", getTopPatientInfoDTO.getSelfDeptName());
         DeptInfo deptInfo = deptInfoFacade.getOne(deptInfoQ);
         if (null != deptInfo) {
             getTopPatientInfoDTO.setSelfDeptName(deptInfo.getName());
+            getTopPatientInfoDTO.setSelfDeptId(deptInfo.getId());
         }
 
         QueryWrapper<DoctorPageMode> doctorPageModeQe = new QueryWrapper<>();

+ 84 - 0
icss-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -4,14 +4,17 @@ 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.TranServiceClient;
 import com.diagbot.client.bean.FeatureRate;
 import com.diagbot.client.bean.GdbResponse;
 import com.diagbot.client.bean.Response;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.client.bean.SearchData;
 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;
@@ -24,7 +27,10 @@ import com.diagbot.exception.CommonException;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.FastJsonUtils;
+import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
+import com.diagbot.vo.EMRPushVO;
+import com.diagbot.vo.HosCodeVO;
 import com.diagbot.vo.LisKYJVO;
 import com.diagbot.vo.LisResult;
 import com.diagbot.vo.LisResultVO;
@@ -65,6 +71,8 @@ public class PushFacade {
     private HighRiskServiceClient highRiskServiceClient;
     @Autowired
     private LisMappingFacade lisMappingFacade;
+    @Autowired
+    private TranServiceClient tranServiceClient;
 
     /**
      * 推理接口
@@ -467,4 +475,80 @@ public class PushFacade {
         }*/
         return vitalDTO;
     }
+
+    /**
+     * 电子病历评级推理
+     *
+     * @param emrPushVO
+     * @return
+     */
+    public PushEMRDTO pushEMR(EMRPushVO emrPushVO) {
+        PushEMRDTO pushEMRDTO = new PushEMRDTO();
+        HosCodeVO hosCodeVO = new HosCodeVO();
+        hosCodeVO.setHosCode(emrPushVO.getHosCode());
+        PushVO pushVO = new PushVO();
+        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;
+            List<LisResultVO> lisResultVOList = pushVO.getLis();
+            for (LisResultVO lisResultVO : lisResultVOList) {
+                if (StringUtil.isNotBlank(lisResultVO.getName())) {
+                    if (StringUtil.isNotBlank(lisResultVO.getDetailName())) {
+                        lisResultVO.setUniqueName(lisConfigMap.get(lisResultVO.getName()).get(lisResultVO.getDetailName()));
+                    } else {
+                        lisResultVO.setUniqueName(lisConfigMap_emptyItemName.get(lisResultVO.getName()));
+                    }
+                }
+            }
+            pushVO.setLis(lisResultVOList);
+        }
+        ResponseData data = pushAI(pushVO);
+        String featureType = pushVO.getFeatureType();
+        String[] featureTypes = featureType.split(",|,");
+        Set<String> featureTypeSet = new HashSet(Arrays.asList(featureTypes));
+
+        if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Lis.getKey()))) {
+            List<FeatureRate> labs = data.getLabs();
+            if (labs.size() > 0) {
+                List<String> lisList = labs.stream().map(lab -> lab.getFeatureName()).collect(Collectors.toList());
+                pushEMRDTO.setLisList(lisList);
+            }
+        }
+        if (featureTypeSet.contains(String.valueOf(QuestionTypeEnum.Pacs.getKey()))) {
+            List<FeatureRate> pacsFeatures = data.getPacs();
+            if (pacsFeatures.size() > 0) {
+                List<String> pacsList = pacsFeatures.stream().map(pacs -> pacs.getFeatureName()).collect(Collectors.toList());
+                pushEMRDTO.setPacsList(pacsList);
+            }
+        }
+        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;
+
+            //诊断分类
+            for (FeatureRate featureRate : dis) {
+                if (StringUtil.isBlank(featureRate.getDesc())) {
+                    featureRate.setDesc("{\"可能诊断\":\"\"}");
+                }
+                Map<String, Object> descMap = FastJsonUtils.getJsonToMap(featureRate.getDesc());
+                for (String disClass : descMap.keySet()) {
+                    List<String> retDisList = Lists.newLinkedList();
+                    if (retDisMap.get(disClass) != null) {
+                        retDisList = retDisMap.get(disClass);
+                    }
+                    //转icd10名称
+                    retDisList.add(disMap.get(featureRate.getFeatureName()));
+                    retDisMap.put(disClass, retDisList);
+                }
+            }
+            pushEMRDTO.setDis(retDisMap);
+        }
+        return pushEMRDTO;
+    }
 }

+ 18 - 0
icss-service/src/main/java/com/diagbot/facade/TranDiseaseIcdFacade.java

@@ -1,8 +1,11 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.GetDiseaseIcdDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.QuestionInfo;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.vo.GetDiseaseIcdVO;
@@ -10,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @Description:
@@ -21,6 +25,8 @@ public class TranDiseaseIcdFacade {
 
     @Autowired
     TranServiceClient tranServiceClient;
+    @Autowired
+    QuestionFacade questionFacade;
 
     /**
      * 根据医院编号和诊断ids获取各自的icd编码
@@ -35,6 +41,18 @@ public class TranDiseaseIcdFacade {
             throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取icd编码失败");
         }
+        List<String> questionNames = getDiseaseIcdsList.data.stream().map(getDiseaseIcdDTO -> getDiseaseIcdDTO.getIcssQuestionName()).collect(Collectors.toList());
+        QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
+        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+            .in("name",questionNames);
+        List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
+        for (GetDiseaseIcdDTO getDiseaseIcdDTO: getDiseaseIcdsList.data) {
+            for (QuestionInfo questionInfo: questionInfoList) {
+                if(getDiseaseIcdDTO.getIcssQuestionName().equals(questionInfo.getName())){
+                    getDiseaseIcdDTO.setQuestionId(questionInfo.getId());
+                }
+            }
+        }
         return getDiseaseIcdsList.data;
     }
 }

+ 20 - 0
icss-service/src/main/java/com/diagbot/mapper/DisScaleMapper.java

@@ -0,0 +1,20 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.DisScaleDTO;
+import com.diagbot.entity.DisScale;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 诊断量表映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-03-11
+ */
+public interface DisScaleMapper extends BaseMapper<DisScale> {
+
+    public List<DisScaleDTO> getDisScaleFac(Long disId);
+}

+ 21 - 0
icss-service/src/main/java/com/diagbot/mapper/DisTypeMapper.java

@@ -0,0 +1,21 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.DisDTO;
+import com.diagbot.entity.DisType;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 诊断类型表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-03-08
+ */
+public interface DisTypeMapper extends BaseMapper<DisType> {
+
+
+    public List<DisDTO> getDisType();
+}

+ 25 - 0
icss-service/src/main/java/com/diagbot/service/DisScaleService.java

@@ -0,0 +1,25 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.DisScaleDTO;
+import com.diagbot.entity.DisScale;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 诊断量表映射表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-03-11
+ */
+public interface DisScaleService extends IService<DisScale> {
+
+    /**
+     * 返回诊断量表列表
+     *
+     * @return
+     */
+    public List<DisScaleDTO> getDisScale(Long disId);
+}

+ 25 - 0
icss-service/src/main/java/com/diagbot/service/DisTypeService.java

@@ -0,0 +1,25 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.DisDTO;
+import com.diagbot.entity.DisType;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 诊断类型表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-03-08
+ */
+public interface DisTypeService extends IService<DisType> {
+
+
+    /**
+     *
+     * @return 返回诊断类型
+     */
+    public List<DisDTO> getDisType();
+}

+ 27 - 0
icss-service/src/main/java/com/diagbot/service/impl/DisScaleServiceImpl.java

@@ -0,0 +1,27 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.dto.DisScaleDTO;
+import com.diagbot.entity.DisScale;
+import com.diagbot.mapper.DisScaleMapper;
+import com.diagbot.service.DisScaleService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 诊断量表映射表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-03-11
+ */
+@Service
+public class DisScaleServiceImpl extends ServiceImpl<DisScaleMapper, DisScale> implements DisScaleService {
+
+    @Override
+    public List<DisScaleDTO> getDisScale(Long disId) {
+        return baseMapper.getDisScaleFac(disId);
+    }
+}

+ 28 - 0
icss-service/src/main/java/com/diagbot/service/impl/DisTypeServiceImpl.java

@@ -0,0 +1,28 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.DisDTO;
+import com.diagbot.entity.DisType;
+import com.diagbot.mapper.DisTypeMapper;
+import com.diagbot.service.DisTypeService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 标签基础表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-11-15
+ */
+@Service
+public class DisTypeServiceImpl extends ServiceImpl<DisTypeMapper, DisType> implements DisTypeService {
+
+
+    @Override
+    public List<DisDTO> getDisType() {
+        return baseMapper.getDisType();
+    }
+}

+ 15 - 0
icss-service/src/main/java/com/diagbot/vo/DisScaleVO.java

@@ -0,0 +1,15 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 诊断量表入参
+ * @author: zhoutg
+ * @time: 2018/8/6 10:16
+ */
+@Getter
+@Setter
+public class DisScaleVO {
+    private Long disId;
+}

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

@@ -0,0 +1,24 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/11 13:50
+ */
+@Getter
+@Setter
+public class EMRIntroduceVO {
+    @NotBlank(message = "请输入医院编码")
+    private String hosCode;
+    @NotBlank(message = "请输入检查或检验类型")
+    private Integer type;
+    @NotBlank(message = "请输入检查或检验套餐名称")
+    private String name;
+    private String detailName;
+    private String[] titles;
+}

+ 18 - 0
icss-service/src/main/java/com/diagbot/vo/EMRPushVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/12 13:21
+ */
+@Getter
+@Setter
+public class EMRPushVO extends PushVO {
+    @NotBlank(message = "请输入医院编码")
+    private String hosCode;
+}

+ 15 - 0
icss-service/src/main/java/com/diagbot/vo/HosCodeVO.java

@@ -0,0 +1,15 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/12 11:05
+ */
+@Getter
+@Setter
+public class HosCodeVO {
+    private String hosCode;
+}

+ 6 - 0
icss-service/src/main/java/com/diagbot/vo/SaveInquiryDetailVO.java

@@ -33,5 +33,11 @@ public class SaveInquiryDetailVO {
      */
     @ApiModelProperty(value="内容字符串")
     private String content;
+    
+    /**
+     * 内容字符串纯文本
+     */
+    @ApiModelProperty(value="内容字符串纯文本")
+    private String contentValue;
 
 }

+ 21 - 0
icss-service/src/main/java/com/diagbot/vo/SaveInquiryToHisVO.java

@@ -0,0 +1,21 @@
+package com.diagbot.vo;
+
+import java.util.List;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2019/3/18
+ */
+@Getter
+@Setter
+public class SaveInquiryToHisVO {
+	
+	private List<String> contentList;
+	
+
+   
+}

+ 41 - 0
icss-service/src/main/java/com/diagbot/web/DisScaleController.java

@@ -0,0 +1,41 @@
+package com.diagbot.web;
+
+
+import com.diagbot.dto.DisScaleDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.DisScaleFacade;
+import com.diagbot.vo.DisScaleVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 诊断量表映射表 前端控制器
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-03-11
+ */
+@RestController
+@RequestMapping("/disScale")
+@Api(value = "诊断量表API", tags = { "诊断量表API" })
+public class DisScaleController {
+
+    @Autowired
+    DisScaleFacade disScaleFacade;
+
+    @ApiOperation(value = "返回诊断量表列表[by:zhoutg]",
+            notes = "")
+    @PostMapping("/getDisScale")
+    public RespDTO<List<DisScaleDTO>> getDisType(@RequestBody DisScaleVO scaleVO) {
+        List<DisScaleDTO> data = disScaleFacade.getDisScaleFac(scaleVO.getDisId());
+        return RespDTO.onSuc(data);
+    }
+}

+ 38 - 0
icss-service/src/main/java/com/diagbot/web/DisTypeController.java

@@ -0,0 +1,38 @@
+package com.diagbot.web;
+
+
+import com.diagbot.dto.DisTypeDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.DisTypeFacade;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 诊断类型表 前端控制器
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-03-08
+ */
+@RestController
+@RequestMapping("/disType")
+@Api(value = "诊断类型API", tags = { "诊断类型API" })
+public class DisTypeController {
+
+
+    @Autowired
+    DisTypeFacade disTypeFacade;
+
+    @ApiOperation(value = "返回诊断类型[by:zhoutg]",
+            notes = "")
+    @PostMapping("/getDisType")
+    public RespDTO<DisTypeDTO> getDisType() {
+        DisTypeDTO data = disTypeFacade.getDisTypeFac();
+        return RespDTO.onSuc(data);
+    }
+}

+ 74 - 0
icss-service/src/main/java/com/diagbot/web/EMRController.java

@@ -0,0 +1,74 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.EMRIntroduceDetailDTO;
+import com.diagbot.dto.PushEMRDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.IntroduceInfoFacade;
+import com.diagbot.facade.PushFacade;
+import com.diagbot.vo.EMRIntroduceVO;
+import com.diagbot.vo.EMRPushVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * @Description: 电子病历评级
+ * @Author:zhaops
+ * @time: 2019/3/12 15:07
+ */
+@RestController
+@RequestMapping("/emr")
+@Api(value = "电子病历评级相关API", tags = { "电子病历评级相关API" })
+@SuppressWarnings("unchecked")
+public class EMRController {
+    @Autowired
+    IntroduceInfoFacade introduceInfoFacade;
+    @Autowired
+    PushFacade pushFacade;
+
+    @ApiOperation(value = "电子病历解读[by:zhaops]",
+            notes = "hosCode: 医院编码,必填,String<br>" +
+                    "type: 检验检查类型,5-检验,6-检查,单选必填,Integer<br>" +
+                    "name: 套餐名称(检验检查),必填,String<br>" +
+                    "detailName: 项目名称(检验选填,检查不填),String<br>" +
+                    "titles: 提示信息标题列表,String数组<br>")
+    @PostMapping("/getIntroduceByEMR")
+    public RespDTO<List<EMRIntroduceDetailDTO>> getIntroduceByEMR(@RequestBody EMRIntroduceVO emrIntroduceVO) {
+        List<EMRIntroduceDetailDTO> data = introduceInfoFacade.getIntroduceByEMR(emrIntroduceVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "推理[by:zhaops]",
+            notes = "hosCode: 医院编码(必填)<br>" +
+                    "age: 年龄(必填)<br>" +
+                    "sex:性别(必填),1:男,2:女<br>" +
+                    "symptom:症状,String<br>" +
+                    "other:其它史,String<br>" +
+                    "vital:查体,String<br>" +
+                    "lis:化验,Array<br>" +
+                    "lis:name:套餐名称(必填),String<br>" +
+                    "lis:detailName:化验项名称(必填),String<br>" +
+                    "lis:uniqueName:公表名称,String<br>" +
+                    "lis:value:值,Double<br>" +
+                    "lis:maxValue:最大值,Double<br>" +
+                    "lis:minValue:最小值,Double<br>" +
+                    "lis:units:单位,String<br>" +
+                    "lis:otherValue:其他结果,包括阴性阳性,文字描述等,String<br>" +
+                    "lis:source:数据来源(必填)0-内部来源,1-外部来源,Integer<br>" +
+                    "pacs:辅检,String<br>" +
+                    "diag:诊断,String<br>" +
+                    "featureType:类型(多选必填),5:检验,6:检查,String<br>")
+    @PostMapping("/pushEMR")
+    @SysLogger("pushEMR")
+    public RespDTO<PushEMRDTO> pushEMR(@RequestBody @Valid EMRPushVO emrPushVO) {
+        return RespDTO.onSuc(pushFacade.pushEMR(emrPushVO));
+    }
+}

+ 25 - 0
icss-service/src/main/resources/mapper/DisScaleMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.DisScaleMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.DisScale">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="dis_id" property="disId" />
+        <result column="scale_id" property="scaleId" />
+        <result column="order_no" property="orderNo" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+
+    <select id="getDisScaleFac" resultType="com.diagbot.dto.DisScaleDTO">
+        SELECT b.id,b.name,b.tag_type,a.order_no FROM `icss_dis_scale` a, icss_question_info b
+        where a.scale_id = b.id and a.is_deleted = 'N' and b.is_deleted = 'N' and a.dis_id = #{disId}
+        order by a.order_no
+    </select>
+</mapper>

+ 22 - 0
icss-service/src/main/resources/mapper/DisTypeMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.DisTypeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.DisType">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="dis_id" property="disId" />
+        <result column="type" property="type" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+    <select id="getDisType" resultType="com.diagbot.dto.DisDTO">
+        SELECT a.type,b.name,b.id,b.tag_type FROM `icss_dis_type` a, icss_question_info b
+        where a.dis_id = b.id and a.is_deleted = 'N' and b.is_deleted = 'N' order by a.type
+    </select>
+</mapper>

+ 1 - 0
icss-service/src/main/resources/mapper/InquiryDetailMapper.xml

@@ -13,6 +13,7 @@
         <result column="inquiry_id" property="inquiryId" />
         <result column="type" property="type" />
         <result column="content" property="content" />
+        <result column="content_value" property="contentValue" />
         <result column="remark" property="remark" />
     </resultMap>
     

+ 2 - 2
icss-service/src/test/java/com/diagbot/CodeGeneration.java

@@ -49,14 +49,14 @@ public class CodeGeneration {
         dsc.setDriverName("com.mysql.jdbc.Driver");
         dsc.setUsername("root");
         dsc.setPassword("lantone");
-        dsc.setUrl("jdbc:mysql://192.168.2.236:3306/sys-icss?useUnicode=true&characterEncoding=utf-8");
+        dsc.setUrl("jdbc:mysql://192.168.2.236:3306/sys-icssncd?useUnicode=true&characterEncoding=utf-8");
         mpg.setDataSource(dsc);
 
         // 策略配置
         StrategyConfig strategy = new StrategyConfig();
         strategy.setTablePrefix(new String[] { "icss_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "icss_module_detal" }); // 需要生成的表
+        strategy.setInclude(new String[] { "icss_dis_scale" }); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);

+ 1 - 1
icssman-service/src/main/java/com/diagbot/facade/QuestionFacade.java

@@ -167,7 +167,7 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
                             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "标签被修改,请刷新后重新保存");
                         }
                     } else {
-                        String name = "组合项_" + DateUtil.format(DateUtil.now(), DateUtil.FORMAT_FULL);
+                        String name = "组合项_" + DateUtil.format(now, DateUtil.FORMAT_FULL);
                         ques.setTagName(name);
                         ques.setName(name);
                         ques.setTagType(TagTypeEnum.T10.getKey());

+ 15 - 1
tran-service/src/main/java/com/diagbot/entity/DiseaseIcd.java

@@ -73,6 +73,11 @@ public class DiseaseIcd implements Serializable {
      */
     private String remark;
 
+    /**
+     * 疾病名称(内)
+     */
+    private String icssQuestionName;
+
     public Long getId() {
         return id;
     }
@@ -151,6 +156,14 @@ public class DiseaseIcd implements Serializable {
         this.remark = remark;
     }
 
+    public String getIcssQuestionName() {
+        return icssQuestionName;
+    }
+
+    public void setIcssQuestionName(String icssQuestionName) {
+        this.icssQuestionName = icssQuestionName;
+    }
+
     @Override
     public String toString() {
         return "DiseaseIcd{" +
@@ -165,6 +178,7 @@ public class DiseaseIcd implements Serializable {
         ", icd=" + icd +
         ", status=" + status +
         ", remark=" + remark +
-        "}";
+        ",icssQuestionName" + icssQuestionName +
+                "}";
     }
 }

+ 11 - 9
tran-service/src/main/java/com/diagbot/entity/HospitalDept.java

@@ -74,7 +74,7 @@ public class HospitalDept implements Serializable {
     /**
      * icss科室id
      */
-    private Long deptId;
+    private String icssDeptName;
 
     /**
      * 状态:0.禁用1.启用
@@ -86,6 +86,15 @@ public class HospitalDept implements Serializable {
      */
     private String remark;
 
+
+    public String getIcssDeptName() {
+        return icssDeptName;
+    }
+
+    public void setIcssDeptName(String icssDeptName) {
+        this.icssDeptName = icssDeptName;
+    }
+
     public Long getId() {
         return id;
     }
@@ -156,13 +165,6 @@ public class HospitalDept implements Serializable {
     public void setHospitalName(String hospitalName) {
         this.hospitalName = hospitalName;
     }
-    public Long getDeptId() {
-        return deptId;
-    }
-
-    public void setDeptId(Long deptId) {
-        this.deptId = deptId;
-    }
     public Integer getStatus() {
         return status;
     }
@@ -191,7 +193,7 @@ public class HospitalDept implements Serializable {
         ", name=" + name +
         ", hospitalCode=" + hospitalCode +
         ", hospitalName=" + hospitalName +
-        ", deptId=" + deptId +
+        ", icssDeptName=" + icssDeptName +
         ", status=" + status +
         ", remark=" + remark +
         "}";

+ 146 - 0
tran-service/src/main/java/com/diagbot/entity/IntroduceTitleConfig.java

@@ -0,0 +1,146 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 提示信息标签映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2019-03-11
+ */
+@TableName("tran_introduce_title_config")
+public class IntroduceTitleConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 项目名
+     */
+    private String itemName;
+
+    /**
+     * 公表名
+     */
+    private String uniqueName;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public String getHospitalCode() {
+        return hospitalCode;
+    }
+
+    public void setHospitalCode(String hospitalCode) {
+        this.hospitalCode = hospitalCode;
+    }
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    @Override
+    public String toString() {
+        return "IntroduceTitleConfig{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", hospitalCode=" + hospitalCode +
+        ", itemName=" + itemName +
+        ", uniqueName=" + uniqueName +
+        "}";
+    }
+}

+ 154 - 0
tran-service/src/main/java/com/diagbot/entity/PacsConfig.java

@@ -0,0 +1,154 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 辅检项目公表映射配置表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2019-03-11
+ */
+@TableName("tran_pacs_config")
+public class PacsConfig implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 套餐名
+     */
+    private String mealName;
+
+    /**
+     * 公表名
+     */
+    private String uniqueName;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public String getHospitalCode() {
+        return hospitalCode;
+    }
+
+    public void setHospitalCode(String hospitalCode) {
+        this.hospitalCode = hospitalCode;
+    }
+
+    public String getMealName() {
+        return mealName;
+    }
+
+    public void setMealName(String mealName) {
+        this.mealName = mealName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    @Override
+    public String toString() {
+        return "PacsConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalCode=" + hospitalCode +
+                ", mealName=" + mealName +
+                ", uniqueName=" + uniqueName +
+                "}";
+    }
+}

+ 50 - 0
tran-service/src/main/java/com/diagbot/enums/TypeEnum.java

@@ -0,0 +1,50 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/11 13:32
+ */
+public enum TypeEnum implements KeyedNamed {
+    Lis(5, "检查"),
+
+    Pacs(6, "检验");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    TypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static TypeEnum getEnum(Integer key) {
+        for (TypeEnum item : TypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        TypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 22 - 0
tran-service/src/main/java/com/diagbot/facade/DiseaseIcdFacade.java

@@ -0,0 +1,22 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.DiseaseIcd;
+import com.diagbot.entity.PacsConfig;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.DiseaseIcdServiceImpl;
+import com.diagbot.util.EntityUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/18 17:29
+ */
+@Component
+public class DiseaseIcdFacade extends DiseaseIcdServiceImpl {
+
+}

+ 13 - 0
tran-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description: 对接问诊信息业务逻辑
+ * @author: rengb
+ * @since 2019-3-18
+ */
+@Component
+public class InquiryInfoFacade {
+
+}

+ 33 - 0
tran-service/src/main/java/com/diagbot/facade/IntroduceTitleConfigFacade.java

@@ -0,0 +1,33 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.IntroduceTitleConfig;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.IntroduceTitleConfigServiceImpl;
+import com.diagbot.util.EntityUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/11 13:16
+ */
+@Component
+public class IntroduceTitleConfigFacade extends IntroduceTitleConfigServiceImpl {
+
+    /**
+     * 根据医院编码获取静态知识标题公表映射关系 Map<itemName,uniqueName>
+     *
+     * @return
+     */
+    public Map<String, String> getTitleMappingHosCode(String hosCode) {
+        QueryWrapper<IntroduceTitleConfig> titleMappingQueryWrapper = new QueryWrapper<>();
+        titleMappingQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("hospital_code",hosCode);
+        List<IntroduceTitleConfig> titleMappingList = this.list(titleMappingQueryWrapper);
+        Map<String, String> retMap= EntityUtil.makeMapWithKeyValue(titleMappingList, "itemName", "uniqueName");
+        return retMap;
+    }
+}

+ 33 - 0
tran-service/src/main/java/com/diagbot/facade/PacsConfigFacade.java

@@ -0,0 +1,33 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.PacsConfig;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.PacsConfigServiceImpl;
+import com.diagbot.util.EntityUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/11 13:10
+ */
+@Component
+public class PacsConfigFacade extends PacsConfigServiceImpl{
+
+    /**
+     * 根据医院编码获取辅检公表映射关系 Map<mealName,uniqueName>
+     *
+     * @return
+     */
+    public Map<String, String> getPacsConfigByHosCode(String hosCode) {
+        QueryWrapper<PacsConfig> pacsConfigQueryWrapper = new QueryWrapper<>();
+        pacsConfigQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("hospital_code",hosCode);
+        List<PacsConfig> pacsConfigList = this.list(pacsConfigQueryWrapper);
+        Map<String, String> retMap=EntityUtil.makeMapWithKeyValue(pacsConfigList, "mealName", "uniqueName");
+        return retMap;
+    }
+}

+ 18 - 1
tran-service/src/main/java/com/diagbot/facade/TranDiseaseIcdFacade.java

@@ -1,7 +1,11 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.GetDiseaseIcdDTO;
+import com.diagbot.entity.DiseaseIcd;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.DiseaseIcdServiceImpl;
+import com.diagbot.util.EntityUtil;
 import com.diagbot.vo.GetDiseaseIcdVO;
 import org.springframework.stereotype.Component;
 
@@ -30,4 +34,17 @@ public class TranDiseaseIcdFacade extends DiseaseIcdServiceImpl {
         paramMap.put("hospitalCode", getDiseaseIcdVO.getHospitalCode());
         return this.getDiseaseIcds(paramMap);
     }
-}
+
+    /**
+     * 根据医院编码获取疾病映射关系 Map<icssName,diseaseName>
+     *
+     * @return
+     */
+    public Map<String, String> getDiseaseIcdByHosCode(String hosCode) {
+        QueryWrapper<DiseaseIcd> diseaseIcdQueryWrapper = new QueryWrapper<>();
+        diseaseIcdQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("hospital_code",hosCode);
+        List<DiseaseIcd> diseaseIcdList = this.list(diseaseIcdQueryWrapper);
+        Map<String, String> retMap= EntityUtil.makeMapWithKeyValue(diseaseIcdList, "icssQuestionName", "diseaseName");
+        return retMap;
+    }
+}

+ 43 - 6
tran-service/src/main/java/com/diagbot/facade/TranLisConfigFacade.java

@@ -1,16 +1,17 @@
 package com.diagbot.facade;
 
-import java.util.List;
-
-import org.springframework.stereotype.Component;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.LisConfigDTO;
 import com.diagbot.entity.TranLisConfig;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.TranLisConfigServiceImpl;
 import com.diagbot.util.BeanUtil;
-import com.diagbot.util.GsonUtil;
+import com.diagbot.util.EntityUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 /**
  * 
  * @author wangfeng
@@ -36,4 +37,40 @@ public class TranLisConfigFacade extends TranLisConfigServiceImpl{
 		//System.out.println("json=="+GsonUtil.toJson(datas));
 		return datas;
 	}
-}
+
+	/**
+	 * 根据医院编码获取化验公表映射关系-itemName不为空 Map<mealName,Map<itemName,uniqueName>>
+	 *
+	 * @return
+	 */
+	public Map<String, Map<String, String>> getLisConfigByHosCode_NotEmptyItemName(String hosCode) {
+		Map<String, Map<String, String>> retMap = new LinkedHashMap<>();
+		QueryWrapper<TranLisConfig> lisConfigQueryWrapper = new QueryWrapper<>();
+		lisConfigQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("hospital_code",hosCode).
+				isNotNull("item_name").and(i->i.ne("item_name",""));
+		List<TranLisConfig> lisConfigList = this.list(lisConfigQueryWrapper);
+		Map<String, List<TranLisConfig>> lisConfigMap = EntityUtil.makeEntityListMap(lisConfigList, "mealName");
+		for (Map.Entry<String, List<TranLisConfig>> entry : lisConfigMap.entrySet()) {
+			if (entry.getValue().size() > 0) {
+				retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "itemName", "uniqueName"));
+			} else {
+				retMap.put(entry.getKey(), null);
+			}
+		}
+		return retMap;
+	}
+
+	/**
+	 * 根据医院编码获取化验公表映射关系-itemName为空 Map<mealName,uniqueName>
+	 *
+	 * @return
+	 */
+	public Map<String, String> getLisConfigByHosCode_EmptyItemName(String hosCode) {
+		QueryWrapper<TranLisConfig> lisConfigQueryWrapper = new QueryWrapper<>();
+		lisConfigQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("hospital_code",hosCode).
+				isNull("item_name").or(i->i.eq("item_name",""));
+		List<TranLisConfig> lisConfigList = this.list(lisConfigQueryWrapper);
+		Map<String, String> retMap = EntityUtil.makeMapWithKeyValue(lisConfigList, "mealName", "uniqueName");
+		return retMap;
+	}
+}

+ 16 - 0
tran-service/src/main/java/com/diagbot/mapper/IntroduceTitleConfigMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.IntroduceTitleConfig;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 提示信息标签映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2019-03-11
+ */
+public interface IntroduceTitleConfigMapper extends BaseMapper<IntroduceTitleConfig> {
+
+}

+ 16 - 0
tran-service/src/main/java/com/diagbot/mapper/PacsConfigMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.PacsConfig;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 辅检项目公表映射配置表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2019-03-11
+ */
+public interface PacsConfigMapper extends BaseMapper<PacsConfig> {
+
+}

+ 16 - 0
tran-service/src/main/java/com/diagbot/service/IntroduceTitleConfigService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.IntroduceTitleConfig;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 提示信息标签映射表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2019-03-11
+ */
+public interface IntroduceTitleConfigService extends IService<IntroduceTitleConfig> {
+
+}

+ 16 - 0
tran-service/src/main/java/com/diagbot/service/PacsConfigService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.PacsConfig;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 辅检项目公表映射配置表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2019-03-11
+ */
+public interface PacsConfigService extends IService<PacsConfig> {
+
+}

+ 20 - 0
tran-service/src/main/java/com/diagbot/service/impl/IntroduceTitleConfigServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.IntroduceTitleConfig;
+import com.diagbot.mapper.IntroduceTitleConfigMapper;
+import com.diagbot.service.IntroduceTitleConfigService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 提示信息标签映射表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2019-03-11
+ */
+@Service
+public class IntroduceTitleConfigServiceImpl extends ServiceImpl<IntroduceTitleConfigMapper, IntroduceTitleConfig> implements IntroduceTitleConfigService {
+
+}

+ 20 - 0
tran-service/src/main/java/com/diagbot/service/impl/PacsConfigServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.PacsConfig;
+import com.diagbot.mapper.PacsConfigMapper;
+import com.diagbot.service.PacsConfigService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 辅检项目公表映射配置表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2019-03-11
+ */
+@Service
+public class PacsConfigServiceImpl extends ServiceImpl<PacsConfigMapper, PacsConfig> implements PacsConfigService {
+
+}

+ 15 - 0
tran-service/src/main/java/com/diagbot/vo/HosCodeVO.java

@@ -0,0 +1,15 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/12 10:45
+ */
+@Getter
+@Setter
+public class HosCodeVO {
+    private String hosCode;
+}

+ 21 - 0
tran-service/src/main/java/com/diagbot/vo/SaveInquiryToHisVO.java

@@ -0,0 +1,21 @@
+package com.diagbot.vo;
+
+import java.util.List;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2019/3/18
+ */
+@Getter
+@Setter
+public class SaveInquiryToHisVO {
+	
+	private List<String> contentList;
+	
+
+   
+}

+ 45 - 0
tran-service/src/main/java/com/diagbot/web/InquiryInfoController.java

@@ -0,0 +1,45 @@
+package com.diagbot.web;
+
+import javax.validation.Valid;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.InquiryInfoFacade;
+import com.diagbot.vo.SaveInquiryToHisVO;
+
+import io.swagger.annotations.Api;
+
+/**
+ * <p>
+ * 对接问诊信息控制器
+ * </p>
+ *
+ * @author rengb
+ * @since 2019-3-18
+ */
+@RestController
+@RequestMapping("/inquiryInfo")
+@Api(value = "对接问诊信息API", tags = { "对接问诊信息API" })
+@SuppressWarnings("unchecked")
+public class InquiryInfoController {
+	
+	 @Autowired
+	 private InquiryInfoFacade inquiryInfoFacade;
+	 
+	 @PostMapping("/saveInquiryToHis")
+	 @SysLogger("saveInquiryToHis")
+
+	 public RespDTO<Boolean> saveInquiryToHis(@Valid @RequestBody SaveInquiryToHisVO saveInquiryToHisVO) {
+		 
+		 
+		
+	     return RespDTO.onSuc(true);
+	 }
+
+}

+ 36 - 0
tran-service/src/main/java/com/diagbot/web/IntroduceTitleConfigController.java

@@ -0,0 +1,36 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.IntroduceTitleConfigFacade;
+import com.diagbot.vo.HosCodeVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/12 10:56
+ */
+@RestController
+@RequestMapping("/introduceTitleConfig")
+@Api(value = "提示信息标题映射相关API", tags = { "提示信息标题映射相关API" })
+public class IntroduceTitleConfigController {
+    @Autowired
+    IntroduceTitleConfigFacade introduceTitleConfigFacade;
+
+    @ApiOperation(value = "根据医院编码查询标题映射:[by:zhaops]",
+            notes = "hosCode: 医院编码,必填<br>")
+    @PostMapping("/getTitleMappingHosCode")
+    @SysLogger("getTitleMappingHosCode")
+    public RespDTO<Map<String, String>> getTitleMappingHosCode(@RequestBody HosCodeVO hosCodeVO) {
+        return RespDTO.onSuc(introduceTitleConfigFacade.getTitleMappingHosCode(hosCodeVO.getHosCode()));
+    }
+}

+ 37 - 0
tran-service/src/main/java/com/diagbot/web/PacsConfigController.java

@@ -0,0 +1,37 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.PacsConfigFacade;
+import com.diagbot.vo.HosCodeVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/3/12 10:50
+ */
+@RestController
+@RequestMapping("/pacsConfig")
+@Api(value = "辅检公表映射配置相关API", tags = { "辅检公表映射配置相关API" })
+public class PacsConfigController {
+
+    @Autowired
+    PacsConfigFacade pacsConfigFacade;
+
+    @ApiOperation(value = "根据医院编码查询辅检公表映射:[by:zhaops]",
+            notes = "hosCode: 医院编码,必填<br>")
+    @PostMapping("/getPacsConfigByHosCode")
+    @SysLogger("getPacsConfigByHosCode")
+    public RespDTO<Map<String, String>> getPacsConfigByHosCode(@RequestBody HosCodeVO hosCodeVO) {
+        return RespDTO.onSuc(pacsConfigFacade.getPacsConfigByHosCode(hosCodeVO.getHosCode()));
+    }
+}

+ 11 - 1
tran-service/src/main/java/com/diagbot/web/TranDiseaseIcdController.java

@@ -6,6 +6,7 @@ import com.diagbot.dto.GetDiseaseIcdDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.TranDiseaseIcdFacade;
 import com.diagbot.vo.GetDiseaseIcdVO;
+import com.diagbot.vo.HosCodeVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,6 +18,7 @@ import springfox.documentation.annotations.ApiIgnore;
 
 import javax.validation.Valid;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -39,8 +41,16 @@ public class TranDiseaseIcdController {
     @PostMapping("/getDiseaseIcds")
     @SysLogger("getDiseaseIcds")
     @ApiIgnore
-    public RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcds(@RequestBody @Valid GetDiseaseIcdVO getDiseaseIcdVO){
+    public RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcds(@RequestBody @Valid GetDiseaseIcdVO getDiseaseIcdVO) {
         List<GetDiseaseIcdDTO> data = diseaseIcdFacade.getDiseaseIcds(getDiseaseIcdVO);
         return RespDTO.onSuc(data);
     }
+
+    @ApiOperation(value = "根据医院编码查询诊断icd映射:[by:zhaops]",
+            notes = "hosCode: 医院编码,必填<br>")
+    @PostMapping("/getDiseaseIcdByHosCode")
+    @SysLogger("getDiseaseIcdByHosCode")
+    public RespDTO<Map<String, String>> getDiseaseIcdByHosCode(@RequestBody HosCodeVO hosCodeVO) {
+        return RespDTO.onSuc(diseaseIcdFacade.getDiseaseIcdByHosCode(hosCodeVO.getHosCode()));
+    }
 }

+ 20 - 3
tran-service/src/main/java/com/diagbot/web/TranLisConfigController.java

@@ -1,7 +1,9 @@
 package com.diagbot.web;
 
 import java.util.List;
+import java.util.Map;
 
+import com.diagbot.vo.HosCodeVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -33,10 +35,25 @@ public class TranLisConfigController {
 	TranLisConfigFacade tranLisConfigFacade;
 
 	@ApiOperation(value = "根据医院编码查询公表映射配置:[by:wangfeng]", notes = "根据医院编码查询公表映射配置")
-    @PostMapping("/getLisConfigByhospitalId")
-    @SysLogger("getLisConfigByhospitalId")
-	public  RespDTO<List<LisConfigDTO>> getLisConfigByhospitalId(@RequestBody LisHospitalCodeVO lisHospitalCodeVO) {
+	@PostMapping("/getLisConfigByhospitalId")
+	@SysLogger("getLisConfigByhospitalId")
+	public RespDTO<List<LisConfigDTO>> getLisConfigByhospitalId(@RequestBody LisHospitalCodeVO lisHospitalCodeVO) {
 		return RespDTO.onSuc(tranLisConfigFacade.getLisConfigByhospitalIds(lisHospitalCodeVO.getHospitalCode()));
 	}
 
+	@ApiOperation(value = "根据医院编码获取化验公表映射关系-itemName不为空:[by:zhaops]",
+			notes = "hosCode: 医院编码,必填<br>")
+	@PostMapping("/getLisConfigByHosCode_NotEmptyItemName")
+	@SysLogger("getLisConfigByHosCode_NotEmptyItemName")
+	public RespDTO<Map<String, Map<String, String>>> getLisConfigByHosCode_NotEmptyItemName(@RequestBody HosCodeVO hosCodeVO) {
+		return RespDTO.onSuc(tranLisConfigFacade.getLisConfigByHosCode_NotEmptyItemName(hosCodeVO.getHosCode()));
+	}
+
+	@ApiOperation(value = "根据医院编码获取化验公表映射关系-itemName为空 :[by:zhaops]",
+			notes = "hosCode: 医院编码,必填<br>")
+	@PostMapping("/getLisConfigByHosCode_EmptyItemName")
+	@SysLogger("getLisConfigByHosCode_EmptyItemName")
+	public RespDTO<Map<String, String>> getLisConfigByHosCode_EmptyItemName(@RequestBody HosCodeVO hosCodeVO) {
+		return RespDTO.onSuc(tranLisConfigFacade.getLisConfigByHosCode_EmptyItemName(hosCodeVO.getHosCode()));
+	}
 }

+ 2 - 1
tran-service/src/main/resources/mapper/DiseaseIcdMapper.xml

@@ -15,13 +15,14 @@
         <result column="icd" property="icd" />
         <result column="status" property="status" />
         <result column="remark" property="remark" />
+        <result column="icss_question_name" property="icssQuestionName" />
     </resultMap>
 
     <select id="getDiseaseIcds" resultMap="BaseResultMap" parameterType="java.util.Map">
         select * from tran_disease_icd t where
         FIND_IN_SET(#{hospitalCode},hospital_code)
         and
-        question_id in
+        icss_question_name in
         <foreach item="item" collection="questions" open="(" separator="," close=")">
             #{item}
         </foreach>

+ 1 - 1
tran-service/src/main/resources/mapper/HospitalDeptMapper.xml

@@ -14,7 +14,7 @@
         <result column="name" property="name" />
         <result column="hospital_code" property="hospitalCode" />
         <result column="hospital_name" property="hospitalName" />
-        <result column="dept_id" property="deptId" />
+        <result column="icss_dept_name" property="icssDeptName" />
         <result column="status" property="status" />
         <result column="remark" property="remark" />
     </resultMap>

+ 18 - 0
tran-service/src/main/resources/mapper/IntroduceTitleConfigMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.IntroduceTitleConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.IntroduceTitleConfig">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="hospital_code" property="hospitalCode" />
+        <result column="item_name" property="itemName" />
+        <result column="unique_name" property="uniqueName" />
+    </resultMap>
+
+</mapper>

+ 18 - 0
tran-service/src/main/resources/mapper/PacsConfigMapper.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.PacsConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.PacsConfig">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="hospital_code" property="hospitalCode" />
+        <result column="meal_name" property="mealName" />
+        <result column="unique_name" property="uniqueName" />
+    </resultMap>
+
+</mapper>

+ 1 - 1
tran-service/src/main/resources/mapper/PatientInfoMapper.xml

@@ -44,7 +44,7 @@
 		a.`code` as hospitalCode,
 		a.`name` as hospitalName,
 		b.id as hospitalDeptId,
-		b.dept_id as selfDeptId,
+		b.icss_dept_name as selfDeptName,
 		b.`code` as hospitalDeptCode,
 		b.`name` as hospitalDeptName,
 		c.id as doctorId,

+ 5 - 5
tran-service/src/test/java/com/diagbot/CodeGeneration.java

@@ -33,7 +33,7 @@ public class CodeGeneration {
         gc.setEnableCache(false);// XML 二级缓存
         gc.setBaseResultMap(true);// XML ResultMap
         gc.setBaseColumnList(false);// XML columList
-        gc.setAuthor("gaodm");// 作者
+        gc.setAuthor("zhaops");// 作者
 
         // 自定义文件命名,注意 %s 会自动填充表实体属性!
         gc.setControllerName("%sController");
@@ -48,15 +48,15 @@ public class CodeGeneration {
         dsc.setDbType(DbType.MYSQL);
         dsc.setDriverName("com.mysql.jdbc.Driver");
         dsc.setUsername("root");
-        dsc.setPassword("root");
-        dsc.setUrl("jdbc:mysql://127.0.0.1:3306/sys-tran?useUnicode=true&characterEncoding=utf-8");
+        dsc.setPassword("lantone");
+        dsc.setUrl("jdbc:mysql://192.168.2.236:3306/sys-tran?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false");
         mpg.setDataSource(dsc);
 
         // 策略配置
         StrategyConfig strategy = new StrategyConfig();
-//        strategy.setTablePrefix(new String[] { "sys_" });// 此处可以修改为您的表前缀
+        strategy.setTablePrefix(new String[] { "tran_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "sys_log" }); // 需要生成的表
+        strategy.setInclude(new String[] { "tran_introduce_title_config","tran_pacs_config" }); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);