فهرست منبع

Merge branch 'dev/neo2mysql20210120' into dev/diagnose20210315

# Conflicts:
#	src/main/java/com/diagbot/config/CacheDeleteInit.java
#	src/main/java/com/diagbot/facade/NeoFacade.java
gaodm 4 سال پیش
والد
کامیت
ceed1eb028
33فایلهای تغییر یافته به همراه767 افزوده شده و 111 حذف شده
  1. 163 0
      doc/004.20210225知识库迁移到Mysql/cdss-core_init.sql
  2. 72 0
      doc/004.20210225知识库迁移到Mysql/sys-user_init.sql
  3. 9 12
      src/main/java/com/diagbot/config/CacheDeleteInit.java
  4. 43 0
      src/main/java/com/diagbot/dto/ConceptDetailDTO.java
  5. 42 0
      src/main/java/com/diagbot/dto/GetAllForRelationDTO.java
  6. 12 10
      src/main/java/com/diagbot/entity/KlRulePlan.java
  7. 4 5
      src/main/java/com/diagbot/facade/CommonFacade.java
  8. 29 0
      src/main/java/com/diagbot/facade/KlConceptFacade.java
  9. 67 0
      src/main/java/com/diagbot/facade/KlConceptStaticFacade.java
  10. 25 24
      src/main/java/com/diagbot/facade/KlRuleFacade.java
  11. 5 3
      src/main/java/com/diagbot/facade/NeoFacade.java
  12. 2 1
      src/main/java/com/diagbot/process/BillProcess.java
  13. 4 0
      src/main/java/com/diagbot/process/PushProcess.java
  14. 2 2
      src/main/java/com/diagbot/rule/LisRule.java
  15. 6 4
      src/main/java/com/diagbot/rule/VitalRule.java
  16. 26 8
      src/main/java/com/diagbot/util/CoreUtil.java
  17. 15 0
      src/main/java/com/diagbot/vo/DictionaryInfoVO.java
  18. 4 0
      src/main/java/com/diagbot/vo/DiseaseItemVO.java
  19. 18 0
      src/main/java/com/diagbot/vo/GetDetailVO.java
  20. 11 2
      src/main/java/com/diagbot/vo/KlRuleInfoSaveVO.java
  21. 1 0
      src/main/java/com/diagbot/vo/KlRuleSatartOrdisaVO.java
  22. 33 0
      src/main/java/com/diagbot/vo/SearchConceptVO.java
  23. 16 1
      src/main/java/com/diagbot/web/KlConceptStaticController.java
  24. 36 0
      src/main/java/com/diagbot/web/KlDictionaryConller.java
  25. 48 0
      src/main/java/com/diagbot/web/KlDiseaseController.java
  26. 3 2
      src/main/java/com/diagbot/web/KlRuleBaseController.java
  27. 3 2
      src/main/java/com/diagbot/web/KlRuleConditionController.java
  28. 7 9
      src/main/java/com/diagbot/web/TestwordInfoController.java
  29. 1 0
      src/main/java/com/diagbot/web/TranLisController.java
  30. 0 1
      src/main/resources/mapper/KlConceptMapper.xml
  31. 59 23
      src/main/resources/mapper/KlRelationMapper.xml
  32. 1 1
      src/main/resources/mapper/KlRuleMapper.xml
  33. 0 1
      src/main/resources/mapper/KlRulePlanMapper.xml

+ 163 - 0
doc/004.20210225知识库迁移到Mysql/cdss-core_init.sql

@@ -10,3 +10,166 @@ UPDATE `sys_menu` SET `id`='14', `is_deleted`='Y', `gmt_create`='1970-01-01 12:0
 INSERT INTO `sys_menu` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `order_no`, `remark`) VALUES ('15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '规则维护', '13', 'GZWH-GZWH', '1', '规则维护-规则维护');
 
 INSERT INTO `sys_role_menu` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ('15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', '15', NULL);
+
+/*
+Navicat MySQL Data Transfer
+
+Source Server         : 192.168.2.236
+Source Server Version : 50731
+Source Host           : 192.168.2.236:3306
+Source Database       : cdss
+
+Target Server Type    : MYSQL
+Target Server Version : 50731
+File Encoding         : 65001
+
+Date: 2021-03-19 09:46:25
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for sys_dictionary_info
+-- ----------------------------
+DROP TABLE IF EXISTS `sys_dictionary_info`;
+CREATE TABLE `sys_dictionary_info` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `group_type` bigint(20) NOT NULL DEFAULT '0' COMMENT '分组(值自定义)',
+  `name` varchar(100) NOT NULL DEFAULT '' COMMENT '内容',
+  `val` varchar(255) NOT NULL DEFAULT '' COMMENT '值',
+  `return_type` int(11) NOT NULL DEFAULT '1' COMMENT '返回类型(0: 都返回,1:后台维护返回 2:界面返回)',
+  `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+  `remark` varchar(300) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8 COMMENT='CDSS字典表';
+
+-- ----------------------------
+-- Records of sys_dictionary_info
+-- ----------------------------
+INSERT INTO `sys_dictionary_info` VALUES ('1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '全部', '0', '2', '1', '静态知识检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('2', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '诊断', '1', '2', '10', '静态知识检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('3', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '药品', '2', '2', '20', '静态知识检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('4', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '检验', '3', '2', '30', '静态知识检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('5', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '检查', '5', '2', '40', '静态知识检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('6', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '手术和操作', '6', '2', '50', '静态知识检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('7', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '诊断', '医保疾病名称', '0', '1', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('8', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '药品', '药品通用名称', '0', '6', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('9', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '检验套餐', '实验室检查套餐名', '0', '2', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('10', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '检验细项', '实验室检查名称', '0', '3', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('11', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '检查', '辅助检查名称', '0', '4', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('12', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '手术和操作', '医保手术和操作名称', '0', '7', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('13', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '9', '', '0', '0', '1', '药品剂型');
+INSERT INTO `sys_dictionary_info` VALUES ('14', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '9', '注射剂', '1', '0', '10', '药品剂型');
+INSERT INTO `sys_dictionary_info` VALUES ('15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '9', '片剂', '2', '0', '20', '药品剂型');
+INSERT INTO `sys_dictionary_info` VALUES ('16', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '9', '缓释剂', '3', '0', '30', '药品剂型');
+INSERT INTO `sys_dictionary_info` VALUES ('17', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '9', '胶囊剂', '4', '0', '40', '药品剂型');
+INSERT INTO `sys_dictionary_info` VALUES ('18', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '9', '滴丸剂', '5', '0', '50', '药品剂型');
+INSERT INTO `sys_dictionary_info` VALUES ('19', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '检查子项', '辅助检查子项目名称', '0', '5', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('21', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '10', '诊断', '1', '0', '1', '静态知识类型');
+INSERT INTO `sys_dictionary_info` VALUES ('22', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '10', '药品', '2', '0', '2', '静态知识类型');
+INSERT INTO `sys_dictionary_info` VALUES ('23', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '10', '检验套餐', '3', '0', '3', '静态知识类型');
+INSERT INTO `sys_dictionary_info` VALUES ('24', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '10', '检验细项', '4', '0', '4', '静态知识类型');
+INSERT INTO `sys_dictionary_info` VALUES ('25', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '10', '检查', '5', '0', '5', '静态知识类型');
+INSERT INTO `sys_dictionary_info` VALUES ('26', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '10', '检查子项', '6', '0', '6', '静态知识类型');
+INSERT INTO `sys_dictionary_info` VALUES ('27', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '10', '手术和操作', '7', '0', '7', '静态知识类型');
+INSERT INTO `sys_dictionary_info` VALUES ('28', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '药品类别', '药品类别', '0', '20', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('29', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '11', '检验套餐', '1', '0', '1', '开单合理项检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('30', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '11', '检查', '2', '0', '2', '开单合理项检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('31', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '11', '检查子项', '3', '0', '3', '开单合理项检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('32', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '11', '手术和操作', '4', '0', '4', '开单合理项检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('33', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '11', '药品注册名称', '5', '0', '5', '开单合理项检索类型');
+INSERT INTO `sys_dictionary_info` VALUES ('34', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '性别', '1', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('35', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '实验室检查', '2', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('36', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '临床表现', '3', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '辅助检查名称描述', '4', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('38', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '疾病', '5', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('39', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '服用药品', '6', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('40', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '药物过敏原', '7', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('41', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '食物过敏原', '8', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('42', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '手术', '9', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('43', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '禁忌人群', '10', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('44', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '过敏原', '11', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('45', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '体征', '12', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('46', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '禁忌医疗器械及物品', '13', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('47', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '年龄', '14', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('48', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '给药途径', '15', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('49', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '开单项互斥', '16', '0', '0', '开单禁忌条件类型');
+INSERT INTO `sys_dictionary_info` VALUES ('50', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '疾病(开单合理性)', '疾病', '0', '8', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('51', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '实验室检查细项(开单合理性)', '实验室检查', '0', '9', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('52', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '化验细项及结果(推理)', '化验细项及结果', '0', '10', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('53', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '实验室检查危急值', '实验室检查危急值', '0', '11', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('54', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '化验提醒指标', '化验提醒指标', '0', '12', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('55', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '化验套餐名称(推理)', '化验套餐名称', '0', '13', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('56', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '辅助检查危急值', '辅助检查危急值', '0', '14', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('57', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '辅助检查结果(开单合理性)', '辅助检查名称描述', '0', '15', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('58', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '辅助检查结果(诊断依据)', '辅助检查名称结果', '0', '16', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('59', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '辅检提醒指标', '辅检提醒指标', '0', '17', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('60', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '药品代码通用名', '药品代码通用名', '0', '18', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('61', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '药品注册名称', '药品注册名称', '0', '19', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('62', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '药品治疗学类别', '药品治疗学类别', '0', '21', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('63', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '药品药理学类别', '药品药理学类别', '0', '22', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('64', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '药品解剖学类别', '药品解剖学类别', '0', '23', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('65', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '药品化学物质类别', '药品化学物质类别', '0', '24', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('66', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '服用药品(开单合理性)', '服用药品', '0', '25', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('67', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '禁忌医疗器械及物品', '禁忌医疗器械及物品', '0', '26', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('68', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '性别', '性别', '0', '27', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('69', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '体征', '体征', '0', '28', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('70', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '症状', '症状', '0', '29', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('71', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '临床表现', '临床表现', '0', '30', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('72', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '科室', '科室', '0', '31', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('73', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '开单项互斥', '开单项互斥', '0', '32', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('74', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '禁忌人群', '禁忌人群', '0', '33', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('75', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '建议输血提醒', '建议输血提醒', '0', '34', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('76', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '药物过敏原', '药物过敏原', '0', '35', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('77', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '其他过敏原', '过敏原', '0', '36', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('78', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '食物过敏原', '食物过敏原', '0', '37', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('79', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '输血提醒指标', '输血提醒指标', '0', '38', '图谱标签与页面显示类型对应关系');
+INSERT INTO `sys_dictionary_info` VALUES ('80', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '诊断', '疾病', '1', '100', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('81', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品', '药品通用名', '1', '101', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('82', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品剂型', '药品剂型', '1', '102', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('83', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '症状', '症状', '1', '103', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('84', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '体格检查项目', '体格检查项目', '1', '104', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('85', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '体格检查结果', '体格检查结果', '1', '105', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('86', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '手术和操作', '手术和操作', '1', '106', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('87', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '检验套餐', '实验室检查套餐', '1', '107', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('88', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '检验细项', '实验室检查子项目', '1', '108', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('89', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '检查', '辅助检查项目', '1', '109', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('90', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '检查子项', '辅助检查子项目', '1', '110', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('91', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '辅助检查描述', '辅助检查描述', '1', '111', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('92', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '辅助检查结果', '辅助检查结果', '1', '112', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('93', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '输血类型', '输血类型', '1', '113', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('94', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '麻醉', '麻醉', '1', '114', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('95', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '科室', '科室', '1', '115', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('96', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '性别', '性别', '1', '116', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('97', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '人群', '人群', '1', '117', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('98', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '食物', '食物', '1', '118', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('99', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '其他过敏原', '其他过敏原', '1', '119', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('100', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '医疗器械及物品', '医疗器械及物品', '1', '120', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('101', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '给药途径', '给药途径', '1', '121', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('102', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '部位', '部位', '1', '122', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('103', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '护理', '护理', '1', '123', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('104', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '量表', '量表', '1', '124', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('105', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '单位', '单位', '1', '125', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('106', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', 'ICD10疾病类别', 'ICD10疾病类别', '1', '300', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('107', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品化学物质类别', '药品化学物质类别', '1', '301', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('108', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品治疗学类别', '药品治疗学类别', '1', '302', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('109', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品药理学类别', '药品药理学类别', '1', '303', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('110', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品解剖学类别', '药品解剖学类别', '1', '304', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('111', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '症状类别', '症状类别', '1', '305', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('112', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '手术和操作类别', '手术和操作类别', '1', '306', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('113', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', 'ICD10疾病类别根节点', 'ICD10疾病类别根节点', '1', '400', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('114', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '科室疾病类别根节点', '科室疾病类别根节点', '1', '401', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('115', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品化学物质类别根节点', '药品化学物质类别根节点', '1', '402', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('116', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品治疗学类别根节点', '药品治疗学类别根节点', '1', '403', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('117', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品药理学类别根节点', '药品药理学类别根节点', '1', '404', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('118', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品解剖学类别根节点', '药品解剖学类别根节点', '1', '405', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('119', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '症状类别根节点', '症状类别根节点', '1', '406', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('120', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '手术和操作类别根节点', '手术和操作类别根节点', '1', '407', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('121', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '实验室检查类别根节点', '实验室检查类别根节点', '1', '408', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('122', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '辅助检查类别根节点', '辅助检查类别根节点', '1', '409', '页面显示词性');
+INSERT INTO `sys_dictionary_info` VALUES ('123', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '年龄', '年龄', '1', '410', '页面显示词性');

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 72 - 0
doc/004.20210225知识库迁移到Mysql/sys-user_init.sql


+ 9 - 12
src/main/java/com/diagbot/config/CacheDeleteInit.java

@@ -32,21 +32,18 @@ public class CacheDeleteInit implements CommandLineRunner {
         cacheFacade.loadDrugTypeCache();
         log.info("CDSS-CORE服务启动加载药品类型对应关系缓存成功!");
 
+        cacheFacade.getDiseaseCorrespondCache();
+        log.info("CDSS-CORE服务启动加载疾病对应ICD10缓存成功!");
+
+        cacheFacade.getdiseaseFilterCache();
+        log.info("CDSS-CORE服务启动加载疾病过滤缓存成功!");
+
+        cacheFacade.loadAllRuleCache();
+        log.info("CDSS-CORE服务启动加载医学知识库中的所有规则缓存成功!");
+
         cacheFacade.loadAllBaseDiagnoseCache();
         log.info("CDSS-CORE服务启动加载诊断依据缓存成功!");
 
-//        cacheFacade.getDiseaseCorrespondCache();
-//        log.info("CDSS-CORE服务启动加载疾病对应ICD10缓存成功!");
-//
-//        cacheFacade.getdiseaseFilterCache();
-//        log.info("CDSS-CORE服务启动加载疾病过滤缓存成功!");
-//
-//        cacheFacade.loadAllRuleCache();
-//        log.info("CDSS-CORE服务启动加载医学知识库中的所有规则缓存成功!");
-//
-//        cacheFacade.loadAllBaseDiagnoseCache();
-//        log.info("CDSS-CORE服务启动加载医学知识库中的所有去重的基础诊断依据!");
-
         //无用的缓存
         //
         //        cacheFacade.getSymptomCache();

+ 43 - 0
src/main/java/com/diagbot/dto/ConceptDetailDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/21 10:28
+ */
+@Getter
+@Setter
+public class ConceptDetailDTO {
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 提示明细标题
+     */
+    private String title;
+
+    /**
+     * 提示明细内容
+     */
+    private String content;
+
+    /**
+     * 纯文本
+     */
+    private String text;
+
+    /**
+     * 提示明细序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
+     */
+    private String contentType;
+}

+ 42 - 0
src/main/java/com/diagbot/dto/GetAllForRelationDTO.java

@@ -0,0 +1,42 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-17 15:23
+ */
+@Setter
+@Getter
+public class GetAllForRelationDTO {
+    /**
+     * 概念id
+     */
+    @ApiModelProperty(value="概念id")
+    private Long conceptId;
+
+    /**
+     * 概念名称
+     */
+    @ApiModelProperty(value="概念名称")
+    private String conceptName;
+
+    /**
+     * 概念id
+     */
+    @ApiModelProperty(value="概念id")
+    private Integer libType;
+
+    /**
+     * 概念名称(类型)
+     */
+    @ApiModelProperty(value="概念名称(类型)")
+    private String conceptNameType;
+
+
+
+}
+

+ 12 - 10
src/main/java/com/diagbot/entity/KlRulePlan.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 
 import java.io.Serializable;
-import java.time.LocalDateTime;
 import java.util.Date;
 
 /**
@@ -72,7 +71,6 @@ public class KlRulePlan implements Serializable {
      */
     private String code;
 
-    private Integer firstPlace;
     /**
      * 显示顺序
      */
@@ -80,14 +78,6 @@ public class KlRulePlan implements Serializable {
 
     private String remark;
 
-    public Integer getFirstPlace() {
-        return firstPlace;
-    }
-
-    public void setFirstPlace(Integer firstPlace) {
-        this.firstPlace = firstPlace;
-    }
-
     public Integer getNumber() {
         return number;
     }
@@ -103,6 +93,7 @@ public class KlRulePlan implements Serializable {
     public void setId(Long id) {
         this.id = id;
     }
+
     public String getIsDeleted() {
         return isDeleted;
     }
@@ -110,6 +101,7 @@ public class KlRulePlan implements Serializable {
     public void setIsDeleted(String isDeleted) {
         this.isDeleted = isDeleted;
     }
+
     public Date getGmtCreate() {
         return gmtCreate;
     }
@@ -117,6 +109,7 @@ public class KlRulePlan implements Serializable {
     public void setGmtCreate(Date gmtCreate) {
         this.gmtCreate = gmtCreate;
     }
+
     public Date getGmtModified() {
         return gmtModified;
     }
@@ -124,6 +117,7 @@ public class KlRulePlan implements Serializable {
     public void setGmtModified(Date gmtModified) {
         this.gmtModified = gmtModified;
     }
+
     public String getCreator() {
         return creator;
     }
@@ -131,6 +125,7 @@ public class KlRulePlan implements Serializable {
     public void setCreator(String creator) {
         this.creator = creator;
     }
+
     public String getModifier() {
         return modifier;
     }
@@ -138,6 +133,7 @@ public class KlRulePlan implements Serializable {
     public void setModifier(String modifier) {
         this.modifier = modifier;
     }
+
     public Long getRuleType() {
         return ruleType;
     }
@@ -145,6 +141,7 @@ public class KlRulePlan implements Serializable {
     public void setRuleType(Long ruleType) {
         this.ruleType = ruleType;
     }
+
     public Long getParentId() {
         return parentId;
     }
@@ -152,6 +149,7 @@ public class KlRulePlan implements Serializable {
     public void setParentId(Long parentId) {
         this.parentId = parentId;
     }
+
     public String getName() {
         return name;
     }
@@ -159,6 +157,7 @@ public class KlRulePlan implements Serializable {
     public void setName(String name) {
         this.name = name;
     }
+
     public Integer getType() {
         return type;
     }
@@ -166,6 +165,7 @@ public class KlRulePlan implements Serializable {
     public void setType(Integer type) {
         this.type = type;
     }
+
     public String getCode() {
         return code;
     }
@@ -173,6 +173,7 @@ public class KlRulePlan implements Serializable {
     public void setCode(String code) {
         this.code = code;
     }
+
     public Integer getOrderNo() {
         return orderNo;
     }
@@ -180,6 +181,7 @@ public class KlRulePlan implements Serializable {
     public void setOrderNo(Integer orderNo) {
         this.orderNo = orderNo;
     }
+
     public String getRemark() {
         return remark;
     }

+ 4 - 5
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -71,7 +71,6 @@ public class CommonFacade {
 
     //组装好的label
     public WordCrfDTO crf_process(SearchData searchData) {
-
         AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient);
         WordCrfDTO wordCrfDTO = new WordCrfDTO();
         wordCrfDTO.setHospitalId(searchData.getHospitalId());
@@ -268,8 +267,8 @@ public class CommonFacade {
         VitalLabel vitalLabel = wordCrfDTO.getVitalLabel();
 
         // 【症状回填】
-//        CoreUtil.setPropertyList(chiefLabel.getClinicals(), map.get(StandConvertEnum.symptom.toString()));
-//        CoreUtil.setPropertyList(presentLabel.getClinicals(), map.get(StandConvertEnum.symptom.toString()));
+        CoreUtil.setPropertyList(chiefLabel.getClinicals(), map.get(StandConvertEnum.symptom.toString()));
+        CoreUtil.setPropertyList(presentLabel.getClinicals(), map.get(StandConvertEnum.symptom.toString()));
 
         // 【诊断回填】
         // 1、主诉诊断
@@ -370,7 +369,7 @@ public class CommonFacade {
                 chiefSymptom = chiefLabel.getClinicals().stream().filter(x -> x.getNegative() == null).map(z -> z.getStandName()).collect(Collectors.toList());
                 List<Symptom> cjiefClinicals = chiefLabel.getClinicals().stream().filter(x -> x.getNegative() == null).map(z ->
                 {
-                    String name_sy = z.getBodyPart() == null? z.getStandName() : z.getBodyPart().getName()+z.getStandName();
+                    String name_sy = z.getBodyPart() == null ? z.getStandName() : z.getBodyPart().getName() + z.getStandName();
                     Symptom symptom = new Symptom();
                     symptom.setName(name_sy);
                     return symptom;
@@ -403,7 +402,7 @@ public class CommonFacade {
                 List<Symptom> presentClinicals = presentLabel.getClinicals().stream()
                         .filter(x -> x.getNegative() == null).map(z ->
                         {
-                            String name_sy = z.getBodyPart() == null? z.getStandName() : z.getBodyPart().getName()+z.getStandName();
+                            String name_sy = z.getBodyPart() == null ? z.getStandName() : z.getBodyPart().getName() + z.getStandName();
                             Symptom symptom = new Symptom();
                             symptom.setName(name_sy);
                             return symptom;

+ 29 - 0
src/main/java/com/diagbot/facade/KlConceptFacade.java

@@ -1,13 +1,17 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.GetAllForRelationDTO;
 import com.diagbot.entity.KlConcept;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.LexiconEnum;
 import com.diagbot.service.impl.KlConceptServiceImpl;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.SearchConceptVO;
 import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -82,4 +86,29 @@ public class KlConceptFacade extends KlConceptServiceImpl {
 
         return retType;
     }
+
+    public List<GetAllForRelationDTO> searchConceptByNameAndLibType(SearchConceptVO searchConceptVO) {
+        List<GetAllForRelationDTO> getAllForRelationDTOS = Lists.newArrayList();
+        String name = searchConceptVO.getName();
+        Integer libType = searchConceptVO.getLibType();
+        List<Long> excludedConceptIds = searchConceptVO.getExcludedConceptIds();
+        if (StringUtils.isNotBlank(name) && libType != null) {
+            List<KlConcept> conceptList = this.list(new QueryWrapper<KlConcept>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .like(StringUtil.isNotBlank(name), "lib_name", name.trim())
+                    .eq("lib_type", libType)
+                    .notIn(ListUtil.isNotEmpty(excludedConceptIds), "id", excludedConceptIds));
+            if (ListUtil.isNotEmpty(conceptList)) {
+                getAllForRelationDTOS = conceptList.stream().map(x -> {
+                    GetAllForRelationDTO getAllForRelationDTO = new GetAllForRelationDTO();
+                    getAllForRelationDTO.setConceptNameType(x.getLibName());
+                    getAllForRelationDTO.setConceptName(x.getLibName());
+                    getAllForRelationDTO.setConceptId(x.getId());
+                    getAllForRelationDTO.setLibType(x.getLibType());
+                    return getAllForRelationDTO;
+                }).collect(Collectors.toList());
+            }
+        }
+        return getAllForRelationDTOS;
+    }
 }

+ 67 - 0
src/main/java/com/diagbot/facade/KlConceptStaticFacade.java

@@ -3,6 +3,7 @@ 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.dto.ConceptDetailDTO;
 import com.diagbot.dto.DictionaryInfoDTO;
 import com.diagbot.dto.KlConceptDetailDTO;
 import com.diagbot.dto.KlConceptStaticDTO;
@@ -25,6 +26,7 @@ import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ChangeStatusVO;
+import com.diagbot.vo.GetDetailVO;
 import com.diagbot.vo.IdVO;
 import com.diagbot.vo.KlConceptStaticPageVO;
 import com.diagbot.vo.KlConceptStaticVO;
@@ -429,6 +431,9 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
      */
     public Integer convertType(Integer type, Integer flag) {
         Integer retType = null;
+        if (type == null) {
+            return retType;
+        }
         if (flag.equals(1)) {
             //1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作
             switch (type) {
@@ -475,4 +480,66 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         }
         return retType;
     }
+
+    /**
+     * 获取静态知识map Map<name_type,List<ConceptDetail>>
+     *
+     * @param getDetailVO
+     * @return
+     */
+    public Map<String, List<ConceptDetailDTO>> getDetailByConcept(GetDetailVO getDetailVO) {
+        Map<String, List<ConceptDetailDTO>> retMap = new HashMap<>();
+        List<DictionaryInfoDTO> dicTypeName = klDictionaryInfoFacade.getListByGroupType(13);
+        Map<String, String> dicTypeNameMap
+                = EntityUtil.makeMapWithKeyValue(dicTypeName, "val", "name");
+
+        QueryWrapper<KlConcept> conceptQueryWrapper = new QueryWrapper<>();
+        conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("status", 1);
+        if (ListUtil.isNotEmpty(getDetailVO.getNameList())) {
+            conceptQueryWrapper.in("lib_name", getDetailVO.getNameList());
+        }
+        List<KlConcept> conceptList = klConceptFacade.list(conceptQueryWrapper);
+        Map<Long, KlConcept> conceptMap = EntityUtil.makeEntityMap(conceptList, "id");
+
+        if (ListUtil.isNotEmpty(conceptList)) {
+            List<Long> conceptIds = conceptList.stream()
+                    .map(i -> i.getId())
+                    .collect(Collectors.toList());
+
+            List<KlConceptStatic> staticList = this.list(new QueryWrapper<KlConceptStatic>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("status", 1)
+                    .in("concept_id", conceptIds));
+
+            if (ListUtil.isEmpty(staticList)) {
+                return retMap;
+            }
+
+            QueryWrapper<KlConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
+            conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .in("concept_id", conceptIds);
+            if (ListUtil.isNotEmpty(getDetailVO.getContentTypes())) {
+                conceptDetailQueryWrapper.and(sql -> {
+                    for (int i = 0; i < getDetailVO.getContentTypes().size(); i++) {
+                        if (i > 0) {
+                            sql.or();
+                        }
+                        sql.apply("find_in_set({0},content_type)", getDetailVO.getContentTypes().get(i));
+                    }
+                });
+            }
+            List<KlConceptDetail> conceptDetailList = klConceptDetailFacade.list(conceptDetailQueryWrapper);
+            Map<Long, List<KlConceptDetail>> detailMap
+                    = EntityUtil.makeEntityListMap(conceptDetailList, "conceptId");
+
+            for (Map.Entry<Long, KlConcept> entry : conceptMap.entrySet()) {
+                if (detailMap.containsKey(entry.getKey())) {
+                    retMap.put(entry.getValue().getLibName() + "_" + dicTypeNameMap.get(LexiconEnum.getName(entry.getValue().getLibType())),
+                            BeanUtil.listCopyTo(detailMap.get(entry.getKey()), ConceptDetailDTO.class));
+                }
+            }
+        }
+        return retMap;
+    }
 }

+ 25 - 24
src/main/java/com/diagbot/facade/KlRuleFacade.java

@@ -81,35 +81,36 @@ public class KlRuleFacade extends KlRuleServiceImpl {
     public Boolean saveRuleInfos(KlRuleInfoSaveVO klRuleInfoSaveVO) {
         Date now = DateUtil.now();
         boolean res = false;
-        // 校验名称是否相同
+/*        // 校验名称是否相同
         int count = this.count(new QueryWrapper<KlRule>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("description", klRuleInfoSaveVO.getParDescription())
-                .ne("id", klRuleInfoSaveVO.getId() == null ? -1 : klRuleInfoSaveVO.getId()));
+                .ne("id", klRuleInfoSaveVO.getParId() == null ? -1 : klRuleInfoSaveVO.getParId()));
         if (count > 0) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该规则名称已存在");
-        }
+        }*/
         //校验数据是否还在
-        if (null != klRuleInfoSaveVO.getId()) {
+        if (null != klRuleInfoSaveVO.getParId()) {
             int sum = this.count(new QueryWrapper<KlRule>().eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("id", klRuleInfoSaveVO.getId()));
+                    .eq("id", klRuleInfoSaveVO.getParId()));
             if (sum == 0) {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该数据已不存在!");
             }
             UpdateWrapper<KlRule> klRuleUpdate = new UpdateWrapper<>();
             klRuleUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("id", klRuleInfoSaveVO.getId())
+                    .eq("id", klRuleInfoSaveVO.getParId())
                     .set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParDescription()), "description", klRuleInfoSaveVO.getParDescription())
                     .set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParConceptId().toString()), "concept_id", klRuleInfoSaveVO.getParConceptId())
                     .set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParRuleType().toString()), "rule_type", klRuleInfoSaveVO.getParRuleType())
                     .set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParHasSub().toString()), "has_sub_cond", klRuleInfoSaveVO.getParHasSub())
                     .set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParStatus().toString()), "status", klRuleInfoSaveVO.getParStatus())
                     .set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParMsg()), "msg", klRuleInfoSaveVO.getParMsg())
+                    .set("modifier", klRuleInfoSaveVO.getModifier())
                     .set("gmt_modified", now);
             res = this.update(klRuleUpdate);
 
             //先删除原有的详情;
-            res = clearSub(klRuleInfoSaveVO.getId());
+            res = clearSub(klRuleInfoSaveVO.getParId());
             if (ListUtil.isNotEmpty(klRuleInfoSaveVO.getKlRuleInfoSaveSub())) {
                 //再重新传入的详情保存
                 res = saveCommon(klRuleInfoSaveVO);
@@ -118,6 +119,8 @@ public class KlRuleFacade extends KlRuleServiceImpl {
             //先保存主表rule
             KlRule klRule = new KlRule();
             klRule.setConceptId(klRuleInfoSaveVO.getParConceptId());
+            klRule.setCreator(klRuleInfoSaveVO.getModifier());
+            klRule.setModifier(klRuleInfoSaveVO.getModifier());
             klRule.setDescription(klRuleInfoSaveVO.getParDescription());
             klRule.setHasSubCond(klRuleInfoSaveVO.getParHasSub());
             klRule.setRuleType(klRuleInfoSaveVO.getParRuleType());
@@ -128,7 +131,7 @@ public class KlRuleFacade extends KlRuleServiceImpl {
             res = this.save(klRule);
             if (res) {
                 //再保存附表
-                klRuleInfoSaveVO.setId(klRule.getId());
+                klRuleInfoSaveVO.setParId(klRule.getId());
                 res = saveCommon(klRuleInfoSaveVO);
             }
         }
@@ -156,7 +159,7 @@ public class KlRuleFacade extends KlRuleServiceImpl {
         List<Long> ruleBaseId = new ArrayList<>();
         if (ListUtil.isNotEmpty(ruleConditionList)) {
             for (KlRuleCondition data : ruleConditionList) {
-                ruleBaseId.add(data.getId());
+                ruleBaseId.add(data.getRuleBaseId());
             }
         }
         if (ListUtil.isNotEmpty(ruleBaseId)) {
@@ -182,8 +185,10 @@ public class KlRuleFacade extends KlRuleServiceImpl {
             //先保存数据到kl_rule_base表里
             List<KlRuleBase> klRuleBaseList = new ArrayList<>();
             for (KlRuleInfoSaveSubVO list : klRuleInfoSaveSub) {
+                KlRuleCondition klRuleCondition = new KlRuleCondition();
                 KlRuleBase klRuleBase = new KlRuleBase();
                 klRuleBase.setGmtModified(now);
+                klRuleBase.setModifier(klRuleInfoSaveVO.getModifier());
                 klRuleBase.setConceptId(list.getSubConceptId());
                 klRuleBase.setType(list.getSubType());
                 klRuleBase.setDescription(list.getSubDescription());
@@ -197,23 +202,18 @@ public class KlRuleFacade extends KlRuleServiceImpl {
                 klRuleBase.setEqValue(list.getSubEqValue());
                 klRuleBase.setEqOperator(list.getSubEqOperator());
                 klRuleBase.setEqUnit(list.getSubEqUnit());
-                klRuleBaseList.add(klRuleBase);
-            }
-            res = klRuleBaseFacade.saveBatchAll(klRuleBaseList);
-            List<KlRuleCondition> klRuleConditionList = new ArrayList<>();
-            for (KlRuleBase data1 : klRuleBaseList) {
-                for (KlRuleInfoSaveSubVO data2 : klRuleInfoSaveSub) {
-                    KlRuleCondition klRuleCondition = new KlRuleCondition();
-                    if (data1.getDescription().equals(data2.getSubDescription())) {
-                        klRuleCondition.setGmtCreate(now);
-                        klRuleCondition.setGroupType(data2.getGroupType());
-                        klRuleCondition.setRuleBaseId(data1.getId());
-                        klRuleCondition.setRuleId(klRuleInfoSaveVO.getId());
-                        klRuleConditionList.add(klRuleCondition);
-                    }
+                res = klRuleBaseFacade.save(klRuleBase);
+                //再把数据保存在kl_rule_condition
+                if (res) {
+                    klRuleCondition.setGmtCreate(now);
+                    klRuleCondition.setModifier(klRuleInfoSaveVO.getModifier());
+                    klRuleCondition.setGroupType(list.getGroupType());
+                    klRuleCondition.setRuleBaseId(klRuleBase.getId());
+                    klRuleCondition.setRuleId(klRuleInfoSaveVO.getParId());
+                    res = klRuleConditionFacade.save(klRuleCondition);
                 }
+
             }
-            res = klRuleConditionFacade.saveBatchAll(klRuleConditionList);
         }
 
         return res;
@@ -231,6 +231,7 @@ public class KlRuleFacade extends KlRuleServiceImpl {
         klRuleUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("id", klRuleSatartOrdisaVO.getId())
                 .set("status", start)
+                .set("modifier", klRuleSatartOrdisaVO.getModifier())
                 .set("gmt_modified", now);
         return this.update(klRuleUpdate);
     }

+ 5 - 3
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -421,11 +421,13 @@ public class NeoFacade {
      * @param dis
      * @return
      */
-    public NeoPushDTO reverseInfoMySql(String dis) {
+    public NeoPushDTO reverseInfoMySql(String dis, NeoPushVO neoPushVO) {
         NeoPushDTO neoPushDTO = new NeoPushDTO();
         //查询疾病相关的项目
         DiseaseItemVO diseaseItemVO = new DiseaseItemVO();
         diseaseItemVO.setDiseaseName(dis);
+        diseaseItemVO.setAge(neoPushVO.getAgeNum());
+        diseaseItemVO.setSexType(neoPushVO.getSex());
         Map<Long, List<String>> items = klRelationFacade.getItemByDiseaseMap(diseaseItemVO);
         if (MapUtils.isNotEmpty(items)) {
             if (ListUtil.isNotEmpty(items.get(PushRelationTypeEnum.SYMPTOMMAIN.getKey()))) {
@@ -461,7 +463,7 @@ public class NeoFacade {
     public NeoPushDTO getDiagInfo(NeoPushVO neoPushVO) {
         NeoPushDTO pushDTO = new NeoPushDTO();
         String term = neoPushVO.getDiagVo().getDiags().get(0).getName();
-        pushDTO = this.reverseInfoMySql(term);
+        pushDTO = this.reverseInfoMySql(term, neoPushVO);
 
         return pushDTO;
     }
@@ -492,7 +494,7 @@ public class NeoFacade {
      * 类型,疾病: disease,症状: symptom,手术和操作:operation,药品: drug,实验室检查:lis,辅助检查:pacs, 辅助检查:vital"
      *
      * @param standConvert
-     * @return Map<String , Map < String , String>> -->Map<类型, Map<原始词, 标准词>>
+     * @return Map<String,Map<String,String>> -->Map<类型, Map<原始词, 标准词>>
      */
     public Map<String, Map<String, String>> standConvertCrf(StandConvert standConvert) {
         Map<String, Map<String, String>> map = new LinkedHashMap<>();

+ 2 - 1
src/main/java/com/diagbot/process/BillProcess.java

@@ -149,7 +149,8 @@ public class BillProcess {
                                     case Vital: // 体格检查项目
                                         vitalRule.bill(wordCrfDTO.getVitalLabel(), ruleBaseDTO, billMsgList, ConEnum.vitals.getName(), ruleSimpleDTO);
                                         break;
-                                    case PacsName: // 辅检项目
+                                    case PacsName: // 辅助检查项目
+                                    case PacsSubName: // 辅助检查子项目
                                         if (ruleBaseDTO.getBaseType() != null && ruleBaseDTO.getBaseType().equals(BaseTypeEnum.B5.getKey())) {
                                             // 开单项互斥
                                             commonRule.exclusionBill(wordCrfDTO, ruleBaseDTO, billMsgList, ConEnum.exclusion.getName(), ruleSimpleDTO, set);

+ 4 - 0
src/main/java/com/diagbot/process/PushProcess.java

@@ -218,6 +218,8 @@ public class PushProcess {
                 return diag;
             }).collect(Collectors.toList()));
             pushVO.setDiagVo(diagVo);
+            pushVO.setAgeNum(pushVo.getAgeNum());
+            pushVO.setSex(pushVo.getSex());
             reversePushPackage(length, pushDTO, ruleTypeList, typeWords, pushVO, dis);
         }
         try {
@@ -259,6 +261,8 @@ public class PushProcess {
                         return diag;
                     }).collect(Collectors.toList()));
                     pushVO.setDiagVo(diagVo);
+                    pushVO.setAgeNum(pushVo.getAgeNum());
+                    pushVO.setSex(pushVo.getSex());
                     //调用反推
                     reversePushPackage(length, pushDTO, ruleTypeList, typeWords, pushVO, dis);
 

+ 2 - 2
src/main/java/com/diagbot/rule/LisRule.java

@@ -127,7 +127,7 @@ public class LisRule {
                         }
                         break;
                     case Medicine: // 药品
-                        map = commonRule.compareItem(wordCrfDTO.getDrug(), ruleBaseDTO);
+                        map = commonRule.compareItem(wordCrfDTO.getDrugSource(), ruleBaseDTO);
                         if (CoreUtil.getMapFlag(map)) {
                             lisOtherDTO.setDrugMsg((List<String>)map.get("msgList"));
                             i++;
@@ -221,7 +221,7 @@ public class LisRule {
                         }
                         break;
                     case Medicine: // 药品
-                        map = commonRule.compareItem(wordCrfDTO.getDrug(), ruleBaseDTO);
+                        map = commonRule.compareItem(wordCrfDTO.getDrugSource(), ruleBaseDTO);
                         if (CoreUtil.getMapFlag(map)) {
                             lisOtherDTO.setDrugMsg((List<String>)map.get("msgList"));
                             i++;

+ 6 - 4
src/main/java/com/diagbot/rule/VitalRule.java

@@ -31,9 +31,10 @@ public class VitalRule {
     public void bill(VitalLabel vitalLabel, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType,
                      RuleSimpleDTO ruleSimpleDTO) {
         Map<String, Object> map = CoreUtil.compareVital(ruleBaseDTO, vitalLabel);
-        if ((Boolean) map.get("flag") == true) {
+        List<String> msgList = CoreUtil.getMapMsgList(map);
+        for (String s : msgList) {
             BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(ruleSimpleDTO.getInputName(),
-                    ruleSimpleDTO.getLibName(), (String) map.get("msg"), conType, ruleSimpleDTO.getLibTypeName());
+                    ruleSimpleDTO.getLibName(), s, conType, ruleSimpleDTO.getLibTypeName());
             billMsgList.add(commonBillMsg);
         }
     }
@@ -48,8 +49,9 @@ public class VitalRule {
      */
     public void highOperation(VitalLabel vitalLabel, RuleBaseDTO ruleBaseDTO, List<BillMsg> highRiskList, RuleSimpleDTO ruleSimpleDTO) {
         Map<String, Object> map = CoreUtil.compareVital(ruleBaseDTO, vitalLabel);
-        if ((Boolean) map.get("flag") == true) {
-            BillMsg billMsg = MsgUtil.getCommonHighRiskMsg((String) map.get("msg"), ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
+        List<String> msgList = CoreUtil.getMapMsgList(map);
+        for (String s : msgList) {
+            BillMsg billMsg = MsgUtil.getCommonHighRiskMsg(s, ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
             highRiskList.add(billMsg);
         }
     }

+ 26 - 8
src/main/java/com/diagbot/util/CoreUtil.java

@@ -346,6 +346,8 @@ public class CoreUtil {
      */
     public static Map<String, Object> compareVital(RuleBaseDTO ruleBaseDTO, VitalLabel vitalLabel) {
         Map<String, Object> map = new LinkedHashMap<>();
+        List<String> msgList = new ArrayList<>();
+        map.put("msgList", msgList);
         List<Vital> vitalList = vitalLabel.getVitals(); // 体征数据
         List<Clinical> clinicals = vitalLabel.getClinicals(); // 体征临床表现
         boolean flag = false;
@@ -370,16 +372,14 @@ public class CoreUtil {
                         && StringUtil.isNotBlank(vital.getPd().getValue())) {
                     flag = compareNum(ruleBaseDTO, Double.parseDouble(vital.getPd().getValue()));
                     if (flag) {
-                        map.put("msg", vital.getName() + subZeroAndDot(String.valueOf(vital.getPd().getValue())));
-                        break;
+                        msgList.add(vital.getName() + subZeroAndDot(String.valueOf(vital.getPd().getValue())));
                     }
                 } else if (ListUtil.isNotEmpty(usualList)) { // 血压比较
                     for (Usual usual : usualList) {
                         if (ruleBaseDTO.getBaseLibName().equals(usual.getStandName())) {
                             flag = compareNum(ruleBaseDTO, Double.parseDouble(usual.getValue()));
                             if (flag) {
-                                map.put("msg", vital.getName() + subZeroAndDot(String.valueOf(vital.getPd().getValue())));
-                                break;
+                                msgList.add(vital.getName() + subZeroAndDot(String.valueOf(vital.getPd().getValue())));
                             }
                         }
                     }
@@ -531,8 +531,8 @@ public class CoreUtil {
             if (StringUtil.isEmpty(ageStr)) {
                 return 20.0;
             }
-            // 全是整形数字,当成年龄处理
-            if (numbersOnly(ageStr)) {
+            // 数值,当成年龄处理
+            if (isNumbers(ageStr)) {
                 return Double.parseDouble(ageStr);
             }
             // 20日
@@ -590,13 +590,13 @@ public class CoreUtil {
     }
 
     /**
-     * 判断字符串是否 仅 包含数字
+     * 判断字符串是否数值(正)
      *
      * @param str
      * @return
      */
     public static boolean isNumbers(String str) {
-        String regex = "^[0-9]*(\\.?)[0-9]*$";
+        String regex = "[0-9]+|([0-9]+\\.)+[0-9]*|[0-9]*(\\.[0-9]+)+";
         return str.matches(regex);
     }
 
@@ -716,6 +716,24 @@ public class CoreUtil {
         return false;
     }
 
+    /**
+     * 获取mapMsgList值
+     *
+     * @param map
+     * @return
+     */
+    public static List<String> getMapMsgList(Map map) {
+        if (map != null && map.get("flag") != null && (Boolean) map.get("flag") == true) {
+            List<String> msgList = (List<String>)map.get("msgList");
+            if (ListUtil.isEmpty(msgList)) {
+                return new ArrayList<>();
+            } else {
+                return msgList;
+            }
+        }
+        return new ArrayList<>();
+    }
+
     /**
      * 添加列表
      *

+ 15 - 0
src/main/java/com/diagbot/vo/DictionaryInfoVO.java

@@ -0,0 +1,15 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-17 13:20
+ */
+@Setter
+@Getter
+public class DictionaryInfoVO {
+    private Integer groupType;
+}

+ 4 - 0
src/main/java/com/diagbot/vo/DiseaseItemVO.java

@@ -12,4 +12,8 @@ import lombok.Setter;
 @Setter
 public class DiseaseItemVO {
     private String diseaseName;
+    //性别:1:男, 2:女, 3:通用
+    private Integer sexType;
+    //年龄
+    private Double age;
 }

+ 18 - 0
src/main/java/com/diagbot/vo/GetDetailVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/3/19 13:33
+ */
+@Getter
+@Setter
+public class GetDetailVO {
+    java.util.List<String> nameList;
+    List<Integer> contentTypes;
+}

+ 11 - 2
src/main/java/com/diagbot/vo/KlRuleInfoSaveVO.java

@@ -1,9 +1,12 @@
 package com.diagbot.vo;
 
 import com.diagbot.dto.KlRuleByIdSubDTO;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.util.List;
 
 /**
@@ -14,15 +17,21 @@ import java.util.List;
 @Setter
 @Getter
 public class KlRuleInfoSaveVO {
-    private Long id;
+    private Long parId;
+    @NotBlank(message = "请输入规则名称")
     private String parDescription;//规则名称
+    @NotNull(message = "请输入规则类型")
     private Integer parRuleType;//规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+    @NotNull(message = "请输入概念id")
     private Long parConceptId;//提示概念id
+    @NotNull(message = "请输入概念id")
     private Integer parHasSub;//是否有子条件(0:无,1:有)
     private String parMsg;//附加信息
-    private Integer parStatus;//启用状态(0:禁用,1:启用)
+    @ApiModelProperty(hidden = true)
+    private Integer parStatus = 1;//启用状态(0:禁用,1:启用)
 /*    private String parlibName;
     private String parLenName;
     private String parLenCode;*/
+    private String modifier;
     private List<KlRuleInfoSaveSubVO> klRuleInfoSaveSub;
 }

+ 1 - 0
src/main/java/com/diagbot/vo/KlRuleSatartOrdisaVO.java

@@ -15,4 +15,5 @@ import javax.validation.constraints.NotNull;
 public class KlRuleSatartOrdisaVO {
     @NotNull(message = "请输id")
     private Long id;
+    private String modifier;
 }

+ 33 - 0
src/main/java/com/diagbot/vo/SearchConceptVO.java

@@ -0,0 +1,33 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @author kwz
+ * @date 2021/3/10
+ * @time 12:57
+ */
+@Setter
+@Getter
+public class SearchConceptVO {
+    @ApiModelProperty(value="名称")
+    @NotBlank(message = "请输入搜索名称")
+    private String name;
+    /**
+     * 词性id
+     */
+    @ApiModelProperty(value="词性id")
+    @NotNull(message ="请输入搜索词的词性" )
+    private Integer libType;
+    /**
+     * 需要排除的概念id集合
+     */
+    @ApiModelProperty(value="需要排除的概念id集合")
+    private List<Long> excludedConceptIds;
+}

+ 16 - 1
src/main/java/com/diagbot/web/KlConceptStaticController.java

@@ -3,12 +3,14 @@ package com.diagbot.web;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.ConceptDetailDTO;
 import com.diagbot.dto.KlConceptStaticDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.StaticKnowledgeDTO;
 import com.diagbot.facade.KlConceptStaticFacade;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.vo.ChangeStatusVO;
+import com.diagbot.vo.GetDetailVO;
 import com.diagbot.vo.IdVO;
 import com.diagbot.vo.KlConceptStaticPageVO;
 import com.diagbot.vo.KlConceptStaticVO;
@@ -23,6 +25,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @Description:
@@ -32,6 +36,7 @@ import javax.validation.Valid;
 @RestController
 @RequestMapping("/kl/conceptStatic")
 @Api(value = "静态知识维护相关API", tags = { "静态知识维护相关API" })
+@SuppressWarnings("unchecked")
 public class KlConceptStaticController {
     @Autowired
     KlConceptStaticFacade klConceptStaticFacade;
@@ -50,7 +55,7 @@ public class KlConceptStaticController {
     @ApiOperation(value = "获取静态知识列表[zhaops]",
             notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作 <br>" +
                     "name: 术语名称<br>" +
-                    "isDeleted: 启用状态:N-启用中、Y-已删除<br>")
+                    "status: 启用状态:1-启用、0-禁用<br>")
     @PostMapping("/getPage")
     @SysLogger("getPage")
     @SuppressWarnings("unchecked")
@@ -105,4 +110,14 @@ public class KlConceptStaticController {
         Boolean data = klConceptStaticFacade.isExist(klConceptStaticVO);
         return RespDTO.onSuc(data);
     }
+
+    @ApiOperation(value = "推理结果匹配静态知识[zhaops]",
+            notes = "nameList: 术语名称 <br>" +
+                    "contentTypes:明细内容")
+    @PostMapping("/getDetailByConcept")
+    @SysLogger("getDetailByConcept")
+    public RespDTO<Map<String, List<ConceptDetailDTO>>> getDetailByConcept(@Valid @RequestBody GetDetailVO getDetailVO) {
+        Map<String, List<ConceptDetailDTO>> data = klConceptStaticFacade.getDetailByConcept(getDetailVO);
+        return RespDTO.onSuc(data);
+    }
 }

+ 36 - 0
src/main/java/com/diagbot/web/KlDictionaryConller.java

@@ -0,0 +1,36 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.DictionaryInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.KlDictionaryInfoFacade;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-03-17 13:14
+ */
+@RestController
+@RequestMapping("/kl/dictionary")
+@Api(value = "字典表信息相关API", tags = { "字典表信息相关API" })
+@SuppressWarnings("unchecked")
+public class KlDictionaryConller {
+    @Autowired
+    KlDictionaryInfoFacade dictionaryFacade;
+
+    @ApiOperation(value = "根据分组获取字典表信息详情[by:wangfeng]")
+    @PostMapping("/getDictionaryInfo")
+    @SysLogger("getDictionaryInfo")
+    public RespDTO<Map<Long, List<DictionaryInfoDTO>>> getDictionaryInfoAll() {
+        return RespDTO.onSuc(dictionaryFacade.getListBack());
+    }
+}

+ 48 - 0
src/main/java/com/diagbot/web/KlDiseaseController.java

@@ -0,0 +1,48 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.GetAllForRelationDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.KlConceptFacade;
+import com.diagbot.vo.SearchConceptVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * <p>
+ * 疾病表 前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-03-01
+ */
+@RestController
+@RequestMapping("/klDisease")
+@SuppressWarnings("unchecked")
+@Api(value = "诊断依据相关的类型术语相关API", tags = { "诊断依据相关的类型术语相关API" })
+public class KlDiseaseController {
+
+    @Autowired
+    KlConceptFacade klConceptFacade;
+
+    @ApiOperation(value = "查询诊断依据相关的类型术语[by:kongwz]",
+            notes = "name: 查询术语的名称<br>" +
+                    "libType: 查询术语的词性<br>" +
+                    "excludedConceptIds: 需要排除的概念id集合")
+    @PostMapping("/searchConcept")
+    @SysLogger("searchConcept")
+    public RespDTO<List<GetAllForRelationDTO>> searchConcept(@Valid @RequestBody SearchConceptVO searchConceptVO) {
+        List<GetAllForRelationDTO> getAllForRelationDTOS = klConceptFacade.searchConceptByNameAndLibType(searchConceptVO);
+        return RespDTO.onSuc(getAllForRelationDTOS);
+    }
+
+}

+ 3 - 2
src/main/java/com/diagbot/web/KlRuleBaseController.java

@@ -1,9 +1,8 @@
 package com.diagbot.web;
 
 
-import org.springframework.web.bind.annotation.RequestMapping;
-
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
 
 /**
  * <p>
@@ -15,6 +14,8 @@ import org.springframework.stereotype.Controller;
  */
 @Controller
 @RequestMapping("/klRuleBase")
+@SuppressWarnings("unchecked")
+@Deprecated
 public class KlRuleBaseController {
 
 }

+ 3 - 2
src/main/java/com/diagbot/web/KlRuleConditionController.java

@@ -1,9 +1,8 @@
 package com.diagbot.web;
 
 
-import org.springframework.web.bind.annotation.RequestMapping;
-
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
 
 /**
  * <p>
@@ -15,6 +14,8 @@ import org.springframework.stereotype.Controller;
  */
 @Controller
 @RequestMapping("/klRuleCondition")
+@SuppressWarnings("unchecked")
+@Deprecated
 public class KlRuleConditionController {
 
 }

+ 7 - 9
src/main/java/com/diagbot/web/TestwordInfoController.java

@@ -5,7 +5,6 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.TestwordInfoFacade;
 import com.diagbot.vo.SymptomFeatureVO;
 import com.diagbot.vo.TestStandVO;
-import com.diagbot.vo.TestwordInfoVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,8 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.Map;
-
 /**
  * <p>
  * 词提取用例 前端控制器
@@ -28,17 +25,18 @@ import java.util.Map;
 @RestController
 @RequestMapping("/testwordInfo")
 @Api(value = "提词API", tags = { "提词API" })
+@SuppressWarnings("unchecked")
 public class TestwordInfoController {
 
     @Autowired
     TestwordInfoFacade testwordInfoFacade;
 
-//    @ApiOperation(value = "提词API[zhoutg]",
-//            notes = "提词API")
-//    @PostMapping("/getword")
-//    public RespDTO<Map<String, String>> getword(@RequestBody TestwordInfoVO testwordInfoVO) {
-//        return RespDTO.onSuc(testwordInfoFacade.getWord(testwordInfoVO));
-//    }
+    //    @ApiOperation(value = "提词API[zhoutg]",
+    //            notes = "提词API")
+    //    @PostMapping("/getword")
+    //    public RespDTO<Map<String, String>> getword(@RequestBody TestwordInfoVO testwordInfoVO) {
+    //        return RespDTO.onSuc(testwordInfoFacade.getWord(testwordInfoVO));
+    //    }
 
     @ApiOperation(value = "提词转换API[zhoutg]",
             notes = "提词转换API")

+ 1 - 0
src/main/java/com/diagbot/web/TranLisController.java

@@ -23,6 +23,7 @@ import java.util.Map;
  */
 @RestController
 @RequestMapping("/tranLisConfig")
+@SuppressWarnings("unchecked")
 @Api(value = "公表映射配置API[by:kongwz]", tags = { "公表映射配置API" })
 
 public class TranLisController {

+ 0 - 1
src/main/resources/mapper/KlConceptMapper.xml

@@ -396,7 +396,6 @@
 					AND f.conceptId IS NULL
 				</when>
 				<when test="hasInfo==1">
-					-- AND f.STATUS = 1
 					AND f.conceptId IS NOT NULL
 				</when>
 			</choose>

+ 59 - 23
src/main/resources/mapper/KlRelationMapper.xml

@@ -51,31 +51,67 @@
 
     <select id="getItemByDisease" resultType="com.diagbot.dto.DiseaseItemDTO" parameterType="com.diagbot.vo.DiseaseItemVO">
         SELECT
-            t1.lib_name AS diseaseName,
-            t2.relation_id AS relationId,
-            t3.lib_name AS itemName
+            t7.diseaseName,
+            t7.relationId,
+            t7.itemName
         FROM
-            kl_concept t1,
-            kl_relation t2,
-            kl_concept t3,
-            kl_relation_order t4
-        WHERE
-            t1.is_deleted = "N"
-        AND t2.is_deleted = "N"
-        AND t3.is_deleted = "N"
-        AND t4.is_deleted = "N"
-        AND t1.lib_type = 100
-        AND t1.id = t2.start_id
-        AND t3.id = t2.end_id
-        AND t2.id = t4.t_relation_id
-        AND t2.relation_id IN (501,502,503,504,505,506,507,508)
-        AND t1.`status` = 1
-        AND t3.`status` = 1
-        AND t1.lib_name = #{diseaseName}
+            (
+                SELECT
+                    t5.diseaseId,
+                    t5.diseaseName,
+                    t5.relationId,
+                    t5.itemName,
+                    t5.itemId,
+                    t5.order_no,
+                    IFNULL(t6.min_age, 0) AS min_age,
+                    IFNULL(t6.max_age, 200) AS max_age,
+                    IFNULL(t6.sex_type, 3) AS sex_type
+                FROM
+                    (
+                        SELECT
+                            t1.id AS diseaseId,
+                            t1.lib_name AS diseaseName,
+                            t2.relation_id AS relationId,
+                            t3.lib_name AS itemName,
+                            t3.id AS itemId,
+                            t4.order_no
+                        FROM
+                            kl_concept t1,
+                            kl_relation t2,
+                            kl_concept t3,
+                            kl_relation_order t4
+                        WHERE
+                            t1.is_deleted = "N"
+                        AND t2.is_deleted = "N"
+                        AND t3.is_deleted = "N"
+                        AND t4.is_deleted = "N"
+                        AND t1.lib_type = 100
+                        AND t1.id = t2.start_id
+                        AND t3.id = t2.end_id
+                        AND t2.id = t4.t_relation_id
+                        AND t2.relation_id IN (501,502,503,504,505,506,507,508)
+                        AND t1.lib_name = #{diseaseName}
+                        AND t1.`status` = 1
+                        AND t3.`status` = 1
+                    ) t5
+                LEFT JOIN kl_concept_common t6 ON t6.is_deleted = "N"
+                AND t5.itemId = t6.concept_id
+            ) t7
+        WHERE 1=1
+        <if test="sexType == 3">
+            AND t7.sex_type in ('1','2','3')
+        </if>
+        <if test="sexType != 3">
+            AND t7.sex_type in ('3',#{sexType})
+        </if>
+        <if test="age != null and age != ''">
+            AND <![CDATA[ t7.min_age <= #{age} ]]>
+            AND <![CDATA[ t7.max_age >= #{age} ]]>
+        </if>
         ORDER BY
-            t1.id,
-            t2.relation_id,
-            t4.order_no
+            t7.diseaseId,
+            t7.relationId,
+            t7.order_no
     </select>
 
 </mapper>

+ 1 - 1
src/main/resources/mapper/KlRuleMapper.xml

@@ -159,7 +159,7 @@
         <if test="parStatus!=null">
             AND ru.status = #{parStatus}
         </if>
-        ORDER BY ru.gmt_modified DESC
+        ORDER BY ru.status DESC ,ru.gmt_modified DESC
     </select>
     <select id="getByIdRuleInfo" resultType="com.diagbot.dto.KlRuleByIdDTO">
         SELECT

+ 0 - 1
src/main/resources/mapper/KlRulePlanMapper.xml

@@ -16,7 +16,6 @@
         <result column="type" property="type"/>
         <result column="number" property="number"/>
         <result column="code" property="code"/>
-        <result column="first_place" property="firstPlace"/>
         <result column="order_no" property="orderNo"/>
         <result column="remark" property="remark"/>
     </resultMap>