Przeglądaj źródła

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

zhaops 3 lat temu
rodzic
commit
9a1c69d7b7
100 zmienionych plików z 3959 dodań i 275 usunięć
  1. 46 0
      doc/008.20210511量表维护脚本/med2021_init.sql
  2. 39 0
      doc/008.20210629诊断依据基础表扩展/med_2021.sql
  3. 324 0
      doc/009.20210615量表规则/med_20221.sql
  4. 305 0
      doc/010.20210630诊断依据新加类型/med_2021_init.sql
  5. 4 4
      src/main/java/com/diagbot/config/CacheDeleteInit.java
  6. 2 6
      src/main/java/com/diagbot/dto/BaseDiagnoseDTO.java
  7. 84 0
      src/main/java/com/diagbot/dto/BaseRegulationDTO.java
  8. 17 0
      src/main/java/com/diagbot/dto/ConceptScaleDTO.java
  9. 107 0
      src/main/java/com/diagbot/dto/ConceptScaleDetailDTO.java
  10. 18 0
      src/main/java/com/diagbot/dto/ConceptScaleSubDTO.java
  11. 2 3
      src/main/java/com/diagbot/dto/ExportDiagnoseDTO.java
  12. 39 0
      src/main/java/com/diagbot/dto/IndicationExportDTO.java
  13. 109 0
      src/main/java/com/diagbot/dto/KlConceptScaleDTO.java
  14. 6 2
      src/main/java/com/diagbot/dto/KlConceptStaticDTO.java
  15. 7 2
      src/main/java/com/diagbot/dto/KlDiagnoseByIdDTO.java
  16. 19 0
      src/main/java/com/diagbot/dto/KlDiagnoseLibNameDTO.java
  17. 49 0
      src/main/java/com/diagbot/dto/KlScaleByIdDTO.java
  18. 83 0
      src/main/java/com/diagbot/dto/KlScaleDetailDTO.java
  19. 43 0
      src/main/java/com/diagbot/dto/KlScaleInfoDTO.java
  20. 16 0
      src/main/java/com/diagbot/dto/RegulationDTO.java
  21. 27 0
      src/main/java/com/diagbot/dto/RegulationIndexDTO.java
  22. 22 0
      src/main/java/com/diagbot/dto/ScaleDTO.java
  23. 5 0
      src/main/java/com/diagbot/dto/StaticKnowledgeDTO.java
  24. 2 0
      src/main/java/com/diagbot/dto/WordCrfDTO.java
  25. 312 0
      src/main/java/com/diagbot/entity/KlConceptScale.java
  26. 0 28
      src/main/java/com/diagbot/entity/KlDiagnoseBase.java
  27. 68 0
      src/main/java/com/diagbot/entity/KlDiagnoseBaseRelation.java
  28. 78 0
      src/main/java/com/diagbot/entity/KlRegulation.java
  29. 108 0
      src/main/java/com/diagbot/entity/KlRegulationBase.java
  30. 83 0
      src/main/java/com/diagbot/entity/KlRegulationCondition.java
  31. 20 0
      src/main/java/com/diagbot/entity/wrapper/KlScaleDetailWrapper.java
  32. 3 1
      src/main/java/com/diagbot/enums/BaseDiagnoseTypeEnum.java
  33. 49 0
      src/main/java/com/diagbot/enums/CommonEnum.java
  34. 1 1
      src/main/java/com/diagbot/enums/DiagnoseLexiconTypeEnum.java
  35. 2 1
      src/main/java/com/diagbot/enums/RedisEnum.java
  36. 11 0
      src/main/java/com/diagbot/facade/CacheFacade.java
  37. 6 5
      src/main/java/com/diagbot/facade/CommonFacade.java
  38. 65 0
      src/main/java/com/diagbot/facade/KlConceptScaleFacade.java
  39. 232 24
      src/main/java/com/diagbot/facade/KlConceptStaticFacade.java
  40. 21 0
      src/main/java/com/diagbot/facade/KlDiagnoseBaseRelationFacade.java
  41. 20 9
      src/main/java/com/diagbot/facade/KlDiagnoseDetailFacade.java
  42. 52 6
      src/main/java/com/diagbot/facade/KlDiagnoseFacade.java
  43. 40 24
      src/main/java/com/diagbot/facade/KlDiagnoseImportFacade.java
  44. 87 0
      src/main/java/com/diagbot/facade/KlRegulationBaseFacade.java
  45. 35 0
      src/main/java/com/diagbot/facade/KlRegulationFacade.java
  46. 14 0
      src/main/java/com/diagbot/facade/KlRuleFacade.java
  47. 169 0
      src/main/java/com/diagbot/facade/KlScaleFacade.java
  48. 10 0
      src/main/java/com/diagbot/facade/NeoFacade.java
  49. 1 0
      src/main/java/com/diagbot/facade/PushFacade.java
  50. 21 0
      src/main/java/com/diagbot/mapper/KlConceptScaleMapper.java
  51. 10 0
      src/main/java/com/diagbot/mapper/KlConceptStaticMapper.java
  52. 20 0
      src/main/java/com/diagbot/mapper/KlDiagnoseBaseRelationMapper.java
  53. 20 0
      src/main/java/com/diagbot/mapper/KlRegulationBaseMapper.java
  54. 16 0
      src/main/java/com/diagbot/mapper/KlRegulationConditionMapper.java
  55. 22 0
      src/main/java/com/diagbot/mapper/KlRegulationMapper.java
  56. 3 0
      src/main/java/com/diagbot/mapper/KlRuleMapper.java
  57. 1 0
      src/main/java/com/diagbot/model/ai/process/EntityProcessClinic.java
  58. 2 61
      src/main/java/com/diagbot/process/PushProcess.java
  59. 98 36
      src/main/java/com/diagbot/rule/CommonRule.java
  60. 43 39
      src/main/java/com/diagbot/rule/GroupRule.java
  61. 1 1
      src/main/java/com/diagbot/rule/VitalRule.java
  62. 20 0
      src/main/java/com/diagbot/service/KlConceptScaleService.java
  63. 10 0
      src/main/java/com/diagbot/service/KlConceptStaticService.java
  64. 19 0
      src/main/java/com/diagbot/service/KlDiagnoseBaseRelationService.java
  65. 20 0
      src/main/java/com/diagbot/service/KlRegulationBaseService.java
  66. 16 0
      src/main/java/com/diagbot/service/KlRegulationConditionService.java
  67. 22 0
      src/main/java/com/diagbot/service/KlRegulationService.java
  68. 3 4
      src/main/java/com/diagbot/service/KlRuleService.java
  69. 28 0
      src/main/java/com/diagbot/service/impl/KlConceptScaleServiceImpl.java
  70. 1 1
      src/main/java/com/diagbot/service/impl/KlConceptServiceImpl.java
  71. 15 0
      src/main/java/com/diagbot/service/impl/KlConceptStaticServiceImpl.java
  72. 25 0
      src/main/java/com/diagbot/service/impl/KlDiagnoseBaseRelationServiceImpl.java
  73. 27 0
      src/main/java/com/diagbot/service/impl/KlRegulationBaseServiceImpl.java
  74. 20 0
      src/main/java/com/diagbot/service/impl/KlRegulationConditionServiceImpl.java
  75. 28 0
      src/main/java/com/diagbot/service/impl/KlRegulationServiceImpl.java
  76. 6 1
      src/main/java/com/diagbot/service/impl/KlRuleServiceImpl.java
  77. 112 0
      src/main/java/com/diagbot/util/CoreUtil.java
  78. 12 12
      src/main/java/com/diagbot/vo/ImportDiagnoseVO.java
  79. 10 0
      src/main/java/com/diagbot/vo/KlConceptStaticVO.java
  80. 3 1
      src/main/java/com/diagbot/vo/KlDiagnoseDetailVO.java
  81. 2 1
      src/main/java/com/diagbot/vo/KlDiagnoseSaveVO.java
  82. 19 0
      src/main/java/com/diagbot/vo/KlScaleByIdVO.java
  83. 15 0
      src/main/java/com/diagbot/vo/KlScaleClearVO.java
  84. 17 0
      src/main/java/com/diagbot/vo/KlScaleDetailMenuVO.java
  85. 17 0
      src/main/java/com/diagbot/vo/KlScaleInfoVO.java
  86. 16 0
      src/main/java/com/diagbot/vo/KlScaleSatartOrdisaVO.java
  87. 18 0
      src/main/java/com/diagbot/vo/KlScaleSaveGroupVO.java
  88. 70 0
      src/main/java/com/diagbot/vo/KlScaleSaveUpDetailVO.java
  89. 66 0
      src/main/java/com/diagbot/vo/KlScaleSaveUpParentVO.java
  90. 25 0
      src/main/java/com/diagbot/vo/KlScaleSaveUpVO.java
  91. 59 0
      src/main/java/com/diagbot/vo/KlScaleSubDetailVO.java
  92. 21 0
      src/main/java/com/diagbot/vo/RegulationIndexVO.java
  93. 20 0
      src/main/java/com/diagbot/vo/RegulationVO.java
  94. 16 0
      src/main/java/com/diagbot/vo/ScaleStaticAllVO.java
  95. 17 0
      src/main/java/com/diagbot/vo/ScaleVO.java
  96. 3 1
      src/main/java/com/diagbot/vo/StaticKnowledgeVO.java
  97. 9 0
      src/main/java/com/diagbot/web/CacheController.java
  98. 20 0
      src/main/java/com/diagbot/web/KlConceptScaleController.java
  99. 13 1
      src/main/java/com/diagbot/web/KlConceptStaticController.java
  100. 0 0
      src/main/java/com/diagbot/web/KlIndicationImportController.java

+ 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='量表明细表';

+ 39 - 0
doc/008.20210629诊断依据基础表扩展/med_2021.sql

@@ -0,0 +1,39 @@
+USE `med_2021`;
+
+drop TABLE if EXISTS kl_diagnose_base_relation;
+CREATE TABLE `kl_diagnose_base_relation` (
+  `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则表示纪录未修改',
+  `diagnose_base_id` bigint(20) NOT NULL COMMENT 'diagnose_base_id',
+  `concept_id` bigint(20) NOT NULL COMMENT 'concept_id',
+  `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+  PRIMARY KEY (`id`),
+  KEY `diagnose_base_id` (`diagnose_base_id`),
+  KEY `concept_id` (`concept_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='基础规则关联表';
+
+-- ALTER TABLE `kl_diagnose_base` drop COLUMN `concept_id`;
+-- ALTER TABLE `kl_diagnose_base` drop COLUMN `status`;
+
+drop TABLE if EXISTS kl_regulation_base_relation;
+CREATE TABLE `kl_regulation_base_relation` (
+  `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_base_id` bigint(20) NOT NULL COMMENT 'regulation_base_id',
+  `concept_id` bigint(20) NOT NULL COMMENT 'concept_id',
+  `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+  PRIMARY KEY (`id`),
+  KEY `regulation_base_id` (`regulation_base_id`),
+  KEY `concept_id` (`concept_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='通用基础规则关联表';
+
+-- ALTER TABLE `kl_regulation_base` drop COLUMN `concept_id`;
+-- ALTER TABLE `kl_regulation_base` drop COLUMN `status`;

+ 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` mediumtext COMMENT '内容',
+  `rule_code` varchar(255) DEFAULT NULL COMMENT '编码',
+  `score` decimal(6,1) DEFAULT '0.0' COMMENT '扣分',
+  `factor` decimal(6,1) DEFAULT '0.0' COMMENT '系数',
+  `constant` decimal(6,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初始化完成!");
     }

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

@@ -11,10 +11,6 @@ import lombok.Setter;
 @Getter
 @Setter
 public class BaseDiagnoseDTO {
-    /**
-     * 联合唯一键
-     */
-    private String baseKey;
 
     /**
      * id逗号隔开
@@ -32,9 +28,9 @@ public class BaseDiagnoseDTO {
     private Integer baseLibType;
 
     /**
-     * 提示概念id
+     * 多个概念id
      */
-    private Long conceptId;
+    private String baseConceptids;
 
     /**
      * 基础规则类型(1:等于术语本身;2:存在比较;3:不等于术语本身;)

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

@@ -0,0 +1,84 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2021/3/15 10:49
+ */
+@Getter
+@Setter
+public class BaseRegulationDTO {
+
+    /**
+     * id逗号隔开
+     */
+    private String ids;
+
+    /**
+     * 医学基本术语
+     */
+    private String baseLibName;
+
+    /**
+     * 术语类型
+     */
+    private Integer baseLibType;
+
+    /**
+     * 多个概念id
+     */
+    private String baseConceptids;
+
+    /**
+     * 基础规则类型(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;
+}

+ 2 - 3
src/main/java/com/diagbot/dto/ExportDiagnoseDTO.java

@@ -24,6 +24,8 @@ public class ExportDiagnoseDTO implements Serializable {
     private String orderNo = "";
     @Excel(name="规则", width = 50, orderNum = "30")
     private String rule = "";
+    @Excel(name="关联词", width = 25, orderNum = "35")
+    private String relation;
     @Excel(name="等于", width = 10, orderNum = "40")
     private String eq;
     @Excel(name="最大值", width = 10, orderNum = "50")
@@ -36,7 +38,4 @@ public class ExportDiagnoseDTO implements Serializable {
     private String maxSymbol;
     @Excel(name="单位", width = 10, orderNum = "90")
     private String minSymbol;
-    @Excel(name="关联词", width = 30, orderNum = "35")
-    private String relation;
-
 }

+ 39 - 0
src/main/java/com/diagbot/dto/IndicationExportDTO.java

@@ -0,0 +1,39 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 诊断依据导出
+ * </p>
+ *
+ * @author kongwz
+ * @since 2020-07-28
+ */
+@Data
+public class IndicationExportDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name="开单名称", width = 25, orderNum = "10")
+    private String parName = "";
+    @Excel(name="开单类型", width = 15, orderNum = "20")
+    private String parType = "";
+    @Excel(name="规则名称", width = 25, orderNum = "30")
+    private String baseName = "";
+    @Excel(name="规则类型", width = 15, orderNum = "35")
+    private String baseType;
+    @Excel(name="其他条件", width = 10, orderNum = "40")
+    private String otherType;
+    @Excel(name="最大值", width = 10, orderNum = "50")
+    private String maxValue;
+    @Excel(name="最大值符号", width = 10, orderNum = "60")
+    private String maxOperator;
+    @Excel(name="最小值", width = 10, orderNum = "70")
+    private String minValue;
+    @Excel(name="最小值符号", width = 10, orderNum = "80")
+    private String minOperator;
+}

+ 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;
 }

+ 7 - 2
src/main/java/com/diagbot/dto/KlDiagnoseByIdDTO.java

@@ -3,6 +3,8 @@ package com.diagbot.dto;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.List;
+
 /**
  * @author wangfeng
  * @Description:
@@ -23,6 +25,7 @@ public class KlDiagnoseByIdDTO {
      */
     private Integer conditionType;
 
+    private Long basId;
     /**
      * 规则组别(condition_type为2:拟诊条件;3:确诊条件;4:警惕条件有效)
      */
@@ -40,9 +43,11 @@ public class KlDiagnoseByIdDTO {
      * 描述
      */
     private String basDescription;
-    private Long basConceptId;
-    private String basLibName;
+    /*  private Long basConceptId;
+      private String basLibName;*/
+    private List<KlDiagnoseLibNameDTO> libNameList;
     private Integer basLibType;
+
     private String basLename;
     /**
      * 基础规则类型(1:等于术语本身;2:存在比较;3:不等于术语本身;)

+ 19 - 0
src/main/java/com/diagbot/dto/KlDiagnoseLibNameDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-07-01 10:20
+ */
+@Setter
+@Getter
+public class KlDiagnoseLibNameDTO {
+    private Long basId;
+    private Long basConceptId;
+    private String basLibName;
+    private Integer basLibType;
+    private String basLename;
+}

+ 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 +
+        "}";
+    }
+}

+ 0 - 28
src/main/java/com/diagbot/entity/KlDiagnoseBase.java

@@ -49,11 +49,6 @@ public class KlDiagnoseBase implements Serializable {
      */
     private String modifier;
 
-    /**
-     * 提示概念id
-     */
-    private Long conceptId;
-
     /**
      * 描述
      */
@@ -109,11 +104,6 @@ public class KlDiagnoseBase implements Serializable {
      */
     private String eqUnit;
 
-    /**
-     * 启用状态(0:禁用,1:启用)
-     */
-    private Integer status;
-
     public Long getId() {
         return id;
     }
@@ -162,14 +152,6 @@ public class KlDiagnoseBase implements Serializable {
         this.modifier = modifier;
     }
 
-    public Long getConceptId() {
-        return conceptId;
-    }
-
-    public void setConceptId(Long conceptId) {
-        this.conceptId = conceptId;
-    }
-
     public String getDescription() {
         return description;
     }
@@ -258,14 +240,6 @@ public class KlDiagnoseBase implements Serializable {
         this.eqUnit = eqUnit;
     }
 
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
     @Override
     public String toString() {
         return "KlDiagnoseBase{" +
@@ -275,7 +249,6 @@ public class KlDiagnoseBase implements Serializable {
                 ", gmtModified=" + gmtModified +
                 ", creator=" + creator +
                 ", modifier=" + modifier +
-                ", conceptId=" + conceptId +
                 ", description=" + description +
                 ", type=" + type +
                 ", minOperator=" + minOperator +
@@ -287,7 +260,6 @@ public class KlDiagnoseBase implements Serializable {
                 ", eqOperator=" + eqOperator +
                 ", eqValue=" + eqValue +
                 ", eqUnit=" + eqUnit +
-                ", status=" + status +
                 "}";
     }
 }

+ 68 - 0
src/main/java/com/diagbot/entity/KlDiagnoseBaseRelation.java

@@ -0,0 +1,68 @@
+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-30
+ */
+@Data
+public class KlDiagnoseBaseRelation 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;
+
+    /**
+     * diagnose_base_id
+     */
+    private Long diagnoseBaseId;
+
+    /**
+     * concept_id
+     */
+    private Long conceptId;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+}

+ 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;
+}

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

@@ -0,0 +1,108 @@
+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;
+
+    /**
+     * 描述
+     */
+    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;

+ 49 - 0
src/main/java/com/diagbot/enums/CommonEnum.java

@@ -0,0 +1,49 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author zhoutg
+ * @Description:
+ * @date 2018年11月21日 下午2:31:42
+ */
+public enum CommonEnum implements KeyedNamed {
+    splitSymbol(1, "#");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    CommonEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static CommonEnum getEnum(int key) {
+        for (CommonEnum item : CommonEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        CommonEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 1 - 1
src/main/java/com/diagbot/enums/DiagnoseLexiconTypeEnum.java

@@ -33,7 +33,7 @@ public enum DiagnoseLexiconTypeEnum implements KeyedNamed {
     DiseaseHisTpye(6, "F:疾病"),//病史
     ZsxbszzTpyeCause(7, "G:主诉现病史正则"),//诱因
     ZsxbszzTpyeBc(8, "G:主诉现病史正则"),//病程
-    jwzzTpye(9, "H:既往史正则"),
+    jwzzTpye(9, "H:既往史正则"),//其他
     QuezhenTpye(91, "确诊"),
     NizhenTpye(92, "拟诊"),
     JtTpye(93, "警惕");

+ 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);
     }

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

@@ -153,6 +153,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);
@@ -821,9 +824,6 @@ public class CommonFacade {
         if (ListUtil.isEmpty(list)) {
             return list;
         }
-        if (configMap == null || configMap.size() == 0) {
-            return list;
-        }
 
         try {
             for (T item : list) {
@@ -834,8 +834,9 @@ public class CommonFacade {
                 }
 
 //                String uniqueName = item.getClass().getMethod("getUniqueName").invoke(item).toString();
+
                 String uniqueName = item.getClass().getMethod("get"+propertyName).invoke(item).toString();
-                if (StringUtil.isNotBlank(uniqueName)) {
+                if (StringUtil.isNotBlank(uniqueName) && !"StandName".equals(propertyName)) {
                     retList.add(item);
                     continue;
                 }
@@ -848,7 +849,7 @@ public class CommonFacade {
                     }
                 }
 
-                if (configMap.containsKey(name)) {
+                if (configMap != null && configMap.containsKey(name)) {
                     Map<String, Map<String, List<String>>> subMap = configMap.get(name);
                     if (subMap.containsKey(hisDetailName)) {
                         if (type.equals(ConceptTypeEnum.Drug.getKey())) {

+ 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;
+    }
+}

+ 232 - 24
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,21 +411,36 @@ 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())) {
                 i.setType(Integer.valueOf(dicTypeMap.get(i.getTypeName())));
             }
             i.setHasInfo(1);
-            i.setHasStaticKnowledge(detailMap.get(i.getId()).stream()
-                    .filter(x -> x.getContentType().contains("1")).count() > 0 ? 1 : 0);
-            i.setHasNotice(detailMap.get(i.getId()).stream()
-                    .filter(x -> x.getContentType().contains("2")).count() > 0 ? 1 : 0);
-            i.setHasClinicalPathway(detailMap.get(i.getId()).stream()
-                    .filter(x -> x.getContentType().contains("3")).count() > 0 ? 1 : 0);
-            i.setHasTreatInfo(detailMap.get(i.getId()).stream()
-                    .filter(x -> x.getContentType().contains("4")).count() > 0 ? 1 : 0);
-            i.setAbstractContent(detailMap.get(i.getId()).get(0).getContent());
+            if (detailMap != null
+                    && detailMap.get(i.getId()) != null) {
+                i.setHasStaticKnowledge(detailMap.get(i.getId()).stream()
+                        .filter(x -> x.getContentType().contains("1")).count() > 0 ? 1 : 0);
+                i.setHasNotice(detailMap.get(i.getId()).stream()
+                        .filter(x -> x.getContentType().contains("2")).count() > 0 ? 1 : 0);
+                i.setHasClinicalPathway(detailMap.get(i.getId()).stream()
+                        .filter(x -> x.getContentType().contains("3")).count() > 0 ? 1 : 0);
+                i.setHasTreatInfo(detailMap.get(i.getId()).stream()
+                        .filter(x -> x.getContentType().contains("4")).count() > 0 ? 1 : 0);
+                i.setAbstractContent(detailMap.get(i.getId()).get(0).getContent());
+            } else {
+                i.setHasStaticKnowledge(0);
+                i.setHasNotice(0);
+                i.setHasClinicalPathway(0);
+                i.setHasTreatInfo(0);
+            }
         });
 
         page.setRecords(records);
@@ -404,7 +454,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 +469,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 +518,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 +607,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 +661,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 +801,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;
+    }
 }

+ 21 - 0
src/main/java/com/diagbot/facade/KlDiagnoseBaseRelationFacade.java

@@ -0,0 +1,21 @@
+package com.diagbot.facade;
+
+import com.diagbot.dto.KlDiagnoseLibNameDTO;
+import com.diagbot.service.impl.KlDiagnoseBaseRelationServiceImpl;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: zhoutg
+ * @time: 2021/3/15 10:58
+ */
+@Component
+public class KlDiagnoseBaseRelationFacade extends KlDiagnoseBaseRelationServiceImpl {
+
+    public List<KlDiagnoseLibNameDTO> getLibNameLists(List<Long> basId) {
+        return getLibNameList(basId);
+    }
+
+}

+ 20 - 9
src/main/java/com/diagbot/facade/KlDiagnoseDetailFacade.java

@@ -5,6 +5,7 @@ import com.diagbot.dto.ExportDescDTO;
 import com.diagbot.dto.ExportDiagnoseDTO;
 import com.diagbot.dto.ExportDiagnoseNameDTO;
 import com.diagbot.entity.KlDiagnoseDetail;
+import com.diagbot.enums.CommonEnum;
 import com.diagbot.enums.DiagnoseLexiconTypeEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.service.impl.KlDiagnoseDetailServiceImpl;
@@ -90,7 +91,8 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
         StringBuffer sb = new StringBuffer();
         sb.append("1、类型:症状【A】,体格检查结果【B】,体格检查项目【C】,实验室检查子项目【D】,辅助检查结果【E】,疾病【F】," +
                 "主诉现病史正则【G】,既往史正则【H】,年龄【I】,人群【J】,查体正则【K】,辅检结果正则【L】\n\n");
-        sb.append("2、诊断类型:【拟诊】,【确诊】,【警惕】");
+        sb.append("2、诊断类型:【拟诊】,【确诊】,【警惕】\n\n");
+        sb.append("3、http://192.168.2.121:7010/swagger-ui.html");
         exportDescDTO.setName(sb.toString());
         exportDescDTOList.add(exportDescDTO);
         exportDto.add(ExcelUtils.createOneSheet("说明", null, ExportDescDTO.class, exportDescDTOList, styleMap2));
@@ -124,7 +126,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
         List<Integer> types = Lists.newArrayList(91, 92, 93);
 
         Map<Integer, List<KlDiagnoseDetail>> typeDiagnoseDetails = EntityUtil.makeEntityListMap(datats, "type");
-        for (Map.Entry<Integer, List<String>> edd : exportDiagnoseDTOS.entrySet()) {
+        /*for (Map.Entry<Integer, List<String>> edd : exportDiagnoseDTOS.entrySet()) {
             Integer type = edd.getKey();
             List<KlDiagnoseDetail> klDiagnoseDetails = typeDiagnoseDetails.get(type);
             List<String> relations = edd.getValue();
@@ -142,7 +144,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
                 codes.add(maxCodeArray[0]+"."+max);
             }
 
-        }
+        }*/
         Map<String,List<String>> typeCodeMap = new HashMap<>();//A --> [1.0,1.1,1.2,1.3]
         Map<String,String> oldNewCodeMap = new HashMap<>();//1.0 -->A0
         for (Map.Entry<Integer, List<KlDiagnoseDetail>> tdd : typeDiagnoseDetails.entrySet()) {
@@ -152,6 +154,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
                 String code = kdl.getCode();
                 String formula = kdl.getFormula();
                 String typeName = DiagnoseLexiconTypeEnum.getName(type);//A:症状
+                String relation = kdl.getRelation();
 
                 ExportDiagnoseDTO exportDiagnoseDTO = new ExportDiagnoseDTO();
                 BeanUtil.copyProperties(kdl, exportDiagnoseDTO);
@@ -187,10 +190,14 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
                         exportDiagnoseDTO.setRule(kdl.getStandard());
                     }
                     if(code.startsWith("4.")){
-                        exportDiagnoseDTO.setRule(kdl.getRelation().replaceAll("\\、","|"));
+                        exportDiagnoseDTO.setRule(relation.replaceAll("\\、","|"));
                         exportDiagnoseDTO.setRelation(kdl.getStandard());
                     }
                     exportDiagnoseDTO.setEq(kdl.getMidResult());
+                    if(("G".equals(tType) || "H".equals(tType)) && StringUtil.isNotBlank(relation)){
+                        exportDiagnoseDTO.setRule(kdl.getStandard()+"|"+kdl.getRelation().replaceAll("\\、","|"));
+                        exportDiagnoseDTO.setRelation("");
+                    }
                 }else {
                     ReflectUtil.setProperty(exportDiagnoseDTO, "type", typeName);
                     for (Map.Entry<String,String> typeq:oldNewCodeMap.entrySet()){
@@ -239,10 +246,11 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
         List<String> regexData = getCodes(allFormula);
 
         //遍历病历
-        List<Integer> types = Stream.of(1, 2, 5, 6, 7, 8, 9).collect(Collectors.toList());
+        List<Integer> types = Stream.of(1, 2, 6).collect(Collectors.toList());//症状、体征、病史有关联词的把关联词添加到规则里
         Iterator<KlDiagnoseDetail> iterator = klDiagnoseDetails.iterator();
         while (iterator.hasNext()) {
             KlDiagnoseDetail next = iterator.next();
+            String standard = next.getStandard();
             String code = next.getCode();//1.0
             Integer type = next.getType();//1
             String relation = next.getRelation();
@@ -251,15 +259,18 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
             } else {
                 if (StringUtil.isNotBlank(relation) && types.contains(type)) {
                     List<String> relationNames = Lists.newArrayList(relation.split("\\、"));
-                    if (typeRelationNamesMap.containsKey(type)) {
+                    relationNames.add(0,standard);
+                    next.setStandard(String.join(CommonEnum.getName(1),relationNames));
+                    next.setRelation("");
+                    /*if (typeRelationNamesMap.containsKey(type)) {
                         List<String> contionNames = typeRelationNamesMap.get(type);
                         contionNames.addAll(relationNames);
                         typeRelationNamesMap.put(type, contionNames);
                     } else {
                         typeRelationNamesMap.put(type, relationNames);
-                    }
+                    }*/
                 }
-                if (StringUtil.isNotBlank(code)) {
+                /*if (StringUtil.isNotBlank(code)) {
                     if (typeCodeNewListMap.containsKey(type)) {
                         List<String> codes = typeCodeNewListMap.get(type);
                         codes.add(code);
@@ -269,7 +280,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
                         codes.add(code);
                         typeCodeNewListMap.put(type, codes);
                     }
-                }
+                }*/
             }
         }
         return typeRelationNamesMap;

+ 52 - 6
src/main/java/com/diagbot/facade/KlDiagnoseFacade.java

@@ -7,13 +7,16 @@ import com.diagbot.dto.DiagnosesFindDTO;
 import com.diagbot.dto.KlDiagnoseByIdDTO;
 import com.diagbot.dto.KlDiagnoseGroupDTO;
 import com.diagbot.dto.KlDiagnoseInfoDTO;
+import com.diagbot.dto.KlDiagnoseLibNameDTO;
 import com.diagbot.dto.KlDiagnoseTypeDTO;
 import com.diagbot.entity.KlDiagnose;
 import com.diagbot.entity.KlDiagnoseBase;
+import com.diagbot.entity.KlDiagnoseBaseRelation;
 import com.diagbot.entity.KlDiagnoseCondition;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
+import com.diagbot.service.KlDiagnoseBaseRelationService;
 import com.diagbot.service.impl.KlDiagnoseServiceImpl;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.ListUtil;
@@ -28,6 +31,7 @@ import com.diagbot.vo.KlDiagnoseSatarDisVO;
 import com.diagbot.vo.KlDiagnoseSaveVO;
 import com.diagbot.vo.KlDiagnoseTypeVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
@@ -49,6 +53,11 @@ public class KlDiagnoseFacade extends KlDiagnoseServiceImpl {
     KlDiagnoseBaseFacade klDiagnoseBaseFacade;
     @Autowired
     KlDictionaryInfoFacade klDictionaryInfoFacade;
+    @Autowired
+    @Qualifier("klDiagnoseBaseRelationServiceImpl")
+    KlDiagnoseBaseRelationService klDiagnoseBaseRelationService;
+    @Autowired
+    KlDiagnoseBaseRelationFacade klDiagnoseBaseRelationFacade;
 
 
     public IPage<KlDiagnoseInfoDTO> getKlDiagnoseInfoPage(KlDiagnoseInfoVO klDiagnoseInfoVO) {
@@ -58,6 +67,25 @@ public class KlDiagnoseFacade extends KlDiagnoseServiceImpl {
 
     public List<KlDiagnoseTypeDTO> getByIdDiagnoseAll(KlDiagnoseByIdVO klDiagnoseByIdVO) {
         List<KlDiagnoseByIdDTO> byIdDiagnoses = this.getByIdDiagnoses(klDiagnoseByIdVO);
+        //查询明细便准词
+        List<Long> basId = byIdDiagnoses.stream().filter(i -> i.getBasId()!=null).map(ac -> ac.getBasId()).collect(Collectors.toList());
+        if (ListUtil.isNotEmpty(basId)) {
+            List<KlDiagnoseLibNameDTO> libNameList = klDiagnoseBaseRelationFacade.getLibNameLists(basId);
+            if (ListUtil.isNotEmpty(libNameList)) {
+                Map<Long, List<KlDiagnoseLibNameDTO>> lixExMap = libNameList.stream().collect(Collectors.groupingBy(KlDiagnoseLibNameDTO::getBasId));
+                for (KlDiagnoseByIdDTO data : byIdDiagnoses) {
+                    List<KlDiagnoseLibNameDTO> klDiagnoseLibName = lixExMap.get(data.getBasId());
+                    if (ListUtil.isNotEmpty(klDiagnoseLibName)) {
+                        data.setBasLibType(klDiagnoseLibName.get(0).getBasLibType());
+                        data.setBasLename(klDiagnoseLibName.get(0).getBasLename());
+                        data.setLibNameList(klDiagnoseLibName);
+                    }
+                }
+            }
+
+        }
+
+
         //基础条件
         Map<Integer, List<KlDiagnoseByIdDTO>> baseGroupMap = byIdDiagnoses.stream().filter(i -> i.getConditionType().equals(1)).collect(Collectors.groupingBy(KlDiagnoseByIdDTO::getBaseGroup));
         //根据ConditionType 和 getConditionGroup两个添加分组
@@ -137,6 +165,7 @@ public class KlDiagnoseFacade extends KlDiagnoseServiceImpl {
 
     public Boolean saveDiagnoseAll(KlDiagnoseSaveVO klDiagnoseSaveVO) {
         Date now = DateUtil.now();
+        klDiagnoseSaveVO.setNow(now);
         boolean res = false;
         // 校验名称是否相同
         int count = this.count(new QueryWrapper<KlDiagnose>()
@@ -211,6 +240,9 @@ public class KlDiagnoseFacade extends KlDiagnoseServiceImpl {
             //删除kl_rule_base表数据
             res = klDiagnoseBaseFacade.remove(klDiagnoseBaseQuery);
 
+            // 删除kl_diagnose_base_relation
+            klDiagnoseBaseRelationService.remove(new QueryWrapper<KlDiagnoseBaseRelation>()
+                    .in("diagnose_base_id", baseId));
         }
         //删除kl_rule_condition表的数据
         res = klDiagnoseConditionFacade.remove(klDiagnoseQuery);
@@ -218,7 +250,7 @@ public class KlDiagnoseFacade extends KlDiagnoseServiceImpl {
     }
 
     public Boolean saveCommon(KlDiagnoseSaveVO klDiagnoseSaveVO) {
-        Date now = DateUtil.now();
+        Date now = klDiagnoseSaveVO.getNow();
         boolean res = false;
         int sum = 99;
         int baseGroup = 9;
@@ -235,6 +267,8 @@ public class KlDiagnoseFacade extends KlDiagnoseServiceImpl {
                     klDiagnoseCondition.setDiagnoseId(klDiagnoseSaveVO.getId());
                     klDiagnoseCondition.setBaseGroup(baseGroup);//
                     klDiagnoseCondition.setFitNo(data2.getFitNo());
+                    klDiagnoseCondition.setGmtCreate(now);
+                    klDiagnoseCondition.setGmtModified(now);
                     klDiagnoseConditionFacade.save(klDiagnoseCondition);
                     //明细
                     List<KlDiagnoseDetailVO> klDiagnoseDetail = data2.getKlDiagnoseDetail();
@@ -242,8 +276,6 @@ public class KlDiagnoseFacade extends KlDiagnoseServiceImpl {
                         for (KlDiagnoseDetailVO detailVO : klDiagnoseDetail) {
                             if (null != detailVO) {
                                 KlDiagnoseBase klDiagnoseBase = new KlDiagnoseBase();
-                                klDiagnoseBase.setGmtModified(now);
-                                klDiagnoseBase.setConceptId(detailVO.getBasConceptId());
                                 klDiagnoseBase.setType(detailVO.getBasType());
                                 klDiagnoseBase.setDescription(detailVO.getBasDescription());
                                 klDiagnoseBase.setMaxOperator(detailVO.getMaxOperator());
@@ -252,25 +284,39 @@ public class KlDiagnoseFacade extends KlDiagnoseServiceImpl {
                                 klDiagnoseBase.setMinOperator(detailVO.getMinOperator());
                                 klDiagnoseBase.setMinValue(detailVO.getMinVal());
                                 klDiagnoseBase.setMinUnit(detailVO.getMinUnit());
-                                klDiagnoseBase.setStatus(1);
                                 klDiagnoseBase.setEqValue(detailVO.getEqValue());
                                 klDiagnoseBase.setEqOperator(detailVO.getEqOperator());
                                 klDiagnoseBase.setEqUnit(detailVO.getEqUnit());
+                                klDiagnoseBase.setGmtCreate(now);
+                                klDiagnoseBase.setGmtModified(now);
                                 res = klDiagnoseBaseFacade.save(klDiagnoseBase);
+
+                                if (ListUtil.isNotEmpty(detailVO.getBasConceptId())) {
+                                    List<KlDiagnoseBaseRelation> klDiagnoseBaseRelationList = new ArrayList<>();
+                                    for (Long conceptId : detailVO.getBasConceptId()) {
+                                        KlDiagnoseBaseRelation baseRelation = new KlDiagnoseBaseRelation();
+                                        baseRelation.setConceptId(conceptId);
+                                        baseRelation.setDiagnoseBaseId(klDiagnoseBase.getId());
+                                        baseRelation.setGmtCreate(now);
+                                        baseRelation.setGmtModified(now);
+                                        klDiagnoseBaseRelationList.add(baseRelation);
+                                    }
+                                    klDiagnoseBaseRelationService.saveBatch(klDiagnoseBaseRelationList);
+                                }
                                 if (res) {
                                     KlDiagnoseCondition klDiagnoseConditionBase = new KlDiagnoseCondition();
                                     klDiagnoseConditionBase.setDiagnoseBaseId(klDiagnoseBase.getId());
                                     klDiagnoseConditionBase.setBaseGroup(baseGroup);
                                     klDiagnoseConditionBase.setConditionType(1);
                                     klDiagnoseConditionBase.setDiagnoseId(klDiagnoseSaveVO.getId());
+                                    klDiagnoseCondition.setGmtCreate(now);
+                                    klDiagnoseCondition.setGmtModified(now);
                                     res = klDiagnoseConditionFacade.save(klDiagnoseConditionBase);
                                 }
                             }
                         }
                     }
-
                 }
-
             }
         }
         return res;

+ 40 - 24
src/main/java/com/diagbot/facade/KlDiagnoseImportFacade.java

@@ -3,11 +3,13 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.entity.KlConcept;
 import com.diagbot.entity.KlDiagnose;
+import com.diagbot.enums.CommonEnum;
 import com.diagbot.enums.DiagnoseLexiconTypeEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.LexiconEnum;
 import com.diagbot.enums.LexiconExtEnum;
 import com.diagbot.service.KlConceptService;
+import com.diagbot.util.CoreUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ExcelUtils;
 import com.diagbot.util.ListUtil;
@@ -33,7 +35,6 @@ import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.ListIterator;
@@ -60,7 +61,7 @@ public class KlDiagnoseImportFacade {
         Map<String, Object> message = new LinkedHashMap<>(); // 提示信息
         List<ImportDiagnoseResVO> allData = Lists.newArrayList();  // 最终需要保存的数据
         if (StringUtil.isNotBlank(diagnoseImportVO.getDiagStr())) {
-            List<String> diagList = Arrays.stream(diagnoseImportVO.getDiagStr().split("#")).map(r -> r.trim()).collect(Collectors.toList());
+            List<String> diagList = CoreUtil.getSplit(diagnoseImportVO.getDiagStr());
             diagnoseImportVO.setDiags(diagList);
         }
         // 校验数据
@@ -72,7 +73,7 @@ public class KlDiagnoseImportFacade {
             message.put("导入条数", allData.size() + "条");
             // 如果有指定诊断,提示导入的诊断;如果全部导入,提示“所有诊断”
             if (ListUtil.isNotEmpty(diagnoseImportVO.getDiags())) {
-                message.put("导入诊断", allData.stream().map(r -> r.getDiseaseName()).collect(Collectors.joining("#")));
+                message.put("导入诊断", allData.stream().map(r -> r.getDiseaseName()).collect(Collectors.joining(CommonEnum.splitSymbol.getName())));
             } else {
                 message.put("导入诊断", "所有诊断");
             }
@@ -94,24 +95,25 @@ public class KlDiagnoseImportFacade {
     public Boolean verifyData(MultipartFile file, DiagnoseImportVO diagnoseImportVO, Map<String, Object> diagMessage, List<ImportDiagnoseResVO> allData) {
         Boolean allFlag = true;
         List<String> diagtypes = Lists.newArrayList("拟诊", "确诊", "警惕");
+        List<String> splitType = Lists.newArrayList("症状", "体格检查结果", "疾病", "人群", "辅助检查结果");
         // 获取标准词库Map
         Map<String, KlConcept> concept_map = getConceptMap();
 
-        // 分组之后的数据
-        Map<String, List<ImportDiagnoseVO>> groupData = new LinkedHashMap<>();
-        // 获取全部数据,分组
+        // 获取表格数据
         List<ImportDiagnoseVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, 0, ImportDiagnoseVO.class);
+
+        // 以疾病分组之后的数据
+        Map<String, List<ImportDiagnoseVO>> groupData = new LinkedHashMap<>();
         List<ImportDiagnoseVO> importDiagnoseVOList = null;
         String addDisName = "";
         for (ImportDiagnoseVO importDiagnoseVO : data) {
             String type = importDiagnoseVO.getType();
             if (type != null && type.startsWith("【") && type.endsWith("】")) {
                 if (StringUtil.isNotBlank(addDisName)) {
-                    addDisName = RegexUtil.getRegexData(addDisName, "【(.*?)】", 1);
-                    groupData.put(addDisName, importDiagnoseVOList);
+                    groupData.put(addDisName, importDiagnoseVOList); // 存放上一个疾病数据
                 }
                 importDiagnoseVOList = new ArrayList<>();
-                addDisName = type;
+                addDisName = RegexUtil.getRegexData(type, "【(.*?)】", 1);
             } else {
                 importDiagnoseVOList.add(importDiagnoseVO);
             }
@@ -143,10 +145,10 @@ public class KlDiagnoseImportFacade {
 
             //处理公式(确诊)
             List<String> orderList = processFormula(curData, diagtypes);
-            dealVerify(currentErrMsg, orderList, diagtypes, curData, concept_map);
+            dealVerify(currentErrMsg, orderList, diagtypes, curData, concept_map, splitType);
             // 数据赋值
             if (ListUtil.isEmpty(currentErrMsg)) {
-                curData = dealImportDiagnose(diagtypes, curData, concept_map);
+                curData = dealImportDiagnose(diagtypes, curData, concept_map, splitType);
                 // 添加到正确数据列表
                 importDiagnoseResVO.setImportDiagnoseVOList(curData);
                 allData.add(importDiagnoseResVO);
@@ -234,7 +236,7 @@ public class KlDiagnoseImportFacade {
      * @param concept_map
      * @return
      */
-    private List<ImportDiagnoseVO> dealImportDiagnose(List<String> diagtypes, List<ImportDiagnoseVO> importDiagnoseVOS, Map<String, KlConcept> concept_map) {
+    private List<ImportDiagnoseVO> dealImportDiagnose(List<String> diagtypes, List<ImportDiagnoseVO> importDiagnoseVOS, Map<String, KlConcept> concept_map, List<String> splitType) {
         for (ImportDiagnoseVO idv : importDiagnoseVOS) {
             String type = idv.getType();
             String orderNo = idv.getOrderNo();
@@ -242,10 +244,17 @@ public class KlDiagnoseImportFacade {
             if (StringUtil.isBlank(type) && StringUtil.isBlank(orderNo)) {
                 continue;
             }
-            if (!type.contains("正则") && !diagtypes.contains(type)) {
-                KlConcept klConcept = concept_map.get(rule + "_" + String.valueOf(LexiconExtEnum.getEnum(type).getKey()));
-                if (klConcept != null) {
-                    idv.setConceptId(klConcept.getId());
+            if (!type.contains("正则") && !diagtypes.contains(type) && splitType.contains(type)) {
+                List<String> splits = CoreUtil.getSplit(rule);
+                if (ListUtil.isNotEmpty(splits)) {
+                    List<Long> conceptIds = Lists.newArrayList();
+                    for (String standName : splits) {
+                        KlConcept klConcept = concept_map.get(standName + "_" + String.valueOf(LexiconExtEnum.getEnum(type).getKey()));
+                        if (klConcept != null) {
+                            conceptIds.add(klConcept.getId());
+                        }
+                    }
+                    idv.setConceptId(conceptIds);
                 }
             }
         }
@@ -253,7 +262,7 @@ public class KlDiagnoseImportFacade {
     }
 
     //数据及格式校验
-    private void dealVerify(List<String> currentErrMsg, List<String> orderNums, List<String> diagtypes, List<ImportDiagnoseVO> data, Map<String, KlConcept> concept_map) {
+    private void dealVerify(List<String> currentErrMsg, List<String> orderNums, List<String> diagtypes, List<ImportDiagnoseVO> data, Map<String, KlConcept> concept_map, List<String> splitType) {
         //list元素计数
         Map<String, Long> orderNumMap = orderNums.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
         for (Map.Entry<String, Long> on : orderNumMap.entrySet()) {
@@ -283,10 +292,18 @@ public class KlDiagnoseImportFacade {
                         continue;
                     }
                     int key = anEnum.getKey();
-                    if (!type.contains("正则") &&
+                    if (!type.contains("正则") && splitType.contains(type)) {
+                        List<String> splits = CoreUtil.getSplit(rule);
+                        for (String standName : splits) {
+                            if (!concept_map.containsKey(standName + "_" + String.valueOf(key))) {
+                                currentErrMsg.add(String.format("第%d行【%s】不是标准词", rowNum, standName));
+                            }
+                        }
+                    }
+                    /*if (!type.contains("正则") &&
                             !concept_map.containsKey(rule + "_" + String.valueOf(key))) {
                         currentErrMsg.add(String.format("第%d行【%s】不是标准词", rowNum, rule));
-                    }
+                    }*/
                     String name = DiagnoseLexiconTypeEnum.getName(key);
                     Boolean regexRes = RegexUtil.getRegexRes(orderNo, name + "\\d+");
                     if (!regexRes) {
@@ -314,7 +331,7 @@ public class KlDiagnoseImportFacade {
                     currentErrMsg.add(String.format("第%d行【类型】不能为空", rowNum));
                 }
                 if (StringUtils.isNotBlank(type) && diagtypes.contains(type) && StringUtils.isBlank(rule)
-                && StringUtils.isBlank(orderNo)) {
+                        && StringUtils.isBlank(orderNo)) {
                     currentErrMsg.add(String.format("第%d行【诊断依据规则】不能为空", rowNum));
                 }
                 if (StringUtils.isNotBlank(type) && !diagtypes.contains(type) && StringUtils.isBlank(rule)) {
@@ -378,11 +395,9 @@ public class KlDiagnoseImportFacade {
 
                 for (ImportDiagnoseVO importDiagnoseVO : data) {
                     String type = importDiagnoseVO.getType();
-                    String getOrderNo = importDiagnoseVO.getOrderNo();
-                    if (StringUtil.isNotBlank(type) && StringUtil.isNotBlank(getOrderNo)) {
+                    String rule = importDiagnoseVO.getRule();
+                    if (StringUtil.isNotBlank(type) && StringUtil.isNotBlank(rule)) {
                         if ("拟诊".equals(type) || "确诊".equals(type) || "警惕".equals(type)) {
-                            String[] splitGroup = getOrderNo.split("\\+");
-
                             KlDiagnoseTypeVO klDiagnoseTypeVO = new KlDiagnoseTypeVO();
                             if ("拟诊".equals(type)) {
                                 klDiagnoseTypeVO.setConditionType(2);
@@ -393,6 +408,7 @@ public class KlDiagnoseImportFacade {
                             }
 
                             //  第三层
+                            String[] splitGroup = rule.split("\\+");
                             List<KlDiagnoseGroupVO> groupVO = Lists.newArrayList();
                             for (String group : splitGroup) {
                                 KlDiagnoseGroupVO klDiagnoseGroupVO = generateDiagnoseGroup(group, map);

+ 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;
+    }
+}

+ 14 - 0
src/main/java/com/diagbot/facade/KlRuleFacade.java

@@ -3,6 +3,7 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.IndicationExportDTO;
 import com.diagbot.dto.KlRuleByIdDTO;
 import com.diagbot.dto.KlRuleByIdParDTO;
 import com.diagbot.dto.KlRuleByIdSubDTO;
@@ -16,6 +17,7 @@ import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.KlRuleServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
+import com.diagbot.util.ExcelUtils;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.KlRuleByIdVO;
@@ -27,6 +29,7 @@ import com.diagbot.vo.KlRuleSatartOrdisaVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -235,4 +238,15 @@ public class KlRuleFacade extends KlRuleServiceImpl {
                 .set("gmt_modified", now);
         return this.update(klRuleUpdate);
     }
+
+    /**
+     * 开单合理性导出
+     *
+     * @return
+     */
+    public void exportIndicationFac(HttpServletResponse response) {
+        List<IndicationExportDTO> indicationExportDTOS = exportIndication();
+        ExcelUtils.exportExcel(indicationExportDTOS, null, "开单合理性", IndicationExportDTO.class, "indication.xlsx",
+                response, 12.8f);
+    }
 }

+ 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.getSelectBase(new ArrayList<>());
+        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);
 }

+ 20 - 0
src/main/java/com/diagbot/mapper/KlDiagnoseBaseRelationMapper.java

@@ -0,0 +1,20 @@
+package com.diagbot.mapper;
+
+import com.diagbot.dto.KlDiagnoseLibNameDTO;
+import com.diagbot.entity.KlDiagnoseBaseRelation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 基础规则关联表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-30
+ */
+public interface KlDiagnoseBaseRelationMapper extends BaseMapper<KlDiagnoseBaseRelation> {
+
+    List<KlDiagnoseLibNameDTO> getLibNameList(List<Long> basId);
+}

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

@@ -0,0 +1,20 @@
+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> 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);
+}

+ 3 - 0
src/main/java/com/diagbot/mapper/KlRuleMapper.java

@@ -1,6 +1,7 @@
 package com.diagbot.mapper;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.IndicationExportDTO;
 import com.diagbot.dto.KlRuleByIdDTO;
 import com.diagbot.dto.KlRuleInfoDTO;
 import com.diagbot.dto.RuleDTO;
@@ -26,4 +27,6 @@ public interface KlRuleMapper extends BaseMapper<KlRule> {
     IPage<KlRuleInfoDTO> getKlRuleInfoPage(KlRuleInfoVO klRuleInfoVO);
 
     List<KlRuleByIdDTO> getByIdRuleInfo(KlRuleByIdVO klRuleByIdVO);
+
+    List<IndicationExportDTO> exportIndication();
 }

+ 1 - 0
src/main/java/com/diagbot/model/ai/process/EntityProcessClinic.java

@@ -159,6 +159,7 @@ public class EntityProcessClinic extends EntityProcess {
                 Operation operation = new Operation();
                 operation.setName(lemma.getText());
                 operation.setStandName(lemma.getText()); // 先赋值,之后有同义词转换再替换
+//                operation.setStandName("");
                 if (lemma.isHaveChildren()) {
                     operation.setNegative(findNegative(lemma));//阴性
                 }

+ 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;
@@ -32,7 +30,6 @@ import com.diagbot.facade.KlDiagnoseFacade;
 import com.diagbot.facade.KlRelationFacade;
 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;
@@ -64,7 +61,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;
@@ -494,63 +490,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);

+ 98 - 36
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;
+
     /**
      * 比较阳性属性是否匹配
      *
@@ -81,7 +98,7 @@ public class CommonRule {
                 Negative val = (Negative) CoreUtil.getFieldValue(d, "negative");
                 if (val == null) {
                     String c = (String) CoreUtil.getFieldValue(d, "standName");
-                    if (StringUtils.isNotBlank(c) && CoreUtil.compareName(ruleBaseDTO, c)) {
+                    if (StringUtils.isNotBlank(c) && CoreUtil.compareNameMulti(ruleBaseDTO, c)) {
                         CoreUtil.addSplitString(baseIdList, ids);
                     }
                 }
@@ -93,14 +110,14 @@ public class CommonRule {
      * 比较是否包含
      *
      * @param input
-     * @param ruleBaseDTO
+     * @param name
      * @return
      */
-    public <T> Boolean containsItem(List<T> input, RuleBaseDTO ruleBaseDTO) {
-        if (ListUtil.isNotEmpty(input) && ruleBaseDTO != null) {
+    public <T> Boolean containsItem(List<T> input, String name) {
+        if (ListUtil.isNotEmpty(input) && StringUtil.isNotBlank(name)) {
             for (T t : input) {
                 String c = (String) CoreUtil.getFieldValue(t, "uniqueName"); // 标准名称
-                if (c.contains(ruleBaseDTO.getBaseLibName())) {
+                if (c.contains(name)) {
                     return true;
                 }
             }
@@ -175,8 +192,7 @@ public class CommonRule {
         if (ListUtil.isNotEmpty(input)) {
             for (T t : input) {
                 String c = (String) CoreUtil.getFieldValue(t, "uniqueName"); // 标准名称
-                String c_name = (String) CoreUtil.getFieldValue(t, "name"); // 界面名称
-                if (CoreUtil.compareName(ruleBaseDTO, c)) {
+                if (CoreUtil.compareNameMulti(ruleBaseDTO, c)) {
                     CoreUtil.addSplitString(baseIdList, ids);
                 }
             }
@@ -406,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;
     }
-
 }

+ 43 - 39
src/main/java/com/diagbot/rule/GroupRule.java

@@ -75,49 +75,53 @@ public class GroupRule {
         String symptom = wordCrfDTO.getSymptom(); // 现病史内容
         String menstrual = wordCrfDTO.getMenstrual(); // 月经史
         boolean flag = false;
-        switch (ruleBaseDTO.getBaseLibName()) {
-            case "妊娠":
-                Map map = gravidityRule(wordCrfDTO);
-                if (CoreUtil.getMapFlag(map) == true) {
-                    flag = true;
-                }
-                break;
-            case "流产":
-                flag = commonRule.containsItem(wordCrfDTO.getDiag(), ruleBaseDTO);
-                break;
-            case "月经期":
-                String regex = "月经第(([零一二三四五六七八九十]{0,3})||([0-9]{0,2}))天";
-                String regex2 = "(?<!上一次)经期";
-                if (RegexUtil.getRegexRes(symptom, regex) || RegexUtil.getRegexRes(menstrual, regex)
-                        || RegexUtil.getRegexRes(symptom, regex2) || RegexUtil.getRegexRes(menstrual, regex2)) {
-                    flag = true;
-                }
-                break;
-            case "幼儿":
-                if (age != null) {
-                    if (age < 6.0D && 1.0D <= age) {
+        List<String> nameList = CoreUtil.getSplit(ruleBaseDTO.getBaseLibName());
+        for (String name : nameList) {
+            switch (name) {
+                case "妊娠":
+                    Map map = gravidityRule(wordCrfDTO);
+                    if (CoreUtil.getMapFlag(map) == true) {
                         flag = true;
                     }
-                }
-                break;
-            case "儿童":
-                if (age != null) {
-                    if (age < 18.0D && age >= 6.0D) {
+                    break;
+                case "流产":
+                    flag = commonRule.containsItem(wordCrfDTO.getDiag(), name);
+                    break;
+                case "月经期":
+                    String regex = "月经第(([零一二三四五六七八九十]{0,3})||([0-9]{0,2}))天";
+                    String regex2 = "(?<!上一次)经期";
+                    if (RegexUtil.getRegexRes(symptom, regex) || RegexUtil.getRegexRes(menstrual, regex)
+                            || RegexUtil.getRegexRes(symptom, regex2) || RegexUtil.getRegexRes(menstrual, regex2)) {
                         flag = true;
                     }
-                }
-                break;
-            case "成人":
-                if (age >= 18) {
-                    flag = true;
-                }
-                break;
-            case "新生儿":
-                if (age <= 1) {
-                    flag = true;
-                }
-                break;
-            default: break;
+                    break;
+                case "幼儿":
+                    if (age != null) {
+                        if (age < 6.0D && 1.0D <= age) {
+                            flag = true;
+                        }
+                    }
+                    break;
+                case "儿童":
+                    if (age != null) {
+                        if (age < 18.0D && age >= 6.0D) {
+                            flag = true;
+                        }
+                    }
+                    break;
+                case "成人":
+                    if (age >= 18) {
+                        flag = true;
+                    }
+                    break;
+                case "新生儿":
+                    if (age <= 1) {
+                        flag = true;
+                    }
+                    break;
+                default:
+                    break;
+            }
         }
         res.put("flag", flag);
         res.put("msg", ruleBaseDTO.getBaseLibName());

+ 1 - 1
src/main/java/com/diagbot/rule/VitalRule.java

@@ -48,7 +48,7 @@ public class VitalRule {
      * @param ids
      */
     public void push(VitalLabel vitalLabel, RuleBaseDTO ruleBaseDTO, List<Long> baseIdList, String ids) {
-        Map<String, Object> map = CoreUtil.compareVital(ruleBaseDTO, vitalLabel);
+        Map<String, Object> map = CoreUtil.compareVitalMulti(ruleBaseDTO, vitalLabel);
         if (CoreUtil.getMapFlag(map)) {
             CoreUtil.addSplitString(baseIdList, ids);
         }

+ 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);
 }

+ 19 - 0
src/main/java/com/diagbot/service/KlDiagnoseBaseRelationService.java

@@ -0,0 +1,19 @@
+package com.diagbot.service;
+
+import com.diagbot.dto.KlDiagnoseLibNameDTO;
+import com.diagbot.entity.KlDiagnoseBaseRelation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 基础规则关联表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-30
+ */
+public interface KlDiagnoseBaseRelationService extends IService<KlDiagnoseBaseRelation> {
+    List<KlDiagnoseLibNameDTO> getLibNameList(List<Long> basId);
+}

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

@@ -0,0 +1,20 @@
+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> 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);
+}

+ 3 - 4
src/main/java/com/diagbot/service/KlRuleService.java

@@ -1,14 +1,12 @@
 package com.diagbot.service;
 
-import com.baomidou.dynamic.datasource.annotation.DSTransactional;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.IndicationExportDTO;
 import com.diagbot.dto.KlRuleByIdDTO;
 import com.diagbot.dto.KlRuleInfoDTO;
 import com.diagbot.dto.RuleDTO;
 import com.diagbot.entity.KlRule;
-import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.vo.KlRuleByIdVO;
 import com.diagbot.vo.KlRuleInfoVO;
 
@@ -26,4 +24,5 @@ public interface KlRuleService extends IService<KlRule> {
     List<RuleDTO> getAllRule();
     IPage<KlRuleInfoDTO> getKlRuleInfoPages(KlRuleInfoVO klRuleInfoVO);
     List<KlRuleByIdDTO> getByIdRuleInfo(KlRuleByIdVO klRuleByIdVO);
+    List<IndicationExportDTO> exportIndication();
 }

+ 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

@@ -41,4 +41,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);
+    }
 }

+ 25 - 0
src/main/java/com/diagbot/service/impl/KlDiagnoseBaseRelationServiceImpl.java

@@ -0,0 +1,25 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.KlDiagnoseLibNameDTO;
+import com.diagbot.entity.KlDiagnoseBaseRelation;
+import com.diagbot.mapper.KlDiagnoseBaseRelationMapper;
+import com.diagbot.service.KlDiagnoseBaseRelationService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 基础规则关联表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-30
+ */
+@Service
+public class KlDiagnoseBaseRelationServiceImpl extends ServiceImpl<KlDiagnoseBaseRelationMapper, KlDiagnoseBaseRelation> implements KlDiagnoseBaseRelationService {
+    public List<KlDiagnoseLibNameDTO> getLibNameList(List<Long> basId) {
+        return baseMapper.getLibNameList(basId);
+    }
+}

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

@@ -0,0 +1,27 @@
+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> 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);
+    }
+}

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

@@ -1,8 +1,8 @@
 package com.diagbot.service.impl;
 
-import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.IndicationExportDTO;
 import com.diagbot.dto.KlRuleByIdDTO;
 import com.diagbot.dto.KlRuleInfoDTO;
 import com.diagbot.dto.RuleDTO;
@@ -38,4 +38,9 @@ public class KlRuleServiceImpl extends ServiceImpl<KlRuleMapper, KlRule> impleme
     public List<KlRuleByIdDTO> getByIdRuleInfo(KlRuleByIdVO klRuleByIdVO) {
         return baseMapper.getByIdRuleInfo(klRuleByIdVO);
     }
+
+    @Override
+    public List<IndicationExportDTO> exportIndication() {
+        return baseMapper.exportIndication();
+    }
 }

+ 112 - 0
src/main/java/com/diagbot/util/CoreUtil.java

@@ -4,6 +4,7 @@ import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.dto.PushBaseDTO;
 import com.diagbot.dto.RuleBaseDTO;
+import com.diagbot.enums.CommonEnum;
 import com.diagbot.enums.LexiconEnum;
 import com.diagbot.model.entity.BodyPart;
 import com.diagbot.model.entity.Clinical;
@@ -430,6 +431,72 @@ public class CoreUtil {
         return map;
     }
 
+    /**
+     * 比较查体是否匹配
+     *
+     * @param ruleBaseDTO
+     * @param vitalLabel
+     * @return
+     */
+    public static Map<String, Object> compareVitalMulti(RuleBaseDTO ruleBaseDTO, VitalLabel vitalLabel) {
+        Map<String, Object> map = new LinkedHashMap<>();
+        List<String> msgList = new ArrayList<>();
+        map.put("msgList", msgList);
+        List<Vital> vitalList = vitalLabel.getVitals(); // 体征数据
+        List<Clinical> clinicals = vitalLabel.getClinicals(); // 体征临床表现
+        boolean flag = false;
+        if (ruleBaseDTO == null) {
+            map.put("flag", flag);
+            return map;
+        }
+        // if (StringUtil.isBlank(ruleBaseDTO.getBaseMaxValue()) && StringUtil.isBlank(ruleBaseDTO.getBaseMinValue())) {
+        // 如果是体格检查结果,就用临床表现比较;如果是体格检查项目,用体征数值比较
+        if (ruleBaseDTO.getBaseLibType().equals(LexiconEnum.VitalResult.getKey())) {
+            // 体征名称比较(例如:喉头水肿)
+            String libNameMulti = ruleBaseDTO.getBaseLibName();
+            if (libNameMulti.contains(CommonEnum.splitSymbol.getName())) {
+                for (Clinical clinical : clinicals) {
+                    List<String> nameList = Lists.newArrayList(libNameMulti.split(CommonEnum.splitSymbol.getName()));
+                    if (nameList.contains(clinical.getStandName())) {
+                        msgList.add(clinical.getName());
+                        flag = true;
+                    }
+                }
+            } else {
+                for (Clinical clinical : clinicals) {
+                    if (ruleBaseDTO.getBaseLibName().equals(clinical.getStandName())) {
+                        msgList.add(clinical.getName());
+                        flag = true;
+                    }
+                }
+            }
+        } else {
+            // 体征数值比较(例如:体温,血压)
+            for (Vital vital : vitalList) {
+                List<Usual> usualList = vital.getUsualList();
+                if (ruleBaseDTO.getBaseLibName().equals(vital.getStandName()) && vital.getPd() != null
+                        && StringUtil.isNotBlank(vital.getPd().getValue())) {
+                    flag = compareNum(ruleBaseDTO, Double.parseDouble(vital.getPd().getValue()));
+                    if (flag) {
+                        msgList.add(vital.getName() + subZeroAndDot(String.valueOf(vital.getPd().getValue())));
+                    }
+                } else if (ListUtil.isNotEmpty(usualList)) { // 血压比较
+                    for (Usual usual : usualList) {
+                        if (ruleBaseDTO.getBaseLibName().equals(usual.getStandName())) {
+                            flag = compareNum(ruleBaseDTO, Double.parseDouble(usual.getValue()));
+                            if (flag) {
+                                msgList.add(vital.getName() + subZeroAndDot(String.valueOf(vital.getPd().getValue())));
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        map.put("flag", flag);
+        return map;
+    }
+
     /**
      * 比较数值大小(double)
      *
@@ -710,6 +777,27 @@ public class CoreUtil {
         return false;
     }
 
+    /**
+     * 比较名称是否匹配(多个名称用分隔符隔开)
+     *
+     * @param ruleBaseDTO
+     * @param input
+     * @return
+     */
+    public static Boolean compareNameMulti(RuleBaseDTO ruleBaseDTO, String input) {
+        if (StringUtil.isBlank(input) || ruleBaseDTO == null || StringUtil.isBlank(ruleBaseDTO.getBaseLibName())) {
+            return false;
+        }
+        // 多个名称用分隔符隔开,只需要满足一个即可
+        List<String> nameList = CoreUtil.getSplit(ruleBaseDTO.getBaseLibName());
+        for (String name : nameList) {
+            if (input.equals(name)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     /**
      * 获取所有阳性【T】,转成Item结构,放入列表
      *
@@ -1067,6 +1155,30 @@ public class CoreUtil {
         return res;
     }
 
+
+    /**
+     * 根据分隔符转成list
+     * @param name
+     * @return
+     */
+    public static List<String> getSplit(String name) {
+        return getSplit(name, CommonEnum.splitSymbol.getName());
+    }
+
+    /**
+     * 根据分隔符转成list
+     *
+     * @param name
+     * @param splitSymbol
+     * @return
+     */
+    public static List<String> getSplit(String name, String splitSymbol) {
+        if (StringUtil.isBlank(name)) {
+            return Lists.newArrayList();
+        }
+        return Lists.newArrayList(name.split(splitSymbol));
+    }
+
     public static void main(String[] args) {
         List<PushBaseDTO> pushBaseDTOList = ListUtil.newArrayList();
         PushBaseDTO pushBaseDTO = new PushBaseDTO();

+ 12 - 12
src/main/java/com/diagbot/vo/ImportDiagnoseVO.java

@@ -5,6 +5,7 @@ import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * <p>
@@ -19,29 +20,29 @@ public class ImportDiagnoseVO implements Serializable, IExcelDataModel {
 
     private static final long serialVersionUID = 1L;
 
-    @Excel(name="类型")
+    @Excel(name = "类型")
     private String type = "";
-    @Excel(name="序号")
+    @Excel(name = "序号")
     private String orderNo = "";
-    @Excel(name="规则")
+    @Excel(name = "规则")
     private String rule = "";
-    @Excel(name="等于")
+    @Excel(name = "等于")
     private String eq;
-    @Excel(name="最大值")
+    @Excel(name = "最大值")
     private String max;
-    @Excel(name="最大值符号")
+    @Excel(name = "最大值符号")
     private String maxSymbol;
-    @Excel(name="单位")
+    @Excel(name = "单位")
     private String unit;
-    @Excel(name="最小值")
+    @Excel(name = "最小值")
     private String min;
-    @Excel(name="最小值符号")
+    @Excel(name = "最小值符号")
     private String minSymbol;
     // @Excel(name="单位")
     // private String minUnit;
 
     // 规则标准词id
-    private Long conceptId;
+    private List<Long> conceptId;
     //行号
     private Integer rowNum;
     //确诊公式(带拟诊)
@@ -54,7 +55,6 @@ public class ImportDiagnoseVO implements Serializable, IExcelDataModel {
 
     @Override
     public void setRowNum(Integer rowNum) {
-        this.rowNum=rowNum+1;//表头占一行
-
+        this.rowNum = rowNum + 1;//表头占一行
     }
 }

+ 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;
 }

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

@@ -3,6 +3,8 @@ package com.diagbot.vo;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.List;
+
 /**
  * @author wangfeng
  * @Description:
@@ -15,7 +17,7 @@ public class KlDiagnoseDetailVO {
      * 描述
      */
     private String basDescription;
-    private Long basConceptId;
+    private List<Long> basConceptId;
     private String basLibName;
     private Integer basLibType;
     private String basLename;

+ 2 - 1
src/main/java/com/diagbot/vo/KlDiagnoseSaveVO.java

@@ -3,6 +3,7 @@ package com.diagbot.vo;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -27,5 +28,5 @@ public class KlDiagnoseSaveVO {
 
     List<KlDiagnoseTypeVO> klDiagnoseTypeVO;
 
-
+    Date now;
 }

+ 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);
+    }
 }

+ 0 - 0
src/main/java/com/diagbot/web/KlIndicationImportController.java


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików