Explorar o código

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

# Conflicts:
#	aipt-service/src/main/java/com/diagbot/web/ConceptController.java
wangyu %!s(int64=6) %!d(string=hai) anos
pai
achega
03a65d67b6
Modificáronse 100 ficheiros con 2833 adicións e 2141 borrados
  1. 12 0
      aipt-service/src/main/java/com/diagbot/client/TranServiceClient.java
  2. 22 0
      aipt-service/src/main/java/com/diagbot/client/bean/AdverseReaction.java
  3. 16 0
      aipt-service/src/main/java/com/diagbot/client/bean/AdverseReactionDetail.java
  4. 27 0
      aipt-service/src/main/java/com/diagbot/client/bean/Medicition.java
  5. 25 0
      aipt-service/src/main/java/com/diagbot/client/bean/MedicitionClass.java
  6. 9 0
      aipt-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java
  7. 156 0
      aipt-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDTO.java
  8. 0 1
      aipt-service/src/main/java/com/diagbot/dto/PushDTO.java
  9. 4 1
      aipt-service/src/main/java/com/diagbot/enums/ConceptTypeEnum.java
  10. 29 15
      aipt-service/src/main/java/com/diagbot/enums/DisTypeEnum.java
  11. 3 2
      aipt-service/src/main/java/com/diagbot/facade/ClinicalFacade.java
  12. 54 0
      aipt-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java
  13. 50 5
      aipt-service/src/main/java/com/diagbot/facade/ConceptFacade.java
  14. 36 4
      aipt-service/src/main/java/com/diagbot/facade/DisTypeFacade.java
  15. 50 0
      aipt-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java
  16. 31 35
      aipt-service/src/main/java/com/diagbot/facade/PushFacade.java
  17. 13 0
      aipt-service/src/main/java/com/diagbot/facade/RelationFacade.java
  18. 119 14
      aipt-service/src/main/java/com/diagbot/facade/TreatmentFacade.java
  19. 10 1
      aipt-service/src/main/java/com/diagbot/util/ParamConvertUtil.java
  20. 18 0
      aipt-service/src/main/java/com/diagbot/vo/ConceptSearchVO.java
  21. 21 0
      aipt-service/src/main/java/com/diagbot/vo/DisTypeVO.java
  22. 56 0
      aipt-service/src/main/java/com/diagbot/vo/GetTopPatientInfoVO.java
  23. 14 2
      aipt-service/src/main/java/com/diagbot/web/ConceptController.java
  24. 12 0
      aipt-service/src/main/java/com/diagbot/web/ConceptDetailController.java
  25. 13 0
      aipt-service/src/main/java/com/diagbot/web/DisTypeController.java
  26. 49 0
      aipt-service/src/main/java/com/diagbot/web/PatientInfoController.java
  27. 90 0
      aipt-service/src/main/java/com/diagbot/web/PushController.java
  28. 65 0
      common/src/main/java/com/diagbot/enums/ConceptTypeEnum.java
  29. 99 0
      common/src/main/java/com/diagbot/enums/LexiconTypeEnum.java
  30. 14 0
      common/src/main/java/com/diagbot/util/IntegerUtil.java
  31. 131 0
      common/src/main/java/com/diagbot/util/ParamConvertUtil.java
  32. 1 1
      config-server/src/main/resources/shared/knowledgeman-service-dev.yml
  33. 1 1
      config-server/src/main/resources/shared/knowledgeman-service-local.yml
  34. 83 1
      icss-service/src/main/java/com/diagbot/client/AiptServiceClient.java
  35. 7 17
      icss-service/src/main/java/com/diagbot/client/TranServiceClient.java
  36. 21 0
      icss-service/src/main/java/com/diagbot/client/bean/ConceptBaseVO.java
  37. 21 0
      icss-service/src/main/java/com/diagbot/client/bean/DisTypeVO.java
  38. 2 1
      icss-service/src/main/java/com/diagbot/client/bean/Medicition.java
  39. 16 40
      icss-service/src/main/java/com/diagbot/client/bean/SearchData.java
  40. 88 0
      icss-service/src/main/java/com/diagbot/client/hystrix/AiptServiceHystrix.java
  41. 9 14
      icss-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java
  42. 22 0
      icss-service/src/main/java/com/diagbot/dto/EvaluationDTO.java
  43. 5 5
      icss-service/src/main/java/com/diagbot/dto/PushDTO.java
  44. 0 164
      icss-service/src/main/java/com/diagbot/entity/EvaluationModuleMapping.java
  45. 0 203
      icss-service/src/main/java/com/diagbot/entity/IndexData.java
  46. 89 0
      icss-service/src/main/java/com/diagbot/facade/AssembleFacade.java
  47. 1 2
      icss-service/src/main/java/com/diagbot/facade/DisScaleFacade.java
  48. 30 23
      icss-service/src/main/java/com/diagbot/facade/EvaluationModuleMappingFacade.java
  49. 13 20
      icss-service/src/main/java/com/diagbot/facade/IndexConfigFacade.java
  50. 13 33
      icss-service/src/main/java/com/diagbot/facade/IndexDataFacade.java
  51. 5 22
      icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java
  52. 52 136
      icss-service/src/main/java/com/diagbot/facade/PushFacade.java
  53. 3 1
      icss-service/src/main/java/com/diagbot/facade/ScaleContentFacade.java
  54. 36 164
      icss-service/src/main/java/com/diagbot/facade/TreatmentFacade.java
  55. 0 16
      icss-service/src/main/java/com/diagbot/mapper/DisScaleMapper.java
  56. 0 16
      icss-service/src/main/java/com/diagbot/mapper/EvaluationModuleMappingMapper.java
  57. 0 16
      icss-service/src/main/java/com/diagbot/mapper/IndexConfigMapper.java
  58. 0 26
      icss-service/src/main/java/com/diagbot/mapper/IndexDataMapper.java
  59. 0 16
      icss-service/src/main/java/com/diagbot/service/DisScaleService.java
  60. 0 16
      icss-service/src/main/java/com/diagbot/service/EvaluationModuleMappingService.java
  61. 0 16
      icss-service/src/main/java/com/diagbot/service/IndexConfigService.java
  62. 0 24
      icss-service/src/main/java/com/diagbot/service/IndexDataService.java
  63. 0 20
      icss-service/src/main/java/com/diagbot/service/impl/DisScaleServiceImpl.java
  64. 0 20
      icss-service/src/main/java/com/diagbot/service/impl/EvaluationModuleMappingServiceImpl.java
  65. 0 20
      icss-service/src/main/java/com/diagbot/service/impl/IndexConfigServiceImpl.java
  66. 0 35
      icss-service/src/main/java/com/diagbot/service/impl/IndexDataServiceImpl.java
  67. 18 0
      icss-service/src/main/java/com/diagbot/vo/ConceptSearchVO.java
  68. 18 0
      icss-service/src/main/java/com/diagbot/vo/EvaluationdiseaseNameVO.java
  69. 16 0
      icss-service/src/main/java/com/diagbot/vo/IndexConfigdiseaseNameVO.java
  70. 2 2
      icss-service/src/main/java/com/diagbot/vo/PushVO.java
  71. 16 13
      icss-service/src/main/java/com/diagbot/web/EvaluationModuleMappingController.java
  72. 14 13
      icss-service/src/main/java/com/diagbot/web/IndexConfigController.java
  73. 35 22
      icss-service/src/main/java/com/diagbot/web/PushController.java
  74. 0 19
      icss-service/src/main/resources/mapper/DisScaleMapper.xml
  75. 0 20
      icss-service/src/main/resources/mapper/IndexConfigMapper.xml
  76. 0 75
      icss-service/src/main/resources/mapper/IndexDataMapper.xml
  77. 0 37
      icssman-service/src/main/java/com/diagbot/facade/QuestionFacade.java
  78. 0 39
      icssman-service/src/main/java/com/diagbot/mapper/ScaleContentMapper.java
  79. 0 38
      icssman-service/src/main/java/com/diagbot/service/ScaleContentService.java
  80. 0 20
      icssman-service/src/main/java/com/diagbot/web/DisTypeController.java
  81. 0 65
      icssman-service/src/main/java/com/diagbot/web/ScaleContentController.java
  82. 2 1
      icssman-service/src/main/resources/mapper/IndexConfigMapper.xml
  83. 0 55
      icssman-service/src/main/resources/mapper/ScaleContentMapper.xml
  84. 3 3
      knowledgeman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  85. 20 22
      knowledgeman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  86. 32 0
      knowledgeman-service/src/main/java/com/diagbot/dto/ScaleContentDTO.java
  87. 25 0
      knowledgeman-service/src/main/java/com/diagbot/dto/ScaleContentIndexDTO.java
  88. 43 0
      knowledgeman-service/src/main/java/com/diagbot/dto/ScaleContentPageDTO.java
  89. 147 119
      knowledgeman-service/src/main/java/com/diagbot/entity/Concept.java
  90. 199 166
      icss-service/src/main/java/com/diagbot/entity/IndexConfig.java
  91. 199 197
      knowledgeman-service/src/main/java/com/diagbot/entity/LibraryInfo.java
  92. 83 0
      knowledgeman-service/src/main/java/com/diagbot/entity/ScaleContent.java
  93. 11 0
      knowledgeman-service/src/main/java/com/diagbot/facade/ConceptCommonFacade.java
  94. 3 3
      knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java
  95. 51 43
      icssman-service/src/main/java/com/diagbot/facade/ScaleContentFacade.java
  96. 16 0
      knowledgeman-service/src/main/java/com/diagbot/mapper/ConceptCommonMapper.java
  97. 49 0
      knowledgeman-service/src/main/java/com/diagbot/mapper/ScaleContentMapper.java
  98. 16 0
      knowledgeman-service/src/main/java/com/diagbot/service/ConceptCommonService.java
  99. 49 0
      knowledgeman-service/src/main/java/com/diagbot/service/ScaleContentService.java
  100. 0 0
      knowledgeman-service/src/main/java/com/diagbot/service/impl/ConceptCommonServiceImpl.java

+ 12 - 0
aipt-service/src/main/java/com/diagbot/client/TranServiceClient.java

@@ -2,10 +2,13 @@ package com.diagbot.client;
 
 import com.diagbot.client.hystrix.TranServiceHystrix;
 import com.diagbot.dto.GetDiseaseIcdDTO;
+import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.HospitalDeptInfoDTO;
 import com.diagbot.dto.HospitalDeptInfoVO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.vo.GetDiseaseIcdVO;
+import com.diagbot.vo.GetTopPatientInfoVO;
+
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -36,4 +39,13 @@ public interface TranServiceClient {
      */
     @PostMapping("/diseaseIcd/getDiseaseIcds")
     RespDTO<List<GetDiseaseIcdDTO>> getDiseaseIcds(@RequestBody GetDiseaseIcdVO getDiseaseIcdVO);
+    
+    /**
+     * 获取页面顶部病人医生科室信息
+     *
+     * @param getTopPatientInfoVO
+     * @return
+     */
+    @PostMapping("/patientInfo/getTopPatientInfo")
+    RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO);
 }

+ 22 - 0
aipt-service/src/main/java/com/diagbot/client/bean/AdverseReaction.java

@@ -0,0 +1,22 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description: 不良反应
+ * @Author:zhaops
+ * @time: 2019/3/14 11:14
+ */
+@Getter
+@Setter
+public class AdverseReaction {
+    private Long conceptId;
+    private String name;  //名称
+    private Integer libType;
+    private String showInfo = "0";//是否显示提示信息
+    private Integer controlType; //控件类型
+    private List<AdverseReactionDetail> details;
+}

+ 16 - 0
aipt-service/src/main/java/com/diagbot/client/bean/AdverseReactionDetail.java

@@ -0,0 +1,16 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description: 不良反应明细
+ * @Author:zhaops
+ * @time: 2019/3/14 11:19
+ */
+@Getter
+@Setter
+public class AdverseReactionDetail {
+    private String name;
+    private Integer value; //是否选中:0-未选中,1-选中
+}

+ 27 - 0
aipt-service/src/main/java/com/diagbot/client/bean/Medicition.java

@@ -0,0 +1,27 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:药品信息
+ * @Author:zhaops
+ * @time: 2018/12/17 13:27
+ */
+@Getter
+@Setter
+public class Medicition {
+    private Long conceptId;
+    private String medicitionName;
+    private Integer libType;
+    /**
+     * 1-显示,0-隐藏
+     */
+    private String isShow;
+    private String forbidden;
+    /**
+     * 1-有提示信息,0-没有提示信息
+     */
+    private String showInfo = "0";
+    private String rate;
+}

+ 25 - 0
aipt-service/src/main/java/com/diagbot/client/bean/MedicitionClass.java

@@ -0,0 +1,25 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.LinkedList;
+
+/**
+ * @Description:药品分类
+ * @Author:zhaops
+ * @time: 2018/12/17 13:32
+ */
+@Getter
+@Setter
+public class MedicitionClass {
+    private String showInfo = "0";
+    private String drugsForbidden;
+    private Long bigdrugsConceptId;//药品分类概念id-大类
+    private String bigdrugsName;//药类名
+    private Integer bigdrgusLibType;
+    private Long subdrugsConceptId;//药品分类概念id-小类
+    private String subdrugsName;//药类名-小类
+    private Integer subdrugsLibType;
+    private LinkedList<Medicition> medicitionsList;
+}

+ 9 - 0
aipt-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java

@@ -2,10 +2,13 @@ package com.diagbot.client.hystrix;
 
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.GetDiseaseIcdDTO;
+import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.HospitalDeptInfoDTO;
 import com.diagbot.dto.HospitalDeptInfoVO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.vo.GetDiseaseIcdVO;
+import com.diagbot.vo.GetTopPatientInfoVO;
+
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
@@ -30,4 +33,10 @@ public class TranServiceHystrix implements TranServiceClient {
         log.error("【hystrix】调用{}异常", "getDiseaseIcds");
         return null;
     }
+    
+    @Override
+    public RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(GetTopPatientInfoVO getTopPatientInfoVO) {
+        log.error("【hystrix】调用{}异常", "getTopPatientInfo");
+        return null;
+    }
 }

+ 156 - 0
aipt-service/src/main/java/com/diagbot/dto/GetTopPatientInfoDTO.java

@@ -0,0 +1,156 @@
+package com.diagbot.dto;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description
+ * @author rgb
+ * @time 2018年11月19日下午4:57:43
+ */
+@ApiModel(value="页面顶部病人医生科室信息查询接口出参")
+@Getter
+@Setter
+public class GetTopPatientInfoDTO {
+	
+	/**
+	 * 医院id
+	 */
+	@ApiModelProperty(value="医院id")
+	private Long hospitalId;
+	
+	/**
+     * 医院编码
+     */
+	@ApiModelProperty(value="医院编码")
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+	@ApiModelProperty(value="医院名称")
+    private String hospitalName;
+    
+    /**
+	 * 医院科室id
+	 */
+	@ApiModelProperty(value="医院科室id")
+	private Long hospitalDeptId;
+	
+    /**
+	 * 自己科室id
+	 */
+	@ApiModelProperty(value="自己科室id")
+	private Long selfDeptId;
+	
+	/**
+	 * 自己科室名称
+	 */
+	@ApiModelProperty(value="自己科室名称")
+	private String selfDeptName;
+    
+    /**
+     * 医院科室编码
+     */
+	@ApiModelProperty(value="医院科室编码")
+    private String hospitalDeptCode;
+
+    /**
+     * 医院科室名称
+     */
+	@ApiModelProperty(value="医院科室名称")
+    private String hospitalDeptName;
+    
+    /**
+	 * 医生id
+	 */
+	@ApiModelProperty(value="医生id")
+	private Long doctorId;
+	
+	/**
+     * 医生编码
+     */
+	@ApiModelProperty(value="医生编码")
+    private String doctorCode;
+
+    /**
+     * 医生姓名
+     */
+	@ApiModelProperty(value="医生姓名")
+    private String doctorName;
+    
+    /**
+   	 * 病人id
+   	 */
+	@ApiModelProperty(value="病人id")
+   	private Long patientId;
+   	
+   	/**
+     * 病人编号
+     */
+	@ApiModelProperty(value="病人编号")
+    private String patientCode;
+
+    /**
+     * 病人姓名
+     */
+	@ApiModelProperty(value="病人姓名")
+    private String patientName;
+
+    /**
+     * 病人性别
+     */
+	@ApiModelProperty(value="病人性别")
+    private String patientSex;
+    
+    /**
+     * 病人年龄
+     */
+	@ApiModelProperty(value="病人年龄")
+    private Integer patientAge;
+    
+    /**
+     * 病人证件号码
+     */
+	@ApiModelProperty(value="病人证件号码")
+    private String patientIdNo;
+
+	/**
+	 * 系统时间
+	 */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+	@ApiModelProperty(value="系统时间")
+	private Date systemTime;
+	
+	/**
+     * 出生日期
+     */
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+	@ApiModelProperty(value="出生日期")
+    private Date birthday;
+	
+	/**
+     * 门诊号
+     */
+	@ApiModelProperty(value="门诊号")
+	private String recordId;
+	
+    /**
+     * 模式分类
+     */
+	@ApiModelProperty(value="模式分类")
+    private Integer modeClassify;
+
+    /**
+     * 模式值
+     */
+	@ApiModelProperty(value="模式值")
+    private Integer modeValue;
+	
+}

+ 0 - 1
aipt-service/src/main/java/com/diagbot/dto/PushDTO.java

@@ -21,7 +21,6 @@ public class PushDTO {
     private List<ConceptPushDTO> lab;
     private List<ConceptPushDTO> pacs;
     private Map<String, List<ConceptPushDTO>> dis;
-    private Map<String, Object> treat;
     private String deptName;
     //private List<MedicalIndicationDTO> medicalIndications;
     //private List<EvaluationModuleMappingDTO> evaluationModule;

+ 4 - 1
aipt-service/src/main/java/com/diagbot/enums/ConceptTypeEnum.java

@@ -21,8 +21,11 @@ public enum  ConceptTypeEnum implements KeyedNamed {
     SIDE_EFFECTS(10, "不良反应"),
     Drug_Category_Small(11, "药品分类-小类"),
     LIS_TABLES(12,"化验公表项"),
+    DEPARTMENT(15,"科室"),
     Scale(21, "量表"),
-    Indication(22, "指标");
+    Indication(22, "指标"),
+    LisDetail(51, "化验明细");
+
 
 
     @Setter

+ 29 - 15
aipt-service/src/main/java/com/diagbot/enums/DisTypeEnum.java

@@ -1,35 +1,49 @@
 package com.diagbot.enums;
 
+import com.diagbot.core.KeyedNamed;
 import lombok.Setter;
 
 /**
- * 
- * @author zhoutg
- * @Description: 诊断类型
- * @date 2018年11月21日 下午2:31:42
+ * @Description: 推送类型
+ * @Author:zhaops
+ * @time: 2019/3/14 11:28
  */
-public enum DisTypeEnum  {
-    CHRONIC("慢病"),
-    EMERGENCY("急诊");
+public enum DisTypeEnum implements KeyedNamed {
+    CHRONIC(1, "慢病"),
+    EMERGENCY(2, "急诊");
 
     @Setter
-    private String typeName;
+    private Integer key;
 
-    DisTypeEnum(String typeName) {
-        this.typeName = typeName;
+    @Setter
+    private String name;
+
+    DisTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
     }
 
-    public static DisTypeEnum getEnum(String typeName) {
+    public static DisTypeEnum getEnum(Integer key) {
         for (DisTypeEnum item : DisTypeEnum.values()) {
-            if (item.typeName.equals(typeName)) {
+            if (item.key == key) {
                 return item;
             }
         }
         return null;
     }
 
-    public String getTypeName() {
-        return this.typeName;
+    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;
+    }
+}

+ 3 - 2
aipt-service/src/main/java/com/diagbot/facade/ClinicalFacade.java

@@ -86,8 +86,9 @@ public class ClinicalFacade {
                 lisres.setOtherValue(lisres.getDetailName() + Otherval);
             } else {
                 Otherval = (Otherval.trim().length() > 0) ? Otherval.trim() + "\n" : "";
-
-                if (lisres.getMaxValue() != null && lisres.getValue() > lisres.getMaxValue()) {
+                if (lisres.getValue() == null) {
+                    continue;
+                } else if (lisres.getMaxValue() != null && lisres.getValue() > lisres.getMaxValue()) {
                     lisres.setOtherValue(Otherval + lisres.getDetailName() + up);
                 } else if (lisres.getMinValue() != null && lisres.getValue() < lisres.getMinValue()) {
                     lisres.setOtherValue(Otherval + lisres.getDetailName() + down);

+ 54 - 0
aipt-service/src/main/java/com/diagbot/facade/ConceptDetailFacade.java

@@ -10,14 +10,19 @@ import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.ConceptDetailServiceImpl;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.ParamConvertUtil;
 import com.diagbot.util.StringUtil;
+import com.diagbot.vo.ConceptBaseVO;
 import com.diagbot.vo.ConceptIntroduceVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description:
@@ -63,6 +68,7 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
 
     /**
      * 获取静态知识明细
+     *
      * @param conceptIntroduceVO
      * @return
      */
@@ -79,4 +85,52 @@ public class ConceptDetailFacade extends ConceptDetailServiceImpl {
         List<ConceptDetail> conceptDetailList = this.list(conceptDetailQueryWrapper);
         return conceptDetailList;
     }
+
+    /**
+     * 是否存在提示信息
+     *
+     * @param conceptBaseVO
+     * @return
+     */
+    public Boolean exist(ConceptBaseVO conceptBaseVO) {
+        //验证存在并且获取概念基本信息
+        Concept concept = conceptFacade.exist(conceptBaseVO);
+        QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
+        conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("concept_id", concept.getId());
+        List<ConceptDetail> conceptDetailList = this.list(conceptDetailQueryWrapper);
+        if (ListUtil.isNotEmpty(conceptDetailList)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 是否存在提示信息-列表
+     *
+     * @param nameList
+     * @param libType
+     * @return
+     */
+    public Map<String, Concept> existList(List<String> nameList, Integer libType) {
+        List<Concept> concepts = conceptFacade.getListByNamesAndType(nameList, libType);
+        Map<String, Concept> retMap = new LinkedHashMap<>();
+        if (ListUtil.isNotEmpty(concepts)) {
+            List<Long> conceptIds = concepts.stream().map(concept -> concept.getId()).collect(Collectors.toList());
+            QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
+            conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .in("concept_id", conceptIds);
+            List<ConceptDetail> conceptDetailList = this.list(conceptDetailQueryWrapper);
+            if (ListUtil.isNotEmpty(conceptDetailList)) {
+                Map<Long, ConceptDetail> conceptDetailMap = EntityUtil.makeEntityMap(conceptDetailList, "conceptId");
+                for (Concept concept : concepts) {
+                    if (conceptDetailMap.containsKey(concept.getId()) && conceptDetailMap.get(concept.getId()) != null) {
+                        retMap.put(concept.getLibName(), concept);
+                    }
+                }
+            }
+        }
+        return retMap;
+    }
 }

+ 50 - 5
aipt-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -13,14 +13,20 @@ import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.ConceptServiceImpl;
+import com.diagbot.util.IntegerUtil;
+import com.diagbot.util.ListUtil;
 import com.diagbot.util.ParamConvertUtil;
 import com.diagbot.vo.ConceptBaseVO;
+import com.diagbot.vo.ConceptSearchVO;
 import com.diagbot.vo.ConceptUsualVO;
 import com.diagbot.vo.RetrievalVO;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description:
@@ -48,13 +54,52 @@ public class ConceptFacade extends ConceptServiceImpl {
         return concept;
     }
 
+    /**
+     * 根据概念Id列表获取概念列表Map
+     *
+     * @param conceptSearchVO 搜索参数
+     * @return 术语id和术语 Map
+     */
+    public Map<Long, String> getConceptMap(ConceptSearchVO conceptSearchVO) {
+        //入参验证
+        if (ListUtil.isEmpty(conceptSearchVO.getConceptIds())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "术语列表不能为空");
+        }
+
+        //获取结构
+        List<Concept> concepts
+                = this.getListByIds(conceptSearchVO.getConceptIds());
+
+        //出参封装
+        Map<Long, String> map = new HashMap<>();
+        if (ListUtil.isNotEmpty(concepts)) {
+            map = concepts.stream().collect(Collectors.toMap(r -> r.getId(), r -> r.getLibName()));
+        }
+        return map;
+    }
+
+    /**
+     * 根据概念Id列表获取概念列表
+     *
+     * @param ids
+     * @return
+     */
+    public List<Concept> getListByIds(List<Long> ids) {
+        QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
+        conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .in("id", ids);
+        List<Concept> list = this.list(conceptQueryWrapper);
+        return list;
+    }
+
     /**
      * 根据名称和词性获取概念列表
+     *
      * @param nameList
      * @param libType
      * @return
      */
-    public List<Concept> getListByNamesAndType(List<String> nameList,Integer libType) {
+    public List<Concept> getListByNamesAndType(List<String> nameList, Integer libType) {
         QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
         conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .in("lib_name", nameList)
@@ -69,7 +114,7 @@ public class ConceptFacade extends ConceptServiceImpl {
      * @param conceptUsualVO
      * @return
      */
-    public List<ConceptBaseDTO> getConceptUsual(ConceptUsualVO conceptUsualVO){
+    public List<ConceptBaseDTO> getConceptUsual(ConceptUsualVO conceptUsualVO) {
         //入参验证
         List<Integer> inputTyps = new ArrayList<>();
         inputTyps.add(ConceptTypeEnum.Symptom.getKey());
@@ -77,8 +122,8 @@ public class ConceptFacade extends ConceptServiceImpl {
         inputTyps.add(ConceptTypeEnum.Lis.getKey());
         inputTyps.add(ConceptTypeEnum.Pacs.getKey());
 
-        if (!inputTyps.contains(conceptUsualVO.getType())){
-            throw new CommonException(CommonErrorCode.NOT_EXISTS,"超出范围");
+        if (!inputTyps.contains(conceptUsualVO.getType())) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "超出范围");
         }
 
         //获取标签内容
@@ -94,7 +139,7 @@ public class ConceptFacade extends ConceptServiceImpl {
         List<ConceptBaseDTO> list = new ArrayList();
         //封装
         ConceptBaseDTO conceptBaseDTO = new ConceptBaseDTO();
-        for (ConceptWithOrderRes conceptWithOrderRes: concepts) {
+        for (ConceptWithOrderRes conceptWithOrderRes : concepts) {
             conceptBaseDTO = new ConceptBaseDTO();
             conceptBaseDTO.setConceptId(conceptWithOrderRes.getEndId());
             conceptBaseDTO.setName(conceptWithOrderRes.getEndName());

+ 36 - 4
aipt-service/src/main/java/com/diagbot/facade/DisTypeFacade.java

@@ -3,6 +3,7 @@ package com.diagbot.facade;
 import com.diagbot.dto.ConceptRes;
 import com.diagbot.dto.DisDTO;
 import com.diagbot.dto.DisTypeDTO;
+import com.diagbot.entity.Concept;
 import com.diagbot.entity.wrapper.ConceptWrapper;
 import com.diagbot.enums.DisTypeEnum;
 import com.diagbot.enums.LexiconRSTypeEnum;
@@ -10,6 +11,8 @@ import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.service.impl.DisTypeServiceImpl;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
+import com.diagbot.vo.ConceptBaseVO;
+import com.diagbot.vo.DisTypeVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -54,11 +57,11 @@ public class DisTypeFacade extends DisTypeServiceImpl {
         }
         Map<String, List<DisDTO>> map = EntityUtil.makeEntityListMap(data, "typeName");
         if (map != null) {
-            List<DisDTO> chr = map.get(DisTypeEnum.CHRONIC.getTypeName()); //放入慢病列表
+            List<DisDTO> chr = map.get(DisTypeEnum.CHRONIC.getName()); //放入慢病列表
             if (ListUtil.isNotEmpty(chr)) {
                 res.setChronic(chr);
             }
-            List<DisDTO> eme = map.get(DisTypeEnum.EMERGENCY.getTypeName()); //放入急诊列表
+            List<DisDTO> eme = map.get(DisTypeEnum.EMERGENCY.getName()); //放入急诊列表
             if (ListUtil.isNotEmpty(eme)) {
                 res.setEmergency(eme);
             }
@@ -66,5 +69,34 @@ public class DisTypeFacade extends DisTypeServiceImpl {
         return res;
     }
 
-
-}
+    /**
+     * 诊断类型验证
+     *
+     * @param disTypeVO
+     * @return
+     */
+    public Boolean verifyDisType(DisTypeVO disTypeVO) {
+        ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
+        conceptBaseVO.setName(disTypeVO.getName());
+        conceptBaseVO.setLibType(LexiconTypeEnum.DIAGNOSIS.getKey());
+        Concept disease = conceptFacade.exist(conceptBaseVO);
+        String disTypeName = DisTypeEnum.getName(disTypeVO.getDisType());
+        conceptBaseVO.setName(disTypeName);
+        conceptBaseVO.setLibType(LexiconTypeEnum.TYPES_OF_DISEASE.getKey());
+        Concept disTypeConcept = conceptFacade.exist(conceptBaseVO);
+        ConceptWrapper conceptWrapper = new ConceptWrapper();
+        conceptWrapper.setStartId(disease.getId());
+        conceptWrapper.setStartName(disease.getLibName());
+        conceptWrapper.setStartType(LexiconTypeEnum.DIAGNOSIS.getKey());
+        conceptWrapper.setEndId(disTypeConcept.getId());
+        conceptWrapper.setEndName(disTypeName);
+        conceptWrapper.setEndType(LexiconTypeEnum.TYPES_OF_DISEASE.getKey());
+        conceptWrapper.setRelationType(LexiconRSTypeEnum.BELONG_TO.getKey());
+        List<ConceptRes> conceptResList = conceptFacade.getConcept(conceptWrapper);
+        if (ListUtil.isNotEmpty(conceptResList)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+}

+ 50 - 0
aipt-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -0,0 +1,50 @@
+package com.diagbot.facade;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import com.diagbot.client.TranServiceClient;
+import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.Concept;
+import com.diagbot.enums.LexiconTypeEnum;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.vo.ConceptBaseVO;
+import com.diagbot.vo.GetTopPatientInfoVO;
+
+/**
+ * @Description: 患者业务逻辑
+ * @author: wangyu
+ * @time: 2018/11/19 13:19
+ */
+@Component
+public class PatientInfoFacade {
+
+	@Autowired
+    private ConceptFacade conceptFacade;
+    @Autowired
+    TranServiceClient tranServiceClient;
+
+    /**
+     * 页面顶部病人医生科室信息查询
+     *
+     * @param getTopPatientInfoVO
+     * @return
+     */
+    public GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
+        RespDTO<GetTopPatientInfoDTO> respDTO = tranServiceClient.getTopPatientInfo(getTopPatientInfoVO);
+        RespDTOUtil.respNGDealCover(respDTO, "获取页面顶部病人医生科室信息失败");
+
+        GetTopPatientInfoDTO getTopPatientInfoDTO = respDTO.data;
+        
+        ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
+        conceptBaseVO.setLibType(LexiconTypeEnum.DEPARTMENT.getKey());
+        conceptBaseVO.setName(getTopPatientInfoDTO.getSelfDeptName());
+        Concept concept = conceptFacade.exist(conceptBaseVO);
+        getTopPatientInfoDTO.setSelfDeptId(concept.getId());
+        
+        return getTopPatientInfoDTO;
+    }
+
+}

+ 31 - 35
aipt-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -2,25 +2,20 @@ package com.diagbot.facade;
 
 import com.alibaba.fastjson.JSONObject;
 import com.diagbot.client.TranServiceClient;
-import com.diagbot.client.bean.Feature;
 import com.diagbot.client.bean.FeatureRate;
 import com.diagbot.client.bean.GdbResponse;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.client.bean.SearchData;
 import com.diagbot.dto.ConceptPushDTO;
 import com.diagbot.dto.PushDTO;
-import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.Concept;
-import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.enums.FeatureTypeEnum;
 import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
-import com.diagbot.util.DateUtil;
 import com.diagbot.util.FastJsonUtils;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.ParamConvertUtil;
-import com.diagbot.util.RespDTOUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.SearchVo;
 import com.google.common.collect.Lists;
@@ -48,6 +43,8 @@ public class PushFacade {
     @Autowired
     private ConceptFacade conceptFacade;
     @Autowired
+    private TreatmentFacade treatmentFacade;
+    @Autowired
     private TranServiceClient tranServiceClient;
 
     /**
@@ -56,7 +53,7 @@ public class PushFacade {
      * @param searchVo
      * @return ResponseData
      */
-    public void pushInner(SearchVo searchVo) {
+    public PushDTO pushInner(SearchVo searchVo) {
         PushDTO pushDTO = new PushDTO();
         ResponseData data = clinicalFacade.processClinicalData(searchVo);
 
@@ -88,9 +85,8 @@ public class PushFacade {
             List<FeatureRate> symptom = data.getSymptom();
             if (ListUtil.isNotEmpty(symptom)) {
                 List<String> nameList = symptom.stream().map(featureRate -> featureRate.getFeatureName()).collect(Collectors.toList());
-                List<Concept> concepts = conceptFacade.getListByNamesAndType(nameList, ParamConvertUtil.conceptConvert2Lib(ConceptTypeEnum.Symptom.getKey()));
-                if (ListUtil.isNotEmpty(concepts)) {
-                    pushDTO.setSymptom(getConceptDTOList(concepts, LexiconTypeEnum.SYMPTOM.getKey()));
+                if (ListUtil.isNotEmpty(nameList)) {
+                    pushDTO.setSymptom(getConceptDTOList(nameList, LexiconTypeEnum.SYMPTOM.getKey()));
                 }
             }
         }
@@ -99,9 +95,8 @@ public class PushFacade {
             List<FeatureRate> vital = data.getVitals();
             if (ListUtil.isNotEmpty(vital)) {
                 List<String> nameList = vital.stream().map(featureRate -> featureRate.getFeatureName()).collect(Collectors.toList());
-                List<Concept> concepts = conceptFacade.getListByNamesAndType(nameList, ParamConvertUtil.conceptConvert2Lib(ConceptTypeEnum.Vital.getKey()));
-                if (ListUtil.isNotEmpty(concepts)) {
-                    pushDTO.setVital(getConceptDTOList(concepts, LexiconTypeEnum.VITAL_INDEX.getKey()));
+                if (ListUtil.isNotEmpty(nameList)) {
+                    pushDTO.setVital(getConceptDTOList(nameList, LexiconTypeEnum.VITAL_INDEX.getKey()));
                 }
             }
         }
@@ -110,9 +105,8 @@ public class PushFacade {
             List<FeatureRate> lis = data.getLabs();
             if (ListUtil.isNotEmpty(lis)) {
                 List<String> nameList = lis.stream().map(featureRate -> featureRate.getFeatureName()).collect(Collectors.toList());
-                List<Concept> concepts = conceptFacade.getListByNamesAndType(nameList, LexiconTypeEnum.LIS_TABLES.getKey());
-                if (ListUtil.isNotEmpty(concepts)) {
-                    pushDTO.setLab(getConceptDTOList(concepts, LexiconTypeEnum.LIS_TABLES.getKey()));
+                if (ListUtil.isNotEmpty(nameList)) {
+                    pushDTO.setLab(getConceptDTOList(nameList, LexiconTypeEnum.LIS_TABLES.getKey()));
                 }
             }
         }
@@ -121,14 +115,13 @@ public class PushFacade {
             List<FeatureRate> pacs = data.getPacs();
             if (ListUtil.isNotEmpty(pacs)) {
                 List<String> nameList = pacs.stream().map(featureRate -> featureRate.getFeatureName()).collect(Collectors.toList());
-                List<Concept> concepts = conceptFacade.getListByNamesAndType(nameList, ParamConvertUtil.conceptConvert2Lib(ConceptTypeEnum.Pacs.getKey()));
-                if (ListUtil.isNotEmpty(concepts)) {
-                    pushDTO.setPacs(getConceptDTOList(concepts, LexiconTypeEnum.PACS_ITEMS.getKey()));
+                if (ListUtil.isNotEmpty(nameList)) {
+                    pushDTO.setPacs(getConceptDTOList(nameList, LexiconTypeEnum.PACS_ITEMS.getKey()));
                 }
             }
         }
         //诊断 map
-        if(featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Disease.getKey()))){
+        if (featureTypeSet.contains(String.valueOf(FeatureTypeEnum.Feature_Type_Disease.getKey()))) {
             if (ListUtil.isNotEmpty(dis)) {
                 List<String> nameList = dis.stream().map(featureRate -> featureRate.getFeatureName()).collect(Collectors.toList());
                 Map<String, List<ConceptPushDTO>> disMapDTO = new LinkedHashMap<>();
@@ -139,7 +132,7 @@ public class PushFacade {
                 SearchData searchData = new SearchData();
                 searchData.setDiag(String.join(",", nameList));
                 GdbResponse graphRes = clinicalFacade.highRiskPageData(searchVo);
-                if (graphRes!=null) {
+                if (graphRes != null) {
                     Map<String, String> graphResult = graphRes.getResult();
                     if (graphResult.size() > 0) {
                         List<String> hrNameList = Lists.newLinkedList();
@@ -148,9 +141,8 @@ public class PushFacade {
                                 hrNameList.add(entry.getKey());
                             }
                         }
-                        List<Concept> concepts = conceptFacade.getListByNamesAndType(hrNameList, ParamConvertUtil.conceptConvert2Lib(ConceptTypeEnum.Disease.getKey()));
-                        if (ListUtil.isNotEmpty(concepts)) {
-                            List<ConceptPushDTO> hrDisDTO = getConceptDTOList(concepts, LexiconTypeEnum.PACS_ITEMS.getKey());
+                        if (ListUtil.isNotEmpty(hrNameList)) {
+                            List<ConceptPushDTO> hrDisDTO = getConceptDTOList(hrNameList, LexiconTypeEnum.DIAGNOSIS.getKey());
                             disMapDTO.put("警惕", hrDisDTO);
                         }
                     }
@@ -172,38 +164,42 @@ public class PushFacade {
                 }
                 for (Map.Entry<String, List<FeatureRate>> entry : disFeatureMap.entrySet()) {
                     List<String> nameListByDisClass = entry.getValue().stream().map(featureRate -> featureRate.getFeatureName()).collect(Collectors.toList());
-                    List<Concept> concepts = conceptFacade.getListByNamesAndType(nameListByDisClass, ParamConvertUtil.conceptConvert2Lib(ConceptTypeEnum.Disease.getKey()));
-                    if (ListUtil.isNotEmpty(concepts)) {
-                        List<ConceptPushDTO> disDTO = getConceptDTOList(concepts, LexiconTypeEnum.PACS_ITEMS.getKey());
+                    if (ListUtil.isNotEmpty(nameListByDisClass)) {
+                        List<ConceptPushDTO> disDTO = getConceptDTOList(nameListByDisClass, LexiconTypeEnum.DIAGNOSIS.getKey());
                         disMapDTO.put(entry.getKey(), disDTO);
                     }
                 }
                 pushDTO.setDis(disMapDTO);
             }
-
         }
-
+        return pushDTO;
     }
 
-    public Map<String, Object>  getTreatment(SearchVo searchVo) {
-        Map<String, Object> treatDTO = new LinkedHashMap<>();
+    /**
+     * 获取治疗方案
+     *
+     * @param searchVo
+     * @return
+     */
+    public Map<String, Object> getTreatment(SearchVo searchVo) {
         ResponseData data = clinicalFacade.processClinicalData(searchVo);
         Map<String, JSONObject> treat = data.getTreat();
         if (StringUtil.isBlank(searchVo.getDiseaseName())) {
             throw new CommonException(CommonErrorCode.PARAM_ERROR, "请输入需获取治疗方案的诊断名称");
         }
-        //Map<String, Object> treatmentMap = treatmentFacade.getTreatment(treat, pushVO.getDiseaseId(), pushVO.getPatientId());
-        return treatDTO;
+        Map<String, Object> treatmentMap = treatmentFacade.getTreatment(treat, searchVo.getDiseaseName(), searchVo.getDisType());
+        return treatmentMap;
     }
 
     /**
-     * 概念转成返回格式
+     * 推理返回概念
      *
-     * @param concepts
+     * @param nameList
      * @param libType
      * @return
      */
-    public List<ConceptPushDTO> getConceptDTOList(List<Concept> concepts, Integer libType) {
+    public List<ConceptPushDTO> getConceptDTOList(List<String> nameList, Integer libType) {
+        List<Concept> concepts = conceptFacade.getListByNamesAndType(nameList, libType);
         List<ConceptPushDTO> conceptDTOS = Lists.newLinkedList();
         if (ListUtil.isNotEmpty(concepts)) {
             for (Concept concept : concepts) {

+ 13 - 0
aipt-service/src/main/java/com/diagbot/facade/RelationFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/5/9 13:39
+ */
+@Component
+public class RelationFacade {
+
+}

+ 119 - 14
aipt-service/src/main/java/com/diagbot/facade/TreatmentFacade.java

@@ -2,14 +2,24 @@ package com.diagbot.facade;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.bean.AdverseReaction;
+import com.diagbot.client.bean.Medicition;
+import com.diagbot.client.bean.MedicitionClass;
 import com.diagbot.dto.ConceptDetailDTO;
+import com.diagbot.dto.ConceptRes;
 import com.diagbot.entity.Concept;
 import com.diagbot.entity.ConceptDetail;
+import com.diagbot.entity.wrapper.ConceptWrapper;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.DisTypeEnum;
 import com.diagbot.enums.IntroducePositionEnum;
+import com.diagbot.enums.LexiconRSTypeEnum;
 import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 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.vo.ConceptBaseVO;
 import com.diagbot.vo.ConceptIntroduceVO;
@@ -17,8 +27,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.LinkedHashMap;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * @Description:治疗方案业务处理
@@ -32,24 +44,23 @@ public class TreatmentFacade {
     @Autowired
     ConceptDetailFacade conceptDetailFacade;
 
-
     /**
      * 获取治疗方案
      *
      * @param
      * @return
      */
-    public Map<String, Object> getTreatment(Map<String, JSONObject> treatmentMap, String diseaseName) {
+    public Map<String, Object> getTreatment(Map<String, JSONObject> treatmentMap, String diseaseName, Integer disType) {
         Map<String, Object> retMap = new LinkedHashMap<>();
-        QueryWrapper<Concept> conceptQueryWrapper=new QueryWrapper<>();
-        ConceptBaseVO conceptBaseVO=new ConceptBaseVO();
+        QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
+        ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
         conceptBaseVO.setName(diseaseName);
         conceptBaseVO.setLibType(LexiconTypeEnum.DIAGNOSIS.getKey());
-        Concept disease =conceptFacade.exist(conceptBaseVO);
+        Concept disease = conceptFacade.exist(conceptBaseVO);
         if (disease == null) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "诊断不存在");
         }
-        if (treatmentMap==null||treatmentMap.size() == 0) {
+        if (treatmentMap == null || treatmentMap.size() == 0) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "未找到治疗方案");
         }
         if (!treatmentMap.containsKey(diseaseName)) {
@@ -57,25 +68,29 @@ public class TreatmentFacade {
         }
 
         //一般治疗
-        ConceptIntroduceVO conceptIntroduceVO=new ConceptIntroduceVO();
+        ConceptIntroduceVO conceptIntroduceVO = new ConceptIntroduceVO();
         conceptIntroduceVO.setName(diseaseName);
         conceptIntroduceVO.setLibType(LexiconTypeEnum.DIAGNOSIS.getKey());
         conceptIntroduceVO.setPosition(IntroducePositionEnum.CommonTreatment.getKey());
-        List<ConceptDetail> commonTreatmentDetailList=conceptDetailFacade.getConceptDetailList(conceptIntroduceVO);
-        ConceptDetailDTO commonDetailDTO=new ConceptDetailDTO();
+        List<ConceptDetail> commonTreatmentDetailList = conceptDetailFacade.getConceptDetailList(conceptIntroduceVO);
         if (ListUtil.isNotEmpty(commonTreatmentDetailList)) {
+            ConceptDetailDTO commonDetailDTO = new ConceptDetailDTO();
             BeanUtil.copyProperties(commonTreatmentDetailList.get(0), commonDetailDTO);
+            retMap.put("commonTreatment", commonDetailDTO);
+        } else {
+            retMap.put("commonTreatment", null);
         }
-        retMap.put("commonTreatment", commonDetailDTO);
 
         //手术治疗
         conceptIntroduceVO.setPosition(IntroducePositionEnum.SurgeryTreatment.getKey());
         List<ConceptDetail> surgeryTreatmentDetailList = conceptDetailFacade.getConceptDetailList(conceptIntroduceVO);
-        ConceptDetailDTO surgeryDetailDTO = new ConceptDetailDTO();
         if (ListUtil.isNotEmpty(surgeryTreatmentDetailList)) {
+            ConceptDetailDTO surgeryDetailDTO = new ConceptDetailDTO();
             BeanUtil.copyProperties(surgeryTreatmentDetailList.get(0), surgeryDetailDTO);
+            retMap.put("surgeryTreatment", surgeryDetailDTO);
+        } else {
+            retMap.put("surgeryTreatment", null);
         }
-        retMap.put("surgeryTreatment", surgeryDetailDTO);
 
 
         //获取知识图谱治疗方案
@@ -84,8 +99,98 @@ public class TreatmentFacade {
             return retMap;
         }
 
+        List<MedicitionClass> drugsList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "treatment", MedicitionClass.class);
+        List<String> cateBigNameList = drugsList.stream().map(drugs -> drugs.getBigdrugsName()).collect(Collectors.toList());
+        List<Concept> cateBigConceptList = conceptFacade.getListByNamesAndType(cateBigNameList, LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey());
+        Map<String, Concept> cateBigConceptMap = EntityUtil.makeEntityMap(cateBigConceptList, "libName");
+        List<String> cateSmallNameList = drugsList.stream().map(drugs -> drugs.getSubdrugsName()).collect(Collectors.toList());
+        List<Concept> cateSmallConceptList = conceptFacade.getListByNamesAndType(cateSmallNameList, LexiconTypeEnum.DRUG_CATEGORY_SMALL.getKey());
+        Map<String, Concept> cateSmallConceptMap = EntityUtil.makeEntityMap(cateSmallConceptList, "libName");
+
+        for (MedicitionClass medicitionClass : drugsList) {
+            Concept cateBigConcept = cateBigConceptMap.get(medicitionClass.getBigdrugsName());
+            if (cateBigConcept != null) {
+                medicitionClass.setBigdrugsConceptId(cateBigConcept.getId());
+            }
+            medicitionClass.setBigdrgusLibType(ConceptTypeEnum.Drug_Category_Big.getKey());
+            Concept cateSmallConcept = cateSmallConceptMap.get(medicitionClass.getSubdrugsName());
+            if (cateSmallConcept != null) {
+                medicitionClass.setSubdrugsConceptId(cateSmallConcept.getId());
+            }
+            medicitionClass.setSubdrugsLibType(ConceptTypeEnum.Drug_Category_Small.getKey());
+
+            if (cateBigConcept != null) {
+                conceptBaseVO.setLibType(LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey());
+                conceptBaseVO.setName(cateBigConcept.getLibName());
+                if (conceptDetailFacade.exist(conceptBaseVO)) {
+                    medicitionClass.setShowInfo("1");
+                } else {
+                    medicitionClass.setShowInfo("0");
+                }
+            }
+            LinkedList<Medicition> medicitionList = medicitionClass.getMedicitionsList();
+            List<String> drugNameList = medicitionList.stream().map(medicition -> medicition.getMedicitionName()).collect(Collectors.toList());
+            List<Concept> drugList = conceptFacade.getListByNamesAndType(drugNameList, LexiconTypeEnum.DRUGS.getKey());
+            Map<String, Concept> drugMap = EntityUtil.makeEntityMap(drugList, "libName");
+            Map<String, Concept> drugDetailMap = conceptDetailFacade.existList(drugNameList, LexiconTypeEnum.DRUGS.getKey());
+            for (Medicition medicition : medicitionList) {
+                Concept drugConcept = drugMap.get(medicition.getMedicitionName());
+                if (drugConcept != null) {
+                    medicition.setConceptId(drugConcept.getId());
+                }
+                medicition.setLibType(ConceptTypeEnum.Drug.getKey());
+                if (drugDetailMap != null && drugDetailMap.containsKey(medicition.getMedicitionName())) {
+                    medicition.setShowInfo("1");
+                } else {
+                    medicition.setShowInfo("0");
+                }
+            }
+            medicitionClass.setMedicitionsList(medicitionList);
+        }
+        retMap.put("treatment", drugsList);
 
+        //判断是否慢病,慢病增加回访时间,上次用药,不良反应
+        if (disType.equals(DisTypeEnum.CHRONIC.getKey())) {
+            //验证是否慢病
+            conceptBaseVO.setName("慢病");
+            conceptBaseVO.setLibType(LexiconTypeEnum.TYPES_OF_DISEASE.getKey());
+            Concept chronicConcept = conceptFacade.exist(conceptBaseVO);
+            ConceptWrapper conceptWrapper = new ConceptWrapper();
+            conceptWrapper.setStartId(disease.getId());
+            conceptWrapper.setStartName(diseaseName);
+            conceptWrapper.setStartType(LexiconTypeEnum.DIAGNOSIS.getKey());
+            conceptWrapper.setEndId(chronicConcept.getId());
+            conceptWrapper.setEndName(chronicConcept.getLibName());
+            conceptWrapper.setEndType(LexiconTypeEnum.TYPES_OF_DISEASE.getKey());
+            conceptWrapper.setRelationType(LexiconRSTypeEnum.BELONG_TO.getKey());
+            List<ConceptRes> conceptResList = conceptFacade.getConcept(conceptWrapper);
+            Boolean isChronic = ListUtil.isNotEmpty(conceptResList);
+            if (isChronic) {
+                //慢病,增加回访时间,暂时前端写死, 以后由只是图谱返回
+                retMap.put("followUp", null);
+                //上次用药-icss层处理
+                retMap.put("drugHistory", null);
+                //不良反应
+                List<AdverseReaction> adverseReactionList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "adverseEvent", AdverseReaction.class);
+                List<String> adNameList = adverseReactionList.stream().map(adverseReaction -> adverseReaction.getName()).collect(Collectors.toList());
+                List<Concept> adConceptList = conceptFacade.getListByNamesAndType(adNameList, LexiconTypeEnum.SIDE_EFFECTS.getKey());
+                Map<String, Concept> adConceptMap = EntityUtil.makeEntityMap(adConceptList, "libName");
+                Map<String, Concept> adConceptDetailMap = conceptDetailFacade.existList(adNameList, LexiconTypeEnum.SIDE_EFFECTS.getKey());
+                for (AdverseReaction adverseReaction : adverseReactionList) {
+                    Concept adConcept = adConceptMap.get(adverseReaction.getName());
+                    if (adConcept != null) {
+                        adverseReaction.setConceptId(adConcept.getId());
+                    }
+                    adverseReaction.setLibType(ConceptTypeEnum.SIDE_EFFECTS.getKey());
+                    if (adConceptDetailMap != null && adConceptDetailMap.containsKey(adverseReaction.getName())) {
+                        adverseReaction.setShowInfo("1");
+                    } else {
+                        adverseReaction.setShowInfo("0");
+                    }
+                }
+                retMap.put("adverseReactions", adverseReactionList);
+            }
+        }
         return retMap;
     }
-
-}
+}

+ 10 - 1
aipt-service/src/main/java/com/diagbot/util/ParamConvertUtil.java

@@ -2,7 +2,6 @@ package com.diagbot.util;
 
 import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.enums.LexiconTypeEnum;
-import org.apache.ibatis.javassist.compiler.Lex;
 
 /**
  * @Description:参数转换
@@ -60,6 +59,11 @@ public class ParamConvertUtil {
             case Indication:
                 libType = LexiconTypeEnum.CORE_INDICATORS.getKey();
                 break;
+            case LisDetail:
+                libType = LexiconTypeEnum.LIS_DETAILS.getKey();
+                break;
+            case DEPARTMENT:
+                libType = LexiconTypeEnum.DEPARTMENT.getKey();
             default:
                 break;
         }
@@ -114,6 +118,11 @@ public class ParamConvertUtil {
             case CORE_INDICATORS:
                 type = ConceptTypeEnum.Indication.getKey();
                 break;
+            case LIS_DETAILS:
+                type = ConceptTypeEnum.LisDetail.getKey();
+                break;
+            case DEPARTMENT:
+                type = ConceptTypeEnum.DEPARTMENT.getKey();
             default:
                 break;
         }

+ 18 - 0
aipt-service/src/main/java/com/diagbot/vo/ConceptSearchVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/5/6 18:50
+ */
+@Getter
+@Setter
+public class ConceptSearchVO {
+    //术语Id列表
+    private List<Long> conceptIds;
+}

+ 21 - 0
aipt-service/src/main/java/com/diagbot/vo/DisTypeVO.java

@@ -0,0 +1,21 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/5/9 16:11
+ */
+@Getter
+@Setter
+public class DisTypeVO {
+    @NotBlank(message = "请输入诊断名称")
+    private String name;
+    @NotNull(message = "请输入诊断类型")
+    private Integer disType;
+}

+ 56 - 0
aipt-service/src/main/java/com/diagbot/vo/GetTopPatientInfoVO.java

@@ -0,0 +1,56 @@
+package com.diagbot.vo;
+
+import javax.validation.constraints.NotBlank;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description
+ * @author rgb
+ * @time 2018年11月19日下午4:58:37
+ */
+@ApiModel(value="页面顶部病人医生科室信息查询接口传参")
+@Getter
+@Setter
+public class GetTopPatientInfoVO {
+	
+	/**
+	 * 医院编号
+	 */
+	@ApiModelProperty(value="医院编号",required=true)
+	@NotBlank(message="医院编号必填")
+	private String hospitalCode;
+	
+	/**
+	 * 医院科室编号
+	 */
+	@ApiModelProperty(value="医院科室编号",required=true)
+	@NotBlank(message="医院科室编号必填")
+	private String hospitalDeptCode;
+	
+	/**
+	 * 医院医生编号
+	 */
+	@ApiModelProperty(value="医院医生编号",required=true)
+	@NotBlank(message="医院医生编号必填")
+	private String doctorCode;
+	
+	/**
+	 * 医院患者编号
+	 */
+	@ApiModelProperty(value="医院患者编号",required=true)
+	@NotBlank(message="医院患者编号必填")
+	private String patientCode;
+	
+	/**
+	 * 门诊号
+	 */
+	@ApiModelProperty(value="门诊号",required=true)
+	@NotBlank(message="门诊号必填")
+	private String recordId;
+	
+
+}

+ 14 - 2
aipt-service/src/main/java/com/diagbot/web/ConceptController.java

@@ -4,10 +4,8 @@ package com.diagbot.web;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.ConceptBaseDTO;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.facade.ConceptFacade;
 import com.diagbot.vo.ConceptUsualVO;
-import com.diagbot.vo.RetrievalVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,6 +45,20 @@ public class ConceptController {
         return RespDTO.onSuc(data);
     }
 
+    /**
+     * 根据概念Id列表获取概念列表Map
+     *
+     * @param conceptSearchVO 搜索参数
+     * @return 术语id和术语 Map
+     */
+    @ApiOperation(value = "知识库标准化-根据概念Id列表获取概念列表Map[by:gaodm]",
+            notes = "conceptIds: 术语Id列表")
+    @PostMapping("/getConceptMap")
+    @SysLogger("getConceptMap")
+    public RespDTO<Map<String, Long>> getConceptMap(@RequestBody ConceptSearchVO conceptSearchVO){
+        return RespDTO.onSuc(conceptFacade.getConceptMap(conceptSearchVO));
+    }
+
     @ApiOperation(value = "知识库标准化-标签检索[by:wangyu]",
             notes = "type:类型(1:症状 3:其他史 4:查体,5:化验 6:辅检 7:诊断),必填<br>" +
                     "age:年龄,必填<br>" +

+ 12 - 0
aipt-service/src/main/java/com/diagbot/web/ConceptDetailController.java

@@ -5,7 +5,10 @@ import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.ConceptIntroduceDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.ConceptDetailFacade;
+import com.diagbot.util.ParamConvertUtil;
+import com.diagbot.vo.ConceptBaseVO;
 import com.diagbot.vo.ConceptIntroduceVO;
+import com.sun.org.apache.xpath.internal.operations.Bool;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,4 +42,13 @@ public class ConceptDetailController {
         ConceptIntroduceDTO data = conceptDetailFacade.getConceptDetail(conceptIntroduceVO);
         return RespDTO.onSuc(data);
     }
+
+    @ApiOperation(value = "知识库标准化-获取提示信息[by:zhaops]", notes = "")
+    @PostMapping("/exist")
+    @SysLogger("exist")
+    public RespDTO<Bool> exist(@Valid @RequestBody ConceptBaseVO conceptBaseVO) {
+        conceptBaseVO.setLibType(ParamConvertUtil.conceptConvert2Lib(conceptBaseVO.getLibType()));
+        Boolean data = conceptDetailFacade.exist(conceptBaseVO);
+        return RespDTO.onSuc(data);
+    }
 }

+ 13 - 0
aipt-service/src/main/java/com/diagbot/web/DisTypeController.java

@@ -4,13 +4,18 @@ package com.diagbot.web;
 import com.diagbot.dto.DisTypeDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.DisTypeFacade;
+import com.diagbot.vo.DisTypeVO;
+import com.sun.org.apache.xpath.internal.operations.Bool;
 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;
+
 /**
  * <p>
  * 诊断类型表 前端控制器
@@ -36,4 +41,12 @@ public class DisTypeController {
         DisTypeDTO data = disTypeFacade.getDisTypeFac();
         return RespDTO.onSuc(data);
     }
+
+    @ApiOperation(value = "知识化标准化-判断诊断类型[by:zhaops]",
+            notes = "")
+    @PostMapping("/verifyDisType")
+    public RespDTO<Boolean> verifyDisType(@Valid @RequestBody DisTypeVO disTypeVO) {
+        Boolean data = disTypeFacade.verifyDisType(disTypeVO);
+        return RespDTO.onSuc(data);
+    }
 }

+ 49 - 0
aipt-service/src/main/java/com/diagbot/web/PatientInfoController.java

@@ -0,0 +1,49 @@
+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.GetTopPatientInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.PatientInfoFacade;
+import com.diagbot.vo.GetTopPatientInfoVO;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import springfox.documentation.annotations.ApiIgnore;
+
+/**
+ * <p>
+ * 患者信息表 前端控制器
+ * </p>
+ *
+ * @author wangyu
+ * @since 2018-11-19
+ */
+@RestController
+@RequestMapping("/patientInfo")
+@Api(value = "患者信息API", tags = { "知识库标准化-患者信息API" })
+@SuppressWarnings("unchecked")
+@ApiIgnore
+public class PatientInfoController {
+    @Autowired
+    private PatientInfoFacade patientInfoFacade;
+
+    @ApiOperation(value = "知识库标准化-页面顶部病人医生科室信息——查询[by:rengb]",
+            notes = "hospitalCode:医院编号,必填<br>" +
+                    "hospitalDeptCode:医院科室编号,必填<br>" +
+                    "doctorCode:医院医生编号,必填<br>" +
+                    "patientCode:医院患者编号,必填<br>")
+    @PostMapping("/getTopPatientInfo")
+    @SysLogger("getTopPatientInfo")
+    public RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@Valid @RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
+        return RespDTO.onSuc(patientInfoFacade.getTopPatientInfo(getTopPatientInfoVO));
+    }
+
+}

+ 90 - 0
aipt-service/src/main/java/com/diagbot/web/PushController.java

@@ -0,0 +1,90 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.PushDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.PushFacade;
+import com.diagbot.vo.SearchVo;
+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.Map;
+
+/**
+ * @Description:推理
+ * @Author:zhaops
+ * @time: 2019/5/9 15:10
+ */
+@RestController
+@RequestMapping("/push")
+@Api(value = "推理相关API", tags = { "推理相关API" })
+@SuppressWarnings("unchecked")
+public class PushController {
+    @Autowired
+    private PushFacade pushFacade;
+
+    @ApiOperation(value = "治疗方案[by:zhaops]",
+            notes = "age: 年龄(必填)<br>" +
+                    "sex:性别(必填),M:男,F:女<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:数据来源(必填),Integer<br>" +
+                    "pacs:辅检,String<br>" +
+                    "diag:诊断,String<br>" +
+                    "featureType:类型(必填),8:治疗方案,String<br>" +
+                    "diseaeName:取治疗方案的诊断,String<br>" +
+                    "disType:诊断类型,1-慢病,2-急诊,普通病不填,Integer<br>" +
+                    "indications:指标结果,String<br>" +
+                    "adverseReactions:不良反应,List<不良反应明细><br>")
+    @PostMapping("/treatment")
+    @SysLogger("treatment")
+    public RespDTO<Map<String, Object>> getTreatment(@Valid @RequestBody SearchVo searchVo) {
+        Map<String, Object> data = pushFacade.getTreatment((searchVo));
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "推理接口[by:zhaops]",
+            notes = "age: 年龄(必填)<br>" +
+                    "sex:性别(必填),M:男,F:女<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:数据来源(必填),Integer<br>" +
+                    "pacs:辅检,String<br>" +
+                    "diag:诊断,String<br>" +
+                    "featureType:类型(必填),1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,22-指标,String<br>" +
+                    "disType:诊断类型,1-慢病,2-急诊,普通病不填,Integer<br>" +
+                    "indications:指标结果,String<br>" +
+                    "adverseReactions:不良反应,List<不良反应明细><br>")
+    @PostMapping("/pushInner")
+    @SysLogger("pushInner")
+    public RespDTO<PushDTO> pushInner(@Valid @RequestBody SearchVo searchVo) {
+        PushDTO data = pushFacade.pushInner(searchVo);
+        return RespDTO.onSuc(data);
+    }
+}

+ 65 - 0
common/src/main/java/com/diagbot/enums/ConceptTypeEnum.java

@@ -0,0 +1,65 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/5/7 14:06
+ */
+public enum  ConceptTypeEnum implements KeyedNamed {
+    Symptom(1, "症状"),
+    Past(2, "既往史"),
+    Other(3, "其他史"),
+    Vital(4, "查体"),
+    Lis(5, "化验"),
+    Pacs(6, "辅检"),
+    Disease(7, "诊断"),
+    Drug(8, "药品"),
+    Drug_Category_Big(9, "药品分类-大类"),
+    SIDE_EFFECTS(10, "不良反应"),
+    Drug_Category_Small(11, "药品分类-小类"),
+    LIS_TABLES(12,"化验公表项"),
+    DEPARTMENT(15,"科室"),
+    Scale(21, "量表"),
+    Indication(22, "指标"),
+    LisDetail(51, "化验明细");
+
+
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    ConceptTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static ConceptTypeEnum getEnum(Integer key) {
+        for (ConceptTypeEnum item : ConceptTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        ConceptTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 99 - 0
common/src/main/java/com/diagbot/enums/LexiconTypeEnum.java

@@ -0,0 +1,99 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description: 术语分类枚举
+ * @author: gaodm
+ * @time: 2019/5/6 13:58
+ */
+public enum LexiconTypeEnum implements KeyedNamed {
+    SYMPTOM(1,"症状"),
+    TIME(2,"时间"),
+    BODYPART(3,"部位"),
+    NATURE(4,"性质"),
+    CAUSE(5,"诱因"),
+    DEGREE(6,"程度"),
+    NEGATIVE(7,"阴性"),
+    POSITIVE(8,"阳性"),
+    COMPANY(9,"单位"),
+    DRUGS(10,"药品"),
+    TREATMENT(11,"治疗"),
+    LIS_PACKAGE(12,"化验套餐"),
+    LIS_DETAILS(13,"化验明细"),
+    LIS_RESULTS(14,"化验结果"),
+    PACS_PACKAGE(15,"辅检套餐"),
+    PACS_ITEMS(16,"辅检项目"),
+    PACS_RESULTS(17,"辅检结果"),
+    DIAGNOSIS(18,"诊断"),
+    CONNECTIVES(19,"连接词"),
+    POSITION(20,"方位"),
+    RELATIVES(21,"亲属"),
+    MARRIAGE(22,"婚姻"),
+    FOOD(23,"食品"),
+    HISTORY(24,"历史"),
+    OPERATION(25,"手术"),
+    SYMPTOM_MANIFESTATION(26,"症状表现"),
+    DIGITAL_QUANTIFIER(27,"数字量词"),
+    NUMBER(28,"数字"),
+    DRUG_CATEGORY_BIG(29,"药品大类"),
+    DRUG_CATEGORY_SMALL(30,"药品小类"),
+    PACS_CATEGORY_BIG(31,"辅检大类"),
+    PACS_CATEGORY_SMALL(32,"辅检小类"),
+    VITAL_INDEX(33,"体征指标"),
+    VITAL_INDEX_VALUE(34,"体征指标值"),
+    VITAL_RESULT(35,"体征结果"),
+    PLACE(36,"地点"),
+    OCCUPATION(37,"职业"),
+    PERSONAL_HISTORY(38,"个人史"),
+    PERSONAL_HISTORY_DESCRIPTION(39,"个人史描述"),
+    TIME_DESCRIPTION(40,"时间描述"),
+    SYMPTOM_INDEX(41,"症状指标"),
+    MEDICAL_SUPPLIES(42,"医用耗材 "),
+    DEGREE_CLASSIFIER(43,"程度量词"),
+    OTHER(44,"其他"),
+    DELETE(45,"删除"),
+    LIS_TABLES(46,"化验公表项"),
+    DEPARTMENT(47,"科室"),
+    GAUGE(48,"量表"),
+    SIDE_EFFECTS(49,"不良反应"),
+    CORE_INDICATORS(50,"核心指标"),
+    TYPES_OF_DISEASE(51,"疾病类型(慢病|急诊)");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    LexiconTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static LexiconTypeEnum getEnum(Integer key) {
+        for (LexiconTypeEnum item : LexiconTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        LexiconTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 14 - 0
common/src/main/java/com/diagbot/util/IntegerUtil.java

@@ -21,4 +21,18 @@ public class IntegerUtil {
         }
         return val;
     }
+
+    /**
+     * 判断Integer是否为空
+     *
+     * @param in
+     * @return
+     */
+    public static boolean isNull(Integer in) {
+        if (null == in) {
+            return Boolean.TRUE;
+        }
+        return Boolean.FALSE;
+    }
+
 }

+ 131 - 0
common/src/main/java/com/diagbot/util/ParamConvertUtil.java

@@ -0,0 +1,131 @@
+package com.diagbot.util;
+
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.LexiconTypeEnum;
+
+/**
+ * @Description:参数转换
+ * @Author:zhaops
+ * @time: 2019/5/7 9:44
+ */
+public class ParamConvertUtil {
+
+    /**
+     * 概念(标签)词性转术语词性
+     *
+     * @param type
+     * @return
+     */
+    public static Integer conceptConvert2Lib(Integer type) {
+        Integer libType = null;
+        switch (ConceptTypeEnum.getEnum(type)) {
+            case Symptom:
+                libType = LexiconTypeEnum.SYMPTOM.getKey();
+                break;
+            case Past:
+            case Other:
+                libType = LexiconTypeEnum.HISTORY.getKey();
+                break;
+            case Vital:
+                libType = LexiconTypeEnum.VITAL_INDEX.getKey();
+                break;
+            case Lis:
+                libType = LexiconTypeEnum.LIS_PACKAGE.getKey();
+                break;
+            case LIS_TABLES:
+                libType = LexiconTypeEnum.LIS_TABLES.getKey();
+                break;
+            case Pacs:
+                libType = LexiconTypeEnum.PACS_ITEMS.getKey();
+                break;
+            case Disease:
+                libType = LexiconTypeEnum.DIAGNOSIS.getKey();
+                break;
+            case Drug:
+                libType = LexiconTypeEnum.DRUGS.getKey();
+                break;
+            case SIDE_EFFECTS:
+                libType = LexiconTypeEnum.SIDE_EFFECTS.getKey();
+                break;
+            case Drug_Category_Big:
+                libType = LexiconTypeEnum.DRUG_CATEGORY_BIG.getKey();
+                break;
+            case Drug_Category_Small:
+                libType = LexiconTypeEnum.DRUG_CATEGORY_SMALL.getKey();
+                break;
+            case Scale:
+                libType = LexiconTypeEnum.GAUGE.getKey();
+                break;
+            case Indication:
+                libType = LexiconTypeEnum.CORE_INDICATORS.getKey();
+                break;
+            case LisDetail:
+                libType = LexiconTypeEnum.LIS_DETAILS.getKey();
+                break;
+            case DEPARTMENT:
+                libType = LexiconTypeEnum.DEPARTMENT.getKey();
+            default:
+                break;
+        }
+        return libType;
+    }
+
+    /**
+     * 术语词性转概念(标签)词性
+     *
+     * @param libType
+     * @return
+     */
+    public static Integer libConvert2Concept(Integer libType) {
+        Integer type = null;
+        switch (LexiconTypeEnum.getEnum(libType)) {
+            case SYMPTOM:
+                type = ConceptTypeEnum.Symptom.getKey();
+                break;
+            case HISTORY:
+                type = ConceptTypeEnum.Other.getKey();
+                break;
+            case VITAL_INDEX:
+                type = ConceptTypeEnum.Vital.getKey();
+                break;
+            case LIS_PACKAGE:
+                type = ConceptTypeEnum.Lis.getKey();
+                break;
+            case LIS_TABLES:
+                type = ConceptTypeEnum.LIS_TABLES.getKey();
+                break;
+            case PACS_ITEMS:
+                type = ConceptTypeEnum.Pacs.getKey();
+                break;
+            case DIAGNOSIS:
+                type = ConceptTypeEnum.Disease.getKey();
+                break;
+            case DRUGS:
+                type = ConceptTypeEnum.Drug.getKey();
+                break;
+            case SIDE_EFFECTS:
+                type = ConceptTypeEnum.SIDE_EFFECTS.getKey();
+                break;
+            case DRUG_CATEGORY_BIG:
+                type = ConceptTypeEnum.Drug_Category_Big.getKey();
+                break;
+            case DRUG_CATEGORY_SMALL:
+                type = ConceptTypeEnum.Drug_Category_Small.getKey();
+                break;
+            case GAUGE:
+                type = ConceptTypeEnum.Scale.getKey();
+                break;
+            case CORE_INDICATORS:
+                type = ConceptTypeEnum.Indication.getKey();
+                break;
+            case LIS_DETAILS:
+                type = ConceptTypeEnum.LisDetail.getKey();
+                break;
+            case DEPARTMENT:
+                type = ConceptTypeEnum.DEPARTMENT.getKey();
+            default:
+                break;
+        }
+        return type;
+    }
+}

+ 1 - 1
config-server/src/main/resources/shared/knowledgeman-service-dev.yml

@@ -7,7 +7,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.235:3306/diagbot-med?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      url: jdbc:mysql://192.168.2.235:3306/med-dev?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
       username: root
       password: diagbot@20180822
       # 连接池的配置信息

+ 1 - 1
config-server/src/main/resources/shared/knowledgeman-service-local.yml

@@ -7,7 +7,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.235:3306/diagbot-med?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
+      url: jdbc:mysql://192.168.2.235:3306/med-dev?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
       username: root
       password: diagbot@20180822
       # 连接池的配置信息

+ 83 - 1
icss-service/src/main/java/com/diagbot/client/AiptServiceClient.java

@@ -1,6 +1,8 @@
 package com.diagbot.client;
 
 import com.diagbot.client.bean.CalculateData;
+import com.diagbot.client.bean.ConceptBaseVO;
+import com.diagbot.client.bean.DisTypeVO;
 import com.diagbot.client.bean.GdbResponse;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.client.bean.SearchData;
@@ -11,13 +13,21 @@ import com.diagbot.dto.DeptInfoDTO;
 import com.diagbot.dto.DisScaleDTO;
 import com.diagbot.dto.DisTypeDTO;
 import com.diagbot.dto.DiseaseIcdDTO;
+import com.diagbot.dto.EvaluationDTO;
+import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.IndexConfigDTO;
+import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.ScaleContent;
 import com.diagbot.vo.ConceptIntroduceVO;
+import com.diagbot.vo.ConceptSearchVO;
 import com.diagbot.vo.ConceptUsualVO;
 import com.diagbot.vo.DeptInfoVO;
 import com.diagbot.vo.DisScaleVO;
+import com.diagbot.vo.EvaluationdiseaseNameVO;
 import com.diagbot.vo.GetDiseaseIcdVO;
+import com.diagbot.vo.GetTopPatientInfoVO;
+import com.diagbot.vo.IndexConfigdiseaseNameVO;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -75,4 +85,76 @@ public interface AiptServiceClient {
      */
     @PostMapping("/diseaseIcd/getDiseaseIcds")
     RespDTO<List<DiseaseIcdDTO>> getDiseaseIcds(@RequestBody GetDiseaseIcdVO getDiseaseIcdVO);
-}
+
+    /**
+     * 获取页面顶部病人医生科室信息
+     *
+     * @param getTopPatientInfoVO
+     * @return
+     */
+    @PostMapping("/patientInfo/getTopPatientInfo")
+    RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO);
+
+    /**
+     * 获取管理评估模板
+     *
+     * @param evaluationdiseaseNameVO
+     * @return
+     */
+    @PostMapping("/evaluation/getEvaluationModules")
+    RespDTO<List<EvaluationDTO>> getEvaluationModules(@RequestBody EvaluationdiseaseNameVO evaluationdiseaseNameVO);
+
+    /**
+     * 获取指标配置
+     *
+     * @param indexConfigdiseaseNameVO
+     * @return
+     */
+    @PostMapping("/indexConfig/getindexConfigs")
+    public RespDTO<List<IndexConfigDTO>> getindexConfigs(@RequestBody IndexConfigdiseaseNameVO indexConfigdiseaseNameVO);
+
+    /**
+     * 根据概念Id列表获取概念列表Map
+     *
+     * @param conceptSearchVO 搜索参数
+     * @return 术语id和术语 Map
+     */
+    @PostMapping("/concept/getConceptMap")
+    RespDTO<Map<Long, String>> getConceptMap(@RequestBody ConceptSearchVO conceptSearchVO);
+
+    /**
+     * 获取治疗方案
+     *
+     * @param searchData
+     * @return
+     */
+    @PostMapping("/push/treatment")
+    RespDTO<Map<String, Object>> getTreatment(@RequestBody SearchData searchData);
+
+    /**
+     * 推理
+     *
+     * @param searchData
+     * @return
+     */
+    @PostMapping("/push/pushInner")
+    RespDTO<PushDTO> pushInner(@RequestBody SearchData searchData);
+
+    /**
+     * 是否有提示信息
+     *
+     * @param conceptBaseVO
+     * @return
+     */
+    @PostMapping("/conceptDetail/exist")
+    RespDTO<Boolean> existConceptDetail(@Valid @RequestBody ConceptBaseVO conceptBaseVO);
+
+    /**
+     * 验证诊断类型
+     *
+     * @param disTypeVO
+     * @return
+     */
+    @PostMapping("/disType/verifyDisType")
+    RespDTO<Boolean> verifyDisType(@Valid @RequestBody DisTypeVO disTypeVO);
+}

+ 7 - 17
icss-service/src/main/java/com/diagbot/client/TranServiceClient.java

@@ -1,8 +1,14 @@
 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.GetTopPatientInfoDTO;
 import com.diagbot.dto.HospitalInfoDTO;
 import com.diagbot.dto.LisConfigDTO;
 import com.diagbot.dto.PatientInfoDTO;
@@ -12,19 +18,12 @@ import com.diagbot.entity.DoctorInfo;
 import com.diagbot.entity.HospitalDept;
 import com.diagbot.entity.PatientInfo;
 import com.diagbot.vo.DoctorInfoVO;
-import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.HosCodeVO;
 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: 调用信息对接层服务
@@ -88,15 +87,6 @@ public interface TranServiceClient {
     @PostMapping("/patientInfo/getPatientInfo")
     RespDTO<PatientInfoDTO> getPatientInfo(@RequestBody PatientInfoVO patientInfoVO);
 
-    /**
-     * 获取页面顶部病人医生科室信息
-     *
-     * @param getTopPatientInfoVO
-     * @return
-     */
-    @PostMapping("/patientInfo/getTopPatientInfo")
-    RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO);
-
     /**
      * 根据ids获取病人信息
      *

+ 21 - 0
icss-service/src/main/java/com/diagbot/client/bean/ConceptBaseVO.java

@@ -0,0 +1,21 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/5/6 18:50
+ */
+@Getter
+@Setter
+public class ConceptBaseVO {
+    @NotBlank(message = "概念名称不能为空")
+    private String name;
+    @NotNull(message = "词性不能为空")
+    private Integer libType;
+}

+ 21 - 0
icss-service/src/main/java/com/diagbot/client/bean/DisTypeVO.java

@@ -0,0 +1,21 @@
+package com.diagbot.client.bean;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/5/9 16:11
+ */
+@Getter
+@Setter
+public class DisTypeVO {
+    @NotBlank(message = "请输入诊断名称")
+    private String name;
+    @NotNull(message = "请输入诊断类型")
+    private Integer disType;
+}

+ 2 - 1
icss-service/src/main/java/com/diagbot/client/bean/Medicition.java

@@ -11,8 +11,9 @@ import lombok.Setter;
 @Getter
 @Setter
 public class Medicition {
-    private Long id;
+    private Long conceptId;
     private String medicitionName;
+    private Integer libType;
     /**
      * 1-显示,0-隐藏
      */

+ 16 - 40
icss-service/src/main/java/com/diagbot/client/bean/SearchData.java

@@ -4,10 +4,7 @@ import com.diagbot.vo.LisResult;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 /**
  * Created by fyeman on 2018/1/31.
@@ -15,46 +12,25 @@ import java.util.Map;
 @Getter
 @Setter
 public class SearchData {
-    private int length = 10;
-    private int age_start = 0;
-    private int age_end = 200;
-    private int age = 0;
+    private int length;
+    private int age;
     private String sex;
-    // 搜索结果的贝叶斯阈值
-    private String threshold = "0";
-
-    private String symptom = "";
-    private String vital = "";
-    private String lis = "";
-    private String pacs = "";
-    private String diag = "";
-    private String past = "";
-    private String other = "";
-    private List<LisResult> lisArr;
-    private Integer disType; //0-普通病(默认不填),1-慢病,2-急诊
-    private String scaleName;
-    private List<AdverseReaction> adverseEvent;
-    private String indications;
-
     //特征类别
     private String featureType;
-    //特征类别对","进行分割后数据
-    private String[] featureTypes;
-    //门诊 住院分类
-    private String resourceType;
-    //模型
-    private AlgorithmClassify algorithmClassify[];
-    //模型
-    private String algorithmClassifyValue;
     //外部系统编码 用于返回映射数据,如果sysCode为空或null,则返回kl_standard_info标准名称
     private String sysCode;
-
-    private Map<String, Map<String, String>> inputs = new HashMap<>(10, 0.8f);
-
-    private List<Feature> symptomFeatureList = new ArrayList<>();
-    private List<Feature> vitalFeatureList = new ArrayList<>();
-    private List<Feature> lisFeatureList = new ArrayList<>();
-    private List<Feature> pacsFeatureList = new ArrayList<>();
-    private List<Feature> diagFeatureList = new ArrayList<>();
-    private List<Feature> symptompropertyFeatureList = new ArrayList<>();
+    private String symptom;
+    private String past;
+    private String other;
+    private String vital;
+    private String lis;
+    private List<LisResult> lisArr;
+    private String pacs;
+    private String diag;
+    private String diseaseName; //指定诊断,例如取治疗方案
+    private String scaleName;   //量表名称
+    private String indications; //指标结果
+    private String adverseReactions; //不良反应
+    private Integer disType;    //诊断类型
+    private List<AdverseReaction> adverseEvent;
 }

+ 88 - 0
icss-service/src/main/java/com/diagbot/client/hystrix/AiptServiceHystrix.java

@@ -2,6 +2,8 @@ package com.diagbot.client.hystrix;
 
 import com.diagbot.client.AiptServiceClient;
 import com.diagbot.client.bean.CalculateData;
+import com.diagbot.client.bean.ConceptBaseVO;
+import com.diagbot.client.bean.DisTypeVO;
 import com.diagbot.client.bean.GdbResponse;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.client.bean.SearchData;
@@ -11,13 +13,21 @@ import com.diagbot.dto.DeptInfoDTO;
 import com.diagbot.dto.DisScaleDTO;
 import com.diagbot.dto.DisTypeDTO;
 import com.diagbot.dto.DiseaseIcdDTO;
+import com.diagbot.dto.EvaluationDTO;
+import com.diagbot.dto.GetTopPatientInfoDTO;
+import com.diagbot.dto.IndexConfigDTO;
+import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.ScaleContent;
 import com.diagbot.vo.ConceptIntroduceVO;
+import com.diagbot.vo.ConceptSearchVO;
 import com.diagbot.vo.ConceptUsualVO;
 import com.diagbot.vo.DeptInfoVO;
 import com.diagbot.vo.DisScaleVO;
+import com.diagbot.vo.EvaluationdiseaseNameVO;
 import com.diagbot.vo.GetDiseaseIcdVO;
+import com.diagbot.vo.GetTopPatientInfoVO;
+import com.diagbot.vo.IndexConfigdiseaseNameVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -113,4 +123,82 @@ public class AiptServiceHystrix implements AiptServiceClient {
         log.error("【hystrix】调用{}异常", "getDiseaseIcds");
         return null;
     }
+
+    @Override
+    public RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(GetTopPatientInfoVO getTopPatientInfoVO) {
+        log.error("【hystrix】调用{}异常", "getTopPatientInfo");
+        return null;
+    }
+
+    @Override
+    public RespDTO<List<EvaluationDTO>> getEvaluationModules(@Valid EvaluationdiseaseNameVO evaluationdiseaseNameVO) {
+        log.error("【hystrix】调用{}异常", "getEvaluationModules");
+        return null;
+    }
+
+    @Override
+    public RespDTO<List<IndexConfigDTO>> getindexConfigs(IndexConfigdiseaseNameVO indexConfigdiseaseNameVO) {
+        log.error("【hystrix】调用{}异常", "getindexConfigs");
+        return null;
+    }
+
+    /**
+     * 根据概念Id列表获取概念列表Map
+     *
+     * @param conceptSearchVO 搜索参数
+     * @return 术语id和术语 Map
+     */
+    @Override
+    public RespDTO<Map<Long, String>> getConceptMap(@RequestBody ConceptSearchVO conceptSearchVO) {
+        log.error("【hystrix】调用{}异常", "getConceptMap");
+        return null;
+    }
+
+    /**
+     * 获取治疗方案
+     *
+     * @param searchData
+     * @return
+     */
+    @Override
+    public RespDTO<Map<String, Object>> getTreatment(@RequestBody SearchData searchData) {
+        log.error("【hystrix】调用{}异常", "getTreatment");
+        return null;
+    }
+
+    /**
+     * 推理
+     *
+     * @param searchData
+     * @return
+     */
+    @Override
+    public RespDTO<PushDTO> pushInner(@RequestBody SearchData searchData) {
+        log.error("【hystrix】调用{}异常", "pushInner");
+        return null;
+    }
+
+    /**
+     * 是否有提示信息
+     *
+     * @param conceptBaseVO
+     * @return
+     */
+    @Override
+    public RespDTO<Boolean> existConceptDetail(@Valid @RequestBody ConceptBaseVO conceptBaseVO) {
+        log.error("【hystrix】调用{}异常", "existConceptDetail");
+        return null;
+    }
+
+    /**
+     * 验证诊断类型
+     *
+     * @param disTypeVO
+     * @return
+     */
+    @Override
+    public RespDTO<Boolean> verifyDisType(@Valid @RequestBody DisTypeVO disTypeVO) {
+        log.error("【hystrix】调用{}异常", "verifyDisType");
+        return null;
+    }
 }

+ 9 - 14
icss-service/src/main/java/com/diagbot/client/hystrix/TranServiceHystrix.java

@@ -1,8 +1,15 @@
 package com.diagbot.client.hystrix;
 
+import java.util.List;
+import java.util.Map;
+
+import javax.validation.Valid;
+
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestBody;
+
 import com.diagbot.client.TranServiceClient;
 import com.diagbot.dto.DoctorInfoDTO;
-import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.HospitalInfoDTO;
 import com.diagbot.dto.LisConfigDTO;
 import com.diagbot.dto.PatientInfoDTO;
@@ -12,20 +19,14 @@ import com.diagbot.entity.DoctorInfo;
 import com.diagbot.entity.HospitalDept;
 import com.diagbot.entity.PatientInfo;
 import com.diagbot.vo.DoctorInfoVO;
-import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.HosCodeVO;
 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;
-import java.util.Map;
+import lombok.extern.slf4j.Slf4j;
 
 /**
  * @Description: 调用信息对接层服务
@@ -71,12 +72,6 @@ public class TranServiceHystrix implements TranServiceClient {
         return null;
     }
 
-    @Override
-    public RespDTO<GetTopPatientInfoDTO> getTopPatientInfo(GetTopPatientInfoVO getTopPatientInfoVO) {
-        log.error("【hystrix】调用{}异常", "getTopPatientInfo");
-        return null;
-    }
-
     @Override
     public RespDTO<Map<Long, PatientInfo>> patientInfoMapByIds(List<Long> ids) {
         log.error("【hystrix】调用{}异常", "patientInfoMapByIds");

+ 22 - 0
icss-service/src/main/java/com/diagbot/dto/EvaluationDTO.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年5月6日 下午5:14:02
+ */
+@Getter
+@Setter
+public class EvaluationDTO {
+
+	private String diseaseName;// 对应术语疾病名
+	private Long conceptId;// 术语概念id
+	private String regionName; // 区域名
+	private String regionType; // 区域类型
+	private Integer orderNo; // 区域顺序
+	private Object data;
+}

+ 5 - 5
icss-service/src/main/java/com/diagbot/dto/PushDTO.java

@@ -1,13 +1,13 @@
 package com.diagbot.dto;
 
-import com.diagbot.client.bean.CalcResult;
+import java.util.List;
+import java.util.Map;
+
 import com.diagbot.entity.ScaleContent;
+
 import lombok.Getter;
 import lombok.Setter;
 
-import java.util.List;
-import java.util.Map;
-
 /**
  * @Description:
  * @Author:zhaops
@@ -26,5 +26,5 @@ public class PushDTO {
     private Map<String, Object> treat;
     private List<MedicalIndicationDTO> medicalIndications;
     private List<ScaleContent> scale;
-    private List<EvaluationModuleMappingDTO> evaluationModule;
+    private List<EvaluationDTO> evaluationModule;
 }

+ 0 - 164
icss-service/src/main/java/com/diagbot/entity/EvaluationModuleMapping.java

@@ -1,164 +0,0 @@
-package com.diagbot.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * <p>
- * 管理与评估模板表
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-@TableName("icss_evaluation_module_mapping")
-public class EvaluationModuleMapping implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private Long id;
-
-    /**
-     * 是否删除,N:未删除,Y:删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 区域名
-     */
-    private String regionName;
-
-    /**
-     * 区域类型
-     */
-    private String regionType;
-
-    /**
-     * 区域顺序
-     */
-    private Integer orderNo;
-
-    /**
-     * 疾病id
-     */
-    private Long diseaseId;
-
-    private String remark;
-
-    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 Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date 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 getRegionName() {
-        return regionName;
-    }
-
-    public void setRegionName(String regionName) {
-        this.regionName = regionName;
-    }
-    public String getRegionType() {
-        return regionType;
-    }
-
-    public void setRegionType(String regionType) {
-        this.regionType = regionType;
-    }
-    public Integer getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(Integer orderNo) {
-        this.orderNo = orderNo;
-    }
-    public Long getDiseaseId() {
-        return diseaseId;
-    }
-
-    public void setDiseaseId(Long diseaseId) {
-        this.diseaseId = diseaseId;
-    }
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    @Override
-    public String toString() {
-        return "EvaluationModuleMapping{" +
-        "id=" + id +
-        ", isDeleted=" + isDeleted +
-        ", gmtCreate=" + gmtCreate +
-        ", gmtModified=" + gmtModified +
-        ", creator=" + creator +
-        ", modifier=" + modifier +
-        ", regionName=" + regionName +
-        ", regionType=" + regionType +
-        ", orderNo=" + orderNo +
-        ", diseaseId=" + diseaseId +
-        ", remark=" + remark +
-        "}";
-    }
-}

+ 0 - 203
icss-service/src/main/java/com/diagbot/entity/IndexData.java

@@ -1,203 +0,0 @@
-package com.diagbot.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-
-/**
- * <p>
- * 指标数据表
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-@TableName("icss_index_data")
-public class IndexData implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private Long id;
-
-    /**
-     * 是否删除,N:未删除,Y:删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 指标公表名
-     */
-    private String indexUnique;
-
-    /**
-     * 指标值
-     */
-    private String indexValue;
-
-    /**
-     * 指标单位
-     */
-    private String indexUnit;
-
-    /**
-     * 是否异常
-     */
-    private Integer isAbnormal;
-
-    /**
-     * 化验时间
-     */
-    private Date creatTime;
-
-    /**
-     * 患者id
-     */
-    private Long patientId;
-
-    /**
-     * 就诊号
-     */
-    private String inquiryCode;
-
-    private String remark;
-
-    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 Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date 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 getIndexUnique() {
-        return indexUnique;
-    }
-
-    public void setIndexUnique(String indexUnique) {
-        this.indexUnique = indexUnique;
-    }
-    public String getIndexValue() {
-        return indexValue;
-    }
-
-    public void setIndexValue(String indexValue) {
-        this.indexValue = indexValue;
-    }
-    public String getIndexUnit() {
-        return indexUnit;
-    }
-
-    public void setIndexUnit(String indexUnit) {
-        this.indexUnit = indexUnit;
-    }
-    public Integer getIsAbnormal() {
-        return isAbnormal;
-    }
-
-    public void setIsAbnormal(Integer isAbnormal) {
-        this.isAbnormal = isAbnormal;
-    }
-    public Date getCreatTime() {
-        return creatTime;
-    }
-
-    public void setCreatTime(Date creatTime) {
-        this.creatTime = creatTime;
-    }
-    public Long getPatientId() {
-        return patientId;
-    }
-
-    public void setPatientId(Long patientId) {
-        this.patientId = patientId;
-    }
-    public String getInquiryCode() {
-        return inquiryCode;
-    }
-
-    public void setInquiryCode(String inquiryCode) {
-        this.inquiryCode = inquiryCode;
-    }
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    @Override
-    public String toString() {
-        return "IndexData{" +
-        "id=" + id +
-        ", isDeleted=" + isDeleted +
-        ", gmtCreate=" + gmtCreate +
-        ", gmtModified=" + gmtModified +
-        ", creator=" + creator +
-        ", modifier=" + modifier +
-        ", indexUnique=" + indexUnique +
-        ", indexValue=" + indexValue +
-        ", indexUnit=" + indexUnit +
-        ", isAbnormal=" + isAbnormal +
-        ", creatTime=" + creatTime +
-        ", patientId=" + patientId +
-        ", inquiryCode=" + inquiryCode +
-        ", remark=" + remark +
-        "}";
-    }
-}

+ 89 - 0
icss-service/src/main/java/com/diagbot/facade/AssembleFacade.java

@@ -0,0 +1,89 @@
+package com.diagbot.facade;
+
+import com.diagbot.client.bean.SearchData;
+import com.diagbot.enums.LisSourceEnum;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.LisResult;
+import com.diagbot.vo.LisResultVO;
+import com.diagbot.vo.PushVO;
+import net.bytebuddy.asm.Advice;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2019/5/9 15:40
+ */
+@Component
+public class AssembleFacade {
+    @Autowired
+    private LisMappingFacade lisMappingFacade;
+
+    /**
+     * 拼装数据
+     *
+     * @param pushVO
+     * @return SearchData
+     */
+    public SearchData assembleData(PushVO pushVO) {
+        SearchData searchData = new SearchData();
+        searchData.setAge(pushVO.getAge());
+        searchData.setSymptom(pushVO.getSymptom());
+        searchData.setVital(pushVO.getVital());
+        searchData.setPacs(pushVO.getPacs());
+        searchData.setPast(pushVO.getPast());
+        searchData.setOther(pushVO.getOther());
+        searchData.setDiag(pushVO.getDiag());
+        searchData.setDisType(pushVO.getDisType());
+        searchData.setAdverseEvent(pushVO.getAdverseReactions());
+        searchData.setScaleName(pushVO.getScaleName());
+        searchData.setDiseaseName(pushVO.getDiseaseName());
+        searchData.setIndications(pushVO.getIndications());
+        searchData.setFeatureType(pushVO.getFeatureType());
+        searchData.setSysCode("1");
+        searchData.setLength(10);
+
+        switch (pushVO.getSex()) {
+            case 1:
+                searchData.setSex("M");
+                break;
+            case 2:
+                searchData.setSex("F");
+                break;
+            default:
+                searchData.setSex("A");
+                break;
+        }
+
+        //化验项映射,转公表
+        if (ListUtil.isNotEmpty(pushVO.getLis())) {
+            Map<String, Map<String, String>> lisConfigMap = lisMappingFacade.getLisMapping_NotEmptyItemName();
+            Map<String, String> lisConfigWithEmptyItemNameMap = lisMappingFacade.getLisConfig_EmptyItemName();
+            for (LisResultVO lisResultVO : pushVO.getLis()) {
+                //source=0 icss页面数据,source=1 外部导入数据,外部导入数据不处理
+                if (!lisResultVO.getSource().equals(LisSourceEnum.Inner.getKey())) {
+                    continue;
+                }
+                if (StringUtil.isNotBlank(lisResultVO.getName())) {
+                    if (StringUtil.isNotBlank(lisResultVO.getDetailName())) {
+                        Map<String, String> detailMap = lisConfigMap.get(lisResultVO.getName());
+                        if (null != detailMap && detailMap.size() > 0 && StringUtil.isNotBlank(detailMap.get(lisResultVO.getDetailName()))) {
+                            lisResultVO.setUniqueName(detailMap.get(lisResultVO.getDetailName()));
+                        }
+                    } else {
+                        lisResultVO.setUniqueName(lisConfigWithEmptyItemNameMap.get(lisResultVO.getName()));
+                    }
+                }
+            }
+            List<LisResult> lisResultList = BeanUtil.listCopyTo(pushVO.getLis(), LisResult.class);
+            searchData.setLisArr(lisResultList);
+        }
+        return searchData;
+    }
+}

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

@@ -3,7 +3,6 @@ package com.diagbot.facade;
 import com.diagbot.client.AiptServiceClient;
 import com.diagbot.dto.DisScaleDTO;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.service.impl.DisScaleServiceImpl;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.DisScaleVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,7 +16,7 @@ import java.util.List;
  * @time: 2018/11/19 13:19
  */
 @Component
-public class DisScaleFacade extends DisScaleServiceImpl {
+public class DisScaleFacade {
 
     @Autowired
     AiptServiceClient aiptServiceClient;

+ 30 - 23
icss-service/src/main/java/com/diagbot/facade/EvaluationModuleMappingFacade.java

@@ -7,13 +7,15 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.diagbot.dto.EvaluationModuleMappingDTO;
-import com.diagbot.entity.EvaluationModuleMapping;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.service.impl.EvaluationModuleMappingServiceImpl;
+import com.diagbot.client.AiptServiceClient;
+import com.diagbot.dto.EvaluationDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.RespDTOUtil;
 import com.diagbot.vo.EvaluationDiseaseIdVO;
+import com.diagbot.vo.EvaluationdiseaseNameVO;
 
 /**
  * 
@@ -23,33 +25,40 @@ import com.diagbot.vo.EvaluationDiseaseIdVO;
  * @date 2019年3月11日 下午4:19:09
  */
 @Component
-public class EvaluationModuleMappingFacade extends EvaluationModuleMappingServiceImpl {
+public class EvaluationModuleMappingFacade  {
 
 	/*@Autowired
 	IndexConfigFacade indexConfigFacade;
 	*/
 	@Autowired
 	PushFacade pushFacade;
-
+	@Autowired 
+	AiptServiceClient aiptServiceClient;
 	/**
 	 * 获取管理与评估模板接口
 	 *
 	 * @param evaluationDiseaseIdVO
 	 * @return
 	 */
-	public List<EvaluationModuleMappingDTO> getEvaluationModule(EvaluationDiseaseIdVO evaluationDiseaseIdVO) {
-		//根据慢病id获取模板信息
+	public List<EvaluationDTO> getEvaluationModule(EvaluationDiseaseIdVO evaluationDiseaseIdVO) {
+/*		//根据慢病id获取模板信息
 		QueryWrapper<EvaluationModuleMapping> evaluationModuleQuery = new QueryWrapper<>();
 		evaluationModuleQuery.eq("disease_id", evaluationDiseaseIdVO.getDiseaseId()).eq("is_deleted",
 				IsDeleteEnum.N.getKey());
 
-		List<EvaluationModuleMapping> datas = list(evaluationModuleQuery);
+		List<EvaluationModuleMapping> datas = list(evaluationModuleQuery);*/
+		EvaluationdiseaseNameVO evaluationdiseaseNameVO =new EvaluationdiseaseNameVO();
+		//TODO 联调需修改
+		evaluationdiseaseNameVO.setDiseaseName("糖尿病");
+		RespDTO<List<EvaluationDTO>> evaluationList = aiptServiceClient.getEvaluationModules(evaluationdiseaseNameVO);
+		RespDTOUtil.respNGDeal(evaluationList, "获取管理与评估模板数据失败!");
+		List<EvaluationDTO> datas= evaluationList.data;
 		// 过滤
-		List<EvaluationModuleMappingDTO> data = BeanUtil.listCopyTo(datas, EvaluationModuleMappingDTO.class);
+		List<EvaluationDTO> data = BeanUtil.listCopyTo(datas, EvaluationDTO.class);
 		//获取大数据知识图谱推送数据
 		Map<String, JSONObject> jsonobject = pushFacade.getManagementEvaluationContent(evaluationDiseaseIdVO, null);
 		for (String key : jsonobject.keySet()) {
-			for (EvaluationModuleMappingDTO evaluadata : data) {
+			for (EvaluationDTO evaluadata : data) {
 				if (key.equals(evaluadata.getRegionName())) {
 					evaluadata.setData(jsonobject.get(key));
 
@@ -59,26 +68,24 @@ public class EvaluationModuleMappingFacade extends EvaluationModuleMappingServic
 		}
 		return data;
 	}
-
-	/**
+/*
+	*//**
 	 * 获取管理与评估模板接口
 	 *
 	 * @param diseaseId
 	 * @param contentMap
 	 * @return
 	 */
-	public List<EvaluationModuleMappingDTO> getEvaluationModule(Long diseaseId, Map<String, JSONObject> contentMap) {
-		//根据慢病id获取模板信息
-		QueryWrapper<EvaluationModuleMapping> evaluationModuleQuery = new QueryWrapper<>();
-		evaluationModuleQuery.eq("disease_id", diseaseId).eq("is_deleted",
-				IsDeleteEnum.N.getKey());
-
-		List<EvaluationModuleMapping> datas = list(evaluationModuleQuery);
+	public List<EvaluationDTO> getEvaluationModule(Long diseaseId, Map<String, JSONObject> contentMap) {
+		EvaluationdiseaseNameVO evaluationdiseaseNameVO =new EvaluationdiseaseNameVO();
+		evaluationdiseaseNameVO.setDiseaseName("糖尿病");
+		RespDTO<List<EvaluationDTO>> evaluationList = aiptServiceClient.getEvaluationModules(evaluationdiseaseNameVO);
+		List<EvaluationDTO> datas= evaluationList.data;
 		// 过滤
-		List<EvaluationModuleMappingDTO> data = BeanUtil.listCopyTo(datas, EvaluationModuleMappingDTO.class);
+		List<EvaluationDTO> data = BeanUtil.listCopyTo(datas, EvaluationDTO.class);
 		if (contentMap != null && contentMap.size() > 0) {
 			for (String key : contentMap.keySet()) {
-				for (EvaluationModuleMappingDTO evaluadata : data) {
+				for (EvaluationDTO evaluadata : data) {
 					if (key.equals(evaluadata.getRegionName())) {
 						evaluadata.setData(contentMap.get(key));
 					}

+ 13 - 20
icss-service/src/main/java/com/diagbot/facade/IndexConfigFacade.java

@@ -1,14 +1,14 @@
 package com.diagbot.facade;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.diagbot.dto.IndexConfigDTO;
-import com.diagbot.entity.IndexConfig;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.service.impl.IndexConfigServiceImpl;
-import com.diagbot.util.BeanUtil;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
+import com.diagbot.client.AiptServiceClient;
+import com.diagbot.dto.IndexConfigDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.vo.IndexConfigdiseaseNameVO;
 
 /**
  * @author wangfeng
@@ -16,26 +16,19 @@ import java.util.List;
  * @date 2019年3月11日 下午4:20:09
  */
 @Component
-public class IndexConfigFacade extends IndexConfigServiceImpl {
+public class IndexConfigFacade {
 
+	@Autowired 
+	AiptServiceClient aiptServiceClient;
     /**
      * 根据疾病Id获取指标配置
      *
      * @param diseaseId 疾病标签id
      * @return
      */
-    public List<IndexConfigDTO> getindexConfig(Long diseaseId) {
-        QueryWrapper<IndexConfig> IndexConfigQuery = new QueryWrapper<>();
-        if (null != diseaseId) {
-            IndexConfigQuery.eq("disease_id", diseaseId);
-        }
-
-        IndexConfigQuery.eq("is_deleted", IsDeleteEnum.N.getKey());
-        List<IndexConfig> datas = list(IndexConfigQuery);
-
-        //过滤
-        List<IndexConfigDTO> data = BeanUtil.listCopyTo(datas, IndexConfigDTO.class);
-        return data;
+    public RespDTO<List<IndexConfigDTO>> getindexConfig(IndexConfigdiseaseNameVO indexConfigdiseaseNameVO) {
+    	RespDTO<List<IndexConfigDTO>> indexConfigList = aiptServiceClient.getindexConfigs(indexConfigdiseaseNameVO);
+        return indexConfigList;
     }
 
 

+ 13 - 33
icss-service/src/main/java/com/diagbot/facade/IndexDataFacade.java

@@ -1,31 +1,11 @@
 package com.diagbot.facade;
 
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.diagbot.dto.IndexConfigAndDataDTO;
-import com.diagbot.dto.IndexConfigDTO;
-import com.diagbot.dto.IndexDataDTO;
-import com.diagbot.dto.ItemIndexDTO;
-import com.diagbot.entity.IndexData;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.impl.IndexDataServiceImpl;
-import com.diagbot.util.DateUtil;
-import com.diagbot.util.ListUtil;
-import com.diagbot.vo.IndexDataFindVO;
-import com.diagbot.vo.IndexDataSaveVO;
-import com.diagbot.vo.IndexDataVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
+import com.diagbot.dto.IndexConfigAndDataDTO;
+import com.diagbot.vo.IndexDataFindVO;
+import com.diagbot.vo.IndexDataSaveVO;
 
 /**
  * @author wangfeng
@@ -33,7 +13,7 @@ import java.util.stream.Collectors;
  * @date 2019年3月11日 下午4:20:33
  */
 @Component
-public class IndexDataFacade extends IndexDataServiceImpl {
+public class IndexDataFacade {
 
     @Autowired
     private IndexConfigFacade indexConfigFacade;
@@ -46,7 +26,7 @@ public class IndexDataFacade extends IndexDataServiceImpl {
      */
     public IndexConfigAndDataDTO getIndexDataAll(IndexDataFindVO indexDataFindVO) {
 
-        Map<String, Object> indexDataMap = new HashMap<>();
+      /*  Map<String, Object> indexDataMap = new HashMap<>();
         indexDataMap.put("diseaseId", indexDataFindVO.getDiseaseId());
         indexDataMap.put("patientId", indexDataFindVO.getPatientId());
         indexDataMap.put("startTime", indexDataFindVO.getStartTime());
@@ -81,8 +61,8 @@ public class IndexDataFacade extends IndexDataServiceImpl {
         }
         IndexConfigAndDataDTO indexsData = new IndexConfigAndDataDTO();
         indexsData.setIndexConfigData(indexConfigFacade.getindexConfig(indexDataFindVO.getDiseaseId()));
-        indexsData.setItemIndexData(list);
-        return indexsData;
+        indexsData.setItemIndexData(list);*/
+        return null;
     }
 
     /**
@@ -92,10 +72,11 @@ public class IndexDataFacade extends IndexDataServiceImpl {
      * @return
      */
     public boolean saveIndexDatas(IndexDataSaveVO indexDataSaveVO) {
-        boolean res = false;
+      /*  boolean res = false;
         if (null != indexDataSaveVO && ListUtil.isNotEmpty(indexDataSaveVO.getIndexData())) {
+        	IndexConfigdiseaseNameVO IndexConfigdiseaseNameVO = new IndexConfigdiseaseNameVO();
             //获取所有需要记录的指标项
-            List<IndexConfigDTO> data = indexConfigFacade.getindexConfig(null);
+           List<IndexConfigDTO> data = indexConfigFacade.getindexConfig(IndexConfigdiseaseNameVO);
             List<String> indexUniquelist
                     = data.stream().map(i -> i.getIndexUnique()).collect(Collectors.toList());
 
@@ -137,8 +118,7 @@ public class IndexDataFacade extends IndexDataServiceImpl {
                 res = insertIndexDataList(IndexDataList);
             }
 
-        }
-        return res;
+        }*/
+        return false;
+    }
     }
-
-}

+ 5 - 22
icss-service/src/main/java/com/diagbot/facade/PatientInfoFacade.java

@@ -8,8 +8,8 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.AiptServiceClient;
 import com.diagbot.client.TranServiceClient;
-import com.diagbot.dto.DeptInfoDTO;
 import com.diagbot.dto.GetTopPatientInfoDTO;
 import com.diagbot.dto.PatientInfoDTO;
 import com.diagbot.dto.RespDTO;
@@ -17,7 +17,6 @@ import com.diagbot.entity.DoctorPageMode;
 import com.diagbot.entity.PatientInfo;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.util.RespDTOUtil;
-import com.diagbot.vo.DeptInfoVO;
 import com.diagbot.vo.GetTopPatientInfoVO;
 import com.diagbot.vo.PatientInfoVO;
 
@@ -32,9 +31,9 @@ public class PatientInfoFacade {
     @Autowired
     private DoctorPageModeFacade doctorPageModeFacade;
     @Autowired
-    private DeptInfoFacade deptInfoFacade;
-    @Autowired
     TranServiceClient tranServiceClient;
+    @Autowired
+    private AiptServiceClient aiptServiceClient;
 
     /**
      * 获取患者信息
@@ -55,27 +54,11 @@ public class PatientInfoFacade {
      * @return
      */
     public GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
-        RespDTO<GetTopPatientInfoDTO> respDTO = tranServiceClient.getTopPatientInfo(getTopPatientInfoVO);
-        RespDTOUtil.respNGDealCover(respDTO, "页面顶部病人医生科室信息");
+        RespDTO<GetTopPatientInfoDTO> respDTO = aiptServiceClient.getTopPatientInfo(getTopPatientInfoVO);
+        RespDTOUtil.respNGDealCover(respDTO, "获取页面顶部病人医生科室信息失败");
 
         GetTopPatientInfoDTO getTopPatientInfoDTO = respDTO.data;
 
-//        QueryWrapper<DeptInfo> deptInfoQ = new QueryWrapper<>();
-//        deptInfoQ.eq("is_deleted", IsDeleteEnum.N.getKey())
-//                .eq("name", getTopPatientInfoDTO.getSelfDeptName());
-//        DeptInfo deptInfo = deptInfoFacade.getOne(deptInfoQ);
-//        if (null != deptInfo) {
-//            getTopPatientInfoDTO.setSelfDeptName(deptInfo.getName());
-//            getTopPatientInfoDTO.setSelfDeptId(deptInfo.getId());
-//        }
-        
-        DeptInfoVO deptInfoVO = new DeptInfoVO();
-        deptInfoVO.setHospitalCode(getTopPatientInfoVO.getHospitalCode());
-        deptInfoVO.setDeptCode(getTopPatientInfoVO.getHospitalDeptCode());
-        DeptInfoDTO deptInfoDTO = deptInfoFacade.getDeptInfo(deptInfoVO);
-        getTopPatientInfoDTO.setSelfDeptId(deptInfoDTO.getConceptId());
-        getTopPatientInfoDTO.setSelfDeptName(deptInfoDTO.getName());
-
         QueryWrapper<DoctorPageMode> doctorPageModeQe = new QueryWrapper<>();
         doctorPageModeQe.eq("is_deleted", IsDeleteEnum.N.getKey());
         doctorPageModeQe.eq("doctor_id", getTopPatientInfoDTO.getDoctorId());

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 52 - 136
icss-service/src/main/java/com/diagbot/facade/PushFacade.java


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

@@ -27,6 +27,8 @@ public class ScaleContentFacade extends ScaleContentServiceImpl {
     PushFacade pushFacade;
     @Autowired
     AiptServiceClient aiptServiceClient;
+    @Autowired
+    AssembleFacade assembleFacade;
 
     /**
      * 返回量表内容
@@ -34,7 +36,7 @@ public class ScaleContentFacade extends ScaleContentServiceImpl {
      * @return
      */
     public List<ScaleContent> getContent(PushVO pushVO) {
-        SearchData searchData = pushFacade.assembleData(pushVO);
+        SearchData searchData = assembleFacade.assembleData(pushVO);
         RespDTO<List<ScaleContent>> res = aiptServiceClient.getScale(searchData);
         RespDTOUtil.respNGDeal(res, "远程调用量表内容失败");
         return res.data;

+ 36 - 164
icss-service/src/main/java/com/diagbot/facade/TreatmentFacade.java

@@ -2,10 +2,14 @@ package com.diagbot.facade;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.AiptServiceClient;
 import com.diagbot.client.bean.AdverseReaction;
+import com.diagbot.client.bean.ConceptBaseVO;
+import com.diagbot.client.bean.DisTypeVO;
 import com.diagbot.client.bean.Medicition;
 import com.diagbot.client.bean.MedicitionClass;
 import com.diagbot.dto.IntroduceDetailDTO;
+import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.InquiryDrug;
 import com.diagbot.entity.InquiryInfo;
 import com.diagbot.entity.IntroduceDetail;
@@ -21,7 +25,9 @@ import com.diagbot.util.BeanUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.FastJsonUtils;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
 import com.google.common.collect.Lists;
+import com.sun.org.apache.xpath.internal.operations.Bool;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -50,6 +56,8 @@ public class TreatmentFacade {
     InquiryInfoFacade inquiryInfoFacade;
     @Autowired
     InquiryDrugFacade inquiryDrugFacade;
+    @Autowired
+    AiptServiceClient aiptServiceClient;
 
     /**
      * 获取治疗方案
@@ -57,169 +65,20 @@ public class TreatmentFacade {
      * @param
      * @return
      */
-    public Map<String, Object> getTreatment(Map<String, JSONObject> treatmentMap, Long diseaseId, Long patientId) {
-        Map<String, Object> retMap = new LinkedHashMap<>();
-        QuestionInfo disease = questionFacade.getById(diseaseId);
-        if (disease == null) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS, "诊断不存在");
-        }
-        if (treatmentMap.size() == 0) {
-            throw new CommonException(CommonErrorCode.NOT_EXISTS, "未找到治疗方案");
-        }
-        if (!treatmentMap.containsKey(disease.getTagName())) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "诊断名称和id不匹配");
-        }
-
-        //一般治疗
-        List<IntroduceDetail> commonTreatmentDetailList = getIntroduceDetailList(diseaseId, IntroducePositionEnum.CommonTreatment.getKey());
-        IntroduceDetailDTO commonDetailDTO = new IntroduceDetailDTO();
-        if (ListUtil.isNotEmpty(commonTreatmentDetailList)) {
-            BeanUtil.copyProperties(commonTreatmentDetailList.get(0), commonDetailDTO);
-        }
-        retMap.put("commonTreatment", commonDetailDTO);
-
-        //手术治疗
-        List<IntroduceDetail> surgeryTreatmentDetailList = getIntroduceDetailList(diseaseId, IntroducePositionEnum.SurgeryTreatment.getKey());
-        IntroduceDetailDTO surgeryDetailDTO = new IntroduceDetailDTO();
-        if (ListUtil.isNotEmpty(surgeryTreatmentDetailList)) {
-            BeanUtil.copyProperties(surgeryTreatmentDetailList.get(0), surgeryDetailDTO);
-        }
-        retMap.put("surgeryTreatment", surgeryDetailDTO);
-
-
-        //获取知识图谱治疗方案
-        JSONObject treatmentJson = treatmentMap.get(disease.getTagName());
-        if (treatmentJson == null || treatmentJson.isEmpty()) {
-            return retMap;
-        }
-
-        List<MedicitionClass> drugsList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "treatment", MedicitionClass.class);
-
-        List<String> classNameList = drugsList.stream().map(drugs -> drugs.getBigdrugsName()).collect(Collectors.toList());
-        List<QuestionInfo> drugClassList = getTopQuestionList(classNameList, QuestionTypeEnum.DrugClass.getKey());
-        Map<String, QuestionInfo> drugClassMap = EntityUtil.makeEntityMap(drugClassList, "tagName");
-        List<Long> drugClassIds = drugClassList.stream().map(drugClass -> drugClass.getId()).collect(Collectors.toList());
-        List<IntroduceMap> introduceMapList = getIntroduceMapList(drugClassIds, QuestionTypeEnum.DrugClass.getKey());
-        Map<Long, IntroduceMap> introduceMapMap = EntityUtil.makeEntityMap(introduceMapList, "questionId");
-
-        for (MedicitionClass medicitionClass : drugsList) {
-            QuestionInfo drugClass = drugClassMap.get(medicitionClass.getBigdrugsName());
-            if (drugClass != null) {
-                medicitionClass.setId(drugClass.getId());
-                if (introduceMapMap.get(drugClass.getId()) != null) {
-                    medicitionClass.setShowInfo("1");
-                }
-            }
-            LinkedList<Medicition> medicitionList = medicitionClass.getMedicitionsList();
-            List<String> drugNameList = medicitionList.stream().map(medicition -> medicition.getMedicitionName()).collect(Collectors.toList());
-            List<QuestionInfo> drugList = getTopQuestionList(drugNameList, QuestionTypeEnum.Drug.getKey());
-            Map<String, QuestionInfo> drugMap = EntityUtil.makeEntityMap(drugList, "tagName");
-            List<Long> drugIds = drugList.stream().map(drug -> drug.getId()).collect(Collectors.toList());
-            List<IntroduceMap> drugIntroduceMapList = getIntroduceMapList(drugIds, QuestionTypeEnum.Drug.getKey());
-            Map<Long, IntroduceMap> drugIntroduceMapMap = EntityUtil.makeEntityMap(drugIntroduceMapList, "questionId");
-            for (Medicition medicition : medicitionList) {
-                QuestionInfo drug = drugMap.get(medicition.getMedicitionName());
-                if (drug != null) {
-                    medicition.setId(drug.getId());
-                    if (drugIntroduceMapMap.get(drug.getId()) != null) {
-                        medicition.setShowInfo("1");
-                    }
-                }
-            }
-            medicitionClass.setMedicitionsList(medicitionList);
-        }
-
-        retMap.put("treatment", drugsList);
-
-        //判断是否慢病,慢病增加回访时间,上次用药,不良反应
-        Boolean isChronic = disTypeFacade.judgeByDisId(diseaseId, DisTypeEnum.CHRONIC.getKey());
-        if (isChronic) {
-            //慢病,增加回访时间,暂时前端写死, 以后由只是图谱返回
-            retMap.put("followUp", null);
-
+    public Map<String, Object> getTreatment(Map<String, Object> map, Long patientId) {
+        Map<String, Object> retMap = map;
+        //慢病 上次用药处理
+        if (map.containsKey("drugHistory")) {
             //上次用药
             if (patientId == null) {
                 retMap.put("drugHistory", null);
             } else {
                 retMap.put("drugHistory", getDrugHistory(patientId));
             }
-
-            //不良反应
-            List<AdverseReaction> adverseReactionList = FastJsonUtils.getJsonToListByKey(treatmentJson.toString(), "adverseEvent", AdverseReaction.class);
-            List<String> adNameList = adverseReactionList.stream().map(adverseReaction -> adverseReaction.getName()).collect(Collectors.toList());
-            List<QuestionInfo> adList = getTopQuestionList(adNameList, QuestionTypeEnum.AdverseReaction.getKey());
-            Map<String, QuestionInfo> adMap = EntityUtil.makeEntityMap(adList, "tagName");
-            List<Long> adIds = adList.stream().map(ad -> ad.getId()).collect(Collectors.toList());
-            List<IntroduceMap> adIntroduceMapList = getIntroduceMapList(adIds, QuestionTypeEnum.AdverseReaction.getKey());
-            Map<Long, IntroduceMap> adIntroduceMapMap = EntityUtil.makeEntityMap(adIntroduceMapList, "questionId");
-            for (AdverseReaction adverseReaction : adverseReactionList) {
-                adverseReaction.setTagName(adverseReaction.getName());
-                if (null != adMap && adMap.size() > 0) {
-                    QuestionInfo adInfo = adMap.get(adverseReaction.getName());
-                    if (adInfo != null) {
-                        adverseReaction.setId(adInfo.getId());
-                    }
-                    IntroduceMap adIntorduceMap = adIntroduceMapMap.get(adInfo.getId());
-                    if (adIntorduceMap != null) {
-                        adverseReaction.setShowInfo("1");
-                    }
-                }
-            }
-            retMap.put("adverseReactions", adverseReactionList);
         }
         return retMap;
     }
 
-    /**
-     * 根据展示位置获取提示信息明细列表
-     *
-     * @param diseaseId
-     * @param position
-     * @return
-     */
-    public List<IntroduceDetail> getIntroduceDetailList(Long diseaseId, Integer position) {
-        QueryWrapper<IntroduceDetail> introduceDetailQueryWrapper = new QueryWrapper<>();
-        String sql = "select introduce_id from icss_introduce_map where question_id=" + diseaseId + " and type=" + QuestionTypeEnum.Disease.getKey();
-        introduceDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .apply("find_in_set({0},position)", position)
-                .inSql("introduce_id", sql)
-                .orderByAsc("introduce_id", "order_no");
-        List<IntroduceDetail> introduceDetailList = introduceDetailFacade.list(introduceDetailQueryWrapper);
-        return introduceDetailList;
-    }
-
-    /**
-     * 获取顶级标签
-     *
-     * @param tagNameList
-     * @param type
-     * @return
-     */
-    public List<QuestionInfo> getTopQuestionList(List<String> tagNameList, Integer type) {
-        QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
-        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .in("tag_name", tagNameList)
-                //.eq("sub_type", 0)
-                .eq("type", type);
-        List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
-        return questionInfoList;
-    }
-
-    /**
-     * 获取标签提示信息映射
-     *
-     * @param questionIdList
-     * @param type
-     * @return
-     */
-    public List<IntroduceMap> getIntroduceMapList(List<Long> questionIdList, Integer type) {
-        QueryWrapper<IntroduceMap> introduceMapQueryWrapper = new QueryWrapper<>();
-        introduceMapQueryWrapper.in("question_id", questionIdList)
-                .eq("type", type)
-                .eq("is_deleted", IsDeleteEnum.N.getKey());
-        List<IntroduceMap> introduceMapList = introduceMapFacade.list(introduceMapQueryWrapper);
-        return introduceMapList;
-    }
 
     /**
      * 根据病人id获取历史用药内容
@@ -237,6 +96,10 @@ public class TreatmentFacade {
         Boolean chronicHistroy = false;
         Boolean not_chronicHistory = false;
         for (InquiryInfo inquiryInfo : inquiryInfoList) {
+            //慢病和普通病都取到上次用药之后不再遍历
+            if (chronicHistroy && not_chronicHistory) {
+                break;
+            }
             String[] diseases = inquiryInfo.getDiagnose().split(",|,");
             if (diseases.length > 0) {
                 QueryWrapper<InquiryDrug> inquiryDrugQueryWrapper = new QueryWrapper<>();
@@ -245,26 +108,35 @@ public class TreatmentFacade {
                 List<Medicition> medicitionList = Lists.newLinkedList();
                 for (InquiryDrug inquiryDrug : inquiryDrugList) {
                     Medicition medicition = new Medicition();
-                    medicition.setId(inquiryDrug.getConceptId());
+                    medicition.setConceptId(inquiryDrug.getConceptId());
                     medicition.setMedicitionName(inquiryDrug.getConceptName());
+                    medicition.setLibType(8);
                     medicition.setIsShow("1");
-                    Boolean hasIntroduce = introduceMapFacade.hasIntroduceByQuestionName(inquiryDrug.getConceptName(), QuestionTypeEnum.Drug.getKey());
-                    if (hasIntroduce) {
+                    ConceptBaseVO conceptBaseVO = new ConceptBaseVO();
+                    conceptBaseVO.setName(medicition.getMedicitionName());
+                    conceptBaseVO.setLibType(8);
+                    RespDTO<Boolean> res = aiptServiceClient.existConceptDetail(conceptBaseVO);
+                    if (RespDTOUtil.respIsOK(res) && res.data == true) {
                         medicition.setShowInfo("1");
                     } else {
                         medicition.setShowInfo("0");
                     }
                     medicitionList.add(medicition);
                 }
-                Boolean isChronic = disTypeFacade.judgeByDisName(diseases[0], DisTypeEnum.CHRONIC.getKey());
-                if (isChronic) {
-                    if (!chronicHistroy)
+
+                DisTypeVO disTypeVO = new DisTypeVO();
+                disTypeVO.setName(diseases[0]);
+                disTypeVO.setDisType(DisTypeEnum.CHRONIC.getKey());
+                RespDTO<Boolean> resDisType = aiptServiceClient.verifyDisType(disTypeVO);
+                if (RespDTOUtil.respIsOK(resDisType) && resDisType.data == true) {
+                    if (!chronicHistroy) {
                         drugHistoryMap.put("慢病用药内容", medicitionList);
-                    chronicHistroy = true;
-                } else {
-                    if (!not_chronicHistory) {
-                        drugHistoryMap.put("普通病用药内容", medicitionList);
-                        not_chronicHistory = true;
+                        chronicHistroy = true;
+                    } else {
+                        if (!not_chronicHistory) {
+                            drugHistoryMap.put("普通病用药内容", medicitionList);
+                            not_chronicHistory = true;
+                        }
                     }
                 }
             }

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

@@ -1,16 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.diagbot.entity.DisScale;
-
-/**
- * <p>
- * 诊断量表映射表 Mapper 接口
- * </p>
- *
- * @author zhoutg
- * @since 2019-03-11
- */
-public interface DisScaleMapper extends BaseMapper<DisScale> {
-
-}

+ 0 - 16
icss-service/src/main/java/com/diagbot/mapper/EvaluationModuleMappingMapper.java

@@ -1,16 +0,0 @@
-package com.diagbot.mapper;
-
-import com.diagbot.entity.EvaluationModuleMapping;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- * 管理与评估模板表 Mapper 接口
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-public interface EvaluationModuleMappingMapper extends BaseMapper<EvaluationModuleMapping> {
-
-}

+ 0 - 16
icss-service/src/main/java/com/diagbot/mapper/IndexConfigMapper.java

@@ -1,16 +0,0 @@
-package com.diagbot.mapper;
-
-import com.diagbot.entity.IndexConfig;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-public interface IndexConfigMapper extends BaseMapper<IndexConfig> {
-
-}

+ 0 - 26
icss-service/src/main/java/com/diagbot/mapper/IndexDataMapper.java

@@ -1,26 +0,0 @@
-package com.diagbot.mapper;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.ibatis.annotations.Param;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.diagbot.dto.IndexDataDTO;
-import com.diagbot.entity.IndexData;
-
-/**
- * <p>
- * 指标数据表 Mapper 接口
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-public interface IndexDataMapper extends BaseMapper<IndexData> {
-
-	List<IndexDataDTO> getIndexDataAll( @Param("indexDataMap") Map<String, Object> indexDataMap);
-
-	boolean insertIndexDataList(List<IndexData> indexDataList);
-
-}

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

@@ -1,16 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.DisScale;
-
-/**
- * <p>
- * 诊断量表映射表 服务类
- * </p>
- *
- * @author zhoutg
- * @since 2019-03-11
- */
-public interface DisScaleService extends IService<DisScale> {
-
-}

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

@@ -1,16 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.EvaluationModuleMapping;
-
-/**
- * <p>
- * 管理与评估模板表 服务类
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-public interface EvaluationModuleMappingService extends IService<EvaluationModuleMapping> {
-
-}

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

@@ -1,16 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.IndexConfig;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-public interface IndexConfigService extends IService<IndexConfig> {
-
-}

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

@@ -1,24 +0,0 @@
-package com.diagbot.service;
-
-import java.util.List;
-import java.util.Map;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.dto.IndexDataDTO;
-import com.diagbot.entity.IndexData;
-
-/**
- * <p>
- * 指标数据表 服务类
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-public interface IndexDataService extends IService<IndexData> {
-
-	List<IndexDataDTO> getIndexDataAll(Map<String, Object> indexDataMap);
-
-	boolean insertIndexDataList(List<IndexData> IndexDataList);
-
-}

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

@@ -1,20 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.entity.DisScale;
-import com.diagbot.mapper.DisScaleMapper;
-import com.diagbot.service.DisScaleService;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 诊断量表映射表 服务实现类
- * </p>
- *
- * @author zhoutg
- * @since 2019-03-11
- */
-@Service
-public class DisScaleServiceImpl extends ServiceImpl<DisScaleMapper, DisScale> implements DisScaleService {
-
-}

+ 0 - 20
icss-service/src/main/java/com/diagbot/service/impl/EvaluationModuleMappingServiceImpl.java

@@ -1,20 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.diagbot.entity.EvaluationModuleMapping;
-import com.diagbot.mapper.EvaluationModuleMappingMapper;
-import com.diagbot.service.EvaluationModuleMappingService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 管理与评估模板表 服务实现类
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-@Service
-public class EvaluationModuleMappingServiceImpl extends ServiceImpl<EvaluationModuleMappingMapper, EvaluationModuleMapping> implements EvaluationModuleMappingService {
-
-}

+ 0 - 20
icss-service/src/main/java/com/diagbot/service/impl/IndexConfigServiceImpl.java

@@ -1,20 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.diagbot.entity.IndexConfig;
-import com.diagbot.mapper.IndexConfigMapper;
-import com.diagbot.service.IndexConfigService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-@Service
-public class IndexConfigServiceImpl extends ServiceImpl<IndexConfigMapper, IndexConfig> implements IndexConfigService {
-
-}

+ 0 - 35
icss-service/src/main/java/com/diagbot/service/impl/IndexDataServiceImpl.java

@@ -1,35 +0,0 @@
-package com.diagbot.service.impl;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.stereotype.Service;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.dto.IndexDataDTO;
-import com.diagbot.entity.IndexData;
-import com.diagbot.mapper.IndexDataMapper;
-import com.diagbot.service.IndexDataService;
-
-/**
- * <p>
- * 指标数据表 服务实现类
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-@Service
-public class IndexDataServiceImpl extends ServiceImpl<IndexDataMapper, IndexData> implements IndexDataService {
-
-	@Override
-	public List<IndexDataDTO> getIndexDataAll(Map<String, Object> indexDataMap) {
-		return baseMapper.getIndexDataAll(indexDataMap);
-	}
-	
-	@Override
-	public boolean insertIndexDataList(List<IndexData> IndexDataList){
-		return baseMapper.insertIndexDataList(IndexDataList);
-	}
-
-}

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

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/5/6 18:50
+ */
+@Getter
+@Setter
+public class ConceptSearchVO {
+    //术语Id列表
+    private List<Long> conceptIds;
+}

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

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年5月6日 下午5:11:54
+ */
+@Setter
+@Getter
+public class EvaluationdiseaseNameVO {
+
+	private String diseaseName;
+	
+}

+ 16 - 0
icss-service/src/main/java/com/diagbot/vo/IndexConfigdiseaseNameVO.java

@@ -0,0 +1,16 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2019年5月6日 下午6:41:38
+ */
+@Setter
+@Getter
+public class IndexConfigdiseaseNameVO {
+	private String diseaseName;
+}

+ 2 - 2
icss-service/src/main/java/com/diagbot/vo/PushVO.java

@@ -15,10 +15,10 @@ import java.util.List;
 @Getter
 @Setter
 public class PushVO  extends PushBaseVO {
-    private Long diseaseId;
+    private String diseaseName;
     private Long patientId;   //病人id
     private String scaleName; //量表名称
-    private Long scaleId;     //量表id
+    //private Long scaleId;     //量表id
     private Integer disType;  //0-普通病(默认不填),1-慢病,2-急诊
     private List<AdverseReaction> adverseReactions; //不良反应
     private String indications;   //推理指标

+ 16 - 13
icss-service/src/main/java/com/diagbot/web/EvaluationModuleMappingController.java

@@ -1,20 +1,23 @@
 package com.diagbot.web;
 
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.EvaluationModuleMappingDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.facade.EvaluationModuleMappingFacade;
-import com.diagbot.vo.EvaluationDiseaseIdVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
+import java.util.List;
+
+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 javax.validation.Valid;
-import java.util.List;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.EvaluationDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.EvaluationModuleMappingFacade;
+import com.diagbot.vo.EvaluationDiseaseIdVO;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 
 /**
  * <p>
@@ -26,18 +29,18 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/evaluationModuleMapping")
-@Api(value = "管理与评估模板API[by:wangfeng]", tags = { "WF-2期-管理与评估模板API" })
+@Api(value = "知识库标准化-管理与评估模板API[by:wangfeng]", tags = { "知识库标准化-管理与评估模板API" })
 @SuppressWarnings("unchecked")
 public class EvaluationModuleMappingController {
 
     @Autowired
     EvaluationModuleMappingFacade evaluationModuleMappingFacade;
 
-    @ApiOperation(value = "2期-获取管理与评估模板[by:wangfeng]", notes = "获取管理与评估模板")
+    @ApiOperation(value = "知识库标准化-获取管理与评估模板[by:wangfeng]", notes = "获取管理与评估模板")
     @PostMapping("/getEvaluationModules")
     @SysLogger("getEvaluationModules")
-    public RespDTO<List<EvaluationModuleMappingDTO>> getEvaluationModules(@Valid @RequestBody EvaluationDiseaseIdVO evaluationDiseaseIdVO) {
-        List<EvaluationModuleMappingDTO> data = evaluationModuleMappingFacade.getEvaluationModule(evaluationDiseaseIdVO);
+    public RespDTO<List<EvaluationDTO>> getEvaluationModules(@Valid @RequestBody EvaluationDiseaseIdVO evaluationDiseaseIdVO) {
+        List<EvaluationDTO> data = evaluationModuleMappingFacade.getEvaluationModule(evaluationDiseaseIdVO);
         return RespDTO.onSuc(data);
     }
 

+ 14 - 13
icss-service/src/main/java/com/diagbot/web/IndexConfigController.java

@@ -1,22 +1,24 @@
 package com.diagbot.web;
 
 
+import java.util.List;
+
+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.IndexConfigDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.IndexConfigFacade;
-import com.diagbot.vo.IndexConfigDiseaseIdVO;
+import com.diagbot.vo.IndexConfigdiseaseNameVO;
+
 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 springfox.documentation.annotations.ApiIgnore;
 
-import java.util.List;
-
 /**
  * <p>
  * 前端控制器
@@ -29,17 +31,16 @@ import java.util.List;
 @RequestMapping("/indexConfig")
 @Api(value = "指标配置API[by:wangfeng]", tags = { "知识库标准化-指标配置API" })
 @SuppressWarnings("unchecked")
-@ApiIgnore
 public class IndexConfigController {
 
     @Autowired
     IndexConfigFacade indexConfigFacade;
 
-    @ApiOperation(value = "知识库标准化-根据疾病Id获取指标配置[by:wangfeng]", notes = "根据疾病Id获取指标配置")
+    @ApiOperation(value = "知识库标准化-根据疾病获取指标配置[by:wangfeng]", notes = "根据疾病获取指标配置")
     @PostMapping("/getindexConfigs")
     @SysLogger("getindexConfigs")
-    public RespDTO<List<IndexConfigDTO>> getindexConfigs(@RequestBody IndexConfigDiseaseIdVO indexConfigDiseaseIdVO) {
-        List<IndexConfigDTO> data = indexConfigFacade.getindexConfig(indexConfigDiseaseIdVO.getDiseaseId());
-        return RespDTO.onSuc(data);
+    public RespDTO<List<IndexConfigDTO>> getindexConfigs(@RequestBody IndexConfigdiseaseNameVO indexConfigdiseaseNameVO) {
+    	return indexConfigFacade.getindexConfig(indexConfigdiseaseNameVO);
+         
     }
 }

+ 35 - 22
icss-service/src/main/java/com/diagbot/web/PushController.java

@@ -1,6 +1,5 @@
 package com.diagbot.web;
 
-import com.alibaba.fastjson.JSONObject;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.client.bean.ResponseData;
 import com.diagbot.client.bean.SearchData;
@@ -8,10 +7,10 @@ import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.PushKYJDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.enums.InputModeEnum;
+import com.diagbot.facade.AssembleFacade;
 import com.diagbot.facade.PushFacade;
 import com.diagbot.vo.PushKYJVO;
 import com.diagbot.vo.PushVO;
-import com.google.common.collect.Lists;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,10 +18,8 @@ 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 springfox.documentation.annotations.ApiIgnore;
 
 import javax.validation.Valid;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -38,6 +35,8 @@ public class PushController {
 
     @Autowired
     PushFacade pushFacade;
+    @Autowired
+    AssembleFacade assembleFacade;
 
     @ApiOperation(value = "知识库标准化-推理接口(半结构化)[by:zhaops]",
             notes = "age: 年龄(必填)<br>" +
@@ -57,7 +56,7 @@ public class PushController {
                     "lis:source:数据来源(必填),Integer<br>" +
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
-                    "featureType:类型(必填),1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案,11-管理评估,21-量表内容,22-指标,String<br>" +
+                    "featureType:类型(必填),1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,11-管理评估,21-量表内容,22-指标,String<br>" +
                     "diseaeId:取治疗方案的诊断,Long<br>" +
                     "scaleName:量表名称,String<br>" +
                     "scaleId:量表id,Long<br>" +
@@ -71,6 +70,36 @@ public class PushController {
         return RespDTO.onSuc(pushFacade.pushInner(pushVO, InputModeEnum.Structured.getKey()));
     }
 
+    @ApiOperation(value = "知识库标准化-治疗方案[by:zhaops]",
+            notes = "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:数据来源(必填),Integer<br>" +
+                    "pacs:辅检,String<br>" +
+                    "diag:诊断,String<br>" +
+                    "featureType:类型(必填),8:治疗方案,String<br>" +
+                    "diseaeName:取治疗方案的诊断,Long<br>" +
+                    "patientId:病人id,Long<br>" +
+                    "disType:诊断类型,1-慢病,2-急诊,普通病不填,Integer<br>" +
+                    "indications:指标结果,String<br>" +
+                    "adverseReactions:不良反应,List<不良反应明细><br>")
+    @PostMapping("/pushTreatment")
+    @SysLogger("pushTreatment")
+    public RespDTO<Map<String,Object>> pushTreatment(@RequestBody @Valid PushVO pushVO) {
+        return RespDTO.onSuc(pushFacade.pushTreatment(pushVO));
+    }
+
     @ApiOperation(value = "推理接口(文本模式)[by:zhaops]",
             notes = "age: 年龄(必填)<br>" +
                     "sex:性别(必填),1:男,2:女<br>" +
@@ -126,7 +155,7 @@ public class PushController {
     @PostMapping("/pushAI")
     @SysLogger("pushAI")
     public RespDTO<ResponseData> pushAI(@RequestBody @Valid PushVO pushVO) {
-        SearchData searchData = pushFacade.assembleData(pushVO);
+        SearchData searchData = assembleFacade.assembleData(pushVO);
         return RespDTO.onSuc(pushFacade.pushAipt(searchData));
     }
 
@@ -140,20 +169,4 @@ public class PushController {
     public RespDTO<PushKYJDTO> pushKYJ(@RequestBody @Valid PushKYJVO pushKYJVO) {
         return RespDTO.onSuc(pushFacade.pushKYJ(pushKYJVO));
     }
-
-    @PostMapping("/getScaleContent")
-    @SysLogger("getScaleContent")
-    @ApiIgnore
-    public RespDTO<String> getScaleContent(@RequestBody @Valid PushVO pushVO) {
-        return RespDTO.onSuc(pushFacade.getScaleContent(pushVO));
-    }
-
-    @PostMapping("/getManagementEvaluationContent")
-    @SysLogger("getManagementEvaluationContent")
-    @ApiIgnore
-    public RespDTO<Map<String, JSONObject>> getManagementEvaluationContent(@RequestBody @Valid PushVO pushVO) {
-        List<String> titles = Lists.newLinkedList();
-        titles.add("疗效评估");
-        return RespDTO.onSuc(pushFacade.getManagementEvaluationContent(pushVO, titles));
-    }
 }

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

@@ -1,19 +0,0 @@
-<?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>
-
-</mapper>

+ 0 - 20
icss-service/src/main/resources/mapper/IndexConfigMapper.xml

@@ -1,20 +0,0 @@
-<?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.IndexConfigMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.IndexConfig">
-        <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="index_unique" property="indexUnique" />
-        <result column="disease_id" property="diseaseId" />
-        <result column="index_desc" property="indexDesc" />
-        <result column="order_no" property="orderNo" />
-        <result column="remark" property="remark" />
-    </resultMap>
-
-</mapper>

+ 0 - 75
icss-service/src/main/resources/mapper/IndexDataMapper.xml

@@ -1,75 +0,0 @@
-<?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.IndexDataMapper">
-
-	<!-- 通用查询映射结果 -->
-	<resultMap id="BaseResultMap" type="com.diagbot.entity.IndexData">
-		<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="index_unique" property="indexUnique" />
-		<result column="index_value" property="indexValue" />
-		<result column="index_unit" property="indexUnit" />
-		<result column="is_abnormal" property="isAbnormal" />
-		<result column="creat_time" property="creatTime" />
-		<result column="patient_id" property="patientId" />
-		<result column="inquiry_code" property="inquiryCode" />
-		<result column="remark" property="remark" />
-	</resultMap>
-
-	<select id="getIndexDataAll" resultType="com.diagbot.dto.IndexDataDTO">
-		SELECT
-		a.id as id,
-		a.index_unique as indexUnique,
-		a.index_value as
-		indexValue,
-		a.index_unit as indexUnit,
-		b.index_desc as indexDesc,
-		a.is_abnormal as isAbnormal,
-		a.creat_time as creatTime,
-		a.patient_id as patientId,
-		a.inquiry_code as
-		inquiryCode
-		FROM
-		icss_index_data a
-		JOIN icss_index_config b
-		WHERE
-		a.is_deleted = "N"
-		AND b.is_deleted = "N"
-		AND b.index_unique =
-		a.index_unique
-		<if test="indexDataMap.diseaseId != null">
-			AND b.disease_id = #{indexDataMap.diseaseId}
-		</if>
-		<if test="indexDataMap.startTime != null and indexDataMap.endTime != null">
-			AND a.creat_time BETWEEN #{indexDataMap.startTime} AND
-			#{indexDataMap.endTime}
-		</if>
-		AND a.patient_id = #{indexDataMap.patientId}
-
-	</select>
-	<insert id="insertIndexDataList" parameterType="java.util.List">
-		insert into icss_index_data
-		(gmt_create , creator ,
-		index_unique,index_value,index_unit,is_abnormal,creat_time,patient_id,inquiry_code
-		)
-		values
-		<foreach collection="list" item="IndexDataList" index="index"
-			separator=",">
-			(
-			#{IndexDataList.gmtCreate},
-			#{IndexDataList.creator},
-			#{IndexDataList.indexUnique},
-			#{IndexDataList.indexValue},
-			#{IndexDataList.indexUnit},
-			#{IndexDataList.isAbnormal},
-			#{IndexDataList.creatTime},
-			#{IndexDataList.patientId},
-			#{IndexDataList.inquiryCode}
-			)
-		</foreach>
-	</insert>
-</mapper>

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

@@ -20,7 +20,6 @@ import com.diagbot.entity.QuestionDetail;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.entity.QuestionMapping;
 import com.diagbot.entity.RetrievalMapping;
-import com.diagbot.entity.ScaleContent;
 import com.diagbot.entity.wrapper.QuestionInfoWrapper;
 import com.diagbot.entity.wrapper.QuestionMappingWrapper;
 import com.diagbot.entity.wrapper.QuestionWrapper;
@@ -62,7 +61,6 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
@@ -104,8 +102,6 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
     DisTypeFacade disTypeFacade;
     @Autowired
     DisScaleFacade disScaleFacade;
-    @Autowired
-    ScaleContentFacade scaleContentFacade;
 
     /**
      * 标签保存
@@ -545,23 +541,6 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
                         .set("modifier", person)
                         .set("is_deleted", IsDeleteEnum.Y.getKey()));
             }
-            //如果是量表
-            if (deleteQuestionVO.getType() == QuestionTypeEnum.Scale.getKey()) {
-                //删除诊断和量表的映射关系
-                disScaleFacade.update(new DisScale(), new UpdateWrapper<DisScale>()
-                        .eq("scale_id", id)
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .set("gmt_modified", now)
-                        .set("modifier", person)
-                        .set("is_deleted", IsDeleteEnum.Y.getKey()));
-
-                scaleContentFacade.update(new ScaleContent(), new UpdateWrapper<ScaleContent>()
-                        .eq("scale_id", id)
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .set("gmt_modified", now)
-                        .set("modifier", person)
-                        .set("is_deleted", IsDeleteEnum.Y.getKey()));
-            }
 
             //TODO 删除映射关系或检查抛异常
 
@@ -589,18 +568,6 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
         paramMap.put("notTagType", questionIndexVO.getNotTagType());
         paramMap.put("notControlType", questionIndexVO.getNotControlType());
         List<QuestionInfo> res = this.index(paramMap);
-        //过滤出没有量表内容标签
-        if (ListUtil.isNotEmpty(questionIndexVO.getFilterList()) &&
-                questionIndexVO.getFilterList().contains("scale")) {
-            List<ScaleContent> scaleContents = scaleContentFacade.list(new QueryWrapper<ScaleContent>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey()));
-            Set<Long> ids = scaleContents.stream().map(row -> row.getScaleId()).collect(Collectors.toSet());
-            for (int i = 0; i < res.size(); i++) {
-                if (ids.contains(res.get(i).getId())) {
-                    res.remove(i--);
-                }
-            }
-        }
         return res;
     }
 
@@ -756,10 +723,6 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
                     .eq("dis_id", questionInfo.getId()));
             res.setDisType(disType == null ? DisTypeEnum.COMMON.getKey() : disType.getType());
         }
-        //如果是量表内容,添加量表内容
-        if (questionInfo.getType() == QuestionTypeEnum.Scale.getKey()) {
-            res.setScale(scaleContentFacade.getByParamFac(questionInfo.getId()));
-        }
         //获取明细项
         List<QuestionDetail> questionDetailList = questionDetailFacade.getByQuestionId(questionVO.getId());
         res.setQuestionDetailList(questionDetailList);

+ 0 - 39
icssman-service/src/main/java/com/diagbot/mapper/ScaleContentMapper.java

@@ -1,39 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.QuestionPageDTO;
-import com.diagbot.dto.ScaleContentDTO;
-import com.diagbot.entity.ScaleContent;
-import com.diagbot.vo.QuestionPageVO;
-import com.diagbot.vo.ScaleContentVO;
-
-import java.util.List;
-
-/**
- * <p>
- * 量表内容表 Mapper 接口
- * </p>
- *
- * @author zhoutg
- * @since 2019-04-08
- */
-public interface ScaleContentMapper extends BaseMapper<ScaleContent> {
-
-    /**
-     * 获取标签列表
-     *
-     * @param questionPageVO
-     * @return
-     */
-    public IPage<QuestionPageDTO> getList(QuestionPageVO questionPageVO);
-
-
-    /**
-     * 返回量表内容
-     *
-     * @param scaleId
-     * @return
-     */
-    public List<ScaleContentDTO> getByParam(Long scaleId);
-}

+ 0 - 38
icssman-service/src/main/java/com/diagbot/service/ScaleContentService.java

@@ -1,38 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.dto.QuestionPageDTO;
-import com.diagbot.dto.ScaleContentDTO;
-import com.diagbot.entity.ScaleContent;
-import com.diagbot.vo.QuestionPageVO;
-
-import java.util.List;
-
-/**
- * <p>
- * 量表内容表 服务类
- * </p>
- *
- * @author zhoutg
- * @since 2019-04-08
- */
-public interface ScaleContentService extends IService<ScaleContent> {
-
-    /**
-     * 获取标签列表
-     *
-     * @param questionPageVO
-     * @return
-     */
-    IPage<QuestionPageDTO> getList(QuestionPageVO questionPageVO);
-
-
-    /**
-     * 返回量表内容
-     *
-     * @param scaleId
-     * @return
-     */
-    public List<ScaleContentDTO> getByParam(Long scaleId);
-}

+ 0 - 20
icssman-service/src/main/java/com/diagbot/web/DisTypeController.java

@@ -1,20 +0,0 @@
-package com.diagbot.web;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.stereotype.Controller;
-
-/**
- * <p>
- * 诊断类型表 前端控制器
- * </p>
- *
- * @author zhoutg
- * @since 2019-03-28
- */
-@Controller
-@RequestMapping("/disType")
-public class DisTypeController {
-
-}

+ 0 - 65
icssman-service/src/main/java/com/diagbot/web/ScaleContentController.java

@@ -1,65 +0,0 @@
-package com.diagbot.web;
-
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.QuestionPageDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.facade.ScaleContentFacade;
-import com.diagbot.vo.DeleteScaleVO;
-import com.diagbot.vo.QuestionPageVO;
-import com.diagbot.vo.ScaleContentSaveVO;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-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;
-
-/**
- * <p>
- * 量表内容表 前端控制器
- * </p>
- *
- * @author zhoutg
- * @since 2019-04-08
- */
-@RestController
-@RequestMapping("/scaleContent")
-@Api(value = "2期-量表内容相关API", tags = { "2期-量表内容相关API" })
-public class ScaleContentController {
-
-    @Autowired
-    ScaleContentFacade scaleContentFacade;
-
-    @ApiOperation(value = "2期-量表内容新增或更新[by:zhoutg]")
-    @PostMapping("/insertOrUpdate")
-    @SysLogger("insertOrUpdate")
-    @Transactional
-    public RespDTO<Boolean> insertOrUpdate(@RequestBody ScaleContentSaveVO scaleContentSaveVO) {
-        scaleContentFacade.insertOrUpdate(scaleContentSaveVO);
-        return RespDTO.onSuc(true);
-    }
-
-
-    @ApiOperation(value = "2期-量表列表[by:zhoutg]",
-            notes = "")
-    @PostMapping("/list")
-    @SysLogger("list")
-    public RespDTO<IPage<QuestionPageDTO>> list(@RequestBody QuestionPageVO questionPageVO) {
-        IPage<QuestionPageDTO> data = scaleContentFacade.getListFac(questionPageVO);
-        return RespDTO.onSuc(data);
-    }
-
-
-    @ApiOperation(value = "2期-量表内容删除[by:zhoutg]",
-            notes = "")
-    @PostMapping("/delete")
-    @SysLogger("delete")
-    public  RespDTO<Boolean> delete(@RequestBody DeleteScaleVO deleteScaleVO) {
-        scaleContentFacade.delete(deleteScaleVO);
-        return RespDTO.onSuc(true);
-    }
-}

+ 2 - 1
icssman-service/src/main/resources/mapper/IndexConfigMapper.xml

@@ -45,8 +45,9 @@
 	icss_dis_type a
 	JOIN icss_question_info b
 	ON a.dis_id = b.id
+	LEFT JOIN icss_index_config f ON a.dis_id = f.disease_id and f.is_deleted = 'N'
 	WHERE a.type = 1
-	AND a.dis_id not in (SELECT DISTINCT f.disease_id as diseaseId From icss_index_config f WHERE f.is_deleted ="N")
+	AND f.disease_id is null
 	AND a.is_deleted = "N"
 	AND b.is_deleted = "N"
 	<if test="diseaseNameVO.diseaseName != null and diseaseNameVO.diseaseName != ''">

+ 0 - 55
icssman-service/src/main/resources/mapper/ScaleContentMapper.xml

@@ -1,55 +0,0 @@
-<?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.ScaleContentMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.ScaleContent">
-        <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="scale_id" property="scaleId" />
-        <result column="content" property="content" />
-        <result column="type" property="type" />
-        <result column="order_no" property="orderNo" />
-        <result column="remark" property="remark" />
-    </resultMap>
-
-    <select id="getList" resultType="com.diagbot.dto.QuestionPageDTO">
-        SELECT a.* FROM `icss_question_info` a where
-        EXISTS (select 1 from icss_scale_content b where a.id = b.scale_id and b.is_deleted = 'N')
-        and a.is_deleted = 'N'
-        <if test="type != null and type != ''">
-            AND a.type = #{type}
-        </if>
-        <if test="tagName != null and tagName != ''">
-            AND a.tag_name like concat ('%', #{tagName}, '%')
-        </if>
-        <if test="notTypeList != null and notTypeList.size() > 0 ">
-            and a.type not in
-            <foreach  collection="notTypeList" item="notType" open="("  separator=","  close=")">
-                #{notType}
-            </foreach>
-        </if>
-        <if test="tagTypeList != null and tagTypeList.size() > 0 ">
-            and a.tag_type in
-            <foreach  collection="tagTypeList" item="tagType" open="("  separator=","  close=")">
-                #{tagType}
-            </foreach>
-        </if>
-        <if test="controlTypeList != null and controlTypeList.size() > 0 ">
-            and a.control_type in
-            <foreach  collection="controlTypeList" item="controlType" open="("  separator=","  close=")">
-                #{controlType}
-            </foreach>
-        </if>
-        order by a.gmt_modified desc
-    </select>
-
-    <select id="getByParam" resultType="com.diagbot.dto.ScaleContentDTO">
-        SELECT a.* FROM `icss_scale_content` a where a.is_deleted = 'N' and a.scale_id = #{scaleId}
-    </select>
-
-</mapper>

+ 3 - 3
knowledgeman-service/src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -25,9 +25,9 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
         http
                 .csrf().disable()
                 .authorizeRequests()
-                .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
-                .antMatchers("/**").authenticated();
-//                .antMatchers("/**").permitAll();
+//                .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
+//                .antMatchers("/**").authenticated();
+                .antMatchers("/**").permitAll();
     }
 
 

+ 20 - 22
knowledgeman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -5,8 +5,6 @@ import org.springframework.security.access.AccessDeniedException;
 import org.springframework.security.access.ConfigAttribute;
 import org.springframework.security.authentication.InsufficientAuthenticationException;
 import org.springframework.security.core.Authentication;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.web.FilterInvocation;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 import org.springframework.stereotype.Service;
 
@@ -23,26 +21,26 @@ import java.util.Collection;
 public class UrlAccessDecisionManager implements AccessDecisionManager {
     @Override
     public void decide(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes) throws AccessDeniedException, InsufficientAuthenticationException {
-        HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
-        String url, method;
-        if (matchPermitAllUrl(request)) {
-            return;
-        }
-        if ("anonymousUser".equals(authentication.getPrincipal())) {
-            throw new AccessDeniedException("no right");
-        } else {
-            for (GrantedAuthority ga : authentication.getAuthorities()) {
-                String[] authority = ga.getAuthority().split(";");
-                url = authority[0];
-                method = authority[1];
-                if (matchers(url, request)) {
-                    if (method.equals(request.getMethod()) || "ALL".equals(method)) {
-                        return;
-                    }
-                }
-            }
-        }
-        throw new AccessDeniedException("no right");
+//        HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
+//        String url, method;
+//        if (matchPermitAllUrl(request)) {
+//            return;
+//        }
+//        if ("anonymousUser".equals(authentication.getPrincipal())) {
+//            throw new AccessDeniedException("no right");
+//        } else {
+//            for (GrantedAuthority ga : authentication.getAuthorities()) {
+//                String[] authority = ga.getAuthority().split(";");
+//                url = authority[0];
+//                method = authority[1];
+//                if (matchers(url, request)) {
+//                    if (method.equals(request.getMethod()) || "ALL".equals(method)) {
+//                        return;
+//                    }
+//                }
+//            }
+//        }
+//        throw new AccessDeniedException("no right");
     }
 
 

+ 32 - 0
knowledgeman-service/src/main/java/com/diagbot/dto/ScaleContentDTO.java

@@ -0,0 +1,32 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 量表内容表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-04-08
+ */
+@Getter
+@Setter
+public class ScaleContentDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 0:文本,1:大数据接口填充
+     */
+    private Integer type;
+
+}

+ 25 - 0
knowledgeman-service/src/main/java/com/diagbot/dto/ScaleContentIndexDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2019/5/6 15:59
+ */
+@Getter
+@Setter
+public class ScaleContentIndexDTO {
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 量表概念id
+     */
+    private Long conceptId;
+
+}

+ 43 - 0
knowledgeman-service/src/main/java/com/diagbot/dto/ScaleContentPageDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2019/5/6 15:59
+ */
+@Getter
+@Setter
+public class ScaleContentPageDTO {
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 量表概念id
+     */
+    private Long conceptId;
+
+}

+ 147 - 119
knowledgeman-service/src/main/java/com/diagbot/entity/Concept.java

@@ -1,119 +1,147 @@
-package com.diagbot.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author gaodm
- * @since 2019-03-26
- */
-public class Concept implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 是否删除,N:未删除,Y:删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreated;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 术语id
-     */
-    private Long libId;
-
-    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 Date getGmtCreated() {
-        return gmtCreated;
-    }
-
-    public void setGmtCreated(Date gmtCreated) {
-        this.gmtCreated = gmtCreated;
-    }
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date 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 Long getLibId() {
-        return libId;
-    }
-
-    public void setLibId(Long libId) {
-        this.libId = libId;
-    }
-
-    @Override
-    public String toString() {
-        return "Concept{" +
-        "id=" + id +
-        ", isDeleted=" + isDeleted +
-        ", gmtCreated=" + gmtCreated +
-        ", gmtModified=" + gmtModified +
-        ", creator=" + creator +
-        ", modifier=" + modifier +
-        ", libId=" + libId +
-        "}";
-    }
-}
+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;
+
+/**
+ * <p>
+ * 概念表
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-05-09
+ */
+@TableName("kl_concept")
+public class Concept implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键,概念id
+     */
+    @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 libId;
+
+    /**
+     * 概念名称(冗余)
+     */
+    private String libName;
+
+    /**
+     * 概念词性type(冗余)
+     */
+    private Long libType;
+
+    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 Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date 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 Long getLibId() {
+        return libId;
+    }
+
+    public void setLibId(Long libId) {
+        this.libId = libId;
+    }
+    public String getLibName() {
+        return libName;
+    }
+
+    public void setLibName(String libName) {
+        this.libName = libName;
+    }
+    public Long getLibType() {
+        return libType;
+    }
+
+    public void setLibType(Long libType) {
+        this.libType = libType;
+    }
+
+    @Override
+    public String toString() {
+        return "Concept{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", libId=" + libId +
+        ", libName=" + libName +
+        ", libType=" + libType +
+        "}";
+    }
+}

+ 199 - 166
icss-service/src/main/java/com/diagbot/entity/IndexConfig.java

@@ -1,166 +1,199 @@
-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;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author wangfeng
- * @since 2019-03-11
- */
-@TableName("icss_index_config")
-public class IndexConfig 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;
-
-    /**
-     * 指标公表名
-     */
-    private String indexUnique;
-
-    /**
-     * 疾病id
-     */
-    private Long diseaseId;
-    
-    private Long indexDesc;
-    /**
-     * 显示顺序
-     */
-    private Integer orderNo;
-
-    /**
-     * 备注
-     */
-    private String remark;
-
-    public Long getIndexDesc() {
-		return indexDesc;
-	}
-
-	public void setIndexDesc(Long indexDesc) {
-		this.indexDesc = indexDesc;
-	}
-
-	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 Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date 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 getIndexUnique() {
-        return indexUnique;
-    }
-
-    public void setIndexUnique(String indexUnique) {
-        this.indexUnique = indexUnique;
-    }
-    public Long getDiseaseId() {
-        return diseaseId;
-    }
-
-    public void setDiseaseId(Long diseaseId) {
-        this.diseaseId = diseaseId;
-    }
-    public Integer getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(Integer orderNo) {
-        this.orderNo = orderNo;
-    }
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    @Override
-    public String toString() {
-        return "IndexConfig{" +
-        "id=" + id +
-        ", isDeleted=" + isDeleted +
-        ", gmtCreate=" + gmtCreate +
-        ", gmtModified=" + gmtModified +
-        ", creator=" + creator +
-        ", modifier=" + modifier +
-        ", indexUnique=" + indexUnique +
-        ", diseaseId=" + diseaseId +
-        ", orderNo=" + orderNo +
-        ", remark=" + remark +
-        "}";
-    }
-}
+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;
+
+/**
+ * <p>
+ * 属于通用扩展表
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-05-09
+ */
+@TableName("kl_concept_common")
+public class ConceptCommon 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 conceptId;
+
+    /**
+     * 性别:1:男, 2:女, 3:通用
+     */
+    private Integer sexType;
+
+    /**
+     * 症状发生的最小年龄
+     */
+    private Integer minAge;
+
+    /**
+     * 症状发生的最大年龄
+     */
+    private Integer maxAge;
+
+    /**
+     * 科室概念id
+     */
+    private Long deptId;
+
+    /**
+     * 术语身份编码
+     */
+    private String code;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    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 Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date 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 Long getConceptId() {
+        return conceptId;
+    }
+
+    public void setConceptId(Long conceptId) {
+        this.conceptId = conceptId;
+    }
+    public Integer getSexType() {
+        return sexType;
+    }
+
+    public void setSexType(Integer sexType) {
+        this.sexType = sexType;
+    }
+    public Integer getMinAge() {
+        return minAge;
+    }
+
+    public void setMinAge(Integer minAge) {
+        this.minAge = minAge;
+    }
+    public Integer getMaxAge() {
+        return maxAge;
+    }
+
+    public void setMaxAge(Integer maxAge) {
+        this.maxAge = maxAge;
+    }
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "ConceptCommon{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", conceptId=" + conceptId +
+        ", sexType=" + sexType +
+        ", minAge=" + minAge +
+        ", maxAge=" + maxAge +
+        ", deptId=" + deptId +
+        ", code=" + code +
+        ", remark=" + remark +
+        "}";
+    }
+}

+ 199 - 197
knowledgeman-service/src/main/java/com/diagbot/entity/LibraryInfo.java

@@ -1,197 +1,199 @@
-package com.diagbot.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-
-/**
- * <p>
- * 提示信息
- * </p>
- *
- * @author gaodm
- * @since 2019-04-19
- */
-public class LibraryInfo implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 名称
-     */
-    private String name;
-
-    /**
-     * 术语类型id
-     */
-    private Long typeId;
-
-    /**
-     * 类型
-     */
-    private String type;
-
-    /**
-     * 概念id
-     */
-    private Long conceptId;
-
-    /**
-     * 是否标准词,1:是,0:否
-     */
-    private Integer isConcept;
-
-    /**
-     * 术语排序
-     */
-    private Integer orderNo;
-
-    /**
-     * 是否删除,N:未删除,Y:删除
-     */
-    private String isDeleted;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreated;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private Date gmtModified;
-
-    /**
-     * 备注
-     */
-    private String remark;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-    public Long getTypeId() {
-        return typeId;
-    }
-
-    public void setTypeId(Long typeId) {
-        this.typeId = typeId;
-    }
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-    public Long getConceptId() {
-        return conceptId;
-    }
-
-    public void setConceptId(Long conceptId) {
-        this.conceptId = conceptId;
-    }
-    public Integer getIsConcept() {
-        return isConcept;
-    }
-
-    public void setIsConcept(Integer isConcept) {
-        this.isConcept = isConcept;
-    }
-    public Integer getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(Integer orderNo) {
-        this.orderNo = orderNo;
-    }
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-    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 Date getGmtCreated() {
-        return gmtCreated;
-    }
-
-    public void setGmtCreated(Date gmtCreated) {
-        this.gmtCreated = gmtCreated;
-    }
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    @Override
-    public String toString() {
-        return "LibraryInfo{" +
-        "id=" + id +
-        ", name=" + name +
-        ", typeId=" + typeId +
-        ", type=" + type +
-        ", conceptId=" + conceptId +
-        ", isConcept=" + isConcept +
-        ", orderNo=" + orderNo +
-        ", isDeleted=" + isDeleted +
-        ", creator=" + creator +
-        ", modifier=" + modifier +
-        ", gmtCreated=" + gmtCreated +
-        ", gmtModified=" + gmtModified +
-        ", remark=" + remark +
-        "}";
-    }
-}
+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;
+
+/**
+ * <p>
+ * 术语表
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-05-09
+ */
+@TableName("kl_library_info")
+public class LibraryInfo 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;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 是否标准词,1:是,0:否
+     */
+    private Integer isConcept;
+
+    /**
+     * 词性id
+     */
+    private Long typeId;
+
+    /**
+     * 词性
+     */
+    private String type;
+
+    /**
+     * 拼音
+     */
+    private String spell;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    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 Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date 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 getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public Long getConceptId() {
+        return conceptId;
+    }
+
+    public void setConceptId(Long conceptId) {
+        this.conceptId = conceptId;
+    }
+    public Integer getIsConcept() {
+        return isConcept;
+    }
+
+    public void setIsConcept(Integer isConcept) {
+        this.isConcept = isConcept;
+    }
+    public Long getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(Long typeId) {
+        this.typeId = typeId;
+    }
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+    public String getSpell() {
+        return spell;
+    }
+
+    public void setSpell(String spell) {
+        this.spell = spell;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "LibraryInfo{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", name=" + name +
+        ", conceptId=" + conceptId +
+        ", isConcept=" + isConcept +
+        ", typeId=" + typeId +
+        ", type=" + type +
+        ", spell=" + spell +
+        ", remark=" + remark +
+        "}";
+    }
+}

+ 83 - 0
knowledgeman-service/src/main/java/com/diagbot/entity/ScaleContent.java

@@ -0,0 +1,83 @@
+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-04-08
+ */
+@TableName("kl_scale")
+@Getter
+@Setter
+public class ScaleContent 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 conceptId;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 0:文本,1:大数据接口填充
+     */
+    private Integer type;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 11 - 0
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptCommonFacade.java

@@ -0,0 +1,11 @@
+package com.diagbot.facade;
+
+import org.springframework.stereotype.Component;
+
+import com.diagbot.service.impl.ConceptCommonServiceImpl;
+
+@Component
+public class ConceptCommonFacade extends ConceptCommonServiceImpl {
+
+
+}

+ 3 - 3
knowledgeman-service/src/main/java/com/diagbot/facade/ConceptFacade.java

@@ -308,13 +308,13 @@ public class ConceptFacade extends ConceptServiceImpl {
     	if(libraryInfoMain==null){
     		libraryInfoMain = new LibraryInfo();
 			BeanUtil.copyProperties(addConceptInfoDetailVOMain, libraryInfoMain);
-			libraryInfoMain.setGmtCreated(now);
+			libraryInfoMain.setGmtCreate(now);
 			libraryInfoMain.setCreator(currentUser);
 			libraryInfoMain.setType(addConceptInfoVO.getType());
 			libraryInfoMain.setTypeId(lexicon.getId());
 			libraryinfoFacade.save(libraryInfoMain);
 			concept.setLibId(libraryInfoMain.getId());
-			concept.setGmtCreated(now);
+			concept.setGmtCreate(now);
 			concept.setCreator(currentUser);
 			concept.setId(addConceptInfoVO.getConceptId());
 			saveOrUpdate(concept);
@@ -354,7 +354,7 @@ public class ConceptFacade extends ConceptServiceImpl {
 			LibraryInfo libraryInfo = libraryInfoMap.get(i.getName());
 			if(libraryInfo==null){
 				libraryInfo = new LibraryInfo();
-				libraryInfo.setGmtCreated(now);
+				libraryInfo.setGmtCreate(now);
 				libraryInfo.setCreator(currentUser);
 			}else if(libraryInfo.getConceptId().intValue()!=conceptId.intValue()){
 				sbf.append(i.getName()).append(" ");

+ 51 - 43
icssman-service/src/main/java/com/diagbot/facade/ScaleContentFacade.java

@@ -3,24 +3,29 @@
  */
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.UserServiceClient;
-import com.diagbot.dto.QuestionPageDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.ScaleContentDTO;
-import com.diagbot.entity.QuestionInfo;
+import com.diagbot.dto.ScaleContentIndexDTO;
+import com.diagbot.dto.ScaleContentPageDTO;
 import com.diagbot.entity.ScaleContent;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.LexiconTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.ScaleContentService;
 import com.diagbot.service.impl.ScaleContentServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
+import com.diagbot.util.RespDTOUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.DeleteScaleVO;
-import com.diagbot.vo.QuestionPageVO;
+import com.diagbot.vo.ScaleContentIndexVO;
+import com.diagbot.vo.ScaleContentPageVO;
+import com.diagbot.vo.ScaleContentParamVO;
 import com.diagbot.vo.ScaleContentSaveVO;
 import com.diagbot.vo.ScaleContentVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,8 +51,6 @@ public class ScaleContentFacade extends ScaleContentServiceImpl {
     ScaleContentService scaleContentService;
     @Autowired
     UserServiceClient userServiceClient;
-    @Autowired
-    QuestionFacade questionFacade;
 
     /**
      * 量表内容新增或更新
@@ -55,24 +58,14 @@ public class ScaleContentFacade extends ScaleContentServiceImpl {
      * @param scaleContentSaveVO
      */
     public void insertOrUpdate(ScaleContentSaveVO scaleContentSaveVO) {
-        Long scaleId = scaleContentSaveVO.getScaleId();
+        Long conceptId = scaleContentSaveVO.getConceptId();
         Date now = DateUtil.now();
         String userId = UserUtils.getCurrentPrincipleID();
 
-        // 更新修改信息
-        questionFacade.update(new QuestionInfo(), new UpdateWrapper<QuestionInfo>()
-                .eq("id", scaleId)
-                .set("gmt_modified", now)
-                .set("modifier", userId)
-        );
-        // 删除原关联内容
-        if (scaleId != null) {
-            this.update(new ScaleContent(), new UpdateWrapper<ScaleContent>()
-                    .eq("scale_id", scaleId)
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .set("gmt_modified", now)
-                    .set("modifier", userId)
-                    .set("is_deleted", IsDeleteEnum.Y.getKey()));
+        // 删除原关联内容(物理删除)
+        if (conceptId != null) {
+            this.remove(new QueryWrapper<ScaleContent>()
+                    .eq("concept_id", conceptId));
         }
         // 新增关联内容
         List<ScaleContent> list = new ArrayList<>();
@@ -80,7 +73,7 @@ public class ScaleContentFacade extends ScaleContentServiceImpl {
         for (ScaleContentVO scaleContentVO : scaleContentVOS) {
             ScaleContent bean = new ScaleContent();
             BeanUtil.copyProperties(scaleContentVO, bean);
-            bean.setScaleId(scaleId);
+            bean.setConceptId(conceptId);
             bean.setModifier(userId);
             bean.setCreator(userId);
             bean.setGmtCreate(now);
@@ -92,22 +85,21 @@ public class ScaleContentFacade extends ScaleContentServiceImpl {
 
 
     /**
-     * 量表列表
+     * 量表分页
      *
-     * @param questionPageVO
+     * @param scaleContentPageVO
      * @return
      */
-    public IPage<QuestionPageDTO> getListFac(QuestionPageVO questionPageVO) {
-        IPage<QuestionPageDTO> res = this.getList(questionPageVO);
+    public IPage<ScaleContentPageDTO> getListFac(ScaleContentPageVO scaleContentPageVO) {
+        scaleContentPageVO.setLibType(LexiconTypeEnum.GAUGE.getKey());
+        IPage<ScaleContentPageDTO> res = this.getList(scaleContentPageVO);
         if (res.getTotal() <= 0) {
             return res;
         }
         List<String> personIds = res.getRecords().stream().map(row -> row.getModifier()).collect(Collectors.toList());
         RespDTO<Map<String, String>> mapRespDTO = userServiceClient.getUserInfoByIds(personIds);
-        if (mapRespDTO == null || !CommonErrorCode.OK.getCode().equals(mapRespDTO.code)) {
-            throw new CommonException(CommonErrorCode.RPC_ERROR, "获取操作人失败");
-        }
-        for (QuestionPageDTO bean : res.getRecords()) {
+        RespDTOUtil.respNGDeal(mapRespDTO, "远程调用获取操作人失败");
+        for (ScaleContentPageDTO bean : res.getRecords()) {
             bean.setModifier(mapRespDTO.data.get(bean.getModifier()));
         }
         return res;
@@ -115,33 +107,49 @@ public class ScaleContentFacade extends ScaleContentServiceImpl {
 
 
     /**
-     * 量表列表
+     * 量表检索
      *
-     * @param scaleId
+     * @param scaleContentIndexVO
      * @return
      */
-    public List<ScaleContentDTO> getByParamFac(Long scaleId) {
-        return this.getByParam(scaleId);
+    public List<ScaleContentIndexDTO> indexFac(ScaleContentIndexVO scaleContentIndexVO) {
+        // 设置量表类型
+        scaleContentIndexVO.setLibType(LexiconTypeEnum.GAUGE.getKey());
+        return this.index(scaleContentIndexVO);
     }
 
 
+
+
     /**
-     * 量表列表
+     * 量表内容
+     *
+     * @param scaleContentParamVO
+     * @return
+     */
+    public List<ScaleContentDTO> getByParamFac(ScaleContentParamVO scaleContentParamVO) {
+        return this.getByParam(scaleContentParamVO.getConceptId());
+    }
+
+
+    /**
+     * 量表删除
      *
      * @param deleteScaleVO
      * @return
      */
     public void delete(DeleteScaleVO deleteScaleVO) {
-        Date now = DateUtil.now();
+        if (!(IsDeleteEnum.N.getKey().equals(deleteScaleVO.getStatus())
+                || IsDeleteEnum.Y.getKey().equals(deleteScaleVO.getStatus()))) {
+            throw new CommonException(CommonErrorCode.STATUS_IS_ERROR, "状态值错误【Y】或【N】");
+        }
         String person = UserUtils.getCurrentPrincipleID();
         List<Long> ids = deleteScaleVO.getIds();
-        for(Long id : ids) {
-            this.update(new ScaleContent(), new UpdateWrapper<ScaleContent>()
-                    .eq("scale_id", id)
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .set("gmt_modified", now)
-                    .set("modifier", person)
-                    .set("is_deleted", IsDeleteEnum.Y.getKey()));
-        }
+        Date now = DateUtil.now();
+        this.update(new ScaleContent(), new UpdateWrapper<ScaleContent>()
+                .in("concept_id", ids)
+                .set("gmt_modified", now)
+                .set("modifier", person)
+                .set("is_deleted", deleteScaleVO.getStatus()));
     }
 }

+ 16 - 0
knowledgeman-service/src/main/java/com/diagbot/mapper/ConceptCommonMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.ConceptCommon;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 属于通用扩展表 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-05-09
+ */
+public interface ConceptCommonMapper extends BaseMapper<ConceptCommon> {
+
+}

+ 49 - 0
knowledgeman-service/src/main/java/com/diagbot/mapper/ScaleContentMapper.java

@@ -0,0 +1,49 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.ScaleContentDTO;
+import com.diagbot.dto.ScaleContentIndexDTO;
+import com.diagbot.dto.ScaleContentPageDTO;
+import com.diagbot.entity.ScaleContent;
+import com.diagbot.vo.ScaleContentIndexVO;
+import com.diagbot.vo.ScaleContentPageVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 量表内容表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-04-08
+ */
+public interface ScaleContentMapper extends BaseMapper<ScaleContent> {
+
+    /**
+     * 获取量表分页
+     *
+     * @param scaleContentPageVO
+     * @return
+     */
+    public IPage<ScaleContentPageDTO> getList(ScaleContentPageVO scaleContentPageVO);
+
+
+    /**
+     * 量表检索
+     *
+     * @param scaleContentIndexVO
+     * @return
+     */
+    public List<ScaleContentIndexDTO> index(ScaleContentIndexVO scaleContentIndexVO);
+
+
+    /**
+     * 返回量表内容
+     *
+     * @param conceptId
+     * @return
+     */
+    public List<ScaleContentDTO> getByParam(Long conceptId);
+}

+ 16 - 0
knowledgeman-service/src/main/java/com/diagbot/service/ConceptCommonService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.ConceptCommon;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 属于通用扩展表 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-05-09
+ */
+public interface ConceptCommonService extends IService<ConceptCommon> {
+
+}

+ 49 - 0
knowledgeman-service/src/main/java/com/diagbot/service/ScaleContentService.java

@@ -0,0 +1,49 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.ScaleContentDTO;
+import com.diagbot.dto.ScaleContentIndexDTO;
+import com.diagbot.dto.ScaleContentPageDTO;
+import com.diagbot.entity.ScaleContent;
+import com.diagbot.vo.ScaleContentIndexVO;
+import com.diagbot.vo.ScaleContentPageVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 量表内容表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2019-04-08
+ */
+public interface ScaleContentService extends IService<ScaleContent> {
+
+    /**
+     * 获取量表分页
+     *
+     * @param scaleContentPageVO
+     * @return
+     */
+    IPage<ScaleContentPageDTO> getList(ScaleContentPageVO scaleContentPageVO);
+
+
+    /**
+     * 量表检索
+     *
+     * @param scaleContentIndexVO
+     * @return
+     */
+    public List<ScaleContentIndexDTO> index(ScaleContentIndexVO scaleContentIndexVO);
+
+
+    /**
+     * 返回量表内容
+     *
+     * @param conceptId
+     * @return
+     */
+    public List<ScaleContentDTO> getByParam(Long conceptId);
+}

+ 0 - 0
knowledgeman-service/src/main/java/com/diagbot/service/impl/ConceptCommonServiceImpl.java


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio