瀏覽代碼

Merge branch 'dev/scale_preserve20210511' into dev/importDiagnose20210429

# Conflicts:
#	src/test/java/com/diagbot/CodeGeneration.java
zhoutg 3 年之前
父節點
當前提交
718bc56d38
共有 79 個文件被更改,包括 3894 次插入173 次删除
  1. 46 0
      doc/008.20210511量表维护脚本/med2021_init.sql
  2. 324 0
      doc/009.20210615量表规则/med_20221.sql
  3. 305 0
      doc/010.20210630诊断依据新加类型/med_2021_init.sql
  4. 4 4
      src/main/java/com/diagbot/config/CacheDeleteInit.java
  5. 88 0
      src/main/java/com/diagbot/dto/BaseRegulationDTO.java
  6. 17 0
      src/main/java/com/diagbot/dto/ConceptScaleDTO.java
  7. 107 0
      src/main/java/com/diagbot/dto/ConceptScaleDetailDTO.java
  8. 18 0
      src/main/java/com/diagbot/dto/ConceptScaleSubDTO.java
  9. 109 0
      src/main/java/com/diagbot/dto/KlConceptScaleDTO.java
  10. 6 2
      src/main/java/com/diagbot/dto/KlConceptStaticDTO.java
  11. 49 0
      src/main/java/com/diagbot/dto/KlScaleByIdDTO.java
  12. 83 0
      src/main/java/com/diagbot/dto/KlScaleDetailDTO.java
  13. 43 0
      src/main/java/com/diagbot/dto/KlScaleInfoDTO.java
  14. 16 0
      src/main/java/com/diagbot/dto/RegulationDTO.java
  15. 27 0
      src/main/java/com/diagbot/dto/RegulationIndexDTO.java
  16. 22 0
      src/main/java/com/diagbot/dto/ScaleDTO.java
  17. 5 0
      src/main/java/com/diagbot/dto/StaticKnowledgeDTO.java
  18. 2 0
      src/main/java/com/diagbot/dto/WordCrfDTO.java
  19. 312 0
      src/main/java/com/diagbot/entity/KlConceptScale.java
  20. 78 0
      src/main/java/com/diagbot/entity/KlRegulation.java
  21. 113 0
      src/main/java/com/diagbot/entity/KlRegulationBase.java
  22. 83 0
      src/main/java/com/diagbot/entity/KlRegulationCondition.java
  23. 20 0
      src/main/java/com/diagbot/entity/wrapper/KlScaleDetailWrapper.java
  24. 3 1
      src/main/java/com/diagbot/enums/BaseDiagnoseTypeEnum.java
  25. 2 1
      src/main/java/com/diagbot/enums/RedisEnum.java
  26. 11 0
      src/main/java/com/diagbot/facade/CacheFacade.java
  27. 3 0
      src/main/java/com/diagbot/facade/CommonFacade.java
  28. 65 0
      src/main/java/com/diagbot/facade/KlConceptScaleFacade.java
  29. 215 15
      src/main/java/com/diagbot/facade/KlConceptStaticFacade.java
  30. 87 0
      src/main/java/com/diagbot/facade/KlRegulationBaseFacade.java
  31. 35 0
      src/main/java/com/diagbot/facade/KlRegulationFacade.java
  32. 169 0
      src/main/java/com/diagbot/facade/KlScaleFacade.java
  33. 10 0
      src/main/java/com/diagbot/facade/NeoFacade.java
  34. 1 0
      src/main/java/com/diagbot/facade/PushFacade.java
  35. 21 0
      src/main/java/com/diagbot/mapper/KlConceptScaleMapper.java
  36. 10 0
      src/main/java/com/diagbot/mapper/KlConceptStaticMapper.java
  37. 23 0
      src/main/java/com/diagbot/mapper/KlRegulationBaseMapper.java
  38. 16 0
      src/main/java/com/diagbot/mapper/KlRegulationConditionMapper.java
  39. 22 0
      src/main/java/com/diagbot/mapper/KlRegulationMapper.java
  40. 2 61
      src/main/java/com/diagbot/process/PushProcess.java
  41. 92 29
      src/main/java/com/diagbot/rule/CommonRule.java
  42. 20 0
      src/main/java/com/diagbot/service/KlConceptScaleService.java
  43. 10 0
      src/main/java/com/diagbot/service/KlConceptStaticService.java
  44. 23 0
      src/main/java/com/diagbot/service/KlRegulationBaseService.java
  45. 16 0
      src/main/java/com/diagbot/service/KlRegulationConditionService.java
  46. 22 0
      src/main/java/com/diagbot/service/KlRegulationService.java
  47. 28 0
      src/main/java/com/diagbot/service/impl/KlConceptScaleServiceImpl.java
  48. 1 1
      src/main/java/com/diagbot/service/impl/KlConceptServiceImpl.java
  49. 15 0
      src/main/java/com/diagbot/service/impl/KlConceptStaticServiceImpl.java
  50. 32 0
      src/main/java/com/diagbot/service/impl/KlRegulationBaseServiceImpl.java
  51. 20 0
      src/main/java/com/diagbot/service/impl/KlRegulationConditionServiceImpl.java
  52. 28 0
      src/main/java/com/diagbot/service/impl/KlRegulationServiceImpl.java
  53. 10 0
      src/main/java/com/diagbot/vo/KlConceptStaticVO.java
  54. 19 0
      src/main/java/com/diagbot/vo/KlScaleByIdVO.java
  55. 15 0
      src/main/java/com/diagbot/vo/KlScaleClearVO.java
  56. 17 0
      src/main/java/com/diagbot/vo/KlScaleDetailMenuVO.java
  57. 17 0
      src/main/java/com/diagbot/vo/KlScaleInfoVO.java
  58. 16 0
      src/main/java/com/diagbot/vo/KlScaleSatartOrdisaVO.java
  59. 18 0
      src/main/java/com/diagbot/vo/KlScaleSaveGroupVO.java
  60. 70 0
      src/main/java/com/diagbot/vo/KlScaleSaveUpDetailVO.java
  61. 66 0
      src/main/java/com/diagbot/vo/KlScaleSaveUpParentVO.java
  62. 25 0
      src/main/java/com/diagbot/vo/KlScaleSaveUpVO.java
  63. 59 0
      src/main/java/com/diagbot/vo/KlScaleSubDetailVO.java
  64. 21 0
      src/main/java/com/diagbot/vo/RegulationIndexVO.java
  65. 20 0
      src/main/java/com/diagbot/vo/RegulationVO.java
  66. 16 0
      src/main/java/com/diagbot/vo/ScaleStaticAllVO.java
  67. 17 0
      src/main/java/com/diagbot/vo/ScaleVO.java
  68. 3 1
      src/main/java/com/diagbot/vo/StaticKnowledgeVO.java
  69. 9 0
      src/main/java/com/diagbot/web/CacheController.java
  70. 20 0
      src/main/java/com/diagbot/web/KlConceptScaleController.java
  71. 13 1
      src/main/java/com/diagbot/web/KlConceptStaticController.java
  72. 55 0
      src/main/java/com/diagbot/web/KlRegulationController.java
  73. 85 0
      src/main/java/com/diagbot/web/KlScaleController.java
  74. 43 38
      src/main/resources/mapper/KlConceptMapper.xml
  75. 36 0
      src/main/resources/mapper/KlConceptScaleMapper.xml
  76. 75 19
      src/main/resources/mapper/KlConceptStaticMapper.xml
  77. 149 0
      src/main/resources/mapper/KlRegulationBaseMapper.xml
  78. 21 0
      src/main/resources/mapper/KlRegulationConditionMapper.xml
  79. 100 0
      src/main/resources/mapper/KlRegulationMapper.xml

+ 46 - 0
doc/008.20210511量表维护脚本/med2021_init.sql

@@ -0,0 +1,46 @@
+/*
+Navicat MySQL Data Transfer
+
+Source Server         : 192.168.2.236
+Source Server Version : 50731
+Source Host           : 192.168.2.236:3306
+Source Database       : med_2021
+
+Target Server Type    : MYSQL
+Target Server Version : 50731
+File Encoding         : 65001
+
+Date: 2021-06-04 09:47:42
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for kl_concept_scale
+-- ----------------------------
+DROP TABLE IF EXISTS `kl_concept_scale`;
+CREATE TABLE `kl_concept_scale` (
+  `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则表示纪录未修改',
+  `concept_id` bigint(20) DEFAULT NULL COMMENT '术语概念id',
+  `parent_id` bigint(20) DEFAULT NULL COMMENT '-1:表示顶级,其他值表示上级菜单的id',
+  `content` text COMMENT '内容',
+  `rule_code` varchar(255) DEFAULT NULL COMMENT '编码',
+  `score` decimal(5,1) DEFAULT '0.0' COMMENT '扣分',
+  `factor` decimal(5,1) DEFAULT '0.0' COMMENT '系数',
+  `constant` decimal(5,1) DEFAULT '0.0' COMMENT '常数',
+  `text_type` int(11) DEFAULT NULL COMMENT '11问题选项;12文本;13得分结果(隐藏)21问题,31答案',
+  `result_type` int(11) NOT NULL DEFAULT '0' COMMENT '结果类型(1算分;2显示选择结果)',
+  `select_type` int(11) NOT NULL DEFAULT '0' COMMENT '选择类型(21单选22多选)',
+  `order_no` int(11) DEFAULT NULL COMMENT '显示顺序',
+  `status` int(2) DEFAULT '1' COMMENT '1:显示,0:不显示,2隐藏',
+  `group_num` int(11) DEFAULT '-1' COMMENT '组别互斥(同组互斥)',
+  `result` varchar(255) DEFAULT NULL COMMENT '结果',
+  `push_info` text COMMENT '推送信息',
+  `remark` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='量表明细表';

+ 324 - 0
doc/009.20210615量表规则/med_20221.sql

@@ -0,0 +1,324 @@
+USE `med_2021`;
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for kl_regulation
+-- ----------------------------
+DROP TABLE IF EXISTS `kl_regulation`;
+CREATE TABLE `kl_regulation` (
+  `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则表示纪录未修改',
+  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '规则名称',
+  `code` int(11) NOT NULL DEFAULT '100001' COMMENT '规则编码',
+  `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '规则类型:(1:量表)',
+  `status` int(1) NOT NULL DEFAULT '1' COMMENT '启用状态(0:禁用,1:启用)',
+  `remark` varchar(300) NOT NULL DEFAULT '' COMMENT '备注',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `idx_code` (`code`) USING BTREE,
+  UNIQUE KEY `idx_name` (`name`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8 COMMENT='通用规则表';
+
+-- ----------------------------
+-- Records of kl_regulation
+-- ----------------------------
+INSERT INTO `kl_regulation` VALUES ('1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '使用公共车辆-自己完全可以做', '100001', '1', '1', '使用公共车辆-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('2', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '使用公共车辆-有些困难', '100002', '1', '1', '使用公共车辆-有些困难');
+INSERT INTO `kl_regulation` VALUES ('3', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '使用公共车辆-需要帮助', '100003', '1', '1', '使用公共车辆-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('4', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '使用公共车辆-根本无法做', '100004', '1', '1', '使用公共车辆-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('5', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '行走-自己完全可以做', '100005', '1', '1', '行走-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('6', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '行走-有些困难', '100006', '1', '1', '行走-有些困难');
+INSERT INTO `kl_regulation` VALUES ('7', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '行走-需要帮助', '100007', '1', '1', '行走-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('8', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '行走-根本无法做', '100008', '1', '1', '行走-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('9', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '做饭菜-自己完全可以做', '100009', '1', '1', '做饭菜-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('10', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '做饭菜-有些困难', '100010', '1', '1', '做饭菜-有些困难');
+INSERT INTO `kl_regulation` VALUES ('11', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '做饭菜-需要帮助', '100011', '1', '1', '做饭菜-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('12', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '做饭菜-根本无法做', '100012', '1', '1', '做饭菜-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('13', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '做家务-自己完全可以做', '100013', '1', '1', '做家务-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('14', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '做家务-有些困难', '100014', '1', '1', '做家务-有些困难');
+INSERT INTO `kl_regulation` VALUES ('15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '做家务-需要帮助', '100015', '1', '1', '做家务-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('16', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '做家务-根本无法做', '100016', '1', '1', '做家务-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('17', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '吃药-自己完全可以做', '100017', '1', '1', '吃药-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('18', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '吃药-有些困难', '100018', '1', '1', '吃药-有些困难');
+INSERT INTO `kl_regulation` VALUES ('19', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '吃药-需要帮助', '100019', '1', '1', '吃药-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('20', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '吃药-根本无法做', '100020', '1', '1', '吃药-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('21', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '吃饭-自己完全可以做', '100021', '1', '1', '吃饭-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('22', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '吃饭-有些困难', '100022', '1', '1', '吃饭-有些困难');
+INSERT INTO `kl_regulation` VALUES ('23', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '吃饭-需要帮助', '100023', '1', '1', '吃饭-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('24', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '吃饭-根本无法做', '100024', '1', '1', '吃饭-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('25', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '梳头、刷牙-自己完全可以做', '100025', '1', '1', '梳头、刷牙-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('26', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '梳头、刷牙-有些困难', '100026', '1', '1', '梳头、刷牙-有些困难');
+INSERT INTO `kl_regulation` VALUES ('27', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '梳头、刷牙-需要帮助', '100027', '1', '1', '梳头、刷牙-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('28', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '梳头、刷牙-根本无法做', '100028', '1', '1', '梳头、刷牙-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('29', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '洗衣-自己完全可以做', '100029', '1', '1', '洗衣-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('30', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '洗衣-有些困难', '100030', '1', '1', '洗衣-有些困难');
+INSERT INTO `kl_regulation` VALUES ('31', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '洗衣-需要帮助', '100031', '1', '1', '洗衣-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('32', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '洗衣-根本无法做', '100032', '1', '1', '洗衣-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('33', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '洗澡-自己完全可以做', '100033', '1', '1', '洗澡-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('34', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '洗澡-有些困难', '100034', '1', '1', '洗澡-有些困难');
+INSERT INTO `kl_regulation` VALUES ('35', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '洗澡-需要帮助', '100035', '1', '1', '洗澡-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('36', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '洗澡-根本无法做', '100036', '1', '1', '洗澡-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '购物-自己完全可以做', '100037', '1', '1', '购物-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('38', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '购物-有些困难', '100038', '1', '1', '购物-有些困难');
+INSERT INTO `kl_regulation` VALUES ('39', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '购物-需要帮助', '100039', '1', '1', '购物-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('40', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '购物-根本无法做', '100040', '1', '1', '购物-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('41', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '定时上厕所-自己完全可以做', '100041', '1', '1', '定时上厕所-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('42', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '定时上厕所-有些困难', '100042', '1', '1', '定时上厕所-有些困难');
+INSERT INTO `kl_regulation` VALUES ('43', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '定时上厕所-需要帮助', '100043', '1', '1', '定时上厕所-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('44', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '定时上厕所-根本无法做', '100044', '1', '1', '定时上厕所-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('45', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '打电话-自己完全可以做', '100045', '1', '1', '打电话-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('46', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '打电话-有些困难', '100046', '1', '1', '打电话-有些困难');
+INSERT INTO `kl_regulation` VALUES ('47', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '打电话-需要帮助', '100047', '1', '1', '打电话-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('48', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '打电话-根本无法做', '100048', '1', '1', '打电话-根本无法做');
+INSERT INTO `kl_regulation` VALUES ('49', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '处理自己钱财-自己完全可以做', '100049', '1', '1', '处理自己钱财-自己完全可以做');
+INSERT INTO `kl_regulation` VALUES ('50', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '处理自己钱财-有些困难', '100050', '1', '1', '处理自己钱财-有些困难');
+INSERT INTO `kl_regulation` VALUES ('51', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '处理自己钱财-需要帮助', '100051', '1', '1', '处理自己钱财-需要帮助');
+INSERT INTO `kl_regulation` VALUES ('52', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '处理自己钱财-根本无法做', '100052', '1', '1', '处理自己钱财-根本无法做');
+
+-- ----------------------------
+-- Table structure for kl_regulation_base
+-- ----------------------------
+DROP TABLE IF EXISTS `kl_regulation_base`;
+CREATE TABLE `kl_regulation_base` (
+  `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则表示纪录未修改',
+  `concept_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '提示概念id',
+  `description` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '描述',
+  `type` int(10) NOT NULL DEFAULT '1' COMMENT '基础规则类型(1:等于术语本身;2:存在比较;3:主诉现病史正则;4:既往史正则)',
+  `min_operator` varchar(15) NOT NULL DEFAULT '' COMMENT '最小域比较符',
+  `min_value` varchar(50) NOT NULL DEFAULT '' COMMENT '最小域值',
+  `min_unit` varchar(50) NOT NULL DEFAULT '' COMMENT '最小域单位',
+  `max_operator` varchar(15) NOT NULL DEFAULT '' COMMENT '最大域比较符',
+  `max_value` varchar(50) NOT NULL DEFAULT '' COMMENT '最大域值',
+  `max_unit` varchar(50) NOT NULL DEFAULT '' COMMENT '最大域单位',
+  `eq_operator` varchar(15) NOT NULL DEFAULT '' COMMENT '等于域比较符',
+  `eq_value` varchar(255) NOT NULL DEFAULT '' COMMENT '等于域值',
+  `eq_unit` varchar(50) NOT NULL DEFAULT '' COMMENT '等于域单位',
+  `status` int(1) NOT NULL DEFAULT '1' COMMENT '启用状态(0:禁用,1:启用)',
+  PRIMARY KEY (`id`),
+  KEY `idx_concept_id` (`concept_id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8 COMMENT='通用规则基础表';
+
+-- ----------------------------
+-- Records of kl_regulation_base
+-- ----------------------------
+INSERT INTO `kl_regulation_base` VALUES ('1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '使用公共车辆-自己完全可以做', '3', '', '', '', '', '', '', '', '自行乘坐公共汽车', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('2', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '使用公共车辆-有些困难', '3', '', '', '', '', '', '', '', '乘坐公共汽车困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('3', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '使用公共车辆-需要帮助', '3', '', '', '', '', '', '', '', '乘坐公共汽车需要帮忙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('4', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '使用公共车辆-根本无法做', '3', '', '', '', '', '', '', '', '不能乘坐公共汽车', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('5', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '行走-自己完全可以做', '3', '', '', '', '', '', '', '', '自行走路|行走自如', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('6', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '行走-有些困难', '3', '', '', '', '', '', '', '', '行走困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('7', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '行走-需要帮助', '3', '', '', '', '', '', '', '', '行走需要搀扶', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('8', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '行走-根本无法做', '3', '', '', '', '', '', '', '', '不能行走', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('9', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '做饭菜-自己完全可以做', '3', '', '', '', '', '', '', '', '(?<!不)会做饭菜', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('10', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '做饭菜-有些困难', '3', '', '', '', '', '', '', '', '做饭菜困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('11', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '做饭菜-需要帮助', '3', '', '', '', '', '', '', '', '做饭菜需要帮忙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('12', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '做饭菜-根本无法做', '3', '', '', '', '', '', '', '', '不会做饭菜', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('13', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '做家务-自己完全可以做', '3', '', '', '', '', '', '', '', '(?<!不)会做家务', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('14', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '做家务-有些困难', '3', '', '', '', '', '', '', '', '做家务困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '做家务-需要帮助', '3', '', '', '', '', '', '', '', '做家务需要帮忙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('16', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '做家务-根本无法做', '3', '', '', '', '', '', '', '', '不会做家务', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('17', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '吃药-自己完全可以做', '3', '', '', '', '', '', '', '', '自行服药', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('18', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '吃药-有些困难', '3', '', '', '', '', '', '', '', '服药困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('19', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '吃药-需要帮助', '3', '', '', '', '', '', '', '', '吃药需要帮忙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('20', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '吃药-根本无法做', '3', '', '', '', '', '', '', '', '不会吃药', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('21', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '吃饭-自己完全可以做', '3', '', '', '', '', '', '', '', '自行吃饭|自行用餐|自主用餐|自主进食', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('22', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '吃饭-有些困难', '3', '', '', '', '', '', '', '', '吃饭困难|用餐困难|进食困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('23', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '吃饭-需要帮助', '3', '', '', '', '', '', '', '', '吃饭需要帮忙|用餐需帮忙|进食需要帮助', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('24', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '吃饭-根本无法做', '3', '', '', '', '', '', '', '', '不会吃饭|不能用餐', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('25', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '梳头、刷牙-自己完全可以做', '3', '', '', '', '', '', '', '', '自行梳头|自行刷牙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('26', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '梳头、刷牙-有些困难', '3', '', '', '', '', '', '', '', '梳头困难|刷牙困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('27', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '梳头、刷牙-需要帮助', '3', '', '', '', '', '', '', '', '梳头需要帮忙|刷牙需要帮忙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('28', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '梳头、刷牙-根本无法做', '3', '', '', '', '', '', '', '', '不会梳头|不会刷牙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('29', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '洗衣-自己完全可以做', '3', '', '', '', '', '', '', '', '自己洗衣服', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('30', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '洗衣-有些困难', '3', '', '', '', '', '', '', '', '洗衣困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('31', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '洗衣-需要帮助', '3', '', '', '', '', '', '', '', '洗衣服需要帮忙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('32', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '洗衣-根本无法做', '3', '', '', '', '', '', '', '', '不会洗衣服', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('33', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '洗澡-自己完全可以做', '3', '', '', '', '', '', '', '', '自己洗澡', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('34', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '洗澡-有些困难', '3', '', '', '', '', '', '', '', '洗澡困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('35', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '洗澡-需要帮助', '3', '', '', '', '', '', '', '', '洗澡需要帮忙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('36', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '洗澡-根本无法做', '3', '', '', '', '', '', '', '', '不会洗澡', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '购物-自己完全可以做', '3', '', '', '', '', '', '', '', '自己购物|自己买东西', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('38', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '购物-有些困难', '3', '', '', '', '', '', '', '', '购物困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('39', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '购物-需要帮助', '3', '', '', '', '', '', '', '', '购物需要帮忙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('40', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '购物-根本无法做', '3', '', '', '', '', '', '', '', '不会购物', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('41', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '定时上厕所-自己完全可以做', '3', '', '', '', '', '', '', '', '自己能上厕所|自行如厕', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('42', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '定时上厕所-有些困难', '3', '', '', '', '', '', '', '', '上厕所困难|如厕困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('43', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '定时上厕所-需要帮助', '3', '', '', '', '', '', '', '', '上厕所需要帮忙|上厕所需要搀扶|如厕需要帮忙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('44', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '定时上厕所-根本无法做', '3', '', '', '', '', '', '', '', '不会上厕所|自己不能上厕所|不能如厕', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('45', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '打电话-自己完全可以做', '3', '', '', '', '', '', '', '', '(?<!不)能正常打电话', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('46', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '打电话-有些困难', '3', '', '', '', '', '', '', '', '打电话困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('47', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '打电话-需要帮助', '3', '', '', '', '', '', '', '', '打电话需要帮忙', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('48', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '打电话-根本无法做', '3', '', '', '', '', '', '', '', '不会打电话', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('49', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '处理自己钱财-自己完全可以做', '3', '', '', '', '', '', '', '', '钱币能分清', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('50', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '处理自己钱财-有些困难', '3', '', '', '', '', '', '', '', '分清钱币困难', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('51', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '处理自己钱财-需要帮助', '3', '', '', '', '', '', '', '', '分清钱币需要帮助', '', '1');
+INSERT INTO `kl_regulation_base` VALUES ('52', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '0', '处理自己钱财-根本无法做', '3', '', '', '', '', '', '', '', '不认识钱币', '', '1');
+
+-- ----------------------------
+-- Table structure for kl_regulation_condition
+-- ----------------------------
+DROP TABLE IF EXISTS `kl_regulation_condition`;
+CREATE TABLE `kl_regulation_condition` (
+  `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则表示纪录未修改',
+  `regulation_id` bigint(20) NOT NULL COMMENT '通用规则表主表id',
+  `condition_type` int(11) NOT NULL DEFAULT '0' COMMENT '条件类型(1:基础条件;2:组合条件)',
+  `condition_group` int(11) NOT NULL DEFAULT '0' COMMENT '规则组别(1XX_condition_type为2:组合条件有效)',
+  `fit_no` int(11) NOT NULL DEFAULT '1' COMMENT '符合数量(condition_type为2:组合条件有效)',
+  `base_group` int(11) NOT NULL DEFAULT '0' COMMENT '基础规则组别(1X_condition_type为1:基础条件;2:组合条件)',
+  `regulation_base_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '基础规则id(condition_type为1:基础条件有效)',
+  PRIMARY KEY (`id`),
+  KEY `idx_regulation_id` (`regulation_id`) USING BTREE,
+  KEY `idx_regulation_base_id` (`regulation_base_id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=105 DEFAULT CHARSET=utf8 COMMENT='通用规则条件表';
+
+-- ----------------------------
+-- Records of kl_regulation_condition
+-- ----------------------------
+INSERT INTO `kl_regulation_condition` VALUES ('1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', '1', '0', '0', '10', '1');
+INSERT INTO `kl_regulation_condition` VALUES ('2', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '2', '1', '0', '0', '10', '2');
+INSERT INTO `kl_regulation_condition` VALUES ('3', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '3', '1', '0', '0', '10', '3');
+INSERT INTO `kl_regulation_condition` VALUES ('4', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '4', '1', '0', '0', '10', '4');
+INSERT INTO `kl_regulation_condition` VALUES ('5', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '5', '1', '0', '0', '10', '5');
+INSERT INTO `kl_regulation_condition` VALUES ('6', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '6', '1', '0', '0', '10', '6');
+INSERT INTO `kl_regulation_condition` VALUES ('7', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '1', '0', '0', '10', '7');
+INSERT INTO `kl_regulation_condition` VALUES ('8', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '1', '0', '0', '10', '8');
+INSERT INTO `kl_regulation_condition` VALUES ('9', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '9', '1', '0', '0', '10', '9');
+INSERT INTO `kl_regulation_condition` VALUES ('10', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '10', '1', '0', '0', '10', '10');
+INSERT INTO `kl_regulation_condition` VALUES ('11', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '11', '1', '0', '0', '10', '11');
+INSERT INTO `kl_regulation_condition` VALUES ('12', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '1', '0', '0', '10', '12');
+INSERT INTO `kl_regulation_condition` VALUES ('13', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '1', '0', '0', '10', '13');
+INSERT INTO `kl_regulation_condition` VALUES ('14', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '14', '1', '0', '0', '10', '14');
+INSERT INTO `kl_regulation_condition` VALUES ('15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '15', '1', '0', '0', '10', '15');
+INSERT INTO `kl_regulation_condition` VALUES ('16', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '16', '1', '0', '0', '10', '16');
+INSERT INTO `kl_regulation_condition` VALUES ('17', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '17', '1', '0', '0', '10', '17');
+INSERT INTO `kl_regulation_condition` VALUES ('18', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '18', '1', '0', '0', '10', '18');
+INSERT INTO `kl_regulation_condition` VALUES ('19', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '19', '1', '0', '0', '10', '19');
+INSERT INTO `kl_regulation_condition` VALUES ('20', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '20', '1', '0', '0', '10', '20');
+INSERT INTO `kl_regulation_condition` VALUES ('21', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '1', '0', '0', '10', '21');
+INSERT INTO `kl_regulation_condition` VALUES ('22', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '22', '1', '0', '0', '10', '22');
+INSERT INTO `kl_regulation_condition` VALUES ('23', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '23', '1', '0', '0', '10', '23');
+INSERT INTO `kl_regulation_condition` VALUES ('24', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '24', '1', '0', '0', '10', '24');
+INSERT INTO `kl_regulation_condition` VALUES ('25', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '25', '1', '0', '0', '10', '25');
+INSERT INTO `kl_regulation_condition` VALUES ('26', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '26', '1', '0', '0', '10', '26');
+INSERT INTO `kl_regulation_condition` VALUES ('27', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '27', '1', '0', '0', '10', '27');
+INSERT INTO `kl_regulation_condition` VALUES ('28', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '28', '1', '0', '0', '10', '28');
+INSERT INTO `kl_regulation_condition` VALUES ('29', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '29', '1', '0', '0', '10', '29');
+INSERT INTO `kl_regulation_condition` VALUES ('30', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '30', '1', '0', '0', '10', '30');
+INSERT INTO `kl_regulation_condition` VALUES ('31', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '31', '1', '0', '0', '10', '31');
+INSERT INTO `kl_regulation_condition` VALUES ('32', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '32', '1', '0', '0', '10', '32');
+INSERT INTO `kl_regulation_condition` VALUES ('33', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '33', '1', '0', '0', '10', '33');
+INSERT INTO `kl_regulation_condition` VALUES ('34', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '34', '1', '0', '0', '10', '34');
+INSERT INTO `kl_regulation_condition` VALUES ('35', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '35', '1', '0', '0', '10', '35');
+INSERT INTO `kl_regulation_condition` VALUES ('36', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '36', '1', '0', '0', '10', '36');
+INSERT INTO `kl_regulation_condition` VALUES ('37', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '37', '1', '0', '0', '10', '37');
+INSERT INTO `kl_regulation_condition` VALUES ('38', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '38', '1', '0', '0', '10', '38');
+INSERT INTO `kl_regulation_condition` VALUES ('39', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '39', '1', '0', '0', '10', '39');
+INSERT INTO `kl_regulation_condition` VALUES ('40', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '40', '1', '0', '0', '10', '40');
+INSERT INTO `kl_regulation_condition` VALUES ('41', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '1', '0', '0', '10', '41');
+INSERT INTO `kl_regulation_condition` VALUES ('42', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '42', '1', '0', '0', '10', '42');
+INSERT INTO `kl_regulation_condition` VALUES ('43', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '43', '1', '0', '0', '10', '43');
+INSERT INTO `kl_regulation_condition` VALUES ('44', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '44', '1', '0', '0', '10', '44');
+INSERT INTO `kl_regulation_condition` VALUES ('45', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '45', '1', '0', '0', '10', '45');
+INSERT INTO `kl_regulation_condition` VALUES ('46', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '46', '1', '0', '0', '10', '46');
+INSERT INTO `kl_regulation_condition` VALUES ('47', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '47', '1', '0', '0', '10', '47');
+INSERT INTO `kl_regulation_condition` VALUES ('48', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '48', '1', '0', '0', '10', '48');
+INSERT INTO `kl_regulation_condition` VALUES ('49', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '49', '1', '0', '0', '10', '49');
+INSERT INTO `kl_regulation_condition` VALUES ('50', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '1', '0', '0', '10', '50');
+INSERT INTO `kl_regulation_condition` VALUES ('51', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '1', '0', '0', '10', '51');
+INSERT INTO `kl_regulation_condition` VALUES ('52', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '52', '1', '0', '0', '10', '52');
+INSERT INTO `kl_regulation_condition` VALUES ('53', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('54', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '2', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('55', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '3', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('56', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '4', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('57', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '5', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('58', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '6', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('59', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('60', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '8', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('61', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '9', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('62', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '10', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('63', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '11', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('64', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '12', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('65', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('66', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '14', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('67', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '15', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('68', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '16', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('69', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '17', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('70', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '18', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('71', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '19', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('72', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '20', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('73', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('74', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '22', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('75', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '23', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('76', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '24', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('77', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '25', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('78', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '26', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('79', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '27', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('80', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '28', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('81', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '29', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('82', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '30', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('83', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '31', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('84', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '32', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('85', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '33', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('86', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '34', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('87', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '35', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('88', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '36', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('89', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '37', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('90', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '38', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('91', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '39', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('92', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '40', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('93', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('94', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '42', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('95', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '43', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('96', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '44', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('97', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '45', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('98', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '46', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('99', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '47', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('100', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '48', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('101', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '49', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('102', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('103', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '2', '100', '1', '10', '0');
+INSERT INTO `kl_regulation_condition` VALUES ('104', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '52', '2', '100', '1', '10', '0');
+
+-- ----------------------------
+-- Table structure for kl_concept_scale
+-- ----------------------------
+DROP TABLE IF EXISTS `kl_concept_scale`;
+CREATE TABLE `kl_concept_scale` (
+  `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则表示纪录未修改',
+  `concept_id` bigint(20) DEFAULT NULL COMMENT '术语概念id',
+  `parent_id` bigint(20) DEFAULT NULL COMMENT '-1:表示顶级,其他值表示上级菜单的id',
+  `content` text COMMENT '内容',
+  `rule_code` varchar(255) DEFAULT NULL COMMENT '编码',
+  `score` decimal(5,1) DEFAULT '0.0' COMMENT '扣分',
+  `factor` decimal(5,1) DEFAULT '0.0' COMMENT '系数',
+  `constant` decimal(5,1) DEFAULT '0.0' COMMENT '常数',
+  `text_type` int(11) DEFAULT NULL COMMENT '11问题选项;12文本;13得分结果(隐藏)21问题,31答案',
+  `result_type` int(11) NOT NULL DEFAULT '0' COMMENT '结果类型(1算分;2显示选择结果)',
+  `select_type` int(11) NOT NULL DEFAULT '0' COMMENT '选择类型(21单选22多选)',
+  `order_no` int(11) DEFAULT NULL COMMENT '显示顺序',
+  `status` int(2) DEFAULT '1' COMMENT '1:显示,0:不显示,2隐藏',
+  `group_num` int(11) DEFAULT '-1' COMMENT '组别互斥(同组互斥)',
+  `result` varchar(255) DEFAULT NULL COMMENT '结果',
+  `push_info` text COMMENT '推送信息',
+  `remark` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='量表明细表';

+ 305 - 0
doc/010.20210630诊断依据新加类型/med_2021_init.sql

@@ -0,0 +1,305 @@
+USE `med_2021`;
+/*
+Navicat MySQL Data Transfer
+
+Source Server         : 192.168.2.236
+Source Server Version : 50731
+Source Host           : 192.168.2.236:3306
+Source Database       : med_2021
+
+Target Server Type    : MYSQL
+Target Server Version : 50731
+File Encoding         : 65001
+
+Date: 2021-06-30 17:04:54
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for kl_rule_plan
+-- ----------------------------
+DROP TABLE IF EXISTS `kl_rule_plan`;
+CREATE TABLE `kl_rule_plan` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '资源ID',
+  `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则表示纪录未修改',
+  `plan_code` varchar(255) DEFAULT NULL COMMENT '方案编码(rule规则dis诊断依据)',
+  `rule_type` bigint(20) DEFAULT NULL COMMENT '规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)',
+  `parent_id` bigint(20) DEFAULT NULL COMMENT '-1:表示顶级,其他值表示上级菜单的id',
+  `name` varchar(255) DEFAULT NULL COMMENT '基础规则类型',
+  `type` int(2) DEFAULT NULL,
+  `number` int(11) DEFAULT NULL COMMENT '条件数量',
+  `code` varchar(255) DEFAULT NULL COMMENT '类型编码',
+  `order_no` int(11) DEFAULT NULL COMMENT '显示顺序',
+  `remark` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2428 DEFAULT CHARSET=utf8;
+
+-- ----------------------------
+-- Records of kl_rule_plan
+-- ----------------------------
+INSERT INTO `kl_rule_plan` VALUES ('1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '-1', '开单合理性', '1', null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '-1', '高危', '2', null, '', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('3', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '3', '-1', '危急值', '3', null, '', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('4', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '-1', '其他值提醒', '4', null, '', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('5', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '5', '-1', '其他值提醒输血', '5', null, '', '5', '');
+INSERT INTO `kl_rule_plan` VALUES ('6', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '6', '-1', '正常项目重复开立', '6', null, '', '6', '');
+INSERT INTO `kl_rule_plan` VALUES ('10', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '1', '药品通用名', null, '1', '101', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('11', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '1', '实验室检查套餐', null, '1', '107', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('12', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '1', '辅助检查项目', null, '1', '109', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('13', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '1', '辅助检查子项目', null, '1', '110', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('14', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '1', '手术和操作', null, '1', '106', '5', '');
+INSERT INTO `kl_rule_plan` VALUES ('15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '1', '输血类型', null, '1', '113', '6', '');
+INSERT INTO `kl_rule_plan` VALUES ('20', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '2', '药品通用名', null, '1', '101', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('21', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '2', '手术和操作', null, '1', '106', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('30', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '3', '3', '实验室检查子项目', null, '2', '108', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('31', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '3', '3', '辅助检查结果', null, '0', '112', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('40', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '4', '实验室检查子项目', null, '2', '108', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('41', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '4', '辅助检查结果', null, '2', '112', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('50', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '5', '5', '实验室检查子项目', null, '2', '108', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('60', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '6', '6', '辅助检查项目', null, '1', '109', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('61', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '6', '6', '辅助检查子项目', null, '1', '110', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('70', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '10', '开单外等于术语本身', '1', null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('71', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '10', '开单外存在比较', '2', null, '', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('72', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '10', '过敏原', '4', null, '', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('73', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '10', '开单项', '5', null, '', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('74', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '70', '人群', null, null, '117', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('75', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '70', '性别', null, null, '116', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('76', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '70', '疾病', null, null, '100', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('77', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '70', '医疗器械及物品', null, null, '120', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('78', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '70', '药品通用名', null, null, '101', '5', '');
+INSERT INTO `kl_rule_plan` VALUES ('79', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '70', '症状', null, null, '103', '6', '');
+INSERT INTO `kl_rule_plan` VALUES ('80', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '70', '辅助检查结果', null, null, '112', '7', '');
+INSERT INTO `kl_rule_plan` VALUES ('81', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '70', '体格检查结果', null, null, '105', '8', '');
+INSERT INTO `kl_rule_plan` VALUES ('82', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '70', '手术和操作', null, null, '106', '9', '');
+INSERT INTO `kl_rule_plan` VALUES ('83', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '71', '年龄', null, null, '410', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('84', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '71', '体格检查项目', null, null, '104', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('85', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '71', '实验室检查子项目', null, null, '108', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('86', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '72', '药品通用名', null, null, '101', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('87', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '72', '药品化学物质类别', null, null, '301', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('88', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '72', '药品治疗学类别', null, null, '302', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('89', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '72', '药品药理学类别', null, null, '303', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('90', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '72', '药品解剖学类别', null, null, '304', '5', '');
+INSERT INTO `kl_rule_plan` VALUES ('91', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '72', '其他过敏原', null, null, '119', '6', '');
+INSERT INTO `kl_rule_plan` VALUES ('92', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '73', '辅助检查项目', null, null, '109', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('93', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '73', '辅助检查子项目', null, null, '110', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('100', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '11', '开单外等于术语本身', '1', null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('101', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '11', '开单外存在比较', '2', null, '', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('102', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '11', '过敏原', '4', null, '', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('103', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '11', '开单项', '5', null, '', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('104', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '100', '人群', null, null, '117', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('105', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '100', '性别', null, null, '116', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('106', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '100', '疾病', null, null, '100', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('107', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '100', '医疗器械及物品', null, null, '120', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('108', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '100', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('109', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '100', '症状', null, null, '103', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('110', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '100', '辅助检查结果', null, null, '112', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('111', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '100', '体格检查结果', null, null, '105', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('112', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '100', '手术和操作', null, null, '106', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('113', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '101', '年龄', null, null, '410', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('114', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '101', '体格检查项目', null, null, '104', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('115', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '101', '实验室检查子项目', null, null, '108', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('116', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '102', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('117', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '102', '药品化学物质类别', null, null, '301', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('118', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '102', '药品治疗学类别', null, null, '302', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('119', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '102', '药品药理学类别', null, null, '303', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('120', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '102', '药品解剖学类别', null, null, '304', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('121', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '102', '其他过敏原', null, null, '119', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('122', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '103', '辅助检查项目', null, null, '109', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('123', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '103', '辅助检查子项目', null, null, '110', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('200', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '12', '开单外等于术语本身', '1', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('201', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '12', '开单外存在比较', '2', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('202', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '12', '过敏原', '4', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('203', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '12', '开单项', '5', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('204', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '200', '人群', null, null, '117', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('205', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '200', '性别', null, null, '116', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('206', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '200', '疾病', null, null, '100', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('207', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '200', '医疗器械及物品', null, null, '120', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('208', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '200', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('209', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '200', '症状', null, null, '103', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('210', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '200', '辅助检查结果', null, null, '112', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('211', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '200', '体格检查结果', null, null, '105', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('212', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '200', '手术和操作', null, null, '106', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('213', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '201', '年龄', null, null, '410', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('214', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '201', '体格检查项目', null, null, '104', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('215', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '201', '实验室检查子项目', null, null, '108', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('216', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '202', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('217', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '202', '药品化学物质类别', null, null, '301', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('218', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '202', '药品治疗学类别', null, null, '302', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('219', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '202', '药品药理学类别', null, null, '303', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('220', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '202', '药品解剖学类别', null, null, '304', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('221', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '202', '其他过敏原', null, null, '119', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('222', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '203', '辅助检查项目', null, null, '109', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('223', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '203', '辅助检查子项目', null, null, '110', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('300', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '13', '开单外等于术语本身', '1', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('301', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '13', '开单外存在比较', '2', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('302', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '13', '过敏原', '4', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('303', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '13', '开单项', '5', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('304', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '300', '人群', null, null, '117', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('305', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '300', '性别', null, null, '116', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('306', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '300', '疾病', null, null, '100', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('307', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '300', '医疗器械及物品', null, null, '120', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('308', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '300', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('309', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '300', '症状', null, null, '103', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('310', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '300', '辅助检查结果', null, null, '112', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('311', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '300', '体格检查结果', null, null, '105', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('312', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '300', '手术和操作', null, null, '106', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('313', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '301', '年龄', null, null, '410', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('314', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '301', '体格检查项目', null, null, '104', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('315', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '301', '实验室检查子项目', null, null, '108', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('316', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '302', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('317', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '302', '药品化学物质类别', null, null, '301', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('318', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '302', '药品治疗学类别', null, null, '302', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('319', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '302', '药品药理学类别', null, null, '303', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('320', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '302', '药品解剖学类别', null, null, '304', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('321', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '302', '其他过敏原', null, null, '119', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('322', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '303', '辅助检查项目', null, null, '109', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('323', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '303', '辅助检查子项目', null, null, '110', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('400', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '14', '开单外等于术语本身', '1', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('401', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '14', '开单外存在比较', '2', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('402', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '14', '过敏原', '4', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('403', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '14', '开单项', '5', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('404', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '400', '人群', null, null, '117', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('405', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '400', '性别', null, null, '116', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('406', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '400', '疾病', null, null, '100', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('407', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '400', '医疗器械及物品', null, null, '120', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('408', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '400', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('409', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '400', '症状', null, null, '103', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('410', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '400', '辅助检查结果', null, null, '112', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('411', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '400', '体格检查结果', null, null, '105', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('412', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '400', '手术和操作', null, null, '106', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('413', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '401', '年龄', null, null, '410', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('414', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '401', '体格检查项目', null, null, '104', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('415', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '401', '实验室检查子项目', null, null, '108', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('416', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '402', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('417', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '402', '药品化学物质类别', null, null, '301', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('418', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '402', '药品治疗学类别', null, null, '302', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('419', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '402', '药品药理学类别', null, null, '303', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('420', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '402', '药品解剖学类别', null, null, '304', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('421', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '402', '其他过敏原', null, null, '119', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('422', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '403', '辅助检查项目', null, null, '109', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('423', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '403', '辅助检查子项目', null, null, '110', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('500', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '15', '开单外等于术语本身', '1', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('501', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '15', '开单外存在比较', '2', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('502', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '15', '过敏原', '4', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('503', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '15', '开单项', '5', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('504', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '500', '人群', null, null, '117', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('505', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '500', '性别', null, null, '116', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('506', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '500', '疾病', null, null, '100', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('507', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '500', '医疗器械及物品', null, null, '120', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('508', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '500', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('509', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '500', '症状', null, null, '103', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('510', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '500', '辅助检查结果', null, null, '112', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('511', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '500', '体格检查结果', null, null, '105', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('512', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '500', '手术和操作', null, null, '106', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('513', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '501', '年龄', null, null, '410', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('514', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '501', '体格检查项目', null, null, '104', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('515', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '501', '实验室检查子项目', null, null, '108', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('516', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '502', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('517', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '502', '药品化学物质类别', null, null, '301', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('518', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '502', '药品治疗学类别', null, null, '302', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('519', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '502', '药品药理学类别', null, null, '303', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('520', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '502', '药品解剖学类别', null, null, '304', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('521', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '502', '其他过敏原', null, null, '119', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('522', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '503', '辅助检查项目', null, null, '109', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('523', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '1', '503', '辅助检查子项目', null, null, '110', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('600', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '20', '开单外等于术语本身', '1', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('601', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '21', '无子条件', null, null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('602', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '21', '开单外等于术语本身', '1', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('603', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '21', '开单外存在比较', '2', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('604', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '600', '药品剂型', null, null, '102', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('605', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '602', '体格检查结果', null, null, '105', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('606', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '602', '疾病', null, null, '100', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('607', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '602', '辅助检查结果', null, null, '112', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('608', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '603', '年龄', null, null, '410', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('609', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '603', '体格检查项目', null, null, '104', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('610', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '2', '603', '实验室检查子项目', null, null, '108', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('700', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '3', '30', '开单外等于术语本身', '1', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('701', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '3', '30', '开单外存在比较', '2', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('702', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '3', '31', '无子条件', null, null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('703', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '3', '700', '人群', null, null, '117', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('704', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '3', '701', '实验室检查子项目', null, null, '108', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('800', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '40', '开单外等于术语本身', '1', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('801', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '40', '开单外存在比较', '2', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('802', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '41', '开单外等于术语本身', '1', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('803', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '41', '开单外存在比较', '2', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('804', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '41', '开单外不等于术语本身', '3', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('805', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '800', '疾病', null, null, '100', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('806', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '800', '药品通用名', null, null, '101', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('807', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '800', '人群', null, null, '117', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('808', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '801', '实验室检查子项目', null, null, '108', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('809', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '802', '人群', null, null, '117', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('810', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '802', '辅助检查结果', null, null, '112', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('811', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '802', '性别', null, null, '116', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('812', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '803', '年龄', null, null, '410', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('813', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '804', '辅助检查结果', null, null, '112', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('900', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '5', '50', '开单外等于术语本身', '1', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('901', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '5', '50', '开单外存在比较', '2', null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('902', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '5', '900', '疾病', null, null, '100', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('903', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '5', '900', '手术和操作', null, null, '106', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('904', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '5', '901', '实验室检查子项目', null, null, '108', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('1000', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '6', '60', '检查结果正则表达式', '6', null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('1001', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '6', '61', '检查结果正则表达式', '6', null, '', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('1002', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '6', '1000', '辅助检查项目', null, null, '109', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('1003', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '6', '1001', '辅助检查子项目', null, null, '110', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2200', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '-1', '拟诊', null, null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('2210', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2200', '等于术语本身', '1', null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2211', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2200', '存在比较', '2', null, '', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('2212', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2200', '主诉现病史正则', '3', null, '', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('2213', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2200', '既往史正则', '4', null, '', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('2214', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2200', '查体正则', '5', null, '', '5', '');
+INSERT INTO `kl_rule_plan` VALUES ('2215', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2200', '辅检结果正则', '6', null, '', '6', '');
+INSERT INTO `kl_rule_plan` VALUES ('2216', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2210', '症状', null, null, '103', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2217', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2210', '体格检查结果', null, null, '105', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('2218', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2210', '疾病', null, null, '100', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('2219', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2210', '人群', null, null, '117', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('2220', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2210', '辅助检查结果', null, null, '112', '5', '');
+INSERT INTO `kl_rule_plan` VALUES ('2221', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2211', '年龄', null, null, '410', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2222', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2211', '体格检查项目', null, null, '104', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('2223', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2211', '实验室检查子项目', null, null, '108', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('2224', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2212', '主诉现病史正则', null, null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2225', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2213', '既往史正则', null, null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2226', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2214', '查体正则', null, null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('2227', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '2', '2215', '辅检结果正则', null, null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('2300', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '-1', '确诊', null, null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('2310', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2300', '等于术语本身', '1', null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2311', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2300', '存在比较', '2', null, '', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('2312', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2300', '主诉现病史正则', '3', null, '', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('2313', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2300', '既往史正则', '4', null, '', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('2314', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2300', '查体正则', '5', null, '', '5', '');
+INSERT INTO `kl_rule_plan` VALUES ('2315', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2300', '辅检结果正则', '6', null, '', '6', '');
+INSERT INTO `kl_rule_plan` VALUES ('2316', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2310', '症状', null, null, '103', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2317', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2310', '体格检查结果', null, null, '105', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('2318', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2310', '疾病', null, null, '100', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('2319', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2310', '人群', null, null, '117', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('2320', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2310', '辅助检查结果', null, null, '112', '5', '');
+INSERT INTO `kl_rule_plan` VALUES ('2321', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2311', '年龄', null, null, '410', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2322', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2311', '体格检查项目', null, null, '104', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('2323', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2311', '实验室检查子项目', null, null, '108', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('2324', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2312', '主诉现病史正则', null, null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2325', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2313', '既往史正则', null, null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2326', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2314', '查体正则', null, null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('2327', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '3', '2315', '辅检结果正则', null, null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('2400', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '-1', '警惕', null, null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('2410', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2400', '等于术语本身', '1', null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2411', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2400', '存在比较', '2', null, '', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('2412', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2400', '主诉现病史正则', '3', null, '', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('2413', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2400', '既往史正则', '4', null, '', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('2414', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2400', '查体正则', '5', null, '', '5', '');
+INSERT INTO `kl_rule_plan` VALUES ('2415', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2400', '辅检结果正则', '6', null, '', '6', '');
+INSERT INTO `kl_rule_plan` VALUES ('2416', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2410', '症状', null, null, '103', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2417', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2410', '体格检查结果', null, null, '105', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('2418', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2410', '疾病', null, null, '100', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('2419', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2410', '人群', null, null, '117', '4', '');
+INSERT INTO `kl_rule_plan` VALUES ('2420', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2410', '辅助检查结果', null, null, '112', '5', '');
+INSERT INTO `kl_rule_plan` VALUES ('2421', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2411', '年龄', null, null, '410', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2422', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2411', '体格检查项目', null, null, '104', '2', '');
+INSERT INTO `kl_rule_plan` VALUES ('2423', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2411', '实验室检查子项目', null, null, '108', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('2424', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2412', '主诉现病史正则', null, null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2425', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2413', '既往史正则', null, null, '', '1', '');
+INSERT INTO `kl_rule_plan` VALUES ('2426', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2414', '查体正则', null, null, '', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('2427', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'dis', '4', '2415', '辅检结果正则', null, null, '', null, '');

+ 4 - 4
src/main/java/com/diagbot/config/CacheDeleteInit.java

@@ -48,14 +48,14 @@ public class CacheDeleteInit implements CommandLineRunner {
         cacheFacade.loadDeptPush();
         log.info("CDSS-CORE服务启动加载科室和推送映射成功!");
 
-        cacheFacade.loadAllRuleCache();
-        log.info("CDSS-CORE服务启动加载医学知识库中的所有规则缓存成功!");
+        conceptInfoFacade.loadCustomDictionary();
+        log.info("CDSS-CORE服务启动加载NLP分词字典成功!");
 
         cacheFacade.loadAllBaseDiagnoseCache();
         log.info("CDSS-CORE服务启动加载诊断依据缓存成功!");
 
-        conceptInfoFacade.loadCustomDictionary();
-        log.info("CDSS-CORE服务启动加载NLP分词字典成功!");
+        cacheFacade.loadAllRuleCache();
+        log.info("CDSS-CORE服务启动加载医学知识库中的所有规则缓存成功!");
 
         log.info("CDSS-CORE初始化完成!");
     }

+ 88 - 0
src/main/java/com/diagbot/dto/BaseRegulationDTO.java

@@ -0,0 +1,88 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2021/3/15 10:49
+ */
+@Getter
+@Setter
+public class BaseRegulationDTO {
+    /**
+     * 联合唯一键
+     */
+    private String baseKey;
+
+    /**
+     * id逗号隔开
+     */
+    private String ids;
+
+    /**
+     * 医学基本术语
+     */
+    private String baseLibName;
+
+    /**
+     * 术语类型
+     */
+    private Integer baseLibType;
+
+    /**
+     * 提示概念id
+     */
+    private Long conceptId;
+
+    /**
+     * 基础规则类型(1:等于术语本身;2:存在比较;3:不等于术语本身;)
+     */
+    private Integer baseType;
+
+    /**
+     * 最小域比较符
+     */
+    private String baseMinOperator;
+
+    /**
+     * 最小域值
+     */
+    private String baseMinValue;
+
+    /**
+     * 最小域单位
+     */
+    private String baseMinUnit;
+
+    /**
+     * 最大域比较符
+     */
+    private String baseMaxOperator;
+
+    /**
+     * 最大域值
+     */
+    private String baseMaxValue;
+
+    /**
+     * 最大域单位
+     */
+    private String baseMaxUnit;
+
+    /**
+     * 等于域比较符
+     */
+    private String baseEqOperator;
+
+    /**
+     * 等于域值
+     */
+    private String baseEqValue;
+
+    /**
+     * 等于域单位
+     */
+    private String baseEqUnit;
+}

+ 17 - 0
src/main/java/com/diagbot/dto/ConceptScaleDTO.java

@@ -0,0 +1,17 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/12 13:50
+ */
+@Getter
+@Setter
+public class ConceptScaleDTO {
+    List<ConceptScaleSubDTO> scaleDetails;
+}

+ 107 - 0
src/main/java/com/diagbot/dto/ConceptScaleDetailDTO.java

@@ -0,0 +1,107 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/12 13:54
+ */
+@Getter
+@Setter
+public class ConceptScaleDetailDTO {
+    /**
+     * 下级
+     */
+    private List<ConceptScaleSubDTO> subList = new ArrayList<>();
+
+    private Long id;
+    /**
+     * -1:表示顶级,其他值表示上级id
+     */
+    private Long parentId;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 0表格1有分数2无分数
+     */
+    private Integer textType;
+
+    /**
+     * 结果类型(1算分;2显示选择结果)
+     */
+    private Integer resultType;
+
+    /**
+     * 选择类型(1单选2多选)
+     */
+    private Integer selectType;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+
+    /**
+     * 系数
+     */
+    private BigDecimal factor;
+
+    /**
+     * 常数
+     */
+    private BigDecimal constant;
+
+
+    /**
+     * 1:显示,0:不显示,2隐藏
+     */
+    private Integer status;
+
+    /**
+     * 组别互斥(同组互斥)
+     */
+    private Integer groupNum;
+
+    /**
+     * 结果
+     */
+    private String result;
+
+    /**
+     * 推送信息
+     */
+    private String pushInfo;
+
+    private Integer match;
+}

+ 18 - 0
src/main/java/com/diagbot/dto/ConceptScaleSubDTO.java

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/25 13:46
+ */
+@Getter
+@Setter
+public class ConceptScaleSubDTO {
+    private Integer groupNum;
+    private List<ConceptScaleDetailDTO> detailList;
+}

+ 109 - 0
src/main/java/com/diagbot/dto/KlConceptScaleDTO.java

@@ -0,0 +1,109 @@
+package com.diagbot.dto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-25 10:00
+ */
+@Setter
+@Getter
+public class KlConceptScaleDTO {
+
+    private Long id;
+
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+    /**
+     * -1:表示顶级,其他值表示上级菜单的id
+     */
+    private Long parentId;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 系数
+     */
+    private BigDecimal factor;
+
+    /**
+     * 常数
+     */
+    private BigDecimal constant;
+
+    /**
+     * 11表格;12文本;21标题;31算分;32显示选择结果
+     */
+    private Integer textType;
+    /**
+     * 结果类型(1算分;2显示选择结果)
+     */
+    private Integer resultType;
+    /**
+     * 选择类型(1单选2多选)
+     */
+    private Integer selectType;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 1:显示,0:不显示,2隐藏
+     */
+    private Integer status;
+
+    /**
+     * 组别互斥(同组互斥)
+     */
+    private Integer groupNum;
+
+    /**
+     * 结果
+     */
+    private String result;
+
+    /**
+     * 推送信息
+     */
+    private String pushInfo;
+
+    private String remark;
+
+}

+ 6 - 2
src/main/java/com/diagbot/dto/KlConceptStaticDTO.java

@@ -46,7 +46,7 @@ public class KlConceptStaticDTO {
     /**
      * 修改时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date gmtModified;
     /**
      * 修改人
@@ -59,5 +59,9 @@ public class KlConceptStaticDTO {
     /**
      * 明细
      */
-    List<KlConceptDetailDTO> details;
+    private List<KlConceptDetailDTO> details;
+    /**
+     * 量表结构
+     */
+    private KlScaleByIdDTO scale;
 }

+ 49 - 0
src/main/java/com/diagbot/dto/KlScaleByIdDTO.java

@@ -0,0 +1,49 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.wrapper.KlScaleDetailWrapper;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 10:36
+ */
+@Setter
+@Getter
+public class KlScaleByIdDTO {
+
+    private Long id;
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+    private String conceptName;
+
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+
+    /**
+     * 量表明细
+     */
+    private List<KlScaleDetailWrapper> klScaleDetail ;
+}

+ 83 - 0
src/main/java/com/diagbot/dto/KlScaleDetailDTO.java

@@ -0,0 +1,83 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 10:32
+ */
+@Setter
+@Getter
+public class KlScaleDetailDTO {
+
+    private Long id;
+
+
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+    /**
+     * -1:表示顶级,其他值表示上级菜单的id
+     */
+    private Long parentId;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 0表格1有分数2无分数
+     */
+    private Integer textType;
+
+    /**
+     * 选择类型(1单选2多选)
+     */
+    private Integer selectType;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 是否显示(1是,0否)
+     */
+    private Integer status;
+
+    private String remark;
+
+    private List<KlScaleDetailDTO> klScaleDetailSub = new ArrayList<>();
+}

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

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 10:30
+ */
+@Setter
+@Getter
+public class KlScaleInfoDTO {
+
+    private Long id;
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+    private String conceptName;
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 量表明细
+     */
+    // private List<KlScaleDetailDTO> klScaleDetail = new ArrayList<>();
+}

+ 16 - 0
src/main/java/com/diagbot/dto/RegulationDTO.java

@@ -0,0 +1,16 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2021/3/15 11:21
+ */
+@Getter
+@Setter
+public class RegulationDTO {
+    private Integer code;
+    private Integer conditionType;
+}

+ 27 - 0
src/main/java/com/diagbot/dto/RegulationIndexDTO.java

@@ -0,0 +1,27 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2020/8/17 11:28
+ */
+@Data
+public class RegulationIndexDTO {
+
+    /**
+     * 规则名称
+     */
+    private String name;
+
+    /**
+     * 规则编码
+     */
+    private Long code;
+
+    /**
+     * 规则类型:(1:量表)
+     */
+    private Integer type;
+}

+ 22 - 0
src/main/java/com/diagbot/dto/ScaleDTO.java

@@ -0,0 +1,22 @@
+package com.diagbot.dto;
+
+import com.google.common.collect.Lists;
+import lombok.Data;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2020/8/17 11:28
+ */
+@Data
+public class ScaleDTO {
+
+    // 匹配的编码列表
+    private List<String> codeList = Lists.newArrayList();
+    // 调试使用
+    private Map<String, Object> debug = new LinkedHashMap<>();
+}

+ 5 - 0
src/main/java/com/diagbot/dto/StaticKnowledgeDTO.java

@@ -42,4 +42,9 @@ public class StaticKnowledgeDTO {
      * 静态知识明细
      */
     private Map<String, List<StaticKnowledgeDetailDTO>> details;
+
+    /**
+     * 量表结构
+     */
+    private ConceptScaleDTO scale;
 }

+ 2 - 0
src/main/java/com/diagbot/dto/WordCrfDTO.java

@@ -108,6 +108,8 @@ public class WordCrfDTO {
     private String marital = "";
     // 家族史
     private String family = "";
+    // 查体
+    private String vital = "";
 
     // 【诊断数据来源】
     private List<Item> diagSource = new ArrayList<>();

+ 312 - 0
src/main/java/com/diagbot/entity/KlConceptScale.java

@@ -0,0 +1,312 @@
+package com.diagbot.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 量表明细表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-05-25
+ */
+public class KlConceptScale 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:表示顶级,其他值表示上级菜单的id
+     */
+    private Long parentId;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 系数
+     */
+    private BigDecimal factor;
+
+    /**
+     * 常数
+     */
+    private BigDecimal constant;
+
+    /**
+     * 11问题选项;12文本;13得分结果(隐藏)21问题,31答案
+     */
+    private Integer textType;
+
+    /**
+     * 结果类型(1算分;2显示选择结果)
+     */
+    private Integer resultType;
+
+    /**
+     * 选择类型(1单选2多选)
+     */
+    private Integer selectType;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 1:显示,0:不显示,2隐藏
+     */
+    private Integer status;
+
+    /**
+     * 组别互斥(同组互斥)
+     */
+    private Integer groupNum;
+
+    /**
+     * 结果
+     */
+    private String result;
+
+    /**
+     * 推送信息
+     */
+    private String pushInfo;
+
+    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 Long getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(Long parentId) {
+        this.parentId = parentId;
+    }
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+    public String getRuleCode() {
+        return ruleCode;
+    }
+
+    public void setRuleCode(String ruleCode) {
+        this.ruleCode = ruleCode;
+    }
+    public BigDecimal getScore() {
+        return score;
+    }
+
+    public void setScore(BigDecimal score) {
+        this.score = score;
+    }
+    public BigDecimal getFactor() {
+        return factor;
+    }
+
+    public void setFactor(BigDecimal factor) {
+        this.factor = factor;
+    }
+    public BigDecimal getConstant() {
+        return constant;
+    }
+
+    public void setConstant(BigDecimal constant) {
+        this.constant = constant;
+    }
+    public Integer getTextType() {
+        return textType;
+    }
+
+    public void setTextType(Integer textType) {
+        this.textType = textType;
+    }
+    public Integer getResultType() {
+        return resultType;
+    }
+
+    public void setResultType(Integer resultType) {
+        this.resultType = resultType;
+    }
+    public Integer getSelectType() {
+        return selectType;
+    }
+
+    public void setSelectType(Integer selectType) {
+        this.selectType = selectType;
+    }
+    public Integer getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(Integer orderNo) {
+        this.orderNo = orderNo;
+    }
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+    public Integer getGroupNum() {
+        return groupNum;
+    }
+
+    public void setGroupNum(Integer groupNum) {
+        this.groupNum = groupNum;
+    }
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+    public String getPushInfo() {
+        return pushInfo;
+    }
+
+    public void setPushInfo(String pushInfo) {
+        this.pushInfo = pushInfo;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "KlConceptScale{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", conceptId=" + conceptId +
+            ", parentId=" + parentId +
+            ", content=" + content +
+            ", ruleCode=" + ruleCode +
+            ", score=" + score +
+            ", factor=" + factor +
+            ", constant=" + constant +
+            ", textType=" + textType +
+            ", resultType=" + resultType +
+            ", selectType=" + selectType +
+            ", orderNo=" + orderNo +
+            ", status=" + status +
+            ", groupNum=" + groupNum +
+            ", result=" + result +
+            ", pushInfo=" + pushInfo +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 78 - 0
src/main/java/com/diagbot/entity/KlRegulation.java

@@ -0,0 +1,78 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 通用规则表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-15
+ */
+@Data
+public class KlRegulation 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;
+
+    /**
+     * 规则编码
+     */
+    private Long code;
+
+    /**
+     * 规则类型:(1:量表)
+     */
+    private Integer type;
+
+    /**
+     * 启用状态(0:禁用,1:启用)
+     */
+    private Integer status;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 113 - 0
src/main/java/com/diagbot/entity/KlRegulationBase.java

@@ -0,0 +1,113 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 通用规则基础表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-15
+ */
+@Data
+public class KlRegulationBase 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 description;
+
+    /**
+     * 基础规则类型(1:等于术语本身;2:存在比较;3:主诉现病史正则;4:既往史正则)
+     */
+    private Integer type;
+
+    /**
+     * 最小域比较符
+     */
+    private String minOperator;
+
+    /**
+     * 最小域值
+     */
+    private String minValue;
+
+    /**
+     * 最小域单位
+     */
+    private String minUnit;
+
+    /**
+     * 最大域比较符
+     */
+    private String maxOperator;
+
+    /**
+     * 最大域值
+     */
+    private String maxValue;
+
+    /**
+     * 最大域单位
+     */
+    private String maxUnit;
+
+    /**
+     * 等于域比较符
+     */
+    private String eqOperator;
+
+    /**
+     * 等于域值
+     */
+    private String eqValue;
+
+    /**
+     * 等于域单位
+     */
+    private String eqUnit;
+}

+ 83 - 0
src/main/java/com/diagbot/entity/KlRegulationCondition.java

@@ -0,0 +1,83 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 通用规则条件表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-15
+ */
+@Data
+public class KlRegulationCondition 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 regulationId;
+
+    /**
+     * 条件类型(1:基础条件;2:组合条件)
+     */
+    private Integer conditionType;
+
+    /**
+     * 规则组别(1XX_condition_type为2:组合条件有效)
+     */
+    private Integer conditionGroup;
+
+    /**
+     * 符合数量(condition_type为2:组合条件有效)
+     */
+    private Integer fitNo;
+
+    /**
+     * 基础规则组别(1X_condition_type为1:基础条件;2:组合条件)
+     */
+    private Integer baseGroup;
+
+    /**
+     * 基础规则id(condition_type为1:基础条件有效)
+     */
+    private Long regulationBaseId;
+}

+ 20 - 0
src/main/java/com/diagbot/entity/wrapper/KlScaleDetailWrapper.java

@@ -0,0 +1,20 @@
+package com.diagbot.entity.wrapper;
+
+import com.diagbot.dto.KlConceptScaleDTO;
+import com.diagbot.entity.KlConceptScale;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 11:32
+ */
+@Setter
+@Getter
+public class KlScaleDetailWrapper extends KlConceptScaleDTO {
+    private List<KlScaleDetailWrapper> subMenuList = new ArrayList<>();
+}

+ 3 - 1
src/main/java/com/diagbot/enums/BaseDiagnoseTypeEnum.java

@@ -13,7 +13,9 @@ public enum BaseDiagnoseTypeEnum implements KeyedNamed {
     equals(1, "等于术语本身"),
     compare(2, "存在比较"),
     regexChiefSymptom(3, "主诉现病史正则"),
-    regexPast(4, "既往史正则");
+    regexPast(4, "既往史正则"),
+    regexVital(5, "查体正则"),
+    regexPacs(6, "辅检正则");
 
     @Setter
     private int key;

+ 2 - 1
src/main/java/com/diagbot/enums/RedisEnum.java

@@ -12,6 +12,7 @@ import lombok.Setter;
 public enum RedisEnum implements KeyedNamed {
 
     drugType(1, "drugType:"),
+    diseaseType(2, "diseaseType:"),
     symptomVitalType(3, "symptomVitalType:"),
     symptomNumType(4, "symptomNumType:"),
     vitalType(5, "vitalType:"),
@@ -19,9 +20,9 @@ public enum RedisEnum implements KeyedNamed {
     symptomMainFeature(7, "symptomMainFeature:"),
     diseaseCorrespond(8, "diseaseCorrespond:"),
     diseaseFilter(9, "diseaseFilter:"),
-    diseaseType(2, "diseaseType:"),
     allRule(10, "allRule:"),
     allBaseDiagnose(11, "allBaseDiagnose"),
+    allBaseRegulation(12, "allBaseRegulation"),
     pushModel(13, "pushModel"),
     hospitalId_(14, "hospitalId_"),
     deptPush(15, "deptPush");

+ 11 - 0
src/main/java/com/diagbot/facade/CacheFacade.java

@@ -142,6 +142,17 @@ public class CacheFacade {
         neoFacade.allBaseDiagnose();
     }
 
+    /**
+     * 缓存医学知识库中的所有去重的基础规则
+     *
+     * @return
+     */
+    public void loadAllBaseRegulationCache(){
+        redisUtil.delete(RedisEnum.allBaseRegulation.getName());
+        neoFacade.allBaseRegulation();
+    }
+
+
     public void clearLoadCache(String str) {
         redisUtil.deleteByPrex(str);
     }

+ 3 - 0
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -184,6 +184,9 @@ public class CommonFacade {
         if (StringUtil.isNotBlank(searchData.getPersonal())) {
             wordCrfDTO.setPersonal(searchData.getPersonal());
         }
+        if (StringUtil.isNotBlank(searchData.getVital())) {
+            wordCrfDTO.setVital(searchData.getVital());
+        }
 
         //模型处理数据
         aiAnalyze.aiProcess(searchData, wordCrfDTO);

+ 65 - 0
src/main/java/com/diagbot/facade/KlConceptScaleFacade.java

@@ -0,0 +1,65 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.KlConceptScale;
+import com.diagbot.entity.wrapper.KlScaleDetailWrapper;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.KlConceptScaleServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.vo.KlScaleDetailMenuVO;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 10:45
+ */
+@Component
+public class KlConceptScaleFacade extends KlConceptScaleServiceImpl {
+
+    public List<KlScaleDetailWrapper> getKlScaleDetailData(KlScaleDetailMenuVO klScaleDetailMenuVO) {
+        //添加菜单信息
+        List<KlConceptScale> list = this.list(new QueryWrapper<KlConceptScale>()
+                .in("concept_id", klScaleDetailMenuVO.getConceptId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .orderByAsc("group_num", "order_no"));
+        List<KlScaleDetailWrapper> menuList = new ArrayList<>();
+        menuList = BeanUtil.listCopyTo(list, KlScaleDetailWrapper.class);
+        Map<Long, List<KlScaleDetailWrapper>> menuMap = EntityUtil.makeEntityListMap(menuList, "parentId");
+        List<KlScaleDetailWrapper> menuRes = menuMap.get(-1L);
+        if (ListUtil.isNotEmpty(menuRes)) {
+            for (KlScaleDetailWrapper bean : menuRes) {
+                getSonMenu(bean, menuMap);
+            }
+        }
+
+        return menuRes;
+    }
+
+
+    /**
+     * 递归获取菜单结构
+     *
+     * @param menu    当前菜单
+     * @param menuMap 菜单集
+     * @return 菜单结构
+     */
+    public List<KlScaleDetailWrapper> getSonMenu(KlScaleDetailWrapper menu,
+                                                 Map<Long, List<KlScaleDetailWrapper>> menuMap) {
+        List<KlScaleDetailWrapper> res = new ArrayList<>();
+        List<KlScaleDetailWrapper> list = menuMap.get(menu.getId());
+        if (ListUtil.isNotEmpty(list)) {
+            menu.setSubMenuList(list);
+            for (KlScaleDetailWrapper bean : list) {
+                getSonMenu(bean, menuMap);
+            }
+        }
+        return res;
+    }
+}

+ 215 - 15
src/main/java/com/diagbot/facade/KlConceptStaticFacade.java

@@ -4,14 +4,20 @@ 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.ConceptScaleDTO;
+import com.diagbot.dto.ConceptScaleDetailDTO;
+import com.diagbot.dto.ConceptScaleSubDTO;
 import com.diagbot.dto.DictionaryInfoDTO;
 import com.diagbot.dto.KlConceptDetailDTO;
 import com.diagbot.dto.KlConceptStaticDTO;
+import com.diagbot.dto.KlScaleByIdDTO;
+import com.diagbot.dto.ScaleDTO;
 import com.diagbot.dto.StaticKnowledgeDTO;
 import com.diagbot.dto.StaticKnowledgeDetailDTO;
 import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
 import com.diagbot.entity.KlConcept;
 import com.diagbot.entity.KlConceptDetail;
+import com.diagbot.entity.KlConceptScale;
 import com.diagbot.entity.KlConceptStatic;
 import com.diagbot.entity.KlRelation;
 import com.diagbot.enums.IsDeleteEnum;
@@ -31,9 +37,12 @@ import com.diagbot.vo.GetDetailVO;
 import com.diagbot.vo.IdVO;
 import com.diagbot.vo.KlConceptStaticPageVO;
 import com.diagbot.vo.KlConceptStaticVO;
+import com.diagbot.vo.KlScaleByIdVO;
+import com.diagbot.vo.ScaleVO;
 import com.diagbot.vo.StaticKnowledgeIndexPageVO;
 import com.diagbot.vo.StaticKnowledgeVO;
 import com.google.common.collect.Lists;
+import io.micrometer.core.instrument.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
@@ -60,7 +69,11 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
     @Autowired
     private KlConceptDetailFacade klConceptDetailFacade;
     @Autowired
+    private KlConceptScaleFacade klConceptScaleFacade;
+    @Autowired
     private KlDictionaryInfoFacade klDictionaryInfoFacade;
+    @Autowired
+    private KlScaleFacade klScaleFacade;
 
     @Autowired
     @Qualifier("klConceptDetailServiceImpl")
@@ -69,6 +82,8 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
     private DictionaryFacade dictionaryFacade;
     @Autowired
     private MedRetrievalFacade medRetrievalFacade;
+    @Autowired
+    KlRegulationBaseFacade klRegulationBaseFacade;
 
     /**
      * 获取静态知识
@@ -88,8 +103,9 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("lib_name", staticKnowledgeVO.getName())
                 .eq("lib_type", type), false);
+
         Integer sameType = null;
-        //标准词不存在,同名的是否存在
+        //标准词不存在,同名的是否存在,仅检验检查
         if (concept == null) {
             //同名静态知识互取
             if (type.equals(LexiconEnum.LisName.getKey())) {
@@ -120,7 +136,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
             staticKnowledgeVO.setType(sameType);
         }
 
-        //标准术语存在静态知识不存在,取同名静态知识
+        //标准术语存在静态知识不存在,取同名静态知识,仅检验检查
         if (concept != null && staticInfo == null && sameType == null) {
             //同名静态知识互取
             if (type.equals(LexiconEnum.LisName.getKey())) {
@@ -165,18 +181,25 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                             .in("concept_id", relations.stream().map(i -> i.getStartId()).collect(Collectors.toList()))
                             .eq("status", StatusEnum.Enable.getKey()), false);
                     if (staticInfo == null) {
-                        throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少静态信息");
+                        throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少" +
+                                (type.equals(LexiconEnum.Scale.getKey()) ? "量表" : "静态") +
+                                "信息");
                     }
                     concept = klConceptFacade.getById(staticInfo.getConceptId());
                 } else {
-                    throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少静态信息");
+                    throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少" +
+                            (type.equals(LexiconEnum.Scale.getKey()) ? "量表" : "静态") +
+                            "信息");
                 }
             } else {
-                throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少静态信息");
+                throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少" +
+                        (type.equals(LexiconEnum.Scale.getKey()) ? "量表" : "静态") +
+                        "信息");
             }
         }
 
-        //详情信息
+
+        //医学知识详情
         String sql = "";
         if (ListUtil.isNotEmpty(staticKnowledgeVO.getContentTypes())) {
 
@@ -218,6 +241,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                 .stream()
                 .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("4"))
                 .collect(Collectors.toList());
+        //Map<String, List<StaticKnowledgeDetailDTO>> detailMap = new HashMap<>();
         Map<String, List<StaticKnowledgeDetailDTO>> detailMap = new HashMap<>();
         if (ListUtil.isEmpty(staticKnowledgeVO.getContentTypes()) || staticKnowledgeVO.getContentTypes().contains(0)) {
             if (ListUtil.isNotEmpty(introduceList)) {
@@ -246,14 +270,21 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                 detailMap.put("治疗方案", treatInfoList);
             }
         }
+        if (type.equals(LexiconEnum.Scale.getKey())) {
+            //量表详情
+            ScaleVO scaleVO = new ScaleVO();
+            BeanUtil.copyProperties(staticKnowledgeVO, scaleVO);
+            staticKnowledgeDTO.setScale(getScaleStructure(scaleVO, concept.getId()));
+        }
 
+        staticKnowledgeDTO.setClinicalPathwayName(staticInfo.getClinicalPathwayName());
+        staticKnowledgeDTO.setNoticeName(staticInfo.getNoticeName());
+        staticKnowledgeDTO.setDetails(detailMap);
         staticKnowledgeDTO.setId(concept.getId());
         staticKnowledgeDTO.setName(concept.getLibName());
         Integer retType = convertType(concept.getLibType(), 2);
         staticKnowledgeDTO.setType(retType == null ? "" : retType.toString());
-        staticKnowledgeDTO.setClinicalPathwayName(staticInfo.getClinicalPathwayName());
-        staticKnowledgeDTO.setNoticeName(staticInfo.getNoticeName());
-        staticKnowledgeDTO.setDetails(detailMap);
+
         return staticKnowledgeDTO;
     }
 
@@ -292,10 +323,14 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                 record.setTypeName(dicTypeNameMap.get(typeName));
                 Integer retType = convertType(record.getType(), 2);
                 record.setType(retType);
-                record.setTitle(detailMap.get(record.getId())
-                        .stream()
-                        .map(KlConceptDetail::getTitle)
-                        .collect(Collectors.joining("、")));
+                if (null != detailMap
+                        && detailMap.containsKey(record.getId())
+                        && ListUtil.isNotEmpty(detailMap.get(record.getId()))) {
+                    record.setTitle(detailMap.get(record.getId())
+                            .stream()
+                            .map(KlConceptDetail::getTitle)
+                            .collect(Collectors.joining("、")));
+                }
             });
         }
         page.setRecords(records);
@@ -376,6 +411,13 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         Map<Long, List<KlConceptDetail>> detailMap = details.stream()
                 .collect(Collectors.groupingBy(KlConceptDetail::getConceptId));
 
+        List<KlConceptScale> scaleDetails = klConceptScaleFacade.list(new QueryWrapper<KlConceptScale>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .in("concept_id", conceptIds)
+                .orderByAsc("concept_id", "parent_id", "order_no"));
+        Map<Long, List<KlConceptScale>> scaleDetailMap = scaleDetails.stream()
+                .collect(Collectors.groupingBy(KlConceptScale::getConceptId));
+
         records.forEach(i -> {
             i.setTypeName(medRetrievalFacade.convertTypeName(i.getTypeName(), 2, dicTypeName));
             if (dicTypeMap.containsKey(i.getTypeName())) {
@@ -404,7 +446,6 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
      * @return
      */
     public Boolean saveOrUpdateRecord(KlConceptStaticVO klConceptStaticVO) {
-        //String userId = SysUserUtils.getCurrentPrincipleID();
         if (klConceptStaticVO.getUserId() == null) {
             klConceptStaticVO.setUserId(0L);
         }
@@ -420,7 +461,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
             concept = klConceptFacade.getOne(new QueryWrapper<KlConcept>()
                     .eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("lib_name", klConceptStaticVO.getName())
-                    .eq("lib_type", type), false);
+                    .eq("lib_type", klConceptStaticVO.getType()), false);
         }
         if (concept == null) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "标准术语不存在");
@@ -469,6 +510,17 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         //保存新的明细
         klConceptDetailService.saveBatch(details);
 
+        //保存量表明细
+        if (klConceptStaticVO.getSource() != null
+                && klConceptStaticVO.getSource().equals(1)
+                && klConceptStaticVO.getType().equals(LexiconEnum.Scale.getKey())) {
+            if (klConceptStaticVO.getScale() != null) {
+                klConceptStaticVO.getScale().setConceptId(concept.getId());
+                klConceptStaticVO.getScale().setModifier(concept.getModifier());
+                klScaleFacade.saveUpKlScaleAll(klConceptStaticVO.getScale());
+            }
+        }
+
         return true;
     }
 
@@ -547,6 +599,16 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         klConceptStaticDTO.setDetails(ListUtil.isNotEmpty(details)
                 ? BeanUtil.listCopyTo(details, KlConceptDetailDTO.class)
                 : new ArrayList<>());
+
+        //获取量表结构
+        if (concept.getLibType().equals(LexiconEnum.Scale.getKey())) {
+            KlScaleByIdVO klScaleByIdVO = new KlScaleByIdVO();
+            klScaleByIdVO.setId(staticInfo.getId());
+            List<KlScaleByIdDTO> scaleList = klScaleFacade.getKlScaleById(klScaleByIdVO);
+            if (ListUtil.isNotEmpty(scaleList)) {
+                klConceptStaticDTO.setScale(scaleList.get(0));
+            }
+        }
         return klConceptStaticDTO;
     }
 
@@ -591,6 +653,13 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         if (ListUtil.isEmpty(details)) {
             return false;
         }
+
+        List<KlConceptScale> scales = klConceptScaleFacade.list(new QueryWrapper<KlConceptScale>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("concept_id", concept.getId()));
+        if (ListUtil.isEmpty(scales)) {
+            return false;
+        }
         return true;
     }
 
@@ -724,4 +793,135 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         }
         return retMap;
     }
+
+    /**
+     * 获取量表结构map Map<name_type,List<KlConceptScale>>
+     *
+     * @param getDetailVO
+     * @return
+     */
+    public Map<String, ConceptScaleDTO> getScaleDetailByConcept(GetDetailVO getDetailVO) {
+        Map<String, ConceptScaleDTO> 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)
+                .eq("lib_type", LexiconEnum.Scale.getKey());
+        if (ListUtil.isNotEmpty(getDetailVO.getNameList())) {
+            conceptQueryWrapper.in("lib_name", getDetailVO.getNameList());
+        }
+        List<KlConcept> conceptList = klConceptFacade.list(conceptQueryWrapper);
+
+        if (ListUtil.isNotEmpty(conceptList)) {
+            for (KlConcept concept : conceptList) {
+                retMap.put(concept.getLibName() + "_" + dicTypeNameMap.get(LexiconEnum.Scale.getName()),
+                        getScaleStructure(new ScaleVO(), concept.getId()));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取量表结构
+     * @param conceptId
+     * @return
+     */
+    public ConceptScaleDTO getScaleStructure(ScaleVO scaleVO, Long conceptId) {
+        ConceptScaleDTO retDTO = new ConceptScaleDTO();
+        List<KlConceptScale> scaleList = klConceptScaleFacade.list(new QueryWrapper<KlConceptScale>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("concept_id", conceptId)
+                .orderByAsc("parent_id", "order_no"));
+        if (ListUtil.isEmpty(scaleList)) {
+            return null;
+        }
+        List<ConceptScaleDetailDTO> scaleDetailList = BeanUtil.listCopyTo(scaleList, ConceptScaleDetailDTO.class);
+        if (null != scaleVO) {
+            List<String> codeList = new ArrayList<>();
+            codeList= scaleDetailList.stream().filter(s -> StringUtils.isNotBlank(s.getRuleCode())).map(ac -> ac.getRuleCode()).collect(Collectors.toList());
+            scaleVO.setCodeList(codeList);
+            ScaleDTO scaleDTO = klRegulationBaseFacade.process(scaleVO);
+            List<String> codeListNew = scaleDTO.getCodeList(); //Arrays.asList("100001", "100013");
+            if (ListUtil.isNotEmpty(codeListNew)) {
+                for (String str : codeListNew) {
+                    for (ConceptScaleDetailDTO data2 : scaleDetailList) {
+                        if (null!=data2.getRuleCode()&&data2.getRuleCode().equals(str)) {
+                            data2.setMatch(1);
+                        }
+                    }
+                }
+            }
+        }
+
+        if (null != scaleVO) {
+            List<String> codeList = new ArrayList<>();
+            codeList = scaleDetailList.stream().map(ac -> ac.getRuleCode()).collect(Collectors.toList());
+            scaleVO.setCodeList(codeList);
+            ScaleDTO scaleDTO = klRegulationBaseFacade.process(scaleVO);
+            List<String> codeListNew = scaleDTO.getCodeList(); //Arrays.asList("100001", "100013");
+            if (ListUtil.isNotEmpty(codeListNew)) {
+                for (String str : codeListNew) {
+                    for (ConceptScaleDetailDTO data2 : scaleDetailList) {
+                        if (null!=data2.getRuleCode()&&data2.getRuleCode().equals(str)) {
+                            data2.setMatch(1);
+                        }
+                    }
+                }
+            }
+        }
+
+        Map<Long, List<ConceptScaleDetailDTO>> parentMap
+                = scaleDetailList.stream().collect(Collectors.groupingBy(ConceptScaleDetailDTO::getParentId));
+        List<ConceptScaleDetailDTO> retScacleDetailList = parentMap.get(-1L);
+        if (ListUtil.isEmpty(retScacleDetailList)) {
+            return null;
+        }
+        List<ConceptScaleSubDTO> retList = Lists.newLinkedList();
+        Map<Integer, List<ConceptScaleDetailDTO>> groupMap
+                = retScacleDetailList.stream().collect(Collectors.groupingBy(ConceptScaleDetailDTO::getGroupNum));
+        for (Map.Entry<Integer, List<ConceptScaleDetailDTO>> entry : groupMap.entrySet()) {
+            ConceptScaleSubDTO subItem = new ConceptScaleSubDTO();
+            subItem.setGroupNum(entry.getKey());
+            subItem.setDetailList(entry.getValue());
+            retList.add(subItem);
+        }
+        for (ConceptScaleSubDTO subDTO : retList) {
+            scaleRecursion(subDTO, parentMap);
+        }
+
+        retDTO.setScaleDetails(retList);
+        return retDTO;
+    }
+
+    /**
+     * 递归
+     * @param item
+     * @param treeMap
+     */
+    public ConceptScaleSubDTO scaleRecursion(ConceptScaleSubDTO item,
+                                             Map<Long, List<ConceptScaleDetailDTO>> treeMap) {
+        List<ConceptScaleDetailDTO> list = item.getDetailList();
+        if (ListUtil.isNotEmpty(list)) {
+            for (ConceptScaleDetailDTO detail : list) {
+                List<ConceptScaleDetailDTO> subDetailList = treeMap.get(detail.getId());
+                if (ListUtil.isNotEmpty(subDetailList)) {
+                    Map<Integer, List<ConceptScaleDetailDTO>> subMap
+                            = subDetailList.stream().collect(Collectors.groupingBy(ConceptScaleDetailDTO::getGroupNum));
+                    List<ConceptScaleSubDTO> subList = Lists.newLinkedList();
+                    for (Map.Entry<Integer, List<ConceptScaleDetailDTO>> subEntry : subMap.entrySet()) {
+                        ConceptScaleSubDTO subDTO = new ConceptScaleSubDTO();
+                        subDTO.setGroupNum(subEntry.getKey());
+                        subDTO.setDetailList(subEntry.getValue());
+                        scaleRecursion(subDTO, treeMap);
+                        subList.add(subDTO);
+                    }
+                    detail.setSubList(subList);
+                }
+            }
+        }
+        return item;
+    }
 }

+ 87 - 0
src/main/java/com/diagbot/facade/KlRegulationBaseFacade.java

@@ -0,0 +1,87 @@
+package com.diagbot.facade;
+
+import com.diagbot.dto.BaseDiagnoseDTO;
+import com.diagbot.dto.BaseRegulationDTO;
+import com.diagbot.dto.RegulationDTO;
+import com.diagbot.dto.ScaleDTO;
+import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.rule.AgeRule;
+import com.diagbot.rule.CommonRule;
+import com.diagbot.rule.GroupRule;
+import com.diagbot.rule.LisRule;
+import com.diagbot.rule.VitalRule;
+import com.diagbot.service.impl.KlRegulationBaseServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RedisUtil;
+import com.diagbot.vo.RegulationVO;
+import com.diagbot.vo.ScaleVO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2021/3/15 10:58
+ */
+@Component
+public class KlRegulationBaseFacade extends KlRegulationBaseServiceImpl {
+
+    @Autowired
+    RedisUtil redisUtil;
+    @Autowired
+    CommonFacade commonFacade;
+    @Autowired
+    CommonRule commonRule;
+    @Autowired
+    VitalRule vitalRule;
+    @Autowired
+    GroupRule groupRule;
+    @Autowired
+    LisRule lisRule;
+    @Autowired
+    AgeRule ageRule;
+    @Autowired
+    KlRegulationFacade klRegulationFacade;
+
+    /**
+     * 匹配规则
+     *
+     * @param scaleVO
+     * @return
+     */
+    public ScaleDTO process(ScaleVO scaleVO) {
+        ScaleDTO scaleDTO = new ScaleDTO();
+        if (ListUtil.isEmpty(scaleVO.getCodeList())) {
+            return scaleDTO;
+        }
+        // 筛选编码对应的规则
+        List<BaseRegulationDTO> baseRegulationDTOList = this.getSelectBase(scaleVO.getCodeList());
+        if (ListUtil.isEmpty(baseRegulationDTOList)) {
+            return scaleDTO;
+        }
+        List<BaseDiagnoseDTO> baseDiagnoseDTOList = BeanUtil.listCopyTo(baseRegulationDTOList, BaseDiagnoseDTO.class);
+        // CRF模型处理
+        WordCrfDTO wordCrfDTO = commonFacade.crf_process(scaleVO, false);
+        // 同义词转换
+        commonFacade.wordStandConvert(wordCrfDTO);
+        // 匹配的基础规则
+        List<Long> baseIdList = commonRule.matchBase(wordCrfDTO, baseDiagnoseDTOList);
+
+        scaleDTO.getDebug().put("基础规则匹配", StringUtils.join(baseIdList));
+
+        if (ListUtil.isNotEmpty(baseIdList)) {
+            RegulationVO regulationVO = new RegulationVO();
+            regulationVO.setIds(baseIdList);
+            List<RegulationDTO> regulationDTOList = klRegulationFacade.getRegulationByIds(regulationVO);
+            if (ListUtil.isNotEmpty(regulationDTOList)) {
+                scaleDTO.setCodeList(regulationDTOList.stream().map(r -> String.valueOf(r.getCode())).collect(Collectors.toList()));
+            }
+        }
+        return scaleDTO;
+    }
+}

+ 35 - 0
src/main/java/com/diagbot/facade/KlRegulationFacade.java

@@ -0,0 +1,35 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.RegulationIndexDTO;
+import com.diagbot.entity.KlRegulation;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.StatusEnum;
+import com.diagbot.service.impl.KlRegulationServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.vo.RegulationIndexVO;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2021/3/15 10:58
+ */
+@Component
+public class KlRegulationFacade extends KlRegulationServiceImpl {
+
+    public List<RegulationIndexDTO> index(RegulationIndexVO regulationIndexVO) {
+        List<KlRegulation> klRegulationList = this.list(new QueryWrapper<KlRegulation>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("status", StatusEnum.Enable.getKey())
+                .eq(regulationIndexVO.getType() != null, "type", regulationIndexVO.getType())
+                .like("name", regulationIndexVO.getName())
+                .notIn(ListUtil.isNotEmpty(regulationIndexVO.getNotCodeList()), "code", regulationIndexVO.getNotCodeList())
+        );
+        List<RegulationIndexDTO> regulationIndexDTOList = BeanUtil.listCopyTo(klRegulationList, RegulationIndexDTO.class);
+        return regulationIndexDTOList;
+    }
+}

+ 169 - 0
src/main/java/com/diagbot/facade/KlScaleFacade.java

@@ -0,0 +1,169 @@
+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.KlScaleByIdDTO;
+import com.diagbot.dto.KlScaleInfoDTO;
+import com.diagbot.entity.KlConceptScale;
+import com.diagbot.entity.KlConceptStatic;
+import com.diagbot.entity.wrapper.KlScaleDetailWrapper;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.vo.KlScaleByIdVO;
+import com.diagbot.vo.KlScaleClearVO;
+import com.diagbot.vo.KlScaleDetailMenuVO;
+import com.diagbot.vo.KlScaleInfoVO;
+import com.diagbot.vo.KlScaleSatartOrdisaVO;
+import com.diagbot.vo.KlScaleSaveGroupVO;
+import com.diagbot.vo.KlScaleSaveUpDetailVO;
+import com.diagbot.vo.KlScaleSaveUpParentVO;
+import com.diagbot.vo.KlScaleSaveUpVO;
+import com.diagbot.vo.KlScaleSubDetailVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 10:29
+ */
+@Component
+public class KlScaleFacade {
+    @Autowired
+    KlConceptScaleFacade klConceptScaleFacade;
+    @Autowired
+    KlConceptStaticFacade klConceptStaticFacade;
+
+    public IPage<KlScaleInfoDTO> getKlScaleInfoAll(KlScaleInfoVO klScaleInfoVO) {
+        IPage<KlScaleInfoDTO> klScaleInfoPage = klConceptStaticFacade.getKlScaleInfoPage(klScaleInfoVO);
+        return klScaleInfoPage;
+    }
+
+    /**
+     * @param klScaleByIdVO
+     * @return
+     */
+    public List<KlScaleByIdDTO> getKlScaleById(KlScaleByIdVO klScaleByIdVO) {
+        List<KlScaleByIdDTO> klScaleInfoData = klConceptStaticFacade.getklScaleInfo(klScaleByIdVO);
+        List<Long> conceptId = new ArrayList<>();
+        if (ListUtil.isNotEmpty(klScaleInfoData)) {
+            for (KlScaleByIdDTO data : klScaleInfoData) {
+                conceptId.add(data.getConceptId());
+            }
+        }
+        if (ListUtil.isEmpty(conceptId)) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该数据不存在!");
+        }
+        KlScaleDetailMenuVO detailMenuVO = new KlScaleDetailMenuVO();
+        detailMenuVO.setConceptId(conceptId);
+        List<KlScaleDetailWrapper> vteFormDetailData = klConceptScaleFacade.getKlScaleDetailData(detailMenuVO);
+        if (ListUtil.isEmpty(vteFormDetailData)) {
+            return null;
+        }
+        Map<Long, Map<Integer, List<KlScaleDetailWrapper>>> collect = vteFormDetailData.stream().filter(i -> !i.getParentId().equals(-1)).collect(Collectors.groupingBy(KlScaleDetailWrapper::getConceptId, Collectors.groupingBy(KlScaleDetailWrapper::getGroupNum)));
+        //把子级数据,放在父级下
+        Map<Long, List<KlScaleDetailWrapper>> mapParentId = vteFormDetailData.stream().collect(Collectors.groupingBy(KlScaleDetailWrapper::getConceptId));
+        for (Long key : mapParentId.keySet()) {
+            for (KlScaleByIdDTO klScaleByIdData : klScaleInfoData) {
+                if (klScaleByIdData.getConceptId().equals(key)) {
+                    klScaleByIdData.setKlScaleDetail(mapParentId.get(key));
+                }
+            }
+        }
+        return klScaleInfoData;
+    }
+
+    public Boolean saveUpKlScaleAll(KlScaleSaveUpVO klScaleSaveUpVO) {
+        boolean res = false;
+        Date now = DateUtil.now();
+        UpdateWrapper<KlConceptScale> KlConceptScaleUp = new UpdateWrapper<>();
+        KlConceptScaleUp.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("concept_id", klScaleSaveUpVO.getConceptId());
+        res = klConceptScaleFacade.remove(KlConceptScaleUp);
+        //保存问题明细
+        //组别默认从1开始
+        int baseGroup = 0;
+        List<KlScaleSaveUpParentVO> klScaleParent = klScaleSaveUpVO.getKlScaleParent();//标题
+        if (ListUtil.isNotEmpty(klScaleParent)) {
+            for (KlScaleSaveUpParentVO data : klScaleParent) {
+                KlConceptScale klConceptScale = new KlConceptScale();
+                BeanUtil.copyProperties(data, klConceptScale);
+                klConceptScale.setGmtModified(now);
+                klConceptScale.setModifier(klScaleSaveUpVO.getModifier());
+                klConceptScale.setParentId(-1L);
+                klConceptScale.setConceptId(klScaleSaveUpVO.getConceptId());
+                res = klConceptScaleFacade.save(klConceptScale);
+                List<KlScaleSaveGroupVO> klScaleSaveGroup = data.getKlScaleSaveGroup();
+                if (ListUtil.isNotEmpty(klScaleSaveGroup)) {
+                    for (KlScaleSaveGroupVO groupData : klScaleSaveGroup) {//组别
+                        baseGroup = baseGroup + 1;
+                        List<KlScaleSaveUpDetailVO> klScaleSub = groupData.getKlScaleSub();
+                        if (ListUtil.isNotEmpty(klScaleSub)) {
+                            for (KlScaleSaveUpDetailVO data1 : klScaleSub) {//问题
+                                KlConceptScale klConceptScaleSub = new KlConceptScale();
+                                BeanUtil.copyProperties(data1, klConceptScaleSub);
+                                klConceptScaleSub.setGmtModified(now);
+                                klConceptScaleSub.setGroupNum(baseGroup);
+                                klConceptScaleSub.setModifier(klScaleSaveUpVO.getModifier());
+                                klConceptScaleSub.setParentId(klConceptScale.getId());
+                                klConceptScaleSub.setConceptId(klScaleSaveUpVO.getConceptId());
+                                res = klConceptScaleFacade.save(klConceptScaleSub);
+                                List<KlScaleSubDetailVO> klScaleDetail = data1.getKlScaleDetail();
+                                if (ListUtil.isNotEmpty(klScaleDetail)) {
+                                    for (KlScaleSubDetailVO data2 : klScaleDetail) {//答案
+                                        KlConceptScale klConceptScaleDetail = new KlConceptScale();
+                                        BeanUtil.copyProperties(data2, klConceptScaleDetail);
+                                        klConceptScaleDetail.setGmtModified(now);
+                                        klConceptScaleDetail.setModifier(klScaleSaveUpVO.getModifier());
+                                        klConceptScaleDetail.setParentId(klConceptScaleSub.getId());
+                                        klConceptScaleDetail.setConceptId(klScaleSaveUpVO.getConceptId());
+                                        res = klConceptScaleFacade.save(klConceptScaleDetail);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return res;
+    }
+
+    public Boolean clearKlScaleAll(KlScaleClearVO klScaleClearVO) {
+        boolean res = false;
+        UpdateWrapper<KlConceptScale> KlConceptScaleUp = new UpdateWrapper<>();
+        KlConceptScaleUp.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("concept_id", klScaleClearVO.getConceptId());
+        res = klConceptScaleFacade.remove(KlConceptScaleUp);
+        UpdateWrapper<KlConceptStatic> klScale = new UpdateWrapper<>();
+        klScale.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("concept_id", klScaleClearVO.getConceptId());
+        res = klConceptStaticFacade.remove(klScale);
+        return res;
+    }
+
+    public Boolean startOrDisableScale(KlScaleSatartOrdisaVO klScaleSatartOrdisaVO, int start) {
+        boolean res = false;
+        Date now = DateUtil.now();
+        int sum = klConceptStaticFacade.count(new QueryWrapper<KlConceptStatic>().eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", klScaleSatartOrdisaVO.getId()));
+        if (sum == 0) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该数据已不存在!");
+        }
+        UpdateWrapper<KlConceptStatic> klScaleUpdate = new UpdateWrapper<>();
+        klScaleUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", klScaleSatartOrdisaVO.getId())
+                .set("status", start)
+                .set("modifier", klScaleSatartOrdisaVO.getModifier())
+                .set("gmt_modified", now);
+        return klConceptStaticFacade.update(klScaleUpdate);
+    }
+}

+ 10 - 0
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.StandConvertServiceClient;
 import com.diagbot.dto.BaseDiagnoseDTO;
+import com.diagbot.dto.BaseRegulationDTO;
 import com.diagbot.dto.DrugNameDTO;
 import com.diagbot.dto.DrugTypeCacheDTO;
 import com.diagbot.dto.DrugTypeDTO;
@@ -75,6 +76,8 @@ public class NeoFacade {
     private KlRelationFacade klRelationFacade;
     @Autowired
     private KlDiagnoseBaseFacade klDiagnoseBaseFacade;
+    @Autowired
+    private KlRegulationBaseFacade klRegulationBaseFacade;
 
     /**
      * 返回药品缓存信息
@@ -496,4 +499,11 @@ public class NeoFacade {
             redisTemplate.opsForValue().set(RedisEnum.allBaseDiagnose.getName(), list);
         }
     }
+
+    public void allBaseRegulation() {
+        List<BaseRegulationDTO> list = klRegulationBaseFacade.getAllBase();
+        if (ListUtil.isNotEmpty(list)) {
+            redisTemplate.opsForValue().set(RedisEnum.allBaseRegulation.getName(), list);
+        }
+    }
 }

+ 1 - 0
src/main/java/com/diagbot/facade/PushFacade.java

@@ -166,6 +166,7 @@ public class PushFacade {
                 invokeParams.put("wordCrfDTO", wordCrfDTO);
                 invokeParams.put("pushNewVO", generatePushVo(wordCrfDTO, modelType));
                 pushDTO = DataFacade.get("pushAll", invokeParams, PushDTO.class);
+                debug.put("使用推送模型", modelType); // 输出调试信息
             } catch (Exception e) {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "推送服务出错" + e.getMessage());
             }

+ 21 - 0
src/main/java/com/diagbot/mapper/KlConceptScaleMapper.java

@@ -0,0 +1,21 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.KlConceptScale;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.entity.wrapper.KlScaleDetailWrapper;
+import com.diagbot.vo.KlScaleDetailMenuVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-05-10
+ */
+public interface KlConceptScaleMapper extends BaseMapper<KlConceptScale> {
+
+    List<KlScaleDetailWrapper> getKlScaleDetailMenu(KlScaleDetailMenuVO klScaleDetailMenuVO);
+}

+ 10 - 0
src/main/java/com/diagbot/mapper/KlConceptStaticMapper.java

@@ -3,12 +3,18 @@ package com.diagbot.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.KlConceptStaticDTO;
+import com.diagbot.dto.KlScaleByIdDTO;
+import com.diagbot.dto.KlScaleInfoDTO;
 import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
 import com.diagbot.entity.KlConceptStatic;
 import com.diagbot.vo.KlConceptStaticPageVO;
+import com.diagbot.vo.KlScaleByIdVO;
+import com.diagbot.vo.KlScaleInfoVO;
 import com.diagbot.vo.StaticKnowledgeIndexPageVO;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * <p>
  * 静态知识标准术语表 Mapper 接口
@@ -22,4 +28,8 @@ public interface KlConceptStaticMapper extends BaseMapper<KlConceptStatic> {
     IPage<KlConceptStaticDTO> getPage(@Param("klConceptStaticPageVO") KlConceptStaticPageVO klConceptStaticPageVO);
 
     IPage<StaticKnowledgeIndexPageDTO> staticIndexPage(@Param("staticKnowledgeIndexPageVO") StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO);
+
+    IPage<KlScaleInfoDTO> getKlScaleInfoPage(KlScaleInfoVO klScaleInfoVO);
+
+    List<KlScaleByIdDTO> getklScaleInfo(KlScaleByIdVO klScaleByIdVO);
 }

+ 23 - 0
src/main/java/com/diagbot/mapper/KlRegulationBaseMapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.BaseRegulationDTO;
+import com.diagbot.entity.KlRegulationBase;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 通用规则基础表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-15
+ */
+public interface KlRegulationBaseMapper extends BaseMapper<KlRegulationBase> {
+
+    // 获取所有去重的基础规则
+    List<BaseRegulationDTO> getAllBase();
+
+    List<BaseRegulationDTO> getSelectBase(List<String> codeList);
+}

+ 16 - 0
src/main/java/com/diagbot/mapper/KlRegulationConditionMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.KlRegulationCondition;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 通用规则条件表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-15
+ */
+public interface KlRegulationConditionMapper extends BaseMapper<KlRegulationCondition> {
+
+}

+ 22 - 0
src/main/java/com/diagbot/mapper/KlRegulationMapper.java

@@ -0,0 +1,22 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.RegulationDTO;
+import com.diagbot.entity.KlRegulation;
+import com.diagbot.vo.RegulationVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 通用规则表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-15
+ */
+public interface KlRegulationMapper extends BaseMapper<KlRegulation> {
+
+    //根据匹配的基础规则ID获取对应的编码
+    List<RegulationDTO> getRegulationByIds(RegulationVO regulationVO);
+}

+ 2 - 61
src/main/java/com/diagbot/process/PushProcess.java

@@ -10,14 +10,12 @@ import com.diagbot.dto.NeoPushDTO;
 import com.diagbot.dto.PushBaseDTO;
 import com.diagbot.dto.PushDTO;
 import com.diagbot.dto.ReverseDTO;
-import com.diagbot.dto.RuleBaseDTO;
 import com.diagbot.dto.TreatDTO;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.dto.icss.FeatureRate;
 import com.diagbot.dto.icss.Response;
 import com.diagbot.dto.icss.ResponseData;
 import com.diagbot.entity.PreResult;
-import com.diagbot.enums.BaseDiagnoseTypeEnum;
 import com.diagbot.enums.DiagnoseTypeEnum;
 import com.diagbot.enums.DiseaseTypeEnum;
 import com.diagbot.enums.LexiconEnum;
@@ -33,7 +31,6 @@ import com.diagbot.facade.KlRelationFacade;
 import com.diagbot.facade.LisConfigFacade;
 import com.diagbot.facade.NeoFacade;
 import com.diagbot.facade.TranLisConfigIcssFacade;
-import com.diagbot.model.entity.Clinical;
 import com.diagbot.rule.AgeRule;
 import com.diagbot.rule.CommonRule;
 import com.diagbot.rule.GroupRule;
@@ -65,7 +62,6 @@ import org.springframework.stereotype.Component;
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -496,63 +492,8 @@ public class PushProcess {
             return pushDTO;
         }
         // 匹配的诊断依据规则
-        List<Long> baseIdList = new ArrayList<>();
-
-        /**---------------------------数据统一处理开始--------------------------------- */
-        // 【临床表现数据来源】(主诉、现病史)
-        List<Clinical> clinicals = commonFacade.getClinicalSource(wordCrfDTO);
-        /**---------------------------数据统一处理结束--------------------------------- */
-
-        // 规则处理
-        for (BaseDiagnoseDTO base : diagnoselist) {
-            RuleBaseDTO ruleBaseDTO = new RuleBaseDTO();
-            BeanUtil.copyProperties(base, ruleBaseDTO);
-            String baseIds = base.getIds();
-            switch (BaseDiagnoseTypeEnum.getEnum(base.getBaseType())) {
-                case equals: // 等于术语本身
-                    switch (LexiconEnum.getEnum(base.getBaseLibType())) {
-                        case Symptom: // 症状
-                            commonRule.compareNameWithPush(clinicals, ruleBaseDTO, baseIdList, baseIds);
-                            break;
-                        case Disease: // 疾病【病史】
-                            commonRule.compareNameWithPush(wordCrfDTO.getPastLabel().getDiags(), ruleBaseDTO, baseIdList, baseIds);
-                            break;
-                        case VitalResult: // 体格检查结果
-                            vitalRule.push(wordCrfDTO.getVitalLabel(), ruleBaseDTO, baseIdList, baseIds);
-                            break;
-                        case Group: // 人群
-                            groupRule.push(wordCrfDTO, ruleBaseDTO, baseIdList, baseIds);
-                            break;
-                        case PacsResult: // 辅助检查结果
-                            commonRule.compareItemWithPush(wordCrfDTO.getPacsLabel().getRes(), ruleBaseDTO, baseIdList, baseIds);
-                            break;
-                    }
-                    break;
-                case compare: // 比较
-                    switch (LexiconEnum.getEnum(base.getBaseLibType())) {
-                        case LisSubName: // 化验
-                            lisRule.push(wordCrfDTO.getLis(), ruleBaseDTO, baseIdList, baseIds);
-                            break;
-                        case Age: // 年龄
-                            ageRule.push(wordCrfDTO, ruleBaseDTO, baseIdList, baseIds);
-                            break;
-                        case Vital: // 体格检查项目
-                            vitalRule.push(wordCrfDTO.getVitalLabel(), ruleBaseDTO, baseIdList, baseIds);
-                            break;
-                    }
-                    break;
-                case regexChiefSymptom: // 主诉现病史正则
-                    commonRule.getRegexResPush(wordCrfDTO.getChief() + wordCrfDTO.getSymptom(),
-                            base.getBaseEqValue(), baseIdList, baseIds);
-                    break;
-                case regexPast: // 既往史正则
-                    commonRule.getRegexResPush(wordCrfDTO.getPasts() + wordCrfDTO.getPersonal() + wordCrfDTO.getMenstrual() + wordCrfDTO.getMarital() + wordCrfDTO.getFamily(),
-                            base.getBaseEqValue(), baseIdList, baseIds);
-                    break;
-            }
-        }
-        // 根据诊断依据推送诊断
-        Collections.sort(baseIdList); // id排序,方便调试查看
+        List<Long> baseIdList = commonRule.matchBase(wordCrfDTO, diagnoselist);
+
         pushDTO.getDebug().put("诊断依据ID列表", StringUtils.join(baseIdList, ","));
         Map<String, List<PushBaseDTO>> pushDiagnoseDTO = setPushDiagnose(wordCrfDTO, baseIdList);
         pushDTO.setDis(pushDiagnoseDTO);

+ 92 - 29
src/main/java/com/diagbot/rule/CommonRule.java

@@ -1,13 +1,19 @@
 package com.diagbot.rule;
 
 import com.diagbot.biz.push.entity.Pacs;
+import com.diagbot.dto.BaseDiagnoseDTO;
 import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.RuleBaseDTO;
 import com.diagbot.dto.RuleSimpleDTO;
 import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.enums.BaseDiagnoseTypeEnum;
 import com.diagbot.enums.ConEnum;
+import com.diagbot.enums.LexiconEnum;
 import com.diagbot.enums.TypeEnum;
+import com.diagbot.facade.CommonFacade;
+import com.diagbot.model.entity.Clinical;
 import com.diagbot.model.entity.Negative;
+import com.diagbot.util.BeanUtil;
 import com.diagbot.util.CatalogueUtil;
 import com.diagbot.util.CoreUtil;
 import com.diagbot.util.EntityUtil;
@@ -16,6 +22,7 @@ import com.diagbot.util.MsgUtil;
 import com.diagbot.util.RegexUtil;
 import com.diagbot.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -26,8 +33,7 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.concurrent.locks.ReentrantLock;
+import java.util.stream.Collectors;
 
 /**
  * @description: 通用规则提取
@@ -37,6 +43,17 @@ import java.util.concurrent.locks.ReentrantLock;
 @Component
 public class CommonRule {
 
+    @Autowired
+    CommonFacade commonFacade;
+    @Autowired
+    GroupRule groupRule;
+    @Autowired
+    VitalRule vitalRule;
+    @Autowired
+    AgeRule ageRule;
+    @Autowired
+    LisRule lisRule;
+
     /**
      * 比较阳性属性是否匹配
      *
@@ -405,34 +422,80 @@ public class CommonRule {
         highRiskList.add(billMsg);
     }
 
+    /**
+     * 根据基础规则,通用
+     *
+     * @param wordCrfDTO
+     */
+    public List<Long> matchBase(WordCrfDTO wordCrfDTO, List<BaseDiagnoseDTO> baseList) {
+        List<Long> baseIdList = new ArrayList<>();
+        /**---------------------------数据统一处理开始--------------------------------- */
+        // 【临床表现数据来源】(主诉、现病史)
+        List<Clinical> clinicals = commonFacade.getClinicalSource(wordCrfDTO);
+        /**---------------------------数据统一处理结束--------------------------------- */
 
-
-
-
-    public static void main(String[] args) {
-        List<Pacs> pacsList = new ArrayList<>();
-        Pacs pacs = new Pacs();
-        pacs.setName("d1");
-        pacs.setDateValue("2020-01-01");
-        pacsList.add(pacs);
-
-        Pacs pacs1 = new Pacs();
-        pacs1.setName("d2");
-        pacs1.setDateValue("2020-01-07");
-        pacsList.add(pacs1);
-
-        Pacs pacs3 = new Pacs();
-        pacs3.setName("d3");
-        pacs3.setDateValue("2020-01-09");
-        pacsList.add(pacs3);
-        CommonRule commonRule = new CommonRule();
-        commonRule.sortByProperty(pacsList, "dateValue");
-        for (Pacs bean : pacsList) {
-            System.out.println(bean.getName());
+        // 规则处理
+        for (BaseDiagnoseDTO base : baseList) {
+            RuleBaseDTO ruleBaseDTO = new RuleBaseDTO();
+            BeanUtil.copyProperties(base, ruleBaseDTO);
+            String baseIds = base.getIds();
+            BaseDiagnoseTypeEnum baseEnum = BaseDiagnoseTypeEnum.getEnum(base.getBaseType());
+            if (baseEnum == null) { // 防止报空指针
+                continue;
+            }
+            switch (baseEnum) {
+                case equals: // 等于术语本身
+                    switch (LexiconEnum.getEnum(base.getBaseLibType())) {
+                        case Symptom: // 症状
+                            compareNameWithPush(clinicals, ruleBaseDTO, baseIdList, baseIds);
+                            break;
+                        case Disease: // 疾病【病史】
+                            compareNameWithPush(wordCrfDTO.getPastLabel().getDiags(), ruleBaseDTO, baseIdList, baseIds);
+                            break;
+                        case VitalResult: // 体格检查结果
+                            vitalRule.push(wordCrfDTO.getVitalLabel(), ruleBaseDTO, baseIdList, baseIds);
+                            break;
+                        case Group: // 人群
+                            groupRule.push(wordCrfDTO, ruleBaseDTO, baseIdList, baseIds);
+                            break;
+                        case PacsResult: // 辅助检查结果
+                            compareItemWithPush(wordCrfDTO.getPacsLabel().getRes(), ruleBaseDTO, baseIdList, baseIds);
+                            break;
+                    }
+                    break;
+                case compare: // 比较
+                    switch (LexiconEnum.getEnum(base.getBaseLibType())) {
+                        case LisSubName: // 化验
+                            lisRule.push(wordCrfDTO.getLis(), ruleBaseDTO, baseIdList, baseIds);
+                            break;
+                        case Age: // 年龄
+                            ageRule.push(wordCrfDTO, ruleBaseDTO, baseIdList, baseIds);
+                            break;
+                        case Vital: // 体格检查项目
+                            vitalRule.push(wordCrfDTO.getVitalLabel(), ruleBaseDTO, baseIdList, baseIds);
+                            break;
+                    }
+                    break;
+                case regexChiefSymptom: // 主诉现病史正则
+                    getRegexResPush(wordCrfDTO.getChief() + wordCrfDTO.getSymptom(),
+                            base.getBaseEqValue(), baseIdList, baseIds);
+                    break;
+                case regexPast: // 既往史正则
+                    getRegexResPush(wordCrfDTO.getPasts() + wordCrfDTO.getPersonal() + wordCrfDTO.getMenstrual() + wordCrfDTO.getMarital() + wordCrfDTO.getFamily(),
+                            base.getBaseEqValue(), baseIdList, baseIds);
+                case regexVital: // 查体正则
+                    getRegexResPush(wordCrfDTO.getVital(),
+                            base.getBaseEqValue(), baseIdList, baseIds);
+                case regexPacs: // 辅检正则
+                    if (ListUtil.isNotEmpty(wordCrfDTO.getPacs())) {
+                        String content = wordCrfDTO.getPacs().stream().map(r -> r.getResult())
+                                .filter(r -> StringUtil.isNotBlank(r)).collect(Collectors.joining("。"));
+                        getRegexResPush(content, base.getBaseEqValue(), baseIdList, baseIds);
+                    }
+                    break;
+            }
         }
-        AtomicReference<Integer> integerAtomicReference = new AtomicReference<>(20);
-        integerAtomicReference.set(1020);
-        new ReentrantLock().lock();
+        Collections.sort(baseIdList); // id排序,方便调试查看
+        return baseIdList;
     }
-
 }

+ 20 - 0
src/main/java/com/diagbot/service/KlConceptScaleService.java

@@ -0,0 +1,20 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.KlConceptScale;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.wrapper.KlScaleDetailWrapper;
+import com.diagbot.vo.KlScaleDetailMenuVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-05-10
+ */
+public interface KlConceptScaleService extends IService<KlConceptScale> {
+    List<KlScaleDetailWrapper>  getKlScaleDetailMenu(KlScaleDetailMenuVO klScaleDetailMenuVO);
+}

+ 10 - 0
src/main/java/com/diagbot/service/KlConceptStaticService.java

@@ -3,12 +3,18 @@ package com.diagbot.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.dto.KlConceptStaticDTO;
+import com.diagbot.dto.KlScaleByIdDTO;
+import com.diagbot.dto.KlScaleInfoDTO;
 import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
 import com.diagbot.entity.KlConceptStatic;
 import com.diagbot.vo.KlConceptStaticPageVO;
+import com.diagbot.vo.KlScaleByIdVO;
+import com.diagbot.vo.KlScaleInfoVO;
 import com.diagbot.vo.StaticKnowledgeIndexPageVO;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * <p>
  * 静态知识标准术语表 服务类
@@ -22,4 +28,8 @@ public interface KlConceptStaticService extends IService<KlConceptStatic> {
     IPage<KlConceptStaticDTO> getPage(@Param("klConceptStaticPageVO") KlConceptStaticPageVO klConceptStaticPageVO);
 
     IPage<StaticKnowledgeIndexPageDTO> staticIndexPage(@Param("staticKnowledgeIndexPageVO") StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO);
+
+    IPage<KlScaleInfoDTO> getKlScaleInfoPage(KlScaleInfoVO klScaleInfoVO);
+
+    List<KlScaleByIdDTO> getklScaleInfo(KlScaleByIdVO klScaleByIdVO);
 }

+ 23 - 0
src/main/java/com/diagbot/service/KlRegulationBaseService.java

@@ -0,0 +1,23 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.BaseRegulationDTO;
+import com.diagbot.entity.KlRegulationBase;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 通用规则基础表 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2021-06-15
+ */
+public interface KlRegulationBaseService extends IService<KlRegulationBase> {
+
+    // 获取所有去重的基础规则
+    List<BaseRegulationDTO> getAllBase();
+
+    List<BaseRegulationDTO> getSelectBase(List<String> codeList);
+}

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

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.KlRegulationCondition;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 通用规则条件表 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2021-06-15
+ */
+public interface KlRegulationConditionService extends IService<KlRegulationCondition> {
+
+}

+ 22 - 0
src/main/java/com/diagbot/service/KlRegulationService.java

@@ -0,0 +1,22 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.RegulationDTO;
+import com.diagbot.entity.KlRegulation;
+import com.diagbot.vo.RegulationVO;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 通用规则表 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2021-06-15
+ */
+public interface KlRegulationService extends IService<KlRegulation> {
+
+    //根据匹配的基础规则ID获取对应的编码
+    List<RegulationDTO> getRegulationByIds(RegulationVO regulationVO);
+}

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

@@ -0,0 +1,28 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.KlConceptScale;
+import com.diagbot.entity.wrapper.KlScaleDetailWrapper;
+import com.diagbot.mapper.KlConceptScaleMapper;
+import com.diagbot.service.KlConceptScaleService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.KlScaleDetailMenuVO;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-05-10
+ */
+@Service
+public class KlConceptScaleServiceImpl extends ServiceImpl<KlConceptScaleMapper, KlConceptScale> implements KlConceptScaleService {
+
+    @Override
+    public List<KlScaleDetailWrapper> getKlScaleDetailMenu(KlScaleDetailMenuVO klScaleDetailMenuVO) {
+        return baseMapper.getKlScaleDetailMenu(klScaleDetailMenuVO);
+    }
+}

+ 1 - 1
src/main/java/com/diagbot/service/impl/KlConceptServiceImpl.java

@@ -39,4 +39,4 @@ public class KlConceptServiceImpl extends ServiceImpl<KlConceptMapper, KlConcept
     public List<KllisDetailDTO> getLisDetaisByNames(KllisDetailVO kllisDetailVO) {
         return baseMapper.getLisDetaisByNames(kllisDetailVO);
     }
-}
+}

+ 15 - 0
src/main/java/com/diagbot/service/impl/KlConceptStaticServiceImpl.java

@@ -3,15 +3,21 @@ package com.diagbot.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.KlConceptStaticDTO;
+import com.diagbot.dto.KlScaleByIdDTO;
+import com.diagbot.dto.KlScaleInfoDTO;
 import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
 import com.diagbot.entity.KlConceptStatic;
 import com.diagbot.mapper.KlConceptStaticMapper;
 import com.diagbot.service.KlConceptStaticService;
 import com.diagbot.vo.KlConceptStaticPageVO;
+import com.diagbot.vo.KlScaleByIdVO;
+import com.diagbot.vo.KlScaleInfoVO;
 import com.diagbot.vo.StaticKnowledgeIndexPageVO;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 静态知识标准术语表 服务实现类
@@ -32,4 +38,13 @@ public class KlConceptStaticServiceImpl extends ServiceImpl<KlConceptStaticMappe
     public IPage<StaticKnowledgeIndexPageDTO> staticIndexPage(@Param("staticKnowledgeIndexPageVO") StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO) {
         return baseMapper.staticIndexPage(staticKnowledgeIndexPageVO);
     }
+    @Override
+    public IPage<KlScaleInfoDTO> getKlScaleInfoPage(KlScaleInfoVO klScaleInfoVO) {
+        return baseMapper.getKlScaleInfoPage(klScaleInfoVO);
+    }
+
+    @Override
+    public List<KlScaleByIdDTO> getklScaleInfo(KlScaleByIdVO klScaleByIdVO) {
+        return baseMapper.getklScaleInfo(klScaleByIdVO);
+    }
 }

+ 32 - 0
src/main/java/com/diagbot/service/impl/KlRegulationBaseServiceImpl.java

@@ -0,0 +1,32 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.dto.BaseRegulationDTO;
+import com.diagbot.entity.KlRegulationBase;
+import com.diagbot.mapper.KlRegulationBaseMapper;
+import com.diagbot.service.KlRegulationBaseService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 通用规则基础表 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2021-06-15
+ */
+@Service
+public class KlRegulationBaseServiceImpl extends ServiceImpl<KlRegulationBaseMapper, KlRegulationBase> implements KlRegulationBaseService {
+
+    @Override
+    public List<BaseRegulationDTO> getAllBase() {
+        return baseMapper.getAllBase();
+    }
+
+    @Override
+    public List<BaseRegulationDTO> getSelectBase(List<String> codeList) {
+        return baseMapper.getSelectBase(codeList);
+    }
+}

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

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.KlRegulationCondition;
+import com.diagbot.mapper.KlRegulationConditionMapper;
+import com.diagbot.service.KlRegulationConditionService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 通用规则条件表 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2021-06-15
+ */
+@Service
+public class KlRegulationConditionServiceImpl extends ServiceImpl<KlRegulationConditionMapper, KlRegulationCondition> implements KlRegulationConditionService {
+
+}

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

@@ -0,0 +1,28 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.dto.RegulationDTO;
+import com.diagbot.entity.KlRegulation;
+import com.diagbot.mapper.KlRegulationMapper;
+import com.diagbot.service.KlRegulationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.RegulationVO;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 通用规则表 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2021-06-15
+ */
+@Service
+public class KlRegulationServiceImpl extends ServiceImpl<KlRegulationMapper, KlRegulation> implements KlRegulationService {
+
+    @Override
+    public List<RegulationDTO> getRegulationByIds(RegulationVO regulationVO) {
+        return baseMapper.getRegulationByIds(regulationVO);
+    }
+}

+ 10 - 0
src/main/java/com/diagbot/vo/KlConceptStaticVO.java

@@ -48,4 +48,14 @@ public class KlConceptStaticVO {
      */
     @ApiModelProperty(hidden = true)
     private Long userId;
+
+    /**
+     * 量表结构
+     */
+    private KlScaleSaveUpVO scale;
+
+    /**
+     * 数据来源:0-医院端、1-云平台,默认0
+     */
+    private Integer source = 0;
 }

+ 19 - 0
src/main/java/com/diagbot/vo/KlScaleByIdVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 10:37
+ */
+@Setter
+@Getter
+public class KlScaleByIdVO {
+    private Long id;
+    private String name;//全等参数
+    private String conceptName;
+    private Integer status;
+
+}

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

@@ -0,0 +1,15 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 17:10
+ */
+@Setter
+@Getter
+public class KlScaleClearVO {
+    private Long conceptId;
+}

+ 17 - 0
src/main/java/com/diagbot/vo/KlScaleDetailMenuVO.java

@@ -0,0 +1,17 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 13:13
+ */
+@Setter
+@Getter
+public class KlScaleDetailMenuVO {
+    private List<Long> conceptId;
+}

+ 17 - 0
src/main/java/com/diagbot/vo/KlScaleInfoVO.java

@@ -0,0 +1,17 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-10 10:38
+ */
+@Setter
+@Getter
+public class KlScaleInfoVO extends Page {
+    private Integer status;
+    private String conceptName;
+}

+ 16 - 0
src/main/java/com/diagbot/vo/KlScaleSatartOrdisaVO.java

@@ -0,0 +1,16 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-05-11 11:35
+ */
+@Setter
+@Getter
+public class KlScaleSatartOrdisaVO {
+    private Long id;
+    private String modifier;
+}

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

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description: 组
+ * @date 2021-05-25 9:20
+ */
+@Setter
+@Getter
+public class KlScaleSaveGroupVO {
+    private Integer groupNum;
+    private List<KlScaleSaveUpDetailVO> klScaleSub;
+}

+ 70 - 0
src/main/java/com/diagbot/vo/KlScaleSaveUpDetailVO.java

@@ -0,0 +1,70 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description: 问题 第二层
+ * @date 2021-05-10 14:11
+ */
+@Setter
+@Getter
+public class KlScaleSaveUpDetailVO {
+    /**
+     * 内容
+     */
+    private String content;
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 系数
+     */
+    private BigDecimal factor;
+
+    /**
+     * 常数
+     */
+    private BigDecimal constant;
+
+    /**
+     * 11问题选项;12文本;13得分结果(隐藏)21问题,31答案'
+     */
+    private Integer textType;
+    /**
+     * 结果类型(1算分;2显示选择结果)
+     */
+    private Integer resultType;
+
+
+    /**
+     * 选择类型(21单选22多选)
+     */
+    private Integer selectType;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 1:显示,0:不显示,2隐藏
+     */
+    private Integer status;
+
+
+    private String remark;
+
+    List<KlScaleSubDetailVO> KlScaleDetail;
+}

+ 66 - 0
src/main/java/com/diagbot/vo/KlScaleSaveUpParentVO.java

@@ -0,0 +1,66 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description: 第一层
+ * @date 2021-05-10 14:13
+ */
+@Setter
+@Getter
+public class KlScaleSaveUpParentVO {
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 系数
+     */
+    private BigDecimal factor;
+
+    /**
+     * 常数
+     */
+    private BigDecimal constant;
+
+    /**
+     * 11问题选项;12文本;13得分结果(隐藏)
+     */
+    private Integer textType;
+    /**
+     * 结果类型(1算分;2显示选择结果)
+     */
+    private Integer resultType;
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 1:显示,0:不显示,2隐藏
+     */
+    private Integer status;
+
+
+    private String remark;
+
+    private List<KlScaleSaveGroupVO> klScaleSaveGroup;
+
+}

+ 25 - 0
src/main/java/com/diagbot/vo/KlScaleSaveUpVO.java

@@ -0,0 +1,25 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author wangfeng
+ * @Description: 总
+ * @date 2021-05-10 14:08
+ */
+@Setter
+@Getter
+public class KlScaleSaveUpVO {
+    /**
+     * 术语概念id
+     */
+    private Long conceptId;
+
+    private String modifier;
+
+    private List<KlScaleSaveUpParentVO> KlScaleParent;
+}

+ 59 - 0
src/main/java/com/diagbot/vo/KlScaleSubDetailVO.java

@@ -0,0 +1,59 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+/**
+ * @author wangfeng
+ * @Description: 选项 第三层
+ * @date 2021-05-10 14:15
+ */
+@Setter
+@Getter
+public class KlScaleSubDetailVO {
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 编码
+     */
+    private String ruleCode;
+
+    /**
+     * 扣分
+     */
+    private BigDecimal score;
+
+    /**
+     * 11表格;12文本;21标题;31算分;32显示选择结果
+     */
+    private Integer textType;
+
+    /**
+     * 显示顺序
+     */
+    private Integer orderNo;
+
+    /**
+     * 1:显示,0:不显示,2隐藏
+     */
+    private Integer status;
+
+
+    /**
+     * 结果
+     */
+    private String result;
+
+    /**
+     * 推送信息
+     */
+    private String pushInfo;
+
+    private String remark;
+
+}

+ 21 - 0
src/main/java/com/diagbot/vo/RegulationIndexVO.java

@@ -0,0 +1,21 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description: 规则搜索
+ * @Author:zhoutg
+ * @time: 2020/7/29 15:34
+ */
+@Data
+public class RegulationIndexVO {
+
+    // 内容
+    private String name;
+    // 规则类型:(1:量表)
+    private Integer type;
+    // 过滤编码
+    private List<String> notCodeList;
+}

+ 20 - 0
src/main/java/com/diagbot/vo/RegulationVO.java

@@ -0,0 +1,20 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2021/3/15 11:21
+ */
+@Getter
+@Setter
+public class RegulationVO {
+    /**
+     * 符合的Id列表
+     */
+    private List<Long> ids;
+}

+ 16 - 0
src/main/java/com/diagbot/vo/ScaleStaticAllVO.java

@@ -0,0 +1,16 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-06-18 10:16
+ */
+@Setter
+@Getter
+public class ScaleStaticAllVO {
+    private StaticKnowledgeVO staticKnowledgeVO;
+    private ScaleVO scaleVO;
+}

+ 17 - 0
src/main/java/com/diagbot/vo/ScaleVO.java

@@ -0,0 +1,17 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:量表规则入参
+ * @Author:zhoutg
+ * @time: 2020/7/29 15:34
+ */
+@Data
+public class ScaleVO extends SearchData {
+
+    // 量表规则列表
+    private List<String> codeList = new ArrayList<>();
+}

+ 3 - 1
src/main/java/com/diagbot/vo/StaticKnowledgeVO.java

@@ -13,7 +13,7 @@ import java.util.List;
  */
 @Getter
 @Setter
-public class StaticKnowledgeVO {
+public class StaticKnowledgeVO extends ScaleVO{
     /**
      * 标准术语名称
      */
@@ -27,4 +27,6 @@ public class StaticKnowledgeVO {
      * 内容类型:1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
      */
     private List<Integer> contentTypes;
+
+    private String mrId;
 }

+ 9 - 0
src/main/java/com/diagbot/web/CacheController.java

@@ -62,6 +62,15 @@ public class CacheController {
         return RespDTO.onSuc(true);
     }
 
+    // @ApiOperation(value = "重新加载基础规则[by:zhoutg]",
+    //         notes = "")
+    // @PostMapping("/reloadRegulation")
+    // @SysLogger("reloadRegulation")
+    // public RespDTO<Boolean> reloadRegulation() {
+    //     cacheFacade.loadAllBaseRegulationCache();
+    //     return RespDTO.onSuc(true);
+    // }
+
     @ApiOperation(value = "重新加载药物缓存[by:zhoutg]",
             notes = "")
     @PostMapping("/clearDrug")

+ 20 - 0
src/main/java/com/diagbot/web/KlConceptScaleController.java

@@ -0,0 +1,20 @@
+package com.diagbot.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-05-10
+ */
+@Controller
+@RequestMapping("/klConceptScale")
+public class KlConceptScaleController {
+
+}

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

@@ -4,6 +4,7 @@ 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.ConceptScaleDTO;
 import com.diagbot.dto.KlConceptStaticDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.StaticKnowledgeDTO;
@@ -88,7 +89,9 @@ public class KlConceptStaticController {
                     "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作、8-量表、9-护理  <br>" +
                     "clinicalPathwayName: 临床路径名称<br>" +
                     "noticeName: 注意事项名称<br>" +
-                    "details: 明细<br>")
+                    "source:数据来源:0-医院端、1-云平台,默认0 <br>" +
+                    "details: 明细<br>" +
+                    "scale:评估量表<br>")
     @PostMapping("/saveOrUpdateRecord")
     @SysLogger("saveOrUpdateRecord")
     @Transactional
@@ -136,4 +139,13 @@ public class KlConceptStaticController {
         Map<String, List<ConceptDetailDTO>> data = klConceptStaticFacade.getDetailByConcept(getDetailVO);
         return RespDTO.onSuc(data);
     }
+
+    @ApiOperation(value = "推理结果匹配量表[zhaops]",
+            notes = "nameList: 术语名称 <br>")
+    @PostMapping("/getScaleDetailByConcept")
+    @SysLogger("getScaleDetailByConcept")
+    public RespDTO<Map<String, ConceptScaleDTO>> getScaleDetailByConcept(@RequestBody @Valid GetDetailVO getDetailVO) {
+        Map<String, ConceptScaleDTO> data = klConceptStaticFacade.getScaleDetailByConcept(getDetailVO);
+        return RespDTO.onSuc(data);
+    }
 }

+ 55 - 0
src/main/java/com/diagbot/web/KlRegulationController.java

@@ -0,0 +1,55 @@
+package com.diagbot.web;
+
+
+import com.diagbot.dto.RegulationIndexDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.ScaleDTO;
+import com.diagbot.facade.KlRegulationBaseFacade;
+import com.diagbot.facade.KlRegulationFacade;
+import com.diagbot.vo.RegulationIndexVO;
+import com.diagbot.vo.ScaleVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 通用规则表 前端控制器
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-15
+ */
+@RestController
+@RequestMapping("/klRegulation")
+@Api(value = "其他规则API", tags = { "其他规则API" })
+public class KlRegulationController {
+
+    @Autowired
+    KlRegulationBaseFacade klRegulationBaseFacade;
+    @Autowired
+    KlRegulationFacade klRegulationFacade;
+
+    @ApiOperation(value = "量表规则匹配[zhoutg]", notes = "")
+    @PostMapping("/scaleRule")
+    public RespDTO<ScaleDTO> scaleRule(@RequestBody ScaleVO scaleVO) {
+        ScaleDTO scaleDTO = klRegulationBaseFacade.process(scaleVO);
+        return RespDTO.onSuc(scaleDTO);
+    }
+
+    @ApiOperation(value = "规则搜索[zhoutg]", notes =
+            "name:内容\n" +
+            "type:规则类型:(1:量表)\n" +
+            " notCodeList:过滤编码")
+    @PostMapping("/index")
+    public RespDTO<List<RegulationIndexDTO>> index(@RequestBody RegulationIndexVO regulationIndexVO) {
+        List<RegulationIndexDTO> regulationIndexDTOList = klRegulationFacade.index(regulationIndexVO);
+        return RespDTO.onSuc(regulationIndexDTOList);
+    }
+}

+ 85 - 0
src/main/java/com/diagbot/web/KlScaleController.java

@@ -0,0 +1,85 @@
+package com.diagbot.web;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.KlScaleByIdDTO;
+import com.diagbot.dto.KlScaleInfoDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.enums.StatusEnum;
+import com.diagbot.facade.KlScaleFacade;
+import com.diagbot.vo.KlScaleByIdVO;
+import com.diagbot.vo.KlScaleInfoVO;
+import com.diagbot.vo.KlScaleSatartOrdisaVO;
+import com.diagbot.vo.KlScaleSaveUpVO;
+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 javax.validation.Valid;
+import java.util.List;
+
+/**
+ * <p>
+ * 量表结构表 前端控制器
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2021-05-10
+ */
+
+@RestController
+@RequestMapping("/klScale")
+@Api(value = "量表结构表相关API", tags = { "量表结构表相关API" })
+@SuppressWarnings("unchecked")
+@ApiIgnore
+@Deprecated
+public class KlScaleController {
+
+    @Autowired
+    KlScaleFacade klScaleFacade;
+
+    @ApiOperation(value = "分页获取量表结构表列表[by:wangfeng]")
+    @PostMapping("/getKlScaleInfoPage")
+    @SysLogger("getKlScaleInfoPage")
+    public RespDTO<IPage<KlScaleInfoDTO>> getKlScaleInfoPages(@RequestBody KlScaleInfoVO klScaleInfoVO) {
+        return RespDTO.onSuc(klScaleFacade.getKlScaleInfoAll(klScaleInfoVO));
+    }
+
+
+    @ApiOperation(value = "根据id获取量表结构[by:wangfeng]", notes = "根据id获取量表结构[by:wangfeng]")
+    @PostMapping("/getKlScaleById")
+    @SysLogger("getKlScaleById")
+    public RespDTO<List<KlScaleByIdDTO>> getKlScaleByIds(@RequestBody @Valid KlScaleByIdVO klScaleByIdVO) {
+        List<KlScaleByIdDTO> data = klScaleFacade.getKlScaleById(klScaleByIdVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "保存修改获取量表结构[by:wangfeng]", notes = "保存修改获取量表结构[by:wangfeng]")
+    @PostMapping("/saveUpKlScale")
+    @SysLogger("saveUpKlScale")
+    public RespDTO<Boolean> saveUpKlScales(@RequestBody @Valid KlScaleSaveUpVO klScaleSaveUpVO) {
+        Boolean res = klScaleFacade.saveUpKlScaleAll(klScaleSaveUpVO);
+        return RespDTO.onSuc(res);
+    }
+
+    @ApiOperation(value = "停用量表[by:wangfeng]")
+    @PostMapping("/disableKlScale")
+    @SysLogger("disableKlScale")
+    public RespDTO<Boolean> disableKlScales(@RequestBody @Valid KlScaleSatartOrdisaVO klScaleSatartOrdisaVO) {
+        return RespDTO.onSuc(klScaleFacade.startOrDisableScale(klScaleSatartOrdisaVO, StatusEnum.Disable.getKey()));
+    }
+
+    @ApiOperation(value = "启用量表[by:wangfeng]")
+    @PostMapping("/startKlScale")
+    @SysLogger("startKlScale")
+    public RespDTO<Boolean> startKlScales(@RequestBody @Valid KlScaleSatartOrdisaVO klScaleSatartOrdisaVO) {
+        return RespDTO.onSuc(klScaleFacade.startOrDisableScale(klScaleSatartOrdisaVO, StatusEnum.Enable.getKey()));
+    }
+
+}

+ 43 - 38
src/main/resources/mapper/KlConceptMapper.xml

@@ -226,7 +226,7 @@
 		FROM
 		(
 		SELECT
-        s.moduleNo,
+		s.moduleNo,
 		s.id,
 		s.name,
 		s.retrievalName,
@@ -234,30 +234,33 @@
 		s.type,
 		s.typeName,
 		s.code,
-		s1.concept_id AS conceptId,
+		IF( s2.concept_id IS NOT NULL, s2.concept_id, s3.concept_id ) AS conceptId,
 		s1.clinical_pathway_name,
 		s1.notice_name,
 		s1.`status` AS status,
-		IF( count( s2.id )> 0, 1, 0 ) AS hasInfo ,
+		IF( count( s2.id )> 0, 1, IF( count( s3.id )>0 ,1 ,0 ) ) AS hasInfo ,
 		IF( sum( IF ( FIND_IN_SET( 1, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasStaticKnowledge,
 		IF( sum( IF ( FIND_IN_SET( 2, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasNotice,
 		IF( sum( IF ( FIND_IN_SET( 3, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasClinicalPathway,
 		IF( sum( IF ( FIND_IN_SET( 4, s2.content_type )> 0, 1, 0 ))> 0, 1, 0 ) AS hasTreatInfo
 		FROM
+		(SELECT
+		o1.*
+		FROM
 		(
 		SELECT
-        t.moduleNo,
+		t.moduleNo,
 		t.id,
 		t.NAME,
 		IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
 		t.isConcept,
 		t.type,
 		t.typeName,
-        t1.icd10_code AS code
+		t1.icd10_code AS code
 		FROM
 		(
 		SELECT
-        concat( '1', b.lib_type ) AS moduleNo,
+		concat( '1', b.lib_type ) AS moduleNo,
 		a.NAME AS retrievalName,
 		a.spell AS spell,
 		a.is_concept AS isConcept,
@@ -277,29 +280,27 @@
 		AND b.lib_type = c.code
 		AND b.`status` = 1
 		<if test="typeIds != null and typeIds.size > 0">
-			<foreach item="typeId" collection="typeIds" open="and(" separator="or" close=")" >
+			<foreach item="typeId" collection="typeIds" open="and(" separator="or" close=")">
 				a.type_id =#{typeId}
-			</foreach>
+			</foreach>AND ( a.name = #{inputStr}</if>
+		<if test="inputStr!=null and inputStr!=''">OR LOWER(a.spell
+			) = LOWER(#{inputStr}))
 		</if>
-        <if test="inputStr!=null and inputStr!=''">
-            AND ( a.name = #{inputStr}
-            OR LOWER(a.spell) = LOWER(#{inputStr}))
-        </if>
 		) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
 		UNION
 		SELECT
-        t.moduleNo,
+		t.moduleNo,
 		t.id,
 		t.NAME,
 		IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
 		t.isConcept,
 		t.type,
 		t.typeName,
-        t1.icd10_code AS code
+		t1.icd10_code AS code
 		FROM
 		(
 		SELECT
-        concat( '2', b.lib_type ) AS moduleNo,
+		concat( '2', b.lib_type ) AS moduleNo,
 		a.NAME AS retrievalName,
 		a.spell AS spell,
 		a.is_concept AS isConcept,
@@ -323,25 +324,25 @@
 				a.type_id =#{typeId}
 			</foreach>
 		</if>
-        <if test="inputStr!=null and inputStr!=''">
-            AND ( a.name LIKE concat(#{inputStr},'%')
-            OR LOWER(a.spell) LIKE LOWER( concat(#{inputStr},'%')))
-        </if>
+		<if test="inputStr!=null and inputStr!=''">
+			AND ( a.name LIKE concat(#{inputStr},'%')
+			OR LOWER(a.spell) LIKE LOWER( concat(#{inputStr},'%')))
+		</if>
 		) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
 		UNION
 		SELECT
-        t.moduleNo,
+		t.moduleNo,
 		t.id,
 		t.NAME,
 		IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
 		t.isConcept,
 		t.type,
 		t.typeName,
-        t1.icd10_code AS code
+		t1.icd10_code AS code
 		FROM
 		(
 		SELECT
-        concat( '3', b.lib_type ) AS moduleNo,
+		concat( '3', b.lib_type ) AS moduleNo,
 		a.NAME AS retrievalName,
 		a.spell AS spell,
 		a.is_concept AS isConcept,
@@ -365,15 +366,15 @@
 				a.type_id =#{typeId}
 			</foreach>
 		</if>
-        <if test="inputStr!=null and inputStr!=''">
-            AND ( a.name LIKE concat('%',#{inputStr},'%')
-            OR LOWER(a.spell) LIKE LOWER( concat('%',#{inputStr},'%')))
-        </if>
+		<if test="inputStr!=null and inputStr!=''">
+			AND ( a.name LIKE concat('%',#{inputStr},'%')
+			OR LOWER(a.spell) LIKE LOWER( concat('%',#{inputStr},'%')))
+		</if>
 		) t left join kl_disease t1 on t.id = t1.concept_id and t1.is_deleted='N'
 		<if test="typeIds.contains(107) or typeIds.contains(108)">
 			UNION
 			SELECT DISTINCT
-            concat( '1', e.lib_type ) AS moduleNo,
+			concat( '1', e.lib_type ) AS moduleNo,
 			e.id AS id,
 			e.lib_name AS NAME,
 			b.lib_name AS retrievalName,
@@ -406,7 +407,7 @@
 			</if>
 			UNION
 			SELECT DISTINCT
-            concat( '2', e.lib_type ) AS moduleNo,
+			concat( '2', e.lib_type ) AS moduleNo,
 			e.id AS id,
 			e.lib_name AS NAME,
 			b.lib_name AS retrievalName,
@@ -439,7 +440,7 @@
 			</if>
 			UNION
 			SELECT DISTINCT
-            concat( '3', e.lib_type ) AS moduleNo,
+			concat( '3', e.lib_type ) AS moduleNo,
 			e.id AS id,
 			e.lib_name AS NAME,
 			b.lib_name AS retrievalName,
@@ -468,13 +469,14 @@
 			AND d.relation_id = 600
 			AND b.`status` = 1
 			<if test="inputStr!=null and inputStr!=''">
-				AND ( a.name LIKE concat('%',#{inputStr},'%') OR LOWER(a.spell) LIKE LOWER( concat('%',#{inputStr},'%')))
+				AND ( a.name LIKE concat('%',#{inputStr},'%') OR LOWER(a.spell) LIKE
+				LOWER( concat('%',#{inputStr},'%')))
 			</if>
 		</if>
 		<if test="typeIds.contains(100) ">
 			UNION
 			SELECT
-            t.moduleNo,
+			t.moduleNo,
 			t.id,
 			t.NAME,
 			IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
@@ -485,7 +487,7 @@
 			FROM
 			(
 			SELECT
-            concat( '1', b.lib_type ) AS moduleNo,
+			concat( '1', b.lib_type ) AS moduleNo,
 			a.NAME AS retrievalName,
 			a.spell AS spell,
 			a.is_concept AS isConcept,
@@ -515,7 +517,7 @@
 			</if>
 			UNION
 			SELECT
-            t.moduleNo,
+			t.moduleNo,
 			t.id,
 			t.NAME,
 			IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
@@ -526,7 +528,7 @@
 			FROM
 			(
 			SELECT
-            concat( '2', b.lib_type ) AS moduleNo,
+			concat( '2', b.lib_type ) AS moduleNo,
 			a.NAME AS retrievalName,
 			a.spell AS spell,
 			a.is_concept AS isConcept,
@@ -556,7 +558,7 @@
 			</if>
 			UNION
 			SELECT
-            t.moduleNo,
+			t.moduleNo,
 			t.id,
 			t.NAME,
 			IF ( t.isConcept = 0, t.retrievalName, '' ) AS retrievalName,
@@ -567,7 +569,7 @@
 			FROM
 			(
 			SELECT
-            concat( '3', b.lib_type ) AS moduleNo,
+			concat( '3', b.lib_type ) AS moduleNo,
 			a.NAME AS retrievalName,
 			a.spell AS spell,
 			a.is_concept AS isConcept,
@@ -595,12 +597,16 @@
 			<if test="inputStr!=null and inputStr!=''">
 				AND LOWER(l1.icd10_code) LIKE LOWER( concat('%',#{inputStr},'%'))
 			</if>
-		</if>
+		</if>)o1
+		order  by o1.type asc,o1.moduleNo ASC,o1.isConcept DESC
+		Limit 1000
 		) s
 		LEFT JOIN kl_concept_static s1 ON s.id = s1.concept_id
 		AND s1.is_deleted = 'N'
 		LEFT JOIN kl_concept_detail s2 ON s.id = s2.concept_id
 		AND s2.is_deleted = 'N'
+		LEFT JOIN kl_concept_scale s3 ON s.id = s3.concept_id
+		AND s3.is_deleted = 'N'
 		GROUP BY s.id
 		) f
 		WHERE
@@ -615,7 +621,6 @@
 				</when>
 			</choose>
 		</if>
-		order  by f.type asc,f.moduleNo ASC,f.isConcept DESC
 		<if test="size!=null">
 			LIMIT #{size}
 		</if>

+ 36 - 0
src/main/resources/mapper/KlConceptScaleMapper.xml

@@ -0,0 +1,36 @@
+<?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.KlConceptScaleMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.wrapper.KlScaleDetailWrapper">
+        <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="concept_id" property="conceptId" />
+        <result column="parent_id" property="parentId" />
+        <result column="content" property="content" />
+        <result column="rule_code" property="ruleCode" />
+        <result column="score" property="score" />
+        <result column="factor" property="factor" />
+        <result column="constant" property="constant" />
+        <result column="text_type" property="textType" />
+        <result column="result_type" property="resultType" />
+        <result column="select_type" property="selectType" />
+        <result column="order_no" property="orderNo" />
+        <result column="status" property="status" />
+        <result column="group_num" property="groupNum" />
+        <result column="result" property="result" />
+        <result column="push_info" property="pushInfo" />
+        <result column="remark" property="remark" />
+    </resultMap>
+    <select id="getKlScaleDetailMenu" resultMap="BaseResultMap">
+        select * from kl_concept_scale where is_deleted = 'N'
+        <if test="conceptId!=null">
+            and concept_id = #{conceptId}
+        </if>
+    </select>
+</mapper>

+ 75 - 19
src/main/resources/mapper/KlConceptStaticMapper.xml

@@ -4,16 +4,16 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.KlConceptStatic">
-        <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="concept_id" property="conceptId" />
-        <result column="status" property="status" />
-        <result column="clinical_pathway_name" property="clinicalPathwayName" />
-        <result column="notice_name" property="noticeName" />
+        <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="concept_id" property="conceptId"/>
+        <result column="status" property="status"/>
+        <result column="clinical_pathway_name" property="clinicalPathwayName"/>
+        <result column="notice_name" property="noticeName"/>
     </resultMap>
 
     <!-- 分页查询 -->
@@ -115,7 +115,7 @@
         AND b.lib_type = c.code
         AND b.`status` = 1
         <if test="staticKnowledgeIndexPageVO.typeIds != null and staticKnowledgeIndexPageVO.typeIds.size > 0">
-            <foreach item="typeId" collection="staticKnowledgeIndexPageVO.typeIds" open="and(" separator="or" close=")" >
+            <foreach item="typeId" collection="staticKnowledgeIndexPageVO.typeIds" open="and(" separator="or" close=")">
                 a.type_id =#{typeId}
             </foreach>
         </if>
@@ -157,7 +157,7 @@
         AND b.lib_type = c.code
         AND b.`status` = 1
         <if test="staticKnowledgeIndexPageVO.typeIds != null and staticKnowledgeIndexPageVO.typeIds.size > 0">
-            <foreach item="typeId" collection="staticKnowledgeIndexPageVO.typeIds" open="and(" separator="or" close=")" >
+            <foreach item="typeId" collection="staticKnowledgeIndexPageVO.typeIds" open="and(" separator="or" close=")">
                 a.type_id =#{typeId}
             </foreach>
         </if>
@@ -199,7 +199,7 @@
         AND b.lib_type = c.code
         AND b.`status` = 1
         <if test="staticKnowledgeIndexPageVO.typeIds != null and staticKnowledgeIndexPageVO.typeIds.size > 0">
-            <foreach item="typeId" collection="staticKnowledgeIndexPageVO.typeIds" open="and(" separator="or" close=")" >
+            <foreach item="typeId" collection="staticKnowledgeIndexPageVO.typeIds" open="and(" separator="or" close=")">
                 a.type_id =#{typeId}
             </foreach>
         </if>
@@ -240,7 +240,8 @@
             AND d.relation_id = 600
             AND b.`status` = 1
             <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
-                AND ( a.name = #{staticKnowledgeIndexPageVO.inputStr} OR LOWER(a.spell) = LOWER(#{staticKnowledgeIndexPageVO.inputStr}))
+                AND ( a.name = #{staticKnowledgeIndexPageVO.inputStr} OR LOWER(a.spell) =
+                LOWER(#{staticKnowledgeIndexPageVO.inputStr}))
             </if>
             UNION
             SELECT DISTINCT
@@ -273,7 +274,8 @@
             AND d.relation_id = 600
             AND b.`status` = 1
             <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
-                AND ( a.name LIKE concat(#{staticKnowledgeIndexPageVO.inputStr},'%') OR LOWER(a.spell) LIKE LOWER( concat(#{staticKnowledgeIndexPageVO.inputStr},'%')))
+                AND ( a.name LIKE concat(#{staticKnowledgeIndexPageVO.inputStr},'%') OR LOWER(a.spell) LIKE LOWER(
+                concat(#{staticKnowledgeIndexPageVO.inputStr},'%')))
             </if>
             UNION
             SELECT DISTINCT
@@ -306,7 +308,8 @@
             AND d.relation_id = 600
             AND b.`status` = 1
             <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
-                AND ( a.name LIKE concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%') OR LOWER(a.spell) LIKE LOWER( concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')))
+                AND ( a.name LIKE concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%') OR LOWER(a.spell) LIKE LOWER(
+                concat('%',#{staticKnowledgeIndexPageVO.inputStr},'%')))
             </if>
         </if>
         <if test="staticKnowledgeIndexPageVO.typeIds.contains(100) ">
@@ -349,7 +352,7 @@
             WHERE
             1=1
             <if test="staticKnowledgeIndexPageVO.inputStr!=null and staticKnowledgeIndexPageVO.inputStr!=''">
-                AND  LOWER(l1.icd10_code) = LOWER(#{staticKnowledgeIndexPageVO.inputStr})
+                AND LOWER(l1.icd10_code) = LOWER(#{staticKnowledgeIndexPageVO.inputStr})
             </if>
             UNION
             SELECT
@@ -439,10 +442,63 @@
         WHERE s.id = s1.concept_id
         AND s1.is_deleted = 'N'
         AND s1.status = 1
-        GROUP BY s.id
         ORDER BY s.type ASC,
         s.moduleNo ASC,
         s.isConcept DESC
-        ) f
+        LIMIT 1000
+        )f
+        GROUP BY f.id
+    </select>
+
+    <select id="getKlScaleInfoPage" resultType="com.diagbot.dto.KlScaleInfoDTO">
+        SELECT
+        a.`id` AS id,
+        a.`gmt_modified` AS gmtModified,
+        a.`modifier` AS MODIFIER,
+        a.`concept_id` AS conceptId,
+        b.`lib_name` AS conceptName,
+        a.`status`
+        FROM
+        kl_concept_static a
+        LEFT JOIN kl_concept b
+        ON a.concept_id = b.id
+        WHERE a.`is_deleted` = "N"
+        AND b.`is_deleted` = "N"
+        AND b.`lib_type` = 124
+        <if test="conceptName!=null and conceptName!=''">
+            AND UPPER(b.lib_name) LIKE CONCAT('%', UPPER(trim(#{conceptName})), '%')
+        </if>
+        <if test="status != null">
+            AND a.status = #{status}
+        </if>
+    </select>
+
+    <select id="getklScaleInfo" resultType="com.diagbot.dto.KlScaleByIdDTO">
+        SELECT
+        a.`id` AS id,
+        a.`gmt_modified` AS gmtModified,
+        a.`modifier` AS MODIFIER,
+        a.`concept_id` AS conceptId,
+        b.`lib_name` AS conceptName,
+        a.`status`
+        FROM
+        kl_concept_static a
+        LEFT JOIN kl_concept b
+        ON a.concept_id = b.id
+        WHERE a.`is_deleted` = "N"
+        AND b.`is_deleted` = "N"
+        AND b.`lib_type` = 124
+        <if test="id != null">
+            AND a.id = #{id}
+        </if>
+        <if test="conceptName!=null and conceptName!=''">
+            AND UPPER(b.lib_name) LIKE CONCAT('%', UPPER(trim(#{conceptName})), '%')
+        </if>
+        <if test="name!=null and name!=''">
+            AND b.lib_name=#{name}
+        </if>
+        <if test="status != null">
+            AND a.status = #{status}
+        </if>
     </select>
 </mapper>

+ 149 - 0
src/main/resources/mapper/KlRegulationBaseMapper.xml

@@ -0,0 +1,149 @@
+<?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.KlRegulationBaseMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.KlRegulationBase">
+        <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="concept_id" property="conceptId" />
+        <result column="description" property="description" />
+        <result column="type" property="type" />
+        <result column="min_operator" property="minOperator" />
+        <result column="min_value" property="minValue" />
+        <result column="min_unit" property="minUnit" />
+        <result column="max_operator" property="maxOperator" />
+        <result column="max_value" property="maxValue" />
+        <result column="max_unit" property="maxUnit" />
+        <result column="eq_operator" property="eqOperator" />
+        <result column="eq_value" property="eqValue" />
+        <result column="eq_unit" property="eqUnit" />
+    </resultMap>
+
+    <select id="getAllBase" resultType="com.diagbot.dto.BaseRegulationDTO">
+        SELECT DISTINCT
+            CONCAT_WS(
+                "_",
+                t1.concept_id,
+                t1.type,
+                t1.max_operator,
+                t1.max_value,
+                t1.max_unit,
+                t1.min_operator,
+                t1.min_value,
+                t1.min_unit,
+                t1.eq_operator,
+                t1.eq_value,
+                t1.eq_unit
+            ) AS baseKey,
+            GROUP_CONCAT(t1.id) AS ids,
+            IFNULL(t2.lib_name, "") AS baseLibName,
+            IFNULL(t2.lib_type, 0) AS baseLibType,
+            t1.concept_id,
+            t1.type AS baseType,
+            t1.max_operator AS baseMaxOperator,
+            t1.max_value AS baseMaxValue,
+            t1.max_unit AS baseMaxUnit,
+            t1.min_operator AS baseMinOperator,
+            t1.min_value AS baseMinValue,
+            t1.min_unit AS baseMinUnit,
+            t1.eq_operator AS baseEqOperator,
+            t1.eq_value AS baseEqValue,
+            t1.eq_unit AS baseEqUnit
+        FROM
+            kl_regulation_base t1
+        LEFT JOIN kl_concept t2 ON t1.concept_id = t2.id
+        AND t2.is_deleted = "N"
+        AND t2.`status` = 1
+        WHERE
+            t1.is_deleted = "N"
+        AND t1.`status` = 1
+        GROUP BY
+            t1.concept_id,
+            t1.type,
+            t1.max_operator,
+            t1.max_value,
+            t1.max_unit,
+            t1.min_operator,
+            t1.min_value,
+            t1.min_unit,
+            t1.eq_operator,
+            t1.eq_value,
+            t1.eq_unit
+    </select>
+
+    <select id="getSelectBase" resultType="com.diagbot.dto.BaseRegulationDTO">
+        SELECT DISTINCT
+            CONCAT_WS(
+                "_",
+                t1.concept_id,
+                t1.type,
+                t1.max_operator,
+                t1.max_value,
+                t1.max_unit,
+                t1.min_operator,
+                t1.min_value,
+                t1.min_unit,
+                t1.eq_operator,
+                t1.eq_value,
+                t1.eq_unit
+            ) AS baseKey,
+            GROUP_CONCAT(t1.id) AS ids,
+            IFNULL(t2.lib_name, "") AS baseLibName,
+            IFNULL(t2.lib_type, 0) AS baseLibType,
+            t1.concept_id,
+            t1.type AS baseType,
+            t1.max_operator AS baseMaxOperator,
+            t1.max_value AS baseMaxValue,
+            t1.max_unit AS baseMaxUnit,
+            t1.min_operator AS baseMinOperator,
+            t1.min_value AS baseMinValue,
+            t1.min_unit AS baseMinUnit,
+            t1.eq_operator AS baseEqOperator,
+            t1.eq_value AS baseEqValue,
+            t1.eq_unit AS baseEqUnit
+        FROM
+            kl_regulation_base t1
+        LEFT JOIN kl_concept t2 ON t1.concept_id = t2.id
+        AND t2.is_deleted = "N"
+        AND t2.`status` = 1
+        WHERE
+            t1.is_deleted = "N"
+        AND t1.`status` = 1
+        AND t1.id in
+        (
+            SELECT
+            b.regulation_base_id
+            FROM
+            `kl_regulation` a,
+            kl_regulation_condition b
+            WHERE
+            a.id = b.regulation_id
+            <if test="list != null and list.size > 0">
+                and a.`code` in
+                <foreach item="code" collection="list" open="(" separator="," close=")">
+                    #{code}
+                </foreach>
+            </if>
+            AND a.`status` = 1
+            AND b.condition_type = 1
+        )
+        GROUP BY
+            t1.concept_id,
+            t1.type,
+            t1.max_operator,
+            t1.max_value,
+            t1.max_unit,
+            t1.min_operator,
+            t1.min_value,
+            t1.min_unit,
+            t1.eq_operator,
+            t1.eq_value,
+            t1.eq_unit
+    </select>
+
+</mapper>

+ 21 - 0
src/main/resources/mapper/KlRegulationConditionMapper.xml

@@ -0,0 +1,21 @@
+<?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.KlRegulationConditionMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.KlRegulationCondition">
+        <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="regulation_id" property="regulationId" />
+        <result column="condition_type" property="conditionType" />
+        <result column="condition_group" property="conditionGroup" />
+        <result column="fit_no" property="fitNo" />
+        <result column="base_group" property="baseGroup" />
+        <result column="regulation_base_id" property="regulationBaseId" />
+    </resultMap>
+
+</mapper>

+ 100 - 0
src/main/resources/mapper/KlRegulationMapper.xml

@@ -0,0 +1,100 @@
+<?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.KlRegulationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.KlRegulation">
+        <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="name" property="name" />
+        <result column="code" property="code" />
+        <result column="type" property="type" />
+        <result column="status" property="status" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+    <select id="getRegulationByIds" resultType="com.diagbot.dto.RegulationDTO" parameterType="com.diagbot.vo.RegulationVO">
+        SELECT DISTINCT
+        t12.code,
+        t12.condition_type
+        FROM
+        (
+        SELECT DISTINCT
+        t11.code,
+        t11.condition_type,
+        t11.condition_group,
+        (
+        count(t11.condition_group) &lt;= sum(baseGroupDiff)
+        ) AS groupDiff
+        FROM
+        (
+        SELECT
+        t3.*, IFNULL(t5.cnt, 0) AS cnt,
+        (
+        t3.fit_no &lt;= IFNULL(t5.cnt, 0)
+        ) AS baseGroupDiff
+        FROM
+        (
+        SELECT
+        t1.code,t2.*
+        FROM
+        kl_regulation t1,
+        kl_regulation_condition t2,
+        (
+        SELECT DISTINCT
+        t4.regulation_id
+        FROM
+        `kl_regulation_condition` t4
+        WHERE
+        t4.condition_type = 1
+        AND t4.is_deleted = "N"
+        <if test="ids != null and ids.size > 0">
+        and t4.regulation_id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")">
+        #{id}
+        </foreach>
+        </if>
+        ) t10
+        WHERE
+        t1.is_deleted = "N"
+        AND t1.`status` = 1
+        AND t2.is_deleted = "N"
+        AND t1.id = t2.regulation_id
+        AND t2.condition_type = 2
+        AND t1.id = t10.regulation_id
+        ) t3
+        LEFT JOIN (
+        SELECT
+        t4.regulation_id,
+        t4.base_group,
+        COUNT(t4.id) AS cnt
+        FROM
+        `kl_regulation_condition` t4
+        WHERE
+        t4.condition_type = 1
+        AND t4.is_deleted = "N"
+        <if test="ids != null and ids.size > 0">
+            and t4.regulation_id in
+            <foreach item="id" collection="ids" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+        GROUP BY
+        t4.regulation_id,
+        t4.base_group
+        ) t5 ON t3.regulation_id = t5.regulation_id
+        AND t3.base_group = t5.base_group
+        ) t11
+        GROUP BY
+        t11.code,
+        t11.condition_type,
+        t11.condition_group
+        ) t12
+        WHERE
+        t12.groupDiff = 1
+    </select>
+</mapper>