瀏覽代碼

Merge branch 'master' into his/yiwufubao

# Conflicts:
#	src/main/resources/application-local.yml
liuqq 3 年之前
父節點
當前提交
0e77fb1bc5
共有 100 個文件被更改,包括 5696 次插入769 次删除
  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 0
      doc/011.20210715开单合理性重复开立/med_2021_init.sql
  6. 17 0
      doc/012.20210712静态知识增加法律法规/cdss_init.sql
  7. 31 0
      doc/012.20210712静态知识增加法律法规/med2021_init.sql
  8. 5 0
      doc/013.20210801静态知识法律法规修改成政策法规/cdss_init.sql
  9. 5 0
      doc/013.20210801静态知识法律法规修改成政策法规/med2021_init.sql
  10. 531 0
      doc/014.20210727提示规则新需求/med2021_init.sql
  11. 81 0
      doc/014.20210727提示规则新需求/temp.sql
  12. 110 0
      src/main/java/com/diagbot/aggregate/RuleAggregate.java
  13. 10 4
      src/main/java/com/diagbot/config/CacheDeleteInit.java
  14. 1 0
      src/main/java/com/diagbot/dto/AnesthesiaInfoDTO.java
  15. 2 6
      src/main/java/com/diagbot/dto/BaseDiagnoseDTO.java
  16. 84 0
      src/main/java/com/diagbot/dto/BaseRegulationDTO.java
  17. 17 0
      src/main/java/com/diagbot/dto/ConceptScaleDTO.java
  18. 107 0
      src/main/java/com/diagbot/dto/ConceptScaleDetailDTO.java
  19. 18 0
      src/main/java/com/diagbot/dto/ConceptScaleSubDTO.java
  20. 1 0
      src/main/java/com/diagbot/dto/DiseaseInfoDTO.java
  21. 1 0
      src/main/java/com/diagbot/dto/DrugInfoDTO.java
  22. 2 0
      src/main/java/com/diagbot/dto/ExportDiagnoseDTO.java
  23. 2 0
      src/main/java/com/diagbot/dto/IndexBatchDTO.java
  24. 42 0
      src/main/java/com/diagbot/dto/IndicationExportDTO.java
  25. 109 0
      src/main/java/com/diagbot/dto/KlConceptScaleDTO.java
  26. 6 2
      src/main/java/com/diagbot/dto/KlConceptStaticDTO.java
  27. 7 2
      src/main/java/com/diagbot/dto/KlDiagnoseByIdDTO.java
  28. 19 0
      src/main/java/com/diagbot/dto/KlDiagnoseLibNameDTO.java
  29. 1 0
      src/main/java/com/diagbot/dto/KlRuleByIdDTO.java
  30. 1 0
      src/main/java/com/diagbot/dto/KlRuleByIdSubDTO.java
  31. 49 0
      src/main/java/com/diagbot/dto/KlScaleByIdDTO.java
  32. 83 0
      src/main/java/com/diagbot/dto/KlScaleDetailDTO.java
  33. 43 0
      src/main/java/com/diagbot/dto/KlScaleInfoDTO.java
  34. 1 0
      src/main/java/com/diagbot/dto/LisDetailDTO.java
  35. 1 0
      src/main/java/com/diagbot/dto/NurseInfoDTO.java
  36. 3 0
      src/main/java/com/diagbot/dto/OperationInfoDTO.java
  37. 16 0
      src/main/java/com/diagbot/dto/RegulationDTO.java
  38. 27 0
      src/main/java/com/diagbot/dto/RegulationIndexDTO.java
  39. 18 0
      src/main/java/com/diagbot/dto/RetrievalConceptDTO.java
  40. 45 40
      src/main/java/com/diagbot/dto/RetrievalDTO.java
  41. 12 12
      src/main/java/com/diagbot/dto/RuleBaseDTO.java
  42. 15 0
      src/main/java/com/diagbot/dto/RuleBaseInitDTO.java
  43. 18 0
      src/main/java/com/diagbot/dto/RuleConditionInitDTO.java
  44. 25 0
      src/main/java/com/diagbot/dto/RuleInitDTO.java
  45. 4 0
      src/main/java/com/diagbot/dto/RuleSimpleDTO.java
  46. 22 0
      src/main/java/com/diagbot/dto/ScaleDTO.java
  47. 1 0
      src/main/java/com/diagbot/dto/ScaleInfoDTO.java
  48. 5 0
      src/main/java/com/diagbot/dto/StaticKnowledgeDTO.java
  49. 1 0
      src/main/java/com/diagbot/dto/TcmdiseaseInfoDTO.java
  50. 1 0
      src/main/java/com/diagbot/dto/TcmsyndromeInfoDTO.java
  51. 19 0
      src/main/java/com/diagbot/dto/TermConceptDTO.java
  52. 7 1
      src/main/java/com/diagbot/dto/WordCrfDTO.java
  53. 312 0
      src/main/java/com/diagbot/entity/KlConceptScale.java
  54. 0 28
      src/main/java/com/diagbot/entity/KlDiagnoseBase.java
  55. 68 0
      src/main/java/com/diagbot/entity/KlDiagnoseBaseRelation.java
  56. 158 0
      src/main/java/com/diagbot/entity/KlOperation.java
  57. 78 0
      src/main/java/com/diagbot/entity/KlRegulation.java
  58. 108 0
      src/main/java/com/diagbot/entity/KlRegulationBase.java
  59. 83 0
      src/main/java/com/diagbot/entity/KlRegulationCondition.java
  60. 18 4
      src/main/java/com/diagbot/entity/KlRuleCondition.java
  61. 296 0
      src/main/java/com/diagbot/entity/MappingConfig.java
  62. 20 0
      src/main/java/com/diagbot/entity/wrapper/KlScaleDetailWrapper.java
  63. 49 0
      src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java
  64. 3 1
      src/main/java/com/diagbot/enums/BaseDiagnoseTypeEnum.java
  65. 49 0
      src/main/java/com/diagbot/enums/CommonEnum.java
  66. 6 6
      src/main/java/com/diagbot/enums/ConEnum.java
  67. 78 0
      src/main/java/com/diagbot/enums/ConceptTypeEnum.java
  68. 13 4
      src/main/java/com/diagbot/enums/DiagnoseLexiconTypeEnum.java
  69. 2 1
      src/main/java/com/diagbot/enums/LexiconEnum.java
  70. 66 0
      src/main/java/com/diagbot/enums/MatchSourceEnum.java
  71. 5 2
      src/main/java/com/diagbot/enums/RedisEnum.java
  72. 56 0
      src/main/java/com/diagbot/enums/StandConvertCrfEnum.java
  73. 9 0
      src/main/java/com/diagbot/facade/BillFacade.java
  74. 41 0
      src/main/java/com/diagbot/facade/CacheFacade.java
  75. 194 104
      src/main/java/com/diagbot/facade/CommonFacade.java
  76. 312 91
      src/main/java/com/diagbot/facade/KlConceptFacade.java
  77. 65 0
      src/main/java/com/diagbot/facade/KlConceptScaleFacade.java
  78. 244 30
      src/main/java/com/diagbot/facade/KlConceptStaticFacade.java
  79. 21 0
      src/main/java/com/diagbot/facade/KlDiagnoseBaseRelationFacade.java
  80. 102 92
      src/main/java/com/diagbot/facade/KlDiagnoseDetailFacade.java
  81. 52 6
      src/main/java/com/diagbot/facade/KlDiagnoseFacade.java
  82. 38 23
      src/main/java/com/diagbot/facade/KlDiagnoseImportFacade.java
  83. 5 0
      src/main/java/com/diagbot/facade/KlLibraryInfoFacade.java
  84. 13 0
      src/main/java/com/diagbot/facade/KlOperationFacade.java
  85. 87 0
      src/main/java/com/diagbot/facade/KlRegulationBaseFacade.java
  86. 35 0
      src/main/java/com/diagbot/facade/KlRegulationFacade.java
  87. 15 0
      src/main/java/com/diagbot/facade/KlRuleFacade.java
  88. 169 0
      src/main/java/com/diagbot/facade/KlScaleFacade.java
  89. 0 139
      src/main/java/com/diagbot/facade/LisConfigFacade.java
  90. 163 0
      src/main/java/com/diagbot/facade/MappingConfigFacade.java
  91. 41 18
      src/main/java/com/diagbot/facade/MedRetrievalFacade.java
  92. 29 7
      src/main/java/com/diagbot/facade/NeoFacade.java
  93. 0 57
      src/main/java/com/diagbot/facade/OperationConfigFacade.java
  94. 0 89
      src/main/java/com/diagbot/facade/PacsConfigFacade.java
  95. 190 0
      src/main/java/com/diagbot/facade/TermMatchingFacade.java
  96. 21 0
      src/main/java/com/diagbot/mapper/KlConceptScaleMapper.java
  97. 10 0
      src/main/java/com/diagbot/mapper/KlConceptStaticMapper.java
  98. 20 0
      src/main/java/com/diagbot/mapper/KlDiagnoseBaseRelationMapper.java
  99. 8 0
      src/main/java/com/diagbot/mapper/KlLibraryInfoMapper.java
  100. 0 0
      src/main/java/com/diagbot/mapper/KlOperationMapper.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 - 0
doc/011.20210715开单合理性重复开立/med_2021_init.sql

@@ -0,0 +1,4 @@
+USE `med_2021`;
+
+INSERT INTO `med_2021`.`kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('161', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '40', '单次', '^(24小时维持|一次|1次|空)$|ALWAYS|BID|ONCE|每日', '1', '0', '开单频次');
+INSERT INTO `med_2021`.`kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('162', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '40', '持续', '每周|每月|每年|每半年|(一|二|三)月一次|qw|biw', '1', '0', '开单频次');

+ 17 - 0
doc/012.20210712静态知识增加法律法规/cdss_init.sql

@@ -0,0 +1,17 @@
+USE `cdss`;
+
+INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('130', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '法律法规', '10', '2', '100', '静态知识检索类型');
+INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('131', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '10', '法律法规', '10', '0', '10', '静态知识类型');
+INSERT INTO `sys_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('132', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '法律法规', '法律法规', '1', '411', '页面显示词性');
+UPDATE `sys_dictionary_info` SET `return_type` = 0 WHERE `group_type` = 10 AND NAME LIKE '护理';
+-- 已经执行
+-- UPDATE `tran_plan_detail`
+-- SET number = NULL
+-- WHERE
+-- 	`name` IN (
+-- 		'开单合理性',
+-- 		'高危',
+-- 		'危急值提醒',
+-- 		'其他提醒'
+-- 	);
+

+ 31 - 0
doc/012.20210712静态知识增加法律法规/med2021_init.sql

@@ -0,0 +1,31 @@
+USE `med_2021`;
+
+INSERT INTO `kl_lexicon` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `is_has_common`, `only_one`, `can_change`, `remark`) VALUES ('50', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '法律法规', '130', '0', '0', '0', '');
+
+
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('144', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '法律法规', '10', '2', '100', '静态知识检索类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('145', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '法律法规', '法律法规', '1', '411', '页面显示词性');
+
+-- 静态信息关联放入到数据库中
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('146', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '静态知识', '1', '1', '10', '静态知识类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('147', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '注意事项', '2', '1', '20', '静态知识类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('148', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '临床路径', '3', '1', '30', '静态知识类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('149', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '一般治疗', '4', '1', '40', '静态知识类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('150', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '1', '1,3,4', '1', '0', '诊断关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('151', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '2', '1', '1', '0', '药品关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('152', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '3', '1,2', '1', '0', '检验套餐关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('153', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '4', '1,2', '1', '0', '检验细项关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('154', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '5', '1,2', '1', '0', '检查关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('155', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '6', '1,2', '1', '0', '检查子项关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('156', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '7', '1', '1', '0', '手术和操作关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('157', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '8', '1', '1', '0', '量表关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('158', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '9', '1', '1', '0', '护理关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('159', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '10', '1', '1', '0', '法律法规关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` (`id`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('160', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '999', '1,2,3,4', '1', '0', '其他关联的静态信息类型');
+
+-- 已经执行
+-- UPDATE `med_2021`.`kl_rule_plan` SET `id`='73', `is_deleted`='Y', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `plan_code`='rule', `rule_type`='1', `parent_id`='10', `name`='开单项', `type`='5', `number`=NULL, `code`='', `order_no`='4', `remark`='' WHERE (`id`='73');
+-- UPDATE `med_2021`.`kl_rule_plan` SET `id`='103', `is_deleted`='Y', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `plan_code`='rule', `rule_type`='1', `parent_id`='11', `name`='开单项', `type`='5', `number`=NULL, `code`='', `order_no`='4', `remark`='' WHERE (`id`='103');
+-- UPDATE `med_2021`.`kl_rule_plan` SET `id`='403', `is_deleted`='Y', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `plan_code`='rule', `rule_type`='1', `parent_id`='14', `name`='开单项', `type`='5', `number`=NULL, `code`='', `order_no`=NULL, `remark`='' WHERE (`id`='403');
+-- UPDATE `med_2021`.`kl_rule_plan` SET `id`='503', `is_deleted`='Y', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `plan_code`='rule', `rule_type`='1', `parent_id`='15', `name`='开单项', `type`='5', `number`=NULL, `code`='', `order_no`=NULL, `remark`='' WHERE (`id`='503');
+-- DELETE FROM `kl_concept` where id = 80958;

+ 5 - 0
doc/013.20210801静态知识法律法规修改成政策法规/cdss_init.sql

@@ -0,0 +1,5 @@
+USE `cdss`;
+
+UPDATE `cdss`.`sys_dictionary_info` SET `id`='130', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `group_type`='7', `name`='政策法规', `val`='10', `return_type`='2', `order_no`='100', `remark`='静态知识检索类型' WHERE (`id`='130');
+UPDATE `cdss`.`sys_dictionary_info` SET `id`='131', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `group_type`='10', `name`='政策法规', `val`='10', `return_type`='0', `order_no`='10', `remark`='静态知识类型' WHERE (`id`='131');
+UPDATE `cdss`.`sys_dictionary_info` SET `id`='132', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `group_type`='13', `name`='政策法规', `val`='政策法规', `return_type`='1', `order_no`='411', `remark`='页面显示词性' WHERE (`id`='132');

+ 5 - 0
doc/013.20210801静态知识法律法规修改成政策法规/med2021_init.sql

@@ -0,0 +1,5 @@
+USE `med_2021`;
+
+update kl_lexicon set name ='政策法规' where code=130;
+UPDATE `med_2021`.`kl_dictionary_info` SET `id`='144', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `group_type`='7', `name`='政策法规', `val`='10', `return_type`='2', `order_no`='100', `remark`='静态知识检索类型' WHERE (`id`='144');
+UPDATE `med_2021`.`kl_dictionary_info` SET `id`='145', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `group_type`='13', `name`='政策法规', `val`='政策法规', `return_type`='1', `order_no`='411', `remark`='页面显示词性' WHERE (`id`='145');

+ 531 - 0
doc/014.20210727提示规则新需求/med2021_init.sql

@@ -0,0 +1,531 @@
+USE `med_2021`;
+
+ALTER TABLE kl_rule_condition ADD  COLUMN `msg` varchar(255) NOT NULL DEFAULT '' COMMENT '附加信息' AFTER `rule_base_id`;
+
+UPDATE kl_rule_condition t1,
+ (
+	SELECT
+		*
+	FROM
+		`kl_rule`
+	WHERE
+		msg != ""
+) t2
+SET t1.msg = t2.msg
+where t1.rule_id = t2.id;
+
+SELECT
+		*
+	FROM
+		`kl_rule_condition`
+	WHERE
+		msg != "";
+/*
+Navicat MySQL Data Transfer
+
+Source Server         : 朗通mysql 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-08-04 11:45:21
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for kl_dictionary_info
+-- ----------------------------
+DROP TABLE IF EXISTS `kl_dictionary_info`;
+CREATE TABLE `kl_dictionary_info` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `group_type` bigint(20) NOT NULL DEFAULT '0' COMMENT '分组(值自定义)',
+  `name` varchar(100) NOT NULL DEFAULT '' COMMENT '内容',
+  `val` varchar(255) NOT NULL DEFAULT '' COMMENT '值',
+  `return_type` int(11) NOT NULL DEFAULT '1' COMMENT '返回类型(0: 都返回,1:后台维护返回 2:界面返回)',
+  `order_no` int(11) NOT NULL DEFAULT '0' COMMENT '排序号',
+  `remark` varchar(300) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=244 DEFAULT CHARSET=utf8 COMMENT='字典表';
+
+-- ----------------------------
+-- Records of kl_dictionary_info
+-- ----------------------------
+INSERT INTO `kl_dictionary_info` VALUES ('1', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '全部', '0', '2', '1', '静态知识检索类型');
+INSERT INTO `kl_dictionary_info` VALUES ('2', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '诊断', '1', '2', '10', '静态知识检索类型');
+INSERT INTO `kl_dictionary_info` VALUES ('3', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '药品', '2', '2', '20', '静态知识检索类型');
+INSERT INTO `kl_dictionary_info` VALUES ('4', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '检验', '3', '2', '30', '静态知识检索类型');
+INSERT INTO `kl_dictionary_info` VALUES ('5', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '检查', '5', '2', '40', '静态知识检索类型');
+INSERT INTO `kl_dictionary_info` VALUES ('6', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '手术和操作', '6', '2', '50', '静态知识检索类型');
+INSERT INTO `kl_dictionary_info` VALUES ('7', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '量表', '8', '2', '80', '静态知识检索类型');
+INSERT INTO `kl_dictionary_info` VALUES ('80', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '诊断', '疾病', '1', '100', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('81', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品', '药品通用名', '1', '101', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('82', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品剂型', '药品剂型', '1', '102', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('83', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '症状', '症状', '1', '103', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('84', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '体格检查项目', '体格检查项目', '1', '104', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('85', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '体格检查结果', '体格检查结果', '1', '105', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('86', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '手术和操作', '手术和操作', '1', '106', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('87', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '检验套餐', '实验室检查套餐', '1', '107', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('88', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '检验细项', '实验室检查子项目', '1', '108', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('89', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '检查', '辅助检查项目', '1', '109', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('90', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '检查子项', '辅助检查子项目', '1', '110', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('91', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '辅助检查描述', '辅助检查描述', '1', '111', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('92', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '辅助检查结果', '辅助检查结果', '1', '112', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('93', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '输血类型', '输血类型', '1', '113', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('94', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '麻醉', '麻醉', '1', '114', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('95', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '科室', '科室', '1', '115', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('96', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '性别', '性别', '1', '116', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('97', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '人群', '人群', '1', '117', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('98', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '食物', '食物', '1', '118', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('99', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '其他过敏原', '其他过敏原', '1', '119', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('100', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '医疗器械及物品', '医疗器械及物品', '1', '120', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('101', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '给药途径', '给药途径', '1', '121', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('102', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '部位', '部位', '1', '122', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('103', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '护理', '护理', '1', '123', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('104', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '量表', '量表', '1', '124', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('105', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '单位', '单位', '1', '125', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('106', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', 'ICD10疾病类别', 'ICD10疾病类别', '1', '300', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('107', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品化学物质类别', '药品化学物质类别', '1', '301', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('108', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品治疗学类别', '药品治疗学类别', '1', '302', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('109', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品药理学类别', '药品药理学类别', '1', '303', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('110', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品解剖学类别', '药品解剖学类别', '1', '304', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('111', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '症状类别', '症状类别', '1', '305', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('112', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '手术和操作类别', '手术和操作类别', '1', '306', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('113', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', 'ICD10疾病类别根节点', 'ICD10疾病类别根节点', '1', '400', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('114', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '科室疾病类别根节点', '科室疾病类别根节点', '1', '401', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('115', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品化学物质类别根节点', '药品化学物质类别根节点', '1', '402', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('116', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品治疗学类别根节点', '药品治疗学类别根节点', '1', '403', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('117', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品药理学类别根节点', '药品药理学类别根节点', '1', '404', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('118', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '药品解剖学类别根节点', '药品解剖学类别根节点', '1', '405', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('119', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '症状类别根节点', '症状类别根节点', '1', '406', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('120', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '手术和操作类别根节点', '手术和操作类别根节点', '1', '407', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('121', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '实验室检查类别根节点', '实验室检查类别根节点', '1', '408', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('122', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '辅助检查类别根节点', '辅助检查类别根节点', '1', '409', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('123', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '年龄', '年龄', '1', '410', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('124', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '20', '危急值-实验室检查子项目', '3-108-2', '1', '0', '化验规则维护特殊处理');
+INSERT INTO `kl_dictionary_info` VALUES ('125', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '20', '其他值提醒-实验室检查子项目', '4-108-2', '1', '0', '化验规则维护特殊处理');
+INSERT INTO `kl_dictionary_info` VALUES ('126', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '20', '其他值提醒输血-实验室检查子项目', '5-108-2', '1', '0', '化验规则维护特殊处理');
+INSERT INTO `kl_dictionary_info` VALUES ('127', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '高危-药品通用名', '2-101-1', '1', '0', '附加信息特殊处理(必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('128', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '其他值提醒-辅助检查结果', '4-112-1', '1', '0', '附加信息特殊处理(必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('129', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '其他值提醒输血-实验室检查子项目', '5-108-1', '1', '0', '附加信息特殊处理(必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('130', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '20', '正常项目重复开立-辅助检查项目', '6-109-6', '1', '0', '化验规则维护特殊处理');
+INSERT INTO `kl_dictionary_info` VALUES ('131', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '20', '正常项目重复开立-辅助检查子项目', '6-110-6', '1', '0', '化验规则维护特殊处理');
+INSERT INTO `kl_dictionary_info` VALUES ('132', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '31', '开单外等于术语本身', '1', '1', '0', '基础规则类型');
+INSERT INTO `kl_dictionary_info` VALUES ('133', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '31', '开单外存在比较', '2', '1', '0', '基础规则类型');
+INSERT INTO `kl_dictionary_info` VALUES ('134', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '31', '开单外不等于术语本身', '3', '1', '0', '基础规则类型');
+INSERT INTO `kl_dictionary_info` VALUES ('135', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '31', '过敏原', '4', '1', '0', '基础规则类型');
+INSERT INTO `kl_dictionary_info` VALUES ('136', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '31', '开单项', '5', '1', '0', '基础规则类型');
+INSERT INTO `kl_dictionary_info` VALUES ('137', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '31', '检查结果正则表达式', '6', '1', '0', '基础规则类型');
+INSERT INTO `kl_dictionary_info` VALUES ('138', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '22', '开单合理性-年龄-体格检查项目', '410,104', '1', '0', '开单合理性只有数字没有文本');
+INSERT INTO `kl_dictionary_info` VALUES ('139', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '23', '复杂情况下高风险手术-手术和操作', '2-106', '1', '0', '高危手术存在有无子条件特殊处理');
+INSERT INTO `kl_dictionary_info` VALUES ('140', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '24', '诊断依据存在比较-年龄-体格检查项目', '410,104', '1', '0', '诊断依据存在比较只有数字没有文本');
+INSERT INTO `kl_dictionary_info` VALUES ('141', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '25', '诊断依据存在比较-实验室检查子项目', '108', '1', '0', '诊断依据存在比较只有文本');
+INSERT INTO `kl_dictionary_info` VALUES ('143', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '护理', '9', '2', '90', '静态知识检索类型');
+INSERT INTO `kl_dictionary_info` VALUES ('144', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '7', '政策法规', '10', '2', '100', '静态知识检索类型');
+INSERT INTO `kl_dictionary_info` VALUES ('145', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '13', '政策法规', '政策法规', '1', '411', '页面显示词性');
+INSERT INTO `kl_dictionary_info` VALUES ('146', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '静态知识', '1', '1', '10', '静态知识类型');
+INSERT INTO `kl_dictionary_info` VALUES ('147', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '注意事项', '2', '1', '20', '静态知识类型');
+INSERT INTO `kl_dictionary_info` VALUES ('148', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '临床路径', '3', '1', '30', '静态知识类型');
+INSERT INTO `kl_dictionary_info` VALUES ('149', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '50', '一般治疗', '4', '1', '40', '静态知识类型');
+INSERT INTO `kl_dictionary_info` VALUES ('150', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '1', '1,3,4', '1', '0', '诊断关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('151', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '2', '1', '1', '0', '药品关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('152', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '3', '1,2', '1', '0', '检验套餐关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('153', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '4', '1,2', '1', '0', '检验细项关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('154', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '5', '1,2', '1', '0', '检查关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('155', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '6', '1,2', '1', '0', '检查子项关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('156', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '7', '1', '1', '0', '手术和操作关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('157', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '8', '1', '1', '0', '量表关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('158', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '9', '1', '1', '0', '护理关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('159', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '10', '1', '1', '0', '法律法规关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('160', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '51', '999', '1,2,3,4', '1', '0', '其他关联的静态信息类型');
+INSERT INTO `kl_dictionary_info` VALUES ('161', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '40', '单次', '^(24小时维持|一次|1次|空)$|ALWAYS|BID|ONCE|每日', '1', '0', '开单频次');
+INSERT INTO `kl_dictionary_info` VALUES ('162', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '40', '持续', '每周|每月|每年|每半年|(一|二|三)月一次|qw|biw', '1', '0', '开单频次');
+INSERT INTO `kl_dictionary_info` VALUES ('163', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌人群', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('164', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌性别', '[匹配内容]性患者,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('165', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌疾病', '[匹配内容]患者,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('166', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌医疗器械及物品', '该患者具有[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('167', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌服用药品', '该患者可能正在用药[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('168', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌临床表现', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('169', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌检查结果', '该患者检查提示[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('170', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌查体结果', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('171', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌手术', '该患者有[匹配内容]史,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('172', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌年龄', '该患者年龄[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('173', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌检验结果', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('174', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌过敏药品', '该患者[匹配内容]过敏,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('175', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '药品_禁忌其他过敏原', '该患者[匹配内容]过敏,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('176', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌人群', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('177', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌性别', '[匹配内容]性患者,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('178', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌疾病', '[匹配内容]患者,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('180', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌医疗器械及物品', '该患者具有[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('181', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌服用药品', '该患者可能正在用药[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('182', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌临床表现', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('183', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌检查结果', '该患者检查提示[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('184', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌查体结果', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('185', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌手术', '该患者有[匹配内容]史,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('186', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌年龄', '该患者年龄[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('187', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌检验结果', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('188', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌过敏药品', '该患者[匹配内容]过敏,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('189', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_禁忌其他过敏原', '该患者[匹配内容]过敏,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('190', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_开单项互斥', '该患者已开[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('191', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌人群', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('192', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌性别', '[匹配内容]性患者,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('193', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌疾病', '[匹配内容]患者,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('194', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌医疗器械及物品', '该患者具有[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('195', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌服用药品', '该患者可能正在用药[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('196', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌临床表现', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('197', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌检查结果', '该患者检查提示[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('198', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌查体结果', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('199', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌手术', '该患者有[匹配内容]史,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('200', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌年龄', '该患者年龄[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('201', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌检验结果', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('202', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌过敏药品', '该患者[匹配内容]过敏,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('203', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_禁忌其他过敏原', '该患者[匹配内容]过敏,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('204', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_开单项互斥', '该患者已开[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('205', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌人群', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('206', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌性别', '[匹配内容]性患者,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('207', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌疾病', '[匹配内容]患者,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('208', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌医疗器械及物品', '该患者具有[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('209', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌服用药品', '该患者可能正在用药[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('210', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌临床表现', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('211', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌检查结果', '该患者检查提示[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('212', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌查体结果', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('213', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌手术', '该患者有[匹配内容]史,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('214', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌年龄', '该患者年龄[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('215', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌检验结果', '该患者[匹配内容],不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('216', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌过敏药品', '该患者[匹配内容]过敏,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('217', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '手术_禁忌其他过敏原', '该患者[匹配内容]过敏,不宜开[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('218', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌人群', '该患者[匹配内容],谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('219', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌性别', '[匹配内容]性患者,谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('220', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌疾病', '[匹配内容]患者,谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('221', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌医疗器械及物品', '该患者具有[匹配内容],谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('222', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌服用药品', '该患者可能正在用药[匹配内容],谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('223', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌临床表现', '该患者[匹配内容],谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('224', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌检查结果', '该患者检查提示[匹配内容],谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('225', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌查体结果', '该患者[匹配内容],谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('226', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌手术', '该患者有[匹配内容]史,谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('227', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌年龄', '该患者年龄[匹配内容],谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('228', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌检验结果', '该患者[匹配内容],谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('229', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌过敏药品', '该患者[匹配内容]过敏,谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('230', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '输血_禁忌其他过敏原', '该患者[匹配内容]过敏,谨慎输注[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('231', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_正常项目重复开立', '该患者近期做过[开单名称],检查结果[匹配内容],请谨慎开立[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('232', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_正常项目重复开立', '该患者近期做过[匹配内容],请谨慎开立[开单名称][原因及建议]', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('233', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '化验_24小时重复开立', '[开单名称]重复开立', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('234', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '41', '辅检_24小时重复开立', '[开单名称]重复开立', '1', '0', '提示语');
+INSERT INTO `kl_dictionary_info` VALUES ('235', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '开单合理性-药品通用名', '1-101-0', '1', '0', '附加信息特殊处理(非必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('236', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '开单合理性-实验室检查套餐', '1-107-0', '1', '0', '附加信息特殊处理(非必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('237', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '开单合理性-辅助检查项目', '1-109-0', '1', '0', '附加信息特殊处理(非必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('238', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '开单合理性-辅助检查子项目', '1-110-0', '1', '0', '附加信息特殊处理(非必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('239', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '开单合理性-手术和操作', '1-106-0', '1', '0', '附加信息特殊处理(非必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('240', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '开单合理性-输血类型', '1-113-0', '1', '0', '附加信息特殊处理(非必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('241', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '正常项目重复开立-辅助检查项目', '6-109-0', '1', '0', '附加信息特殊处理(非必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('242', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '正常项目重复开立-辅助检查子项目', '6-110-0', '1', '0', '附加信息特殊处理(非必填)');
+INSERT INTO `kl_dictionary_info` VALUES ('243', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '21', '正常项目重复开立-实验室检查套餐', '6-107-0', '1', '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 ('62', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '6', '6', '实验室检查套餐', null, '1', '107', '3', '');
+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', 'Y', '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, '107', 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', 'Y', '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', 'Y', '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', 'Y', '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', 'Y', '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', '802', '体格检查结果', null, null, '105', 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', '802', '疾病', null, null, '100', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('814', '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 ('815', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '803', '实验室检查子项目', null, null, '108', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('816', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '4', '803', '体格检查项目', null, null, '104', null, '');
+INSERT INTO `kl_rule_plan` VALUES ('817', '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', '62', '开单外存在比较', '2', null, '', '3', '');
+INSERT INTO `kl_rule_plan` VALUES ('1003', '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 ('1004', '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 ('1005', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'rule', '6', '1002', '实验室检查子项目', null, null, '108', null, '');
+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, '');
+
+
+
+UPDATE `med_2021`.`kl_dictionary_info` SET `id`='177', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `group_type`='41', `name`='化验_禁忌性别', `val`='[匹配内容]性患者,不宜开[开单名称],[开单名称]为针对[性别取反]性患者的检验项目', `return_type`='1', `order_no`='0', `remark`='提示语' WHERE (`id`='177');
+
+UPDATE `med_2021`.`kl_dictionary_info` SET `id`='192', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `group_type`='41', `name`='辅检_禁忌性别', `val`='[匹配内容]性患者,不宜开[开单名称],[开单名称]为针对[性别取反]性患者的检查项目', `return_type`='1', `order_no`='0', `remark`='提示语' WHERE (`id`='192');

+ 81 - 0
doc/014.20210727提示规则新需求/temp.sql

@@ -0,0 +1,81 @@
+USE `med_2021`;
+-- 临时表
+DROP TABLE IF EXISTS `temp_msg`;
+CREATE TABLE `temp_msg` (
+  `cond_id` bigint(20) DEFAULT NULL COMMENT 'con_id',
+  `msg` varchar(255) DEFAULT NULL COMMENT '提示语',
+   KEY (`cond_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
+
+-- 更新提示语:原因及建议
+update kl_rule_condition a, temp_msg b set a.msg = b.msg where a.id = b.cond_id;
+
+-- 查询已有的开单条目
+SELECT
+	tt1.cond_id,
+	tt1.par_name,
+	tt1.par_type,
+	tt2.lib_name base_name,
+	xx2. NAME base_type,
+	CASE tt1.type
+WHEN '4' THEN
+	'过敏原'
+WHEN '5' THEN
+	'辅检开单互斥'
+ELSE
+	''
+END other_type,
+ tt1.max_value,
+ tt1.max_operator,
+ tt1.min_value,
+ tt1.min_operator,
+ tt1.cond_msg
+FROM
+	(
+		SELECT
+			c1.lib_name par_name,
+			c1.id par_id,
+			x1.`name` par_type,
+			t1.id rule_id,
+			t1.description,
+			t1.rule_type,
+			t1.has_sub_cond,
+			t1.msg,
+			t3.type,
+			t3.concept_id base_id,
+			t3.eq_value,
+			t3.min_value,
+			t3.min_operator,
+			t3.min_unit,
+			t3.max_value,
+			t3.max_operator,
+			t3.max_unit,
+			t2.id cond_id,
+			t2.msg cond_msg
+		FROM
+			kl_concept c1,
+			kl_lexicon x1,
+			kl_rule t1,
+			kl_rule_condition t2,
+			kl_rule_base t3
+		WHERE
+			c1.is_deleted = 'N'
+		AND t1.is_deleted = 'N'
+		AND t2.is_deleted = 'N'
+		AND t3.is_deleted = 'N'
+		AND c1.`status` = 1
+		AND t1.`status` = 1
+		AND c1.id = t1.concept_id
+		AND t1.id = t2.rule_id
+		AND t2.rule_base_id = t3.id
+		AND t1.rule_type = 1
+		AND x1.`code` = c1.lib_type
+	) tt1
+LEFT JOIN kl_concept tt2 ON tt2.is_deleted = 'N'
+AND tt2.`status` = 1
+AND tt1.base_id = tt2.id
+LEFT JOIN kl_lexicon xx2 ON tt2.lib_type = xx2. CODE
+ORDER BY
+	rule_id;
+
+

+ 110 - 0
src/main/java/com/diagbot/aggregate/RuleAggregate.java

@@ -0,0 +1,110 @@
+package com.diagbot.aggregate;
+
+import com.diagbot.dto.RuleBaseDTO;
+import com.diagbot.dto.RuleBaseInitDTO;
+import com.diagbot.dto.RuleConditionDTO;
+import com.diagbot.dto.RuleConditionInitDTO;
+import com.diagbot.dto.RuleDTO;
+import com.diagbot.dto.RuleInitDTO;
+import com.diagbot.enums.RedisEnum;
+import com.diagbot.facade.KlRuleFacade;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import io.github.lvyahui8.spring.annotation.DataConsumer;
+import io.github.lvyahui8.spring.annotation.DataProvider;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.MapUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/5/31 17:14
+ */
+@Component
+@Slf4j
+public class RuleAggregate {
+    @Autowired
+    private KlRuleFacade klRuleFacade;
+
+    @DataProvider("getAllRules")
+    public Map<String, RuleDTO> getAllRules(
+            @DataConsumer("getRuleInit") Map<String, List<RuleInitDTO>> ruleInits,
+            @DataConsumer("getRuleConditionInit") Map<Integer, Map<String, List<RuleConditionInitDTO>>> ruleConditionInits,
+            @DataConsumer("getRuleBaseInit") Map<Integer, RuleBaseInitDTO> ruleBaseInits) {
+        Map<String, RuleDTO> res = new HashMap();
+        //结果判空第一层规则类型
+        if (MapUtils.isNotEmpty(ruleInits)) {
+            for (String ruleKey : ruleInits.keySet()) {
+                RuleInitDTO ruleInitZeroDTO = ruleInits.get(ruleKey).get(0);
+                RuleDTO ruleDTO = new RuleDTO();
+                ruleDTO.setLibName(ruleInitZeroDTO.getLibName());
+                ruleDTO.setLibType(ruleInitZeroDTO.getLibType());
+                ruleDTO.setRuleType(ruleInitZeroDTO.getRuleType());
+                for (RuleInitDTO ruleInitDTO : ruleInits.get(ruleKey)) {
+                    if (ruleInitDTO.getHasSubCond().equals(1)) {
+                        Map<String, List<RuleConditionInitDTO>> map = ruleConditionInits.get(ruleInitDTO.getRuleId());
+                        //结果判空第二层条件组别
+                        if (MapUtils.isNotEmpty(map)) {
+                            for (String key : map.keySet()) {
+                                RuleConditionDTO ruleConditionDTO = new RuleConditionDTO();
+                                ruleConditionDTO.setHasSubCond(ruleInitDTO.getHasSubCond());
+                                ruleConditionDTO.setRuleGroup(key);
+                                //结果判空第三层条件明细
+                                if (ListUtil.isNotEmpty(map.get(key))) {
+                                    for (RuleConditionInitDTO ruleConditionInitDTO : map.get(key)) {
+                                        ruleConditionDTO.setMsg(ruleConditionInitDTO.getMsg());
+                                        RuleBaseDTO ruleBaseDTO = new RuleBaseDTO();
+                                        BeanUtil.copyProperties(ruleBaseInits.get(ruleConditionInitDTO.getRuleBaseId()), ruleBaseDTO);
+                                        ruleConditionDTO.getRuleBaseDTOList().add(ruleBaseDTO);
+                                    }
+                                }
+                                ruleDTO.getRuleConditionDTOList().add(ruleConditionDTO);
+                            }
+                        }
+                    } else {
+                        RuleConditionDTO ruleConditionDTO = new RuleConditionDTO();
+                        ruleConditionDTO.setHasSubCond(ruleInitDTO.getHasSubCond());
+                        ruleConditionDTO.setMsg(ruleInitDTO.getMsg());
+                        //无条件
+                        ruleConditionDTO.setRuleGroup(ruleInitDTO.getRuleId() + "-1");
+                        ruleConditionDTO.getRuleBaseDTOList().add(new RuleBaseDTO());
+                        ruleDTO.getRuleConditionDTOList().add(ruleConditionDTO);
+                    }
+                }
+                res.put(RedisEnum.allRule.getName() + ruleDTO.getLibType() + "_" + ruleDTO.getLibName() + "_" + ruleDTO.getRuleType(), ruleDTO);
+            }
+        }
+        return res;
+    }
+
+    @DataProvider("getRuleInit")
+    public Map<String, List<RuleInitDTO>> getRuleInit() {
+        List<RuleInitDTO> list = klRuleFacade.getRuleInitDTO();
+        return EntityUtil.makeEntityListMap(list, "conceptGroup");
+    }
+
+    @DataProvider("getRuleConditionInit")
+    public Map<Integer, Map<String, List<RuleConditionInitDTO>>> getRuleConditionInit() {
+        List<RuleConditionInitDTO> list = klRuleFacade.getRuleConditionInitDTO();
+        Map<Integer, List<RuleConditionInitDTO>> map = EntityUtil.makeEntityListMap(list, "ruleId");
+        Map<Integer, Map<String, List<RuleConditionInitDTO>>> res = new HashMap<>();
+        for (Integer key : map.keySet()) {
+            res.put(key, EntityUtil.makeEntityListMap(map.get(key), "ruleGroup"));
+        }
+        return res;
+    }
+
+
+    @DataProvider("getRuleBaseInit")
+    public Map<Integer, RuleBaseInitDTO> getRuleBaseInit() {
+        List<RuleBaseInitDTO> list = klRuleFacade.getRuleBaseInitDTO();
+        return EntityUtil.makeEntityMap(list, "ruleBaseId");
+    }
+}

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

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

+ 1 - 0
src/main/java/com/diagbot/dto/AnesthesiaInfoDTO.java

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class AnesthesiaInfoDTO {
+    private Long id;
     /**
      * 麻醉名称
      */

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

+ 1 - 0
src/main/java/com/diagbot/dto/DiseaseInfoDTO.java

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class DiseaseInfoDTO {
+    private Long id;
     /**
      * 疾病名称
      */

+ 1 - 0
src/main/java/com/diagbot/dto/DrugInfoDTO.java

@@ -13,6 +13,7 @@ import java.util.List;
 @Getter
 @Setter
 public class DrugInfoDTO {
+    private Long id;
     /**
      * 药品名称
      */

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

@@ -38,5 +38,7 @@ public class ExportDiagnoseDTO implements Serializable {
     private String minSymbol;
     @Excel(name="关联词", width = 30, orderNum = "35")
     private String relation;
+    @Excel(name="校验", width = 50, orderNum = "33")
+    private String check;
 
 }

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

@@ -14,4 +14,6 @@ public class IndexBatchDTO {
     private Long id;
     private String name;
     private String code;
+    private String synonyms;
+    private Integer type;
 }

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

@@ -0,0 +1,42 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: 开单导出
+ * @author: zhoutg
+ * @date: 2021/8/2 13:40
+ */
+@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 = 15, orderNum = "40")
+    private String tabooType;
+    @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;
+    @Excel(name="原因及建议", width = 15, orderNum = "90")
+    private String msg;
+    @Excel(name="ruleId", width = 10, orderNum = "100")
+    private Long ruleId;
+    @Excel(name="condId", width = 10, orderNum = "110")
+    private Long condId;
+}

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

+ 1 - 0
src/main/java/com/diagbot/dto/KlRuleByIdDTO.java

@@ -39,4 +39,5 @@ public class KlRuleByIdDTO {
     private String subEqOperator;//等于域比较符
     private String subEqValue;//等于域值
     private String subEqUnit;//等于域单位
+    private String subMsg;//附加信息
 }

+ 1 - 0
src/main/java/com/diagbot/dto/KlRuleByIdSubDTO.java

@@ -28,4 +28,5 @@ public class KlRuleByIdSubDTO {
     private String subEqOperator;//等于域比较符
     private String subEqValue;//等于域值
     private String subEqUnit;//等于域单位
+    private String subMsg;//附加信息
 }

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

+ 1 - 0
src/main/java/com/diagbot/dto/LisDetailDTO.java

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class LisDetailDTO {
+    private Long id;
     /**
      * 大项(套餐)
      */

+ 1 - 0
src/main/java/com/diagbot/dto/NurseInfoDTO.java

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class NurseInfoDTO {
+    private Long id;
     /**
      * 护理名称
      */

+ 3 - 0
src/main/java/com/diagbot/dto/OperationInfoDTO.java

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class OperationInfoDTO {
+    private Long id;
     /**
      * 手术或操作名称
      */
@@ -19,4 +20,6 @@ public class OperationInfoDTO {
      * 类型:手术、操作
      */
     private String type;
+
+    private String code;
 }

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

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

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-06-10 14:46
+ */
+@Setter
+@Getter
+public class RetrievalConceptDTO {
+    private Long id;
+    private String name;
+    private String code;
+}

+ 45 - 40
src/main/java/com/diagbot/dto/RetrievalDTO.java

@@ -14,64 +14,69 @@ import java.util.List;
 @Setter
 public class RetrievalDTO {
     /**
-     * 化验大项
+     * 化验大项 辅检 诊断 药品 手术或操作 科室 输血 症状 体征 量表 护理 中医诊断 中医证候 麻醉 药品剂型
      */
-    private List<String> lisNames;
+    private List<RetrievalConceptDTO> nameList;
     /**
      * 化验小项
      */
     private List<LisDetailDTO> lisDetailNames;
     /**
      * 辅检
-     */
-    private List<String> pacsNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> pacsNames;
+    *//**
      * 诊断
-     */
-    private List<DiseaseInfoDTO> diseaseNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> diseaseNames;
+    *//**
      * 药品
-     */
-    private List<DrugInfoDTO> drugNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> drugNames;
+    *//**
      * 手术或操作
-     */
-    private List<OperationInfoDTO> operationNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> operationNames;
+    *//**
      * 科室
-     */
-    private List<String> deptNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> deptNames;
+    *//**
      * 输血
-     */
-    private List<String> transfusionNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> transfusionNames;
+    *//**
      * 症状
-     */
-    private List<String> symptomNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> symptomNames;
+    *//**
      * 体征
-     */
-    private List<String> vitalNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> vitalNames;
+    *//**
      * 量表
-     */
-    private List<ScaleInfoDTO> scalenames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> scalenames;
+    *//**
      * 护理
-     */
-    private List<NurseInfoDTO> nursenames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> nursenames;
+    *//**
      * 中医诊断
-     */
-    private List<TcmdiseaseInfoDTO> tcmdiseaseNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> tcmdiseaseNames;
+    *//**
      * 中医证候
-     */
-    private List<TcmsyndromeInfoDTO> tcmsyndromeNames;
-    /**
+     *//*
+    private List<RetrievalConceptDTO> tcmsyndromeNames;
+    *//**
      * 麻醉
-     */
-    private List<AnesthesiaInfoDTO> anesthesiaInfonames;
+     *//*
+    private List<RetrievalConceptDTO> anesthesiaInfonames;
+
+    *//**
+     * 药品剂型
+     *//*
+    private List<RetrievalConceptDTO> drugDosage;*/
 
 }

+ 12 - 12
src/main/java/com/diagbot/dto/RuleBaseDTO.java

@@ -11,16 +11,16 @@ import lombok.Setter;
 @Getter
 @Setter
 public class RuleBaseDTO {
-    private String baseLibName;
-    private Integer baseLibType;
-    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;
+    private String baseLibName = "";
+    private Integer baseLibType = 0;
+    private Integer baseType = 0;
+    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 = "";
 }

+ 15 - 0
src/main/java/com/diagbot/dto/RuleBaseInitDTO.java

@@ -0,0 +1,15 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/3 16:25
+ */
+@Getter
+@Setter
+public class RuleBaseInitDTO extends RuleBaseDTO {
+    private Integer ruleBaseId;
+}

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

@@ -0,0 +1,18 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/3 16:32
+ */
+@Getter
+@Setter
+public class RuleConditionInitDTO {
+    private Integer ruleId;
+    private String ruleGroup;
+    private Integer ruleBaseId;
+    private String msg;
+}

+ 25 - 0
src/main/java/com/diagbot/dto/RuleInitDTO.java

@@ -0,0 +1,25 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2021/2/3 16:34
+ */
+@Getter
+@Setter
+public class RuleInitDTO {
+    private String conceptGroup;
+    private Integer conceptId;
+    private Integer ruleId;
+    private String libName;
+    private Integer libType;
+    private Integer ruleType;
+    private String msg;
+    private Integer hasSubCond;
+}

+ 4 - 0
src/main/java/com/diagbot/dto/RuleSimpleDTO.java

@@ -23,4 +23,8 @@ public class RuleSimpleDTO {
     private String form;
     // 提示语
     private String msg;
+    // 界面匹配内容
+    private String content;
+    // 禁忌类型
+    private String conType;
 }

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

+ 1 - 0
src/main/java/com/diagbot/dto/ScaleInfoDTO.java

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class ScaleInfoDTO {
+    private Long id;
     /**
      * 量表名称
      */

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

+ 1 - 0
src/main/java/com/diagbot/dto/TcmdiseaseInfoDTO.java

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class TcmdiseaseInfoDTO {
+    private Long id;
     /**
      * 疾病名称
      */

+ 1 - 0
src/main/java/com/diagbot/dto/TcmsyndromeInfoDTO.java

@@ -11,6 +11,7 @@ import lombok.Setter;
 @Getter
 @Setter
 public class TcmsyndromeInfoDTO {
+    private Long id;
     /**
      * 疾病名称
      */

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

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-06-10 19:51
+ */
+@Setter
+@Getter
+public class TermConceptDTO {
+    private Long id;
+    private String name;
+    private String code;
+    //数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+    private Integer source;
+}

+ 7 - 1
src/main/java/com/diagbot/dto/WordCrfDTO.java

@@ -36,7 +36,7 @@ public class WordCrfDTO {
     private Double ageNum;
     // 性别(1:男,2:女)
     private Integer sex;
-    //科室
+    // 科室
     private List<Item> dept = new ArrayList<>();
     // 化验项目和结果
     private List<Lis> lis = new ArrayList<>();
@@ -88,6 +88,8 @@ public class WordCrfDTO {
     private List<Item> operationOrder = new ArrayList<>();
     // 当前输血开单项
     private List<ItemExt> transfusionOrder = new ArrayList<>();
+    // 输血记录
+    private List<ItemExt> transfusion = new ArrayList<>();
     /*******************************************入参数据拷贝结束******************************/
     // 化验
     // private LisLabel lisLabel;
@@ -108,6 +110,10 @@ public class WordCrfDTO {
     private String marital = "";
     // 家族史
     private String family = "";
+    // 查体
+    private String vital = "";
+    // 婚姻
+    private String marriage = "";
 
     // 【诊断数据来源】
     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;
+}

+ 158 - 0
src/main/java/com/diagbot/entity/KlOperation.java

@@ -0,0 +1,158 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 手术扩展表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-06-15
+ */
+public class KlOperation 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;
+
+    /**
+     * 手术级别(0,1,2,3,4)
+     */
+    private Integer operationLevel;
+
+    /**
+     * 手术操作码
+     */
+    private String operationCode;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public Long getConceptId() {
+        return conceptId;
+    }
+
+    public void setConceptId(Long conceptId) {
+        this.conceptId = conceptId;
+    }
+    public Integer getOperationLevel() {
+        return operationLevel;
+    }
+
+    public void setOperationLevel(Integer operationLevel) {
+        this.operationLevel = operationLevel;
+    }
+    public String getOperationCode() {
+        return operationCode;
+    }
+
+    public void setOperationCode(String operationCode) {
+        this.operationCode = operationCode;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "KlOperation{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", conceptId=" + conceptId +
+            ", operationLevel=" + operationLevel +
+            ", operationCode=" + operationCode +
+            ", remark=" + remark +
+        "}";
+    }
+}

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

@@ -0,0 +1,78 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 通用规则表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-06-15
+ */
+@Data
+public class KlRegulation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 规则名称
+     */
+    private String name;
+
+    /**
+     * 规则编码
+     */
+    private Long code;
+
+    /**
+     * 规则类型:(1:量表)
+     */
+    private Integer type;
+
+    /**
+     * 启用状态(0:禁用,1:启用)
+     */
+    private Integer status;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

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

+ 18 - 4
src/main/java/com/diagbot/entity/KlRuleCondition.java

@@ -11,8 +11,8 @@ import java.util.Date;
  * 规则条件表
  * </p>
  *
- * @author gaodm
- * @since 2021-01-21
+ * @author zhoutg
+ * @since 2021-07-27
  */
 public class KlRuleCondition implements Serializable {
 
@@ -50,7 +50,7 @@ public class KlRuleCondition implements Serializable {
     private String modifier;
 
     /**
-     * 提示概念id
+     * 规则主表id
      */
     private Long ruleId;
 
@@ -60,10 +60,15 @@ public class KlRuleCondition implements Serializable {
     private Integer groupType;
 
     /**
-     * 提示概念id
+     * 基础规则id
      */
     private Long ruleBaseId;
 
+    /**
+     * 附加信息
+     */
+    private String msg;
+
     public Long getId() {
         return id;
     }
@@ -136,6 +141,14 @@ public class KlRuleCondition implements Serializable {
         this.ruleBaseId = ruleBaseId;
     }
 
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
     @Override
     public String toString() {
         return "KlRuleCondition{" +
@@ -148,6 +161,7 @@ public class KlRuleCondition implements Serializable {
                 ", ruleId=" + ruleId +
                 ", groupType=" + groupType +
                 ", ruleBaseId=" + ruleBaseId +
+                ", msg=" + msg +
                 "}";
     }
 }

+ 296 - 0
src/main/java/com/diagbot/entity/MappingConfig.java

@@ -0,0 +1,296 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.diagbot.util.StringUtil;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 医学术语映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-06-09
+ */
+@TableName("tran_mapping_config")
+public class MappingConfig 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 hospitalId;
+
+    /**
+     * 医学术语类型( 1-检验套餐、2-检验细项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医疾病、13-中医证候、14-麻醉)
+     */
+    private Integer type;
+
+    /**
+     * 医院术语名称
+     */
+    private String hisName;
+
+    /**
+     * 医院术语编码
+     */
+    private String hisCode;
+
+    /**
+     * 医院术语细项名称(检验细项)
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private String hisDetailName;
+
+    /**
+     * 医学标准术语id
+     */
+    private Long conceptId;
+
+    /**
+     * 药品剂型id
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private Long formConceptId;
+
+    /**
+     * 是否匹配(0-未匹配、1-已匹配)
+     */
+    private Integer isMatch;
+
+    /**
+     * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
+     */
+    private Integer source;
+
+    /**
+     * 备注
+     */
+    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 getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getHisCode() {
+        return hisCode;
+    }
+
+    public void setHisCode(String hisCode) {
+        this.hisCode = hisCode;
+    }
+
+    public String getHisDetailName() {
+        return hisDetailName;
+    }
+
+    public void setHisDetailName(String hisDetailName) {
+        this.hisDetailName = hisDetailName;
+    }
+
+    public Long getConceptId() {
+        return conceptId;
+    }
+
+    public void setConceptId(Long conceptId) {
+        this.conceptId = conceptId;
+    }
+
+    public Long getFormConceptId() {
+        return formConceptId;
+    }
+
+    public void setFormConceptId(Long formConceptId) {
+        this.formConceptId = formConceptId;
+    }
+
+    public Integer getIsMatch() {
+        return isMatch;
+    }
+
+    public void setIsMatch(Integer isMatch) {
+        this.isMatch = isMatch;
+    }
+
+    public Integer getSource() {
+        return source;
+    }
+
+    public void setSource(Integer source) {
+        this.source = source;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "MappingConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", type=" + type +
+                ", hisName=" + hisName +
+                ", hisCode=" + hisCode +
+                ", hisDetailName=" + hisDetailName +
+                ", conceptId=" + conceptId +
+                ", formConceptId=" + formConceptId +
+                ", isMatch=" + isMatch +
+                ", source=" + source +
+                ", remark=" + remark +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        MappingConfig mappingConfig = (MappingConfig) o;
+        return Objects.equals(id, mappingConfig.id)
+                && Objects.equals(isDeleted, mappingConfig.isDeleted)
+                && Objects.equals(hospitalId, mappingConfig.hospitalId)
+                && Objects.equals(type, mappingConfig.type)
+                && Objects.equals(hisName, mappingConfig.hisName)
+                && Objects.equals(hisCode, mappingConfig.hisCode)
+                && Objects.equals(hisDetailName, mappingConfig.hisDetailName)
+                && Objects.equals(conceptId, mappingConfig.conceptId)
+                && Objects.equals(formConceptId, mappingConfig.formConceptId)
+                && Objects.equals(isMatch, mappingConfig.isMatch)
+                //&& Objects.equals(source, mappingConfig.source)
+                ;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, type, hisName, hisCode, hisDetailName, conceptId, formConceptId, isMatch);
+    }
+
+    public static boolean nonNull(MappingConfig o) {
+        return !(o == null
+                || (o.hospitalId == null
+                && o.type == null
+                && StringUtil.isBlank(o.hisName)
+                && StringUtil.isBlank(o.hisCode)
+                && StringUtil.isBlank(o.hisDetailName)
+                && o.conceptId == null
+                && o.formConceptId == null
+                && o.isMatch == null
+                && o.source == null));
+    }
+}

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

+ 49 - 0
src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java

@@ -0,0 +1,49 @@
+package com.diagbot.entity.wrapper;
+
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.util.StringUtil;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Objects;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/10 19:27
+ */
+@Getter
+@Setter
+public class MappingConfigWrapper extends MappingConfig {
+    private String uniqueName;
+    private String form;
+    private String code;
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        MappingConfigWrapper mappingConfigWrapper = (MappingConfigWrapper) o;
+        return super.equals(o)
+                && Objects.equals(uniqueName, mappingConfigWrapper.uniqueName)
+                && Objects.equals(form, mappingConfigWrapper.form)
+                && Objects.equals(code, mappingConfigWrapper.code);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(uniqueName, form, code) + super.hashCode();
+    }
+
+    public static boolean nonNull(MappingConfigWrapper o) {
+        return !(o == null
+                || (StringUtil.isBlank(o.uniqueName)
+                && StringUtil.isBlank(o.form)
+                && StringUtil.isBlank(o.code)))
+                || MappingConfig.nonNull(o);
+    }
+}

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

+ 6 - 6
src/main/java/com/diagbot/enums/ConEnum.java

@@ -17,14 +17,14 @@ public enum ConEnum implements KeyedNamed {
     oralmeds(4, "禁忌服用药品"),
     allergicmeds(5, "禁忌过敏药品"),
     operations(6, "禁忌手术"),
-    procedures(7, "禁忌操作"),
-    lis(8, "禁忌实验室检查"),
-    pacs(9, "禁忌辅助检查"),
+    procedures(7, "禁忌操作"), // 未使用
+    lis(8, "禁忌检验结果"),
+    pacs(9, "禁忌检查项目"), // 未使用
     disease(10, "禁忌疾病"),
     group(11, "禁忌人群"),
-    conflictmeds(12, "配伍禁忌"),
-    vitals(13, "禁忌查体"),
-    pacsDesc(14, "禁忌辅助检查描述"),
+    conflictmeds(12, "配伍禁忌"), // 未使用
+    vitals(13, "禁忌查体结果"),
+    pacsDesc(14, "禁忌检查结果"),
     medEqu(15, "禁忌医疗器械及物品"),
     exclusion(16, "开单项互斥"),
     otherAllergy(17, "禁忌其他过敏原"),

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

@@ -0,0 +1,78 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/9/10 15:51
+ */
+public enum ConceptTypeEnum implements KeyedNamed {
+
+    LisPack(1, "检验套餐"),
+    Lis(2, "检验细项"),
+    Pacs(3, "检查"),
+    Disease(4, "诊断"),
+    Drug(5, "药品"),
+    Operation(6, "手术和操作"),
+    Dept(7, "科室"),
+    Transfusion(8, "输血"),
+    Symptom(9,"症状"),
+    //PacsSubName(9, "检查子项"),
+    Scale(10, "量表"),
+    Nurse(11, "护理"),
+    Tcmdisease(12,"中医疾病"),
+    Tcmsyndrome(13,"中医证候"),
+    Anesthesia(14, "麻醉"),
+    Form(15, "药品剂型");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    ConceptTypeEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static ConceptTypeEnum getEnum(int key) {
+        for (ConceptTypeEnum item : ConceptTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static ConceptTypeEnum getEnum(String name) {
+        for (ConceptTypeEnum item : ConceptTypeEnum.values()) {
+            if (item.name.equals(name)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        ConceptTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    public static Integer getKey(String name) {
+        ConceptTypeEnum item = getEnum(name);
+        return item != null ? item.key : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 13 - 4
src/main/java/com/diagbot/enums/DiagnoseLexiconTypeEnum.java

@@ -19,21 +19,21 @@ public enum DiagnoseLexiconTypeEnum implements KeyedNamed {
     Disease(100, "F"),
     zsxbszz(900, "G"),
     jwzz(901, "H"),
-    Age(410,"I"),
+    Age(410, "I"),
     Group(117, "J"),
     Ctzz(902, "K"),
     Fjjgzz(903, "L"),
     // 旧新诊断依据类型对应
     SymptomTpye(1, "A:症状"),
     VitalResultTpye(2, "B:体格检查结果"),
-//    VitalTpye(104, "C"),
+    //    VitalTpye(104, "C"),
     LisSubNameTpye(3, "D:实验室检查子项目"),
     PacsResultTpye(4, "L:辅检结果正则"),
     DiseaseTpye(5, "F:疾病"),
     DiseaseHisTpye(6, "F:疾病"),//病史
     ZsxbszzTpyeCause(7, "G:主诉现病史正则"),//诱因
     ZsxbszzTpyeBc(8, "G:主诉现病史正则"),//病程
-    jwzzTpye(9, "H:既往史正则"),
+    jwzzTpye(9, "H:既往史正则"),//其他
     QuezhenTpye(91, "确诊"),
     NizhenTpye(92, "拟诊"),
     JtTpye(93, "警惕");
@@ -59,12 +59,21 @@ public enum DiagnoseLexiconTypeEnum implements KeyedNamed {
     }
 
 
-
     public static String getName(int key) {
         DiagnoseLexiconTypeEnum item = getEnum(key);
         return item != null ? item.name : null;
     }
 
+    public static int getKey(String value) {
+        DiagnoseLexiconTypeEnum[] values = values();
+        for (DiagnoseLexiconTypeEnum d : values) {
+            if (d.name.equals(value)) {
+                return d.key;
+            }
+        }
+        return 1000;
+    }
+
 
     @Override
     public int getKey() {

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

@@ -58,7 +58,8 @@ public enum LexiconEnum implements KeyedNamed {
     OperationClassNode(407,"手术和操作类别根节点"),
     LisClassNode(408,"实验室检查类别根节点"),
     PacsClassNode(409,"辅助检查类别根节点"),
-    Age(410,"年龄");
+    Age(410,"年龄"),
+    Law(130,"政策法规");
 
 
     @Setter

+ 66 - 0
src/main/java/com/diagbot/enums/MatchSourceEnum.java

@@ -0,0 +1,66 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/15 13:20
+ */
+public enum MatchSourceEnum implements KeyedNamed {
+    StandWord(1, "标准词"),
+    SynonymsWord(2, "同义词"),
+    Code(3,"编码"),
+    History(4,"历史数据"),
+    SimilarWord(5,"相似词");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    MatchSourceEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static MatchSourceEnum getEnum(int key) {
+        for (MatchSourceEnum item : MatchSourceEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static MatchSourceEnum getEnum(String name) {
+        for (MatchSourceEnum item : MatchSourceEnum.values()) {
+            if (item.name.equals(name)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        MatchSourceEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    public static Integer getKey(String name) {
+        MatchSourceEnum item = getEnum(name);
+        return item != null ? item.key : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 5 - 2
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,12 +20,14 @@ 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");
+    deptPush(15, "deptPush"),
+    frequency(20, "frequency"),
+    msg(21, "msg");
 
     @Setter
     private int key;

+ 56 - 0
src/main/java/com/diagbot/enums/StandConvertCrfEnum.java

@@ -0,0 +1,56 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-06-11 9:28
+ */
+public enum StandConvertCrfEnum implements KeyedNamed {
+    // 类型,疾病: disease,症状: symptom,手术和操作:operation,药品: drug,实验室检查:lis,辅助检查:pacs, 查体:vital
+    disease(1, "disease"),
+    symptom(2, "symptom"),
+    operation(3, "operation"),
+    drug(4, "drug"),
+    lis(5, "lis"),
+    pacs(6, "pacs"),
+    vital(7, "vital");
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    StandConvertCrfEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static StandConvertCrfEnum getEnum(int key) {
+        for (StandConvertCrfEnum item : StandConvertCrfEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        StandConvertCrfEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+
+}

+ 9 - 0
src/main/java/com/diagbot/facade/BillFacade.java

@@ -108,6 +108,15 @@ public class BillFacade {
                 ruleVO.setLibTypeName(TypeEnum.lis.getName());
                 ruleVO.setDateValue(lis.getDateValue());
                 ruleVOList.add(ruleVO);
+
+                RuleVO ruleVO1 = new RuleVO();
+                ruleVO1.setInputName(lis.getName());
+                ruleVO1.setLibName(lis.getUniqueName());
+                ruleVO1.setLibType(LexiconEnum.LisName.getKey());
+                ruleVO1.setLibTypeName(TypeEnum.lis.getName());
+                ruleVO1.setSuffix(String.valueOf(RuleTypeEnum.repeat.getKey()));
+                ruleVO1.setDateValue(lis.getDateValue());
+                ruleVOList.add(ruleVO1);
             }
         }
 

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

@@ -2,6 +2,7 @@ package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.client.PushNewServiceClient;
+import com.diagbot.dto.DictionaryInfoDTO;
 import com.diagbot.dto.PushReloadDTO;
 import com.diagbot.entity.SysDeptPush;
 import com.diagbot.entity.TranHospitalInfo;
@@ -142,6 +143,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);
     }
@@ -188,4 +200,33 @@ public class CacheFacade {
                     deptPushList.stream().collect(Collectors.toMap(k -> k.getDeptName(), v -> v.getPush(), (v1, v2) -> (v2))));
         }
     }
+
+    /**
+     * 加载开单频次
+     */
+    public void loadFrequency() {
+        // 删除
+        redisUtil.delete(RedisEnum.frequency.getName());
+        // 加载
+        List<DictionaryInfoDTO> dictionaryInfoDTOList = klDictionaryInfoFacade.getListByGroupType(40);
+        redisUtil.set(RedisEnum.frequency.getName(), dictionaryInfoDTOList);
+    }
+
+    /**
+     * 加载提示语
+     */
+    public void loadMsg() {
+        // 删除
+        redisUtil.delete(RedisEnum.msg.getName());
+        // 加载
+        List<DictionaryInfoDTO> dictionaryInfoDTOList = klDictionaryInfoFacade.getListByGroupType(41);
+        if (ListUtil.isNotEmpty(dictionaryInfoDTOList)) {
+            // 提示语
+            Map<String, Object> msgMap = new LinkedMap<>();
+            for (DictionaryInfoDTO dic : dictionaryInfoDTOList) {
+                msgMap.put(dic.getName(), dic.getVal());
+            }
+            redisUtil.putHashMap(RedisEnum.msg.getName(), msgMap);
+        }
+    }
 }

+ 194 - 104
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -4,62 +4,33 @@ import com.diagbot.biz.push.entity.Item;
 import com.diagbot.biz.push.entity.Lis;
 import com.diagbot.client.CRFServiceClient;
 import com.diagbot.client.StandConvertServiceClient;
-import com.diagbot.dto.BillMsg;
-import com.diagbot.dto.RuleDTO;
-import com.diagbot.dto.RuleExtDTO;
-import com.diagbot.dto.StandConvertCrfBatchDTO;
-import com.diagbot.dto.StandConvertCrfDTO;
-import com.diagbot.dto.WordCrfDTO;
+import com.diagbot.dto.*;
+import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.enums.LexiconEnum;
 import com.diagbot.enums.RedisEnum;
 import com.diagbot.enums.StandConvertEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.model.ai.AIAnalyze;
-import com.diagbot.model.entity.BodyPart;
-import com.diagbot.model.entity.Clinical;
-import com.diagbot.model.entity.Modification;
 import com.diagbot.model.entity.Operation;
-import com.diagbot.model.entity.Pacs;
-import com.diagbot.model.entity.Vital;
-import com.diagbot.model.label.ChiefLabel;
-import com.diagbot.model.label.DiagLabel;
-import com.diagbot.model.label.PacsLabel;
-import com.diagbot.model.label.PastLabel;
-import com.diagbot.model.label.PresentLabel;
-import com.diagbot.model.label.VitalLabel;
+import com.diagbot.model.entity.*;
+import com.diagbot.model.label.*;
 import com.diagbot.rule.CommonRule;
-import com.diagbot.util.BeanUtil;
-import com.diagbot.util.CoreUtil;
-import com.diagbot.util.ListUtil;
-import com.diagbot.util.RedisUtil;
-import com.diagbot.util.ReflectUtil;
-import com.diagbot.util.StringUtil;
-import com.diagbot.vo.NeoPushVO;
-import com.diagbot.vo.RuleVO;
-import com.diagbot.vo.SearchData;
-import com.diagbot.vo.StandConvert;
-import com.diagbot.vo.StandConvertCrfVO;
-import com.diagbot.vo.neoPushEntity.ChiefPushVo;
+import com.diagbot.util.*;
+import com.diagbot.vo.*;
 import com.diagbot.vo.neoPushEntity.Diag;
-import com.diagbot.vo.neoPushEntity.DiagVo;
 import com.diagbot.vo.neoPushEntity.Drug;
-import com.diagbot.vo.neoPushEntity.LisPushVo;
-import com.diagbot.vo.neoPushEntity.PacsPushVo;
-import com.diagbot.vo.neoPushEntity.PresentPushVo;
-import com.diagbot.vo.neoPushEntity.Symptom;
+import com.diagbot.vo.neoPushEntity.*;
 import com.google.common.collect.Lists;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Method;
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -72,9 +43,7 @@ public class CommonFacade {
     @Autowired
     CRFServiceClient crfServiceClient;
     @Autowired
-    LisConfigFacade lisConfigFacade;
-    @Autowired
-    PacsConfigFacade pacsConfigFacade;
+    MappingConfigFacade mappingConfigFacade;
     @Autowired
     TranOperationConfigFacade tranOperationConfigFacade;
     @Autowired
@@ -139,6 +108,9 @@ public class CommonFacade {
         if (ListUtil.isNotEmpty(searchData.getDrug())) {
             wordCrfDTO.setDrug(searchData.getDrug());
         }
+        if (ListUtil.isNotEmpty(searchData.getTransfusion())) {
+            wordCrfDTO.setTransfusion(searchData.getTransfusion());
+        }
         if (ListUtil.isNotEmpty(searchData.getOperation())) {
             wordCrfDTO.setOperation(searchData.getOperation());
         }
@@ -181,17 +153,23 @@ public class CommonFacade {
         if (StringUtil.isNotBlank(searchData.getMarital())) {
             wordCrfDTO.setMarital(searchData.getMarital());
         }
+        if (StringUtil.isNotBlank(searchData.getMarriage())) {
+            wordCrfDTO.setMarriage(searchData.getMarriage());
+        }
         if (StringUtil.isNotBlank(searchData.getPersonal())) {
             wordCrfDTO.setPersonal(searchData.getPersonal());
         }
+        if (StringUtil.isNotBlank(searchData.getVital())) {
+            wordCrfDTO.setVital(searchData.getVital());
+        }
 
-        //模型处理数据
+        // 模型处理数据
         aiAnalyze.aiProcess(searchData, wordCrfDTO);
 
         // 统一处理化验、辅检、诊断,放入结构化
         processLisPacsDiag(wordCrfDTO);
 
-        // 现病史体征内容放入体征标签
+        // 现病史体征内容放入体征标签
         processPresentVital(wordCrfDTO);
 
         // 加入分词
@@ -428,9 +406,9 @@ public class CommonFacade {
         //        // 3、开单辅检项目
         //        CoreUtil.setPropertyList(wordCrfDTO.getPacsOrder(), "name", "uniqueName", map.get(StandConvertEnum.pacs.toString()));
 
-        CoreUtil.setUninameFromDetail(wordCrfDTO.getLis(), "detailName");
-        CoreUtil.setUninameFromDetail(wordCrfDTO.getLisOrder(), "name");
-
+//        CoreUtil.setUninameFromDetail(wordCrfDTO.getLis(), "detailName");
+//        CoreUtil.setUninameFromDetail(wordCrfDTO.getLisOrder(), "name");
+        lisGetAndSet(wordCrfDTO);
         pacsGetAndSet(wordCrfDTO);
 
         // 【体征回填】
@@ -686,19 +664,25 @@ public class CommonFacade {
                 .distinct()
                 .collect(Collectors.toList());
 
-        Map<String, Map<String, Long>> configMap = new LinkedHashMap<>();
+//        Map<String, Map<String, Long>> configMap = new LinkedHashMap<>();
         if (ListUtil.isNotEmpty(operationList)) {
-            configMap = tranOperationConfigFacade.getConfigMap(wordCrfDTO.getHospitalId(), operationList, null);
+//            configMap = tranOperationConfigFacade.getConfigMap(wordCrfDTO.getHospitalId(), operationList, null);
+            Map<String, Map<String, Map<String, List<String>>>> operstionMap = mappingConfigFacade.groupByHisNameWithName(operationList, ConceptTypeEnum.Operation.getKey(), wordCrfDTO.getHospitalId());
             // 1、主诉手术
-            setListProperty(wordCrfDTO.getChiefLabel(), "operations", "standName", configMap);
+//            setListProperty(wordCrfDTO.getChiefLabel(), "operations", "standName", configMap);
+            setListProperty(wordCrfDTO.getChiefLabel(), "operations", ConceptTypeEnum.Operation.getKey(),"StandName",operstionMap);
             // 2、现病史手术
-            setListProperty(wordCrfDTO.getPresentLabel(), "operations", "standName", configMap);
+//            setListProperty(wordCrfDTO.getPresentLabel(), "operations", "standName", configMap);
+            setListProperty(wordCrfDTO.getPresentLabel(),"operations", ConceptTypeEnum.Operation.getKey(),"StandName",operstionMap);
             // 3、既往史手术
-            setListProperty(wordCrfDTO.getPastLabel(), "operations", "standName", configMap);
-            // 4、开单手术
-            setListProperty(wordCrfDTO, "operation", "uniqueName", configMap);
-            // 5、结构化手术
-            setListProperty(wordCrfDTO, "operationOrder", "uniqueName", configMap);
+//            setListProperty(wordCrfDTO.getPastLabel(), "operations", "standName", configMap);
+            setListProperty(wordCrfDTO.getPastLabel(),"operations", ConceptTypeEnum.Operation.getKey(),"StandName",operstionMap);
+            // 4、结构化手术
+//            setListProperty(wordCrfDTO, "operation", "uniqueName", configMap);
+            setListProperty(wordCrfDTO, "operation", ConceptTypeEnum.Operation.getKey(),"UniqueName",operstionMap);
+            // 5、手术
+//            setListProperty(wordCrfDTO, "operationOrder", "uniqueName", configMap);
+            setListProperty(wordCrfDTO, "operationOrder", ConceptTypeEnum.Operation.getKey(),"UniqueName",operstionMap);
             // 6、选中手术
             if (wordCrfDTO.getOperationName() != null &&
                     StringUtil.isNotBlank(wordCrfDTO.getOperationName().getName()) &&
@@ -717,24 +701,50 @@ public class CommonFacade {
         // 【所有辅检】
         List<String> pacsList = new ArrayList<>();
         // 1、结构化
-        CoreUtil.addList(pacsList, CoreUtil.getPropertyList(wordCrfDTO.getPacs()));
-        // 2、开单
-        CoreUtil.addList(pacsList, CoreUtil.getPropertyList(wordCrfDTO.getPacsOrder()));
+        CoreUtil.addList(pacsList, CoreUtil.filterUniqueList(wordCrfDTO.getPacs()));
+//        // 2、开单
+        CoreUtil.addList(pacsList, CoreUtil.filterUniqueList(wordCrfDTO.getPacsOrder()));
+        PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
+        if(pacsLabel != null){
+            pacsList = pacsLabel.getItem().stream()
+                    .map(x -> x.getName())
+                    .collect(Collectors.toList());
+        }
+
+        if (ListUtil.isNotEmpty(pacsList)) {
+            Map<String, Map<String, Map<String, List<String>>>> pacsMap = mappingConfigFacade.groupByHisNameWithName(pacsList, ConceptTypeEnum.Pacs.getKey(), wordCrfDTO.getHospitalId());
+            setListProperty(wordCrfDTO, "pacs", ConceptTypeEnum.Pacs.getKey(),"UniqueName",pacsMap);
+            setListProperty(wordCrfDTO, "pacsOrder", ConceptTypeEnum.Pacs.getKey(),"UniqueName",pacsMap);
+            setListProperty(pacsLabel, "item", ConceptTypeEnum.Pacs.getKey(),"UniqueName",pacsMap);
+        }
+    }
 
-        pacsList = pacsList
+    /**
+     * 化验映射(关闭同义词转换)
+     *
+     * @param wordCrfDTO
+     */
+    public void lisGetAndSet(WordCrfDTO wordCrfDTO) {
+        //化验公表转换
+        List<String> lisHisNameList = Lists.newArrayList();
+        // 【所有化验】
+        List<Lis> lisList = wordCrfDTO.getLis();
+        if(ListUtil.isNotEmpty(lisList)){
+            lisHisNameList.addAll(lisList
+                    .stream()
+                    .filter(i -> StringUtil.isNotBlank(i.getName()) || StringUtil.isNotBlank(i.getUniqueName()))
+                    .map(i -> i.getName())
+                    .collect(Collectors.toList()));
+        }
+        lisHisNameList = lisHisNameList
                 .stream()
                 .distinct()
                 .collect(Collectors.toList());
-
-        Map<String, Map<String, Long>> configMap = new LinkedHashMap<>();
-        if (ListUtil.isNotEmpty(pacsList)) {
-            configMap = pacsConfigFacade.getConfigMap(wordCrfDTO.getHospitalId(), pacsList, null);
-
-            // 4、结构化
-            setListProperty(wordCrfDTO, "pacs", "uniqueName", configMap);
-            // 5、开单
-            setListProperty(wordCrfDTO, "pacsOrder", "uniqueName", configMap);
+        if (ListUtil.isNotEmpty(lisHisNameList)) {
+            Map<String, Map<String, Map<String, List<String>>>> lisConfigMap = mappingConfigFacade.groupByHisNameWithName(lisHisNameList, ConceptTypeEnum.LisPack.getKey(), wordCrfDTO.getHospitalId());
+            setListProperty(wordCrfDTO, "lis", ConceptTypeEnum.LisPack.getKey(),"UniqueName",lisConfigMap);
         }
+
     }
 
     /**
@@ -751,6 +761,12 @@ public class CommonFacade {
         ReflectUtil.setProperty(obj, listProperty, newList);
     }
 
+    public <T> void setListProperty(Object obj, String listProperty,Integer type,String propertyName, Map<String, Map<String, Map<String, List<String>>>> configMap) {
+        Object tList = CoreUtil.getFieldValue(obj, listProperty);
+        List<T> newList = convertStandName((List) tList,type, propertyName,configMap);
+        ReflectUtil.setProperty(obj, listProperty, newList);
+    }
+
     /**
      * 标准名称转换
      *
@@ -767,13 +783,13 @@ public class CommonFacade {
                 return retList;
             }
             for (T item : list) {
-                String name = item.getClass().getMethod("getName").invoke(item).toString();
+                String name = ReflectUtil.getProperty(item, "name");
                 if (StringUtil.isBlank(name)) {
                     retList.add(item);
                     continue;
                 }
                 if (fieldName.equals("uniqueName")) {
-                    String uniqueName = item.getClass().getMethod("getUniqueName").invoke(item).toString();
+                    String uniqueName = ReflectUtil.getProperty(item, "uniqueName");
                     if (StringUtil.isNotBlank(uniqueName)) {
                         retList.add(item);
                         continue;
@@ -800,6 +816,95 @@ public class CommonFacade {
         return retList;
     }
 
+    /**
+     * 标准名称转换
+     *
+     * @param list
+     * @param configMap
+     * @param type
+     * @param <T>
+     * @return
+     */
+    public <T> List<T> convertStandName(List<T> list,Integer type,String propertyName, Map<String, Map<String, Map<String, List<String>>>> configMap) {
+        List<T> retList = new ArrayList<>();
+        if (ListUtil.isEmpty(list)) {
+            return list;
+        }
+
+        try {
+            for (T item : list) {
+                String name = item.getClass().getMethod("getName").invoke(item).toString();
+                if (StringUtil.isBlank(name)) {
+                    retList.add(item);
+                    continue;
+                }
+
+//                String uniqueName = item.getClass().getMethod("getUniqueName").invoke(item).toString();
+
+                String uniqueName = item.getClass().getMethod("get"+propertyName).invoke(item).toString();
+                if (StringUtil.isNotBlank(uniqueName) && !"StandName".equals(propertyName)) {
+                    retList.add(item);
+                    continue;
+                }
+
+                String hisDetailName = "";
+                if(type.equals(ConceptTypeEnum.LisPack.getKey())) {
+                    hisDetailName = item.getClass().getMethod("getDetailName").invoke(item).toString();
+                    if (StringUtil.isBlank(hisDetailName)) {
+                        hisDetailName = "";
+                    }
+                }
+
+                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())) {
+                            for (Map.Entry<String, List<String>> thirdEntry : subMap.get(hisDetailName).entrySet()) {
+                                if (ListUtil.isNotEmpty(thirdEntry.getValue())) {
+                                    for (String form : thirdEntry.getValue()) {
+                                        T o = (T) item.getClass().newInstance();
+                                        BeanUtil.copyProperties(item, o);
+                                        Method setUniqueName = o.getClass().getMethod("set"+propertyName, String.class);
+                                        setUniqueName.invoke(o, thirdEntry.getKey());
+                                        Method setForm = o.getClass().getMethod("setForm", String.class);
+                                        setForm.invoke(o, form);
+                                        retList.add(o);
+                                    }
+                                } else {
+                                    T o = (T) item.getClass().newInstance();
+                                    BeanUtil.copyProperties(item, o);
+                                    Method setUniqueName = o.getClass().getMethod("set"+propertyName, String.class);
+                                    setUniqueName.invoke(o, thirdEntry.getKey());
+                                    retList.add(o);
+                                }
+                            }
+
+                        } else {
+                            List<String> standNames = new ArrayList<>(subMap.get(hisDetailName).keySet());
+                            for (String stdName : standNames) {
+                                T o = (T) item.getClass().newInstance();
+                                BeanUtil.copyProperties(item, o);
+                                Method setUniqueName = o.getClass().getMethod("set"+propertyName, String.class);
+                                setUniqueName.invoke(o, stdName);
+                                retList.add(o);
+                            }
+                        }
+                    } else {
+                        retList.add(item);
+                    }
+                } else {
+                    if (propertyName.equals("UniqueName")) {
+                        BeanUtils.copyProperty(item, "uniqueName", name);
+                    }
+                    retList.add(item);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return retList;
+    }
+
     /**
      * 生成给图谱的入参(推送)
      */
@@ -959,9 +1064,9 @@ public class CommonFacade {
         /**************************化验结构化处理开始*****************************/
         List<Lis> lisList = new ArrayList<>();
         // 处理主诉化验
-        getLisStruct(wordCrfDTO.getChiefLabel().getLises(), lisList, wordCrfDTO.getHospitalId());
+        getLisStruct(wordCrfDTO.getChiefLabel().getLises(), lisList);
         // 处理现病史化验
-        getLisStruct(wordCrfDTO.getPresentLabel().getLises(), lisList, wordCrfDTO.getHospitalId());
+        getLisStruct(wordCrfDTO.getPresentLabel().getLises(), lisList);
         // 统一放置化验结构
         if (ListUtil.isNotEmpty(lisList)) {
             wordCrfDTO.getLis().addAll(lisList);
@@ -975,6 +1080,16 @@ public class CommonFacade {
         getPacsStruct(pacsLabel, wordCrfDTO.getChiefLabel().getPacsLabel());
         // 处理现病史辅检
         getPacsStruct(pacsLabel, wordCrfDTO.getPresentLabel().getPacsLabel());
+        //结构化pacs
+        List<com.diagbot.biz.push.entity.Pacs> pacs = wordCrfDTO.getPacs();
+        if(ListUtil.isNotEmpty(pacs)){
+            pacs.forEach(p ->{
+                Item item = new Item();
+                item.setName(p.getName()==null?"":p.getName());
+                item.setUniqueName(p.getUniqueName()==null?"":p.getUniqueName());
+                pacsLabel.getItem().add(item);
+            });
+        }
         // 辅检结果去重
         if (ListUtil.isNotEmpty(pacsLabel.getRes())) {
             dealMsgWithItem(pacsLabel.getRes());
@@ -1007,8 +1122,8 @@ public class CommonFacade {
         if (ListUtil.isNotEmpty(res.getDisease())) {
             for (Pacs pacs : res.getDisease()) {
                 Item item = new Item();
-                item.setName(pacs.getName());
-                item.setUniqueName(pacs.getStandName());
+                item.setName(pacs.getName()==null?"":pacs.getName());
+                item.setUniqueName(pacs.getStandName()==null?"":pacs.getStandName());
                 pacsResList.add(item);
             }
         }
@@ -1048,43 +1163,18 @@ public class CommonFacade {
      *
      * @param lises
      * @param lisList
-     * @param hospitalId
+     *
      */
-    public void getLisStruct(List<com.diagbot.model.entity.Lis> lises, List<Lis> lisList, Long hospitalId) {
+    public void getLisStruct(List<com.diagbot.model.entity.Lis> lises, List<Lis> lisList) {
         if (ListUtil.isNotEmpty(lises)) {
-            List<String> lisNames = lises.stream().map(x -> x.getBigItem().getName()).distinct().collect(Collectors.toList());
-            Map<String, Map<String, Map<String, Long>>> configMap = lisConfigFacade.getConfigMap(hospitalId, lisNames, null);
-            if (configMap.size() > 0) {
                 lises.stream().forEach(x -> {
                     String bigName = x.getBigItem().getName();//大项名
                     String detailName = x.getName();//小项名
                     String value = x.getPd().getValue();
                     String unit = x.getPd().getUnit();
-                    if (configMap.containsKey(bigName)) {
-                        Map<String, Map<String, Long>> uniqueDetailMap = configMap.get(bigName);
-                        if (uniqueDetailMap.containsKey(detailName)) {
-                            List<String> uniques = uniqueDetailMap.get(detailName).keySet().stream().collect(Collectors.toList());//所有的公表项
-                            if (ListUtil.isNotEmpty(uniques)) {
-                                List<Lis> lisStream = uniques.stream().map(z -> {
-                                    return getLis(bigName, detailName, value, unit, z);
-                                }).collect(Collectors.toList());
-                                lisList.addAll(lisStream);
-                            }
-                        } else {
-                            Lis lis = getLis(bigName, detailName, value, unit, null);
-                            lisList.add(lis);
-                        }
-                    } else {
-                        Lis lis = getLis(bigName, detailName, value, unit, null);
-                        lisList.add(lis);
-                    }
+                    String standName = x.getStandName();
+                    lisList.add(getLis(bigName,detailName,value,unit,standName));
                 });
-            } else {
-                lises.stream().forEach(x -> {
-                    Lis lis = getLis(x.getBigItem().getName(), x.getName(), x.getPd().getValue(), x.getPd().getUnit(), null);
-                    lisList.add(lis);
-                });
-            }
         }
     }
 

+ 312 - 91
src/main/java/com/diagbot/facade/KlConceptFacade.java

@@ -6,16 +6,21 @@ import com.diagbot.dto.IndexBatchDTO;
 import com.diagbot.dto.KllisDetailDTO;
 import com.diagbot.entity.KlConcept;
 import com.diagbot.entity.KlDisease;
+import com.diagbot.entity.KlLibraryInfo;
+import com.diagbot.entity.KlOperation;
 import com.diagbot.entity.TcmDisease;
 import com.diagbot.entity.TcmSyndrome;
+import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.LexiconEnum;
+import com.diagbot.enums.MatchSourceEnum;
 import com.diagbot.enums.StatusEnum;
 import com.diagbot.service.impl.KlConceptServiceImpl;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.FilterVO;
 import com.diagbot.vo.KllisDetailVO;
 import com.diagbot.vo.SearchConceptVO;
 import com.google.common.collect.Lists;
@@ -23,8 +28,8 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -40,9 +45,13 @@ public class KlConceptFacade extends KlConceptServiceImpl {
     @Autowired
     private KlDiseaseFacade klDiseaseFacade;
     @Autowired
+    private KlOperationFacade klOperationFacade;
+    @Autowired
     private TcmDiseaseFacade tcmDiseaseFacade;
     @Autowired
     private TcmSyndromeFacade tcmSyndromeFacade;
+    @Autowired
+    private KlLibraryInfoFacade klLibraryInfoFacade;
 
     /**
      * 批量校验标准术语
@@ -51,122 +60,334 @@ public class KlConceptFacade extends KlConceptServiceImpl {
      * @return
      */
     public List<IndexBatchDTO> getConceptNames(ConceptVO conceptVO) {
-        if (ListUtil.isEmpty(conceptVO.getNames())) {
-            return new ArrayList<>();
-        }
         List<IndexBatchDTO> retList = Lists.newLinkedList();
-        //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候
-        Integer type = convertType(conceptVO.getType());
-
-        QueryWrapper<KlConcept> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .in("lib_name", conceptVO.getNames());
-        if (conceptVO.getType().equals(3)) {
-            //辅检同时检索辅检项目和辅检子项
-            queryWrapper.in("lib_type", Arrays.asList(LexiconEnum.PacsName.getKey(), LexiconEnum.PacsSubName.getKey()));
-        } else {
-            queryWrapper.eq("lib_type", type);
-        }
-        List<KlConcept> concepts = this.list(queryWrapper);
+        Integer type = convertType(conceptVO.getType(), false);
 
-        if (ListUtil.isNotEmpty(concepts)) {
+        if (conceptVO.getSource().equals(-1)) {
+            if (ListUtil.isEmpty(conceptVO.getIds())) {
+                return retList;
+            }
+            //根据id检索
+            List<KlConcept> concepts = this.list(new QueryWrapper<KlConcept>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    //.eq("status", StatusEnum.Enable.getKey())
+                    .in("id", conceptVO.getIds()));
             for (KlConcept concept : concepts) {
                 IndexBatchDTO dto = new IndexBatchDTO();
                 dto.setId(concept.getId());
                 dto.setName(concept.getLibName());
+                dto.setType(convertType(concept.getLibType(), true));
                 retList.add(dto);
             }
+        } else if (conceptVO.getSource().equals(MatchSourceEnum.StandWord.getKey())) {
+            QueryWrapper<KlConcept> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
+            //.eq("status", StatusEnum.Enable.getKey());
+            if (ListUtil.isNotEmpty(conceptVO.getNames())) {
+                queryWrapper.in("lib_name", conceptVO.getNames());
+            }
+            if (conceptVO.getType().equals(ConceptTypeEnum.Pacs.getKey())) {
+                //辅检同时检索辅检项目和辅检子项
+                queryWrapper.in("lib_type", Arrays.asList(LexiconEnum.PacsName.getKey(), LexiconEnum.PacsSubName.getKey()));
+            } else {
+                queryWrapper.eq("lib_type", type);
+            }
+            List<KlConcept> concepts = this.list(queryWrapper);
+
+            if (ListUtil.isNotEmpty(concepts)) {
+                for (KlConcept concept : concepts) {
+                    IndexBatchDTO dto = new IndexBatchDTO();
+                    dto.setId(concept.getId());
+                    dto.setName(concept.getLibName());
+                    retList.add(dto);
+                }
+            }
+        } else if (conceptVO.getSource().equals(MatchSourceEnum.SynonymsWord.getKey())) {
+            if (ListUtil.isEmpty(conceptVO.getNames())) {
+                return retList;
+            }
+            QueryWrapper<KlLibraryInfo> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("is_concept", 0)
+                    .in("name", conceptVO.getNames());
+            if (conceptVO.getType().equals(ConceptTypeEnum.Pacs.getKey())) {
+                //辅检同时检索辅检项目和辅检子项
+                queryWrapper.in("type_id", Arrays.asList(LexiconEnum.PacsName.getKey(), LexiconEnum.PacsSubName.getKey()));
+            } else {
+                queryWrapper.eq("type_id", type);
+            }
+            List<KlLibraryInfo> libratyInfos = klLibraryInfoFacade.list(queryWrapper);
+            if (ListUtil.isEmpty(libratyInfos)) {
+                return retList;
+            }
+            Map<Long, List<KlLibraryInfo>> libraryInfoMap
+                    = libratyInfos.stream().collect(Collectors.groupingBy(KlLibraryInfo::getConceptId));
+            List<Long> synonymsRelatedConceptIds
+                    = libratyInfos.stream().map(KlLibraryInfo::getConceptId).collect(Collectors.toList());
+            List<KlConcept> synonymsRelatedConcepts = this.list(new QueryWrapper<KlConcept>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    //.eq("status", StatusEnum.Enable.getKey())
+                    .in("id", synonymsRelatedConceptIds));
+            Map<Long, KlConcept> conceptMap
+                    = synonymsRelatedConcepts.stream().collect(Collectors.toMap(KlConcept::getId, v -> v));
+
+            if (conceptMap != null && conceptMap.size() > 0) {
+                for (Map.Entry<Long, KlConcept> entry : conceptMap.entrySet()) {
+                    KlConcept concept = entry.getValue();
+                    if (libraryInfoMap.containsKey(entry.getKey())) {
+                        for (KlLibraryInfo libraryInfo : libraryInfoMap.get(entry.getKey())) {
+                            if (!conceptVO.getNames().contains(libraryInfo.getName())) {
+                                continue;
+                            }
+                            IndexBatchDTO indexBatchDTO = new IndexBatchDTO();
+                            indexBatchDTO.setId(concept.getId());
+                            indexBatchDTO.setName(concept.getLibName());
+                            indexBatchDTO.setSynonyms(libraryInfo.getName());
+                            retList.add(indexBatchDTO);
+                        }
+                    }
+                }
+            }
+        } else if (conceptVO.getSource().equals(MatchSourceEnum.Code.getKey())) {
+            if (ListUtil.isEmpty(conceptVO.getNames())) {
+                return retList;
+            }
+            List<Long> conceptIds = Lists.newArrayList();
+            Map<Long, List<String>> codeMap = new HashMap<>();
+            if (type.equals(LexiconEnum.Disease.getKey())) {
+                List<KlDisease> diseases = klDiseaseFacade.list(new QueryWrapper<KlDisease>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .in("icd10_code", conceptVO.getNames()));
+                if (ListUtil.isNotEmpty(diseases)) {
+                    conceptIds = diseases.stream().map(KlDisease::getConceptId).distinct().collect(Collectors.toList());
+                    codeMap = diseases.stream()
+                            .collect(Collectors.groupingBy(KlDisease::getConceptId,
+                                    Collectors.mapping(KlDisease::getIcd10Code, Collectors.toList())));
+                }
+            } else if (type.equals(LexiconEnum.Operation.getKey())) {
+                List<KlOperation> operations = klOperationFacade.list(new QueryWrapper<KlOperation>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .in("operation_code", conceptVO.getNames()));
+                if (ListUtil.isNotEmpty(operations)) {
+                    conceptIds = operations.stream().map(KlOperation::getConceptId).distinct().collect(Collectors.toList());
+                    codeMap = operations.stream()
+                            .collect(Collectors.groupingBy(KlOperation::getConceptId,
+                                    Collectors.mapping(KlOperation::getOperationCode, Collectors.toList())));
+                }
+            } else if (type.equals(LexiconEnum.Tcmdisease.getKey())) {
+                List<TcmDisease> tcmDiseases = tcmDiseaseFacade.list(new QueryWrapper<TcmDisease>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .in("code", conceptVO.getNames()));
+                if (ListUtil.isNotEmpty(tcmDiseases)) {
+                    conceptIds = tcmDiseases.stream().map(TcmDisease::getConceptId).distinct().collect(Collectors.toList());
+                    codeMap = tcmDiseases.stream().collect(Collectors.groupingBy(TcmDisease::getConceptId,
+                            Collectors.mapping(TcmDisease::getCode, Collectors.toList())));
+                }
+            } else if (type.equals(LexiconEnum.Tcmsyndrome.getKey())) {
+                List<TcmSyndrome> tcmSyndromes = tcmSyndromeFacade.list(new QueryWrapper<TcmSyndrome>()
+                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                        .in("code", conceptVO.getNames()));
+                if (ListUtil.isNotEmpty(tcmSyndromes)) {
+                    conceptIds = tcmSyndromes.stream().map(TcmSyndrome::getConceptId).distinct().collect(Collectors.toList());
+                    codeMap = tcmSyndromes.stream().collect(Collectors.groupingBy(TcmSyndrome::getConceptId,
+                            Collectors.mapping(TcmSyndrome::getCode, Collectors.toList())));
+                }
+            }
+            List<KlConcept> concepts = this.list(new QueryWrapper<KlConcept>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    //.eq("status", StatusEnum.Enable.getKey())
+                    .in("id", conceptIds));
+            Map<Long, KlConcept> conceptMap
+                    = concepts.stream().collect(Collectors.toMap(KlConcept::getId, v -> v));
+            if (conceptMap != null && conceptMap.size() > 0) {
+                for (Map.Entry<Long, KlConcept> entry : conceptMap.entrySet()) {
+                    KlConcept concept = entry.getValue();
+                    if (codeMap.containsKey(entry.getKey())) {
+                        for (String code : codeMap.get(entry.getKey())) {
+                            if (!conceptVO.getNames().contains(code)) {
+                                continue;
+                            }
+                            IndexBatchDTO indexBatchDTO = new IndexBatchDTO();
+                            indexBatchDTO.setId(concept.getId());
+                            indexBatchDTO.setName(concept.getLibName());
+                            indexBatchDTO.setCode(code);
+                            retList.add(indexBatchDTO);
+                        }
+                    }
+                }
+            }
         }
 
         if (ListUtil.isEmpty(retList)) {
             return retList;
         }
+        //关联编码
         List<Long> conceptIds = retList.stream().map(IndexBatchDTO::getId).collect(Collectors.toList());
-
-        if (type.equals(LexiconEnum.Disease.getKey())) {
-            List<KlDisease> diseases = klDiseaseFacade.list(new QueryWrapper<KlDisease>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .in("concept_id", conceptIds));
-            if (ListUtil.isNotEmpty(diseases)) {
-                Map<Long, KlDisease> idMap = diseases.stream().collect(Collectors.toMap(KlDisease::getConceptId, v -> v));
-                for (IndexBatchDTO dto : retList) {
-                    if (idMap.containsKey(dto.getId())) {
-                        dto.setCode(idMap.get(dto.getId()).getIcd10Code());
-                    }
+        //诊断关联编码
+        List<KlDisease> diseases = klDiseaseFacade.list(new QueryWrapper<KlDisease>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .in("concept_id", conceptIds));
+        if (ListUtil.isNotEmpty(diseases)) {
+            Map<Long, KlDisease> idMap = diseases.stream().collect(Collectors.toMap(KlDisease::getConceptId, v -> v));
+            for (IndexBatchDTO dto : retList) {
+                if (idMap.containsKey(dto.getId())) {
+                    dto.setCode(idMap.get(dto.getId()).getIcd10Code());
                 }
             }
-        } else if (type.equals(LexiconEnum.Tcmdisease.getKey())) {
-            List<TcmDisease> tcmDiseases = tcmDiseaseFacade.list(new QueryWrapper<TcmDisease>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .in("concept_id", conceptIds));
-            if (ListUtil.isNotEmpty(tcmDiseases)) {
-                Map<Long, TcmDisease> idMap = tcmDiseases.stream().collect(Collectors.toMap(TcmDisease::getConceptId, v -> v));
-                for (IndexBatchDTO dto : retList) {
-                    if (idMap.containsKey(dto.getId())) {
-                        dto.setCode(idMap.get(dto.getId()).getCode());
-                    }
+        }
+        //手术关联编码
+        List<KlOperation> operations = klOperationFacade.list(new QueryWrapper<KlOperation>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .in("concept_id", conceptIds));
+        if (ListUtil.isNotEmpty(operations)) {
+            Map<Long, KlOperation> idMap = operations.stream().collect(Collectors.toMap(KlOperation::getConceptId, v -> v));
+            for (IndexBatchDTO dto : retList) {
+                if (idMap.containsKey(dto.getId())) {
+                    dto.setCode(idMap.get(dto.getId()).getOperationCode());
                 }
             }
-        } else if (type.equals(LexiconEnum.Tcmsyndrome.getKey())) {
-            List<TcmSyndrome> tcmSyndromes = tcmSyndromeFacade.list(new QueryWrapper<TcmSyndrome>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .in("concept_id", conceptIds));
-            if (ListUtil.isNotEmpty(tcmSyndromes)) {
-                Map<Long, TcmSyndrome> idMap = tcmSyndromes.stream().collect(Collectors.toMap(TcmSyndrome::getConceptId, v -> v));
-                for (IndexBatchDTO dto : retList) {
-                    if (idMap.containsKey(dto.getId())) {
-                        dto.setCode(idMap.get(dto.getId()).getCode());
-                    }
+        }
+        //中医疾病关联编码
+        List<TcmDisease> tcmDiseases = tcmDiseaseFacade.list(new QueryWrapper<TcmDisease>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .in("concept_id", conceptIds));
+        if (ListUtil.isNotEmpty(tcmDiseases)) {
+            Map<Long, TcmDisease> idMap = tcmDiseases.stream().collect(Collectors.toMap(TcmDisease::getConceptId, v -> v));
+            for (IndexBatchDTO dto : retList) {
+                if (idMap.containsKey(dto.getId())) {
+                    dto.setCode(idMap.get(dto.getId()).getCode());
                 }
             }
         }
+        //中医证候关联编码
+        List<TcmSyndrome> tcmSyndromes = tcmSyndromeFacade.list(new QueryWrapper<TcmSyndrome>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .in("concept_id", conceptIds));
+        if (ListUtil.isNotEmpty(tcmSyndromes)) {
+            Map<Long, TcmSyndrome> idMap = tcmSyndromes.stream().collect(Collectors.toMap(TcmSyndrome::getConceptId, v -> v));
+            for (IndexBatchDTO dto : retList) {
+                if (idMap.containsKey(dto.getId())) {
+                    dto.setCode(idMap.get(dto.getId()).getCode());
+                }
+            }
+        }
+        return retList;
+    }
 
+    /**
+     * 术语模糊检索
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<IndexBatchDTO> filter(FilterVO filterVO) {
+        List<IndexBatchDTO> retList = Lists.newArrayList();
+        List<KlConcept> klConcepts = this.list(new QueryWrapper<KlConcept>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                //.eq("status", StatusEnum.Enable.getKey())
+                .like("lib_name", filterVO.getInputStr()));
+        for (KlConcept concept : klConcepts) {
+            IndexBatchDTO indexBatchDTO = new IndexBatchDTO();
+            indexBatchDTO.setId(concept.getId());
+            indexBatchDTO.setName(concept.getLibName());
+            Integer type = convertType(concept.getLibType(), true);
+            if (type != null) {
+                indexBatchDTO.setType(type);
+                retList.add(indexBatchDTO);
+            }
+        }
         return retList;
     }
 
 
-    public Integer convertType(Integer type) {
+    /**
+     * 类型互转
+     *
+     * @param type
+     * @param reverse
+     * @return
+     */
+    public Integer convertType(Integer type, Boolean reverse) {
         Integer retType = null;
-        //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候
-        switch (type) {
-            case 1:
-                retType = LexiconEnum.LisName.getKey();
-                break;
-            case 2:
-                retType = LexiconEnum.LisSubName.getKey();
-                break;
-            case 3:
-                retType = LexiconEnum.PacsName.getKey();
-                break;
-            case 4:
-                retType = LexiconEnum.Disease.getKey();
-                break;
-            case 5:
-                retType = LexiconEnum.Medicine.getKey();
-                break;
-            case 6:
-                retType = LexiconEnum.Operation.getKey();
-                break;
-            case 7:
-                retType = LexiconEnum.Dept.getKey();
-                break;
-            case 8:
-                retType = LexiconEnum.Transfusion.getKey();
-                break;
-            case 10:
-                retType = LexiconEnum.Scale.getKey();
-                break;
-            case 11:
-                retType = LexiconEnum.Nurse.getKey();
-                break;
-            case 12:
-                retType = LexiconEnum.Tcmdisease.getKey();
-                break;
-            case 13:
-                retType = LexiconEnum.Tcmsyndrome.getKey();
-                break;
-            default:
-                break;
+        if (type == null) {
+            return retType;
+        }
+        if (reverse) {
+            if (type.equals(LexiconEnum.LisName.getKey())
+                    || type.equals(LexiconEnum.LisSubName.getKey())) {
+                retType = ConceptTypeEnum.LisPack.getKey();
+            } else if (type.equals(LexiconEnum.PacsName.getKey())
+                    || type.equals(LexiconEnum.PacsSubName.getKey())) {
+                retType = ConceptTypeEnum.Pacs.getKey();
+            } else if (type.equals(LexiconEnum.Disease.getKey())) {
+                retType = ConceptTypeEnum.Disease.getKey();
+            } else if (type.equals(LexiconEnum.Medicine.getKey())) {
+                retType = ConceptTypeEnum.Drug.getKey();
+            } else if (type.equals(LexiconEnum.Operation.getKey())) {
+                retType = ConceptTypeEnum.Operation.getKey();
+            } else if (type.equals(LexiconEnum.Dept.getKey())) {
+                retType = ConceptTypeEnum.Dept.getKey();
+            } else if (type.equals(LexiconEnum.Transfusion.getKey())) {
+                retType = ConceptTypeEnum.Transfusion.getKey();
+            } else if (type.equals(LexiconEnum.Scale.getKey())) {
+                retType = ConceptTypeEnum.Scale.getKey();
+            } else if (type.equals(LexiconEnum.Nurse.getKey())) {
+                retType = ConceptTypeEnum.Nurse.getKey();
+            } else if (type.equals(LexiconEnum.Tcmdisease.getKey())) {
+                retType = ConceptTypeEnum.Tcmdisease.getKey();
+            } else if (type.equals(LexiconEnum.Tcmsyndrome.getKey())) {
+                retType = ConceptTypeEnum.Tcmsyndrome.getKey();
+            } else if (type.equals(LexiconEnum.Anesthesia.getKey())) {
+                retType = ConceptTypeEnum.Anesthesia.getKey();
+            } else if (type.equals(LexiconEnum.Form.getKey())) {
+                retType = ConceptTypeEnum.Form.getKey();
+            }
+        } else {
+            switch (type) {
+                case 1:
+                    retType = LexiconEnum.LisName.getKey();
+                    break;
+                case 2:
+                    retType = LexiconEnum.LisSubName.getKey();
+                    break;
+                case 3:
+                    retType = LexiconEnum.PacsName.getKey();
+                    break;
+                case 4:
+                    retType = LexiconEnum.Disease.getKey();
+                    break;
+                case 5:
+                    retType = LexiconEnum.Medicine.getKey();
+                    break;
+                case 6:
+                    retType = LexiconEnum.Operation.getKey();
+                    break;
+                case 7:
+                    retType = LexiconEnum.Dept.getKey();
+                    break;
+                case 8:
+                    retType = LexiconEnum.Transfusion.getKey();
+                    break;
+                case 10:
+                    retType = LexiconEnum.Scale.getKey();
+                    break;
+                case 11:
+                    retType = LexiconEnum.Nurse.getKey();
+                    break;
+                case 12:
+                    retType = LexiconEnum.Tcmdisease.getKey();
+                    break;
+                case 13:
+                    retType = LexiconEnum.Tcmsyndrome.getKey();
+                    break;
+                case 14:
+                    retType = LexiconEnum.Anesthesia.getKey();
+                    break;
+                case 15:
+                    retType = LexiconEnum.Form.getKey();
+                default:
+                    break;
+            }
         }
         return retType;
     }
@@ -202,4 +423,4 @@ public class KlConceptFacade extends KlConceptServiceImpl {
         Map<String, KllisDetailDTO> res = EntityUtil.makeEntityMap(list, "libName");
         return res;
     }
-}
+}

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

+ 244 - 30
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;
 
     /**
      * 获取静态知识
@@ -80,7 +95,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         StaticKnowledgeDTO staticKnowledgeDTO = new StaticKnowledgeDTO();
         Integer type = convertType(staticKnowledgeVO.getType(), 1);
         if (type == null) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "请输入正确类型(1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作、8-量表、9-护理)");
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "请输入正确类型(1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作、8-量表、9-护理、10-政策法规)");
         }
         staticKnowledgeVO.setType(type);
 
@@ -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);
@@ -311,7 +346,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
     public IPage<StaticKnowledgeIndexPageDTO> staticIndexPage(StaticKnowledgeIndexPageVO staticKnowledgeIndexPageVO) {
         //默认查找全部
         if (ListUtil.isEmpty(staticKnowledgeIndexPageVO.getTypes())) {
-            staticKnowledgeIndexPageVO.setTypeIds(Arrays.asList(new Integer[] { 0 }));
+            staticKnowledgeIndexPageVO.setTypeIds(Arrays.asList(0));
         }
         staticKnowledgeIndexPageVO.setTypeIds(new ArrayList<>());
 
@@ -324,7 +359,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         //检索类型(多选):0-全部、1-诊断、2-药品、3-检验、4-检查、5-手术和操作
         if (ListUtil.isEmpty(types)
                 || (ListUtil.isNotEmpty(types) && types.contains(0))) {
-            staticKnowledgeIndexPageVO.getTypeIds().addAll(Arrays.asList(new Integer[] { LexiconEnum.Disease.getKey(),
+            staticKnowledgeIndexPageVO.getTypeIds().addAll(Arrays.asList(LexiconEnum.Disease.getKey(),
                     LexiconEnum.Medicine.getKey(),
                     LexiconEnum.LisName.getKey(),
                     LexiconEnum.LisSubName.getKey(),
@@ -332,7 +367,8 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                     LexiconEnum.PacsSubName.getKey(),
                     LexiconEnum.Operation.getKey(),
                     LexiconEnum.Scale.getKey(),
-                    LexiconEnum.Nurse.getKey() }));
+                    LexiconEnum.Nurse.getKey(),
+                    LexiconEnum.Law.getKey()));
         } else {
             if (types.contains(1)) {
                 staticKnowledgeIndexPageVO.getTypeIds().add(LexiconEnum.Disease.getKey());
@@ -357,9 +393,12 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
             if (types.contains(9)) {
                 staticKnowledgeIndexPageVO.getTypeIds().add(LexiconEnum.Nurse.getKey());
             }
+            if (types.contains(10)) {
+                staticKnowledgeIndexPageVO.getTypeIds().add(LexiconEnum.Law.getKey());
+            }
         }
         if (ListUtil.isEmpty(staticKnowledgeIndexPageVO.getTypeIds())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "请输入正确的检索类型(多选):0-全部、1-诊断、2-药品、3-检验、4-检查、7-手术和操作、8-量表、9-护理");
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "请输入正确的检索类型(多选):0-全部、1-诊断、2-药品、3-检验、4-检查、7-手术和操作、8-量表、9-护理、10-政策法规");
         }
         IPage<StaticKnowledgeIndexPageDTO> page = super.staticIndexPage(staticKnowledgeIndexPageVO);
 
@@ -376,21 +415,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 +458,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 +473,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 +522,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 +611,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,7 +665,11 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
         if (ListUtil.isEmpty(details)) {
             return false;
         }
-        return true;
+
+        List<KlConceptScale> scales = klConceptScaleFacade.list(new QueryWrapper<KlConceptScale>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("concept_id", concept.getId()));
+        return !ListUtil.isEmpty(scales);
     }
 
     /**
@@ -636,6 +714,9 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                 case 9:
                     retType = LexiconEnum.Nurse.getKey();
                     break;
+                case 10:
+                    retType = LexiconEnum.Law.getKey();
+                    break;
                 default:
                     break;
             }
@@ -658,6 +739,8 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
                 retType = 8;
             } else if (type.equals(LexiconEnum.Nurse.getKey())) {
                 retType = 9;
+            } else if (type.equals(LexiconEnum.Law.getKey())) {
+                retType = 10;
             }
         }
         return retType;
@@ -724,4 +807,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);
+    }
+
+}

+ 102 - 92
src/main/java/com/diagbot/facade/KlDiagnoseDetailFacade.java

@@ -5,28 +5,20 @@ import com.diagbot.dto.ExportDescDTO;
 import com.diagbot.dto.ExportDiagnoseDTO;
 import com.diagbot.dto.ExportDiagnoseNameDTO;
 import com.diagbot.entity.KlDiagnoseDetail;
+import com.diagbot.entity.KlLibraryInfo;
+import com.diagbot.enums.CommonEnum;
 import com.diagbot.enums.DiagnoseLexiconTypeEnum;
 import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.service.impl.KlDiagnoseDetailServiceImpl;
-import com.diagbot.util.BeanUtil;
-import com.diagbot.util.EntityUtil;
-import com.diagbot.util.ExcelUtils;
-import com.diagbot.util.ListUtil;
-import com.diagbot.util.ReflectUtil;
-import com.diagbot.util.RegexUtil;
-import com.diagbot.util.StringUtil;
+import com.diagbot.service.KlDiagnoseDetailService;
+import com.diagbot.service.KlLibraryInfoService;
+import com.diagbot.util.*;
 import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -39,17 +31,27 @@ import java.util.stream.Stream;
  * @since 2021-06-10
  */
 @Service
-public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
+public class KlDiagnoseDetailFacade {
+
+//    @Autowired
+//    KlDiagnoseDetailFacade klDiagnoseDetailFacade;
+
+
+    @Autowired
+    @Qualifier("klLibraryInfoServiceImpl")
+    private KlLibraryInfoService klLibraryInfoService;
+
 
     @Autowired
-    KlDiagnoseDetailFacade klDiagnoseDetailFacade;
+    @Qualifier("klDiagnoseDetailServiceImpl")
+    private KlDiagnoseDetailService klDiagnoseDetailService;
 
     /**
      * 导出诊断依据【初版】
      */
     public void exportDiagnose(HttpServletResponse response) {
         // 获取全部数据、分组
-        List<KlDiagnoseDetail> klDiagnoseDetailList = klDiagnoseDetailFacade.list(new QueryWrapper<KlDiagnoseDetail>()
+        List<KlDiagnoseDetail> klDiagnoseDetailList = klDiagnoseDetailService.list(new QueryWrapper<KlDiagnoseDetail>()
 //                .eq("dis_name", "急性化脓性扁桃体炎")
                 .eq("is_deleted", IsDeleteEnum.N.getKey()));
         Map<String, List<KlDiagnoseDetail>> diagnoseDetailMap = EntityUtil.makeEntityListMap(klDiagnoseDetailList, "disName");
@@ -90,7 +92,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));
@@ -107,99 +110,121 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
             List<KlDiagnoseDetail> datats = kd.getValue();
             Map<Integer, List<String>> typeCodeNewListMap = new HashMap<>();// 1 --> [1.0,1.1]
             Map<Integer, List<String>> exportDiagnoseDTOS = removeKlDiagnoseDetail(datats, typeCodeNewListMap);
-            List<ExportDiagnoseDTO> exportDiagnoseDTO= packageData(exportDiagnoseDTOS, datats, typeCodeNewListMap);
-            data.put(sheetName,exportDiagnoseDTO);
+            List<ExportDiagnoseDTO> exportDiagnoseDTO = packageData(exportDiagnoseDTOS, datats, typeCodeNewListMap);
+            data.put(sheetName, exportDiagnoseDTO);
         }
         return data;
     }
 
     /**
-     *
      * @param exportDiagnoseDTOS 各种类型的关联词
-     * @param datats 诊断依据
+     * @param datats             诊断依据
      * @param typeCodeNewListMap 各种类型的codes
      */
-    public List<ExportDiagnoseDTO> packageData(Map<Integer, List<String>> exportDiagnoseDTOS,List<KlDiagnoseDetail> datats,Map<Integer, List<String>> typeCodeNewListMap){
+    public List<ExportDiagnoseDTO> packageData(Map<Integer, List<String>> exportDiagnoseDTOS, List<KlDiagnoseDetail> datats, Map<Integer, List<String>> typeCodeNewListMap) {
         List<ExportDiagnoseDTO> eds = Lists.newArrayList();
         List<Integer> types = Lists.newArrayList(91, 92, 93);
-
+        List<Integer> tps = Stream.of(1, 2, 3).collect(Collectors.toList());
         Map<Integer, List<KlDiagnoseDetail>> typeDiagnoseDetails = EntityUtil.makeEntityListMap(datats, "type");
-        for (Map.Entry<Integer, List<String>> edd : exportDiagnoseDTOS.entrySet()) {
-            Integer type = edd.getKey();
-            List<KlDiagnoseDetail> klDiagnoseDetails = typeDiagnoseDetails.get(type);
-            List<String> relations = edd.getValue();
-            List<String> codes = typeCodeNewListMap.get(type);
-            String maxCode = codes.get(codes.size() - 1);
-            String[] maxCodeArray = maxCode.split("\\.");
-            Integer max = Integer.parseInt(maxCodeArray[1]);
-            for (String relation:relations) {
-                max += 1;
-                KlDiagnoseDetail klDiagnoseDetail = new KlDiagnoseDetail();
-                klDiagnoseDetail.setType(type);
-                klDiagnoseDetail.setCode(maxCodeArray[0]+"."+max);
-                klDiagnoseDetail.setStandard(relation);
-                klDiagnoseDetails.add(klDiagnoseDetail);
-                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
+        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()) {
             List<KlDiagnoseDetail> klDiagnoseDetails = tdd.getValue();
-            for (KlDiagnoseDetail kdl:klDiagnoseDetails) {
+            for (KlDiagnoseDetail kdl : klDiagnoseDetails) {
                 Integer type = kdl.getType();
                 String code = kdl.getCode();
                 String formula = kdl.getFormula();
                 String typeName = DiagnoseLexiconTypeEnum.getName(type);//A:症状
-
+                String relation = kdl.getRelation();
+                String standard = kdl.getStandard();
+                List<String> relationNames = Lists.newArrayList(standard.split(CommonEnum.getName(1)));
+                if(type == 3){
+                    relationNames.clear();
+                    relationNames.add(relation);
+                }
+                List<String> checks = Lists.newArrayList();
                 ExportDiagnoseDTO exportDiagnoseDTO = new ExportDiagnoseDTO();
                 BeanUtil.copyProperties(kdl, exportDiagnoseDTO);
+                if (tps.contains(type)) {
+                    String s = DiagnoseLexiconTypeEnum.getName(type).split("\\:")[0];
+                    int key = DiagnoseLexiconTypeEnum.getKey(s);
+                    for (String name : relationNames) {
+                        List<KlLibraryInfo> klLibraryInfos = klLibraryInfoService.list(new QueryWrapper<KlLibraryInfo>()
+                                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                                .eq("name", name)
+                                .eq("type_id", key));
+                        if (ListUtil.isEmpty(klLibraryInfos)) {
+                            checks.add(name + "->");
+                        } else {
+                            KlLibraryInfo klLibraryInfo = klLibraryInfos.get(0);
+                            Long conceptId = klLibraryInfo.getConceptId();
+                            if (klLibraryInfo.getIsConcept() == 0) {
+                                List<KlLibraryInfo> infos = klLibraryInfoService.list(new QueryWrapper<KlLibraryInfo>()
+                                        .eq("is_deleted", IsDeleteEnum.N.getKey())
+                                        .eq("is_concept", 1)
+                                        .eq("type_id", key)
+                                        .eq("concept_id", conceptId));
+                                if (ListUtil.isNotEmpty(infos)) {
+                                    checks.add(name + "->" + infos.get(0).getName());
+                                } else {
+                                    checks.add(name + "->");
+                                }
 
+                            }
+                        }
+                    }
+                }
+                if (ListUtil.isNotEmpty(checks)) {
+                    exportDiagnoseDTO.setCheck(String.join(CommonEnum.getName(1), checks));
+                }
                 if (!types.contains(type)) {
                     String tName = typeName.split(":")[1];//症状
                     String tType = typeName.split(":")[0];//A
                     String tCode = code.split("\\.")[1];
-                    if(typeCodeMap.containsKey(tType)){
+                    if (typeCodeMap.containsKey(tType)) {
                         List<String> codes = typeCodeMap.get(tType);
                         List<String> collect = codes.stream().map(z -> z.split("\\.")[1]).sorted().collect(Collectors.toList());
-                        if(collect.contains(tCode)){
-                            String maxCode = collect.get(collect.size()-1);
-                            tCode = String.valueOf(Integer.parseInt(maxCode)+1);
-                            codes.add(String.valueOf(type)+"."+tCode);
+                        if (collect.contains(tCode)) {
+                            String maxCode = collect.get(collect.size() - 1);
+                            tCode = String.valueOf(Integer.parseInt(maxCode) + 1);
+                            codes.add(String.valueOf(type) + "." + tCode);
 
-                        }else {
-                            codes.add(String.valueOf(type)+"."+tCode);
+                        } else {
+                            codes.add(String.valueOf(type) + "." + tCode);
                         }
-                        typeCodeMap.put(tType,codes);
-                    }else {
+                        typeCodeMap.put(tType, codes);
+                    } else {
                         List<String> codes = Lists.newArrayList();
-                        codes.add(String.valueOf(type)+"."+tCode);
-                        typeCodeMap.put(tType,codes);
+                        codes.add(String.valueOf(type) + "." + tCode);
+                        typeCodeMap.put(tType, codes);
                     }
                     ReflectUtil.setProperty(exportDiagnoseDTO, "type", tName);
-                    ReflectUtil.setProperty(exportDiagnoseDTO, "orderNo", tType+String.valueOf(tCode));
-                    oldNewCodeMap.put(code,tType+String.valueOf(tCode));
-                    if (code.startsWith("3.") ) {
+                    ReflectUtil.setProperty(exportDiagnoseDTO, "orderNo", tType + String.valueOf(tCode));
+                    oldNewCodeMap.put(code, tType + String.valueOf(tCode));
+                    if (code.startsWith("3.")) {
                         exportDiagnoseDTO.setRule(kdl.getRelation());
                         exportDiagnoseDTO.setRelation("");
                     } else {
                         exportDiagnoseDTO.setRule(kdl.getStandard());
                     }
-                    if(code.startsWith("4.")){
-                        exportDiagnoseDTO.setRule(kdl.getRelation().replaceAll("\\、","|"));
+                    if (code.startsWith("4.")) {
+                        exportDiagnoseDTO.setRule(relation.replaceAll("\\、", "|"));
                         exportDiagnoseDTO.setRelation(kdl.getStandard());
                     }
                     exportDiagnoseDTO.setEq(kdl.getMidResult());
-                }else {
+                    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()){
+                    for (Map.Entry<String, String> typeq : oldNewCodeMap.entrySet()) {
                         String oldCode = typeq.getKey();
                         String newCode = typeq.getValue();
-                        formula = formula.replace(oldCode,newCode);
+                        formula = formula.replace(oldCode, newCode);
                     }
-                    exportDiagnoseDTO.setRule(formula.replaceAll("/","、")
-                            .replaceAll("\\(","[").replaceAll("\\)","]"));
+                    exportDiagnoseDTO.setRule(formula.replaceAll("/", "、")
+                            .replaceAll("\\(", "[").replaceAll("\\)", "]"));
                 }
 
                 eds.add(exportDiagnoseDTO);
@@ -214,7 +239,7 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
      * @param diagnoseDetails
      * @return
      */
-    public  List<ExportDiagnoseNameDTO> getCatalogue(Map<String, List<ExportDiagnoseDTO>> diagnoseDetails) {
+    public List<ExportDiagnoseNameDTO> getCatalogue(Map<String, List<ExportDiagnoseDTO>> diagnoseDetails) {
         List<ExportDiagnoseNameDTO> exportDiagnoseNameDTOList = Lists.newArrayList();
         for (String key : diagnoseDetails.keySet()) {
             ExportDiagnoseNameDTO exportDiagnoseNameDTO = new ExportDiagnoseNameDTO();
@@ -230,19 +255,17 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
      * @param klDiagnoseDetails
      */
     public Map<Integer, List<String>> removeKlDiagnoseDetail(List<KlDiagnoseDetail> klDiagnoseDetails, Map<Integer, List<String>> typeCodeNewListMap) {
-
         Map<Integer, List<String>> typeRelationNamesMap = new HashMap<>();// 1 --> [症状1,症状2]
-
         //获取所有公式
         List<String> allFormula = getAllFormula(klDiagnoseDetails);
         //获取公式中的所有编码
         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();
@@ -250,26 +273,13 @@ public class KlDiagnoseDetailFacade extends KlDiagnoseDetailServiceImpl {
                 iterator.remove();
             } else {
                 if (StringUtil.isNotBlank(relation) && types.contains(type)) {
+                    List<String> checks = Lists.newArrayList();
                     List<String> relationNames = Lists.newArrayList(relation.split("\\、"));
-                    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 (typeCodeNewListMap.containsKey(type)) {
-                        List<String> codes = typeCodeNewListMap.get(type);
-                        codes.add(code);
-                        typeCodeNewListMap.put(type, codes);
-                    } else {
-                        List<String> codes = Lists.newArrayList();
-                        codes.add(code);
-                        typeCodeNewListMap.put(type, codes);
-                    }
+                    relationNames.add(0, standard);
+                    next.setStandard(String.join(CommonEnum.getName(1), relationNames));
+                    next.setRelation("");
                 }
+
             }
         }
         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;

+ 38 - 23
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,29 +95,29 @@ 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);
             }
         }
-        addDisName = RegexUtil.getRegexData(addDisName, "【(.*?)】", 1); // 获取名字
         groupData.put(addDisName, importDiagnoseVOList); // 添加最后一个
 
         int i = 0;
@@ -144,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);
@@ -235,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();
@@ -243,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);
                 }
             }
         }
@@ -254,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()) {
@@ -284,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) {
@@ -315,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)) {
@@ -382,8 +398,6 @@ public class KlDiagnoseImportFacade {
                     String rule = importDiagnoseVO.getRule();
                     if (StringUtil.isNotBlank(type) && StringUtil.isNotBlank(rule)) {
                         if ("拟诊".equals(type) || "确诊".equals(type) || "警惕".equals(type)) {
-                            String[] splitGroup = rule.split("\\+");
-
                             KlDiagnoseTypeVO klDiagnoseTypeVO = new KlDiagnoseTypeVO();
                             if ("拟诊".equals(type)) {
                                 klDiagnoseTypeVO.setConditionType(2);
@@ -394,6 +408,7 @@ public class KlDiagnoseImportFacade {
                             }
 
                             //  第三层
+                            String[] splitGroup = rule.split("\\+");
                             List<KlDiagnoseGroupVO> groupVO = Lists.newArrayList();
                             for (String group : splitGroup) {
                                 KlDiagnoseGroupVO klDiagnoseGroupVO = generateDiagnoseGroup(group, map);

+ 5 - 0
src/main/java/com/diagbot/facade/KlLibraryInfoFacade.java

@@ -1,6 +1,10 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.TermConceptDTO;
+import com.diagbot.entity.KlLibraryInfo;
 import com.diagbot.service.impl.KlLibraryInfoServiceImpl;
+import com.diagbot.vo.TermMatchingVO;
 import org.springframework.stereotype.Component;
 
 /**
@@ -10,4 +14,5 @@ import org.springframework.stereotype.Component;
  */
 @Component
 public class KlLibraryInfoFacade extends KlLibraryInfoServiceImpl {
+
 }

+ 13 - 0
src/main/java/com/diagbot/facade/KlOperationFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.KlOperationServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/15 15:07
+ */
+@Component
+public class KlOperationFacade extends KlOperationServiceImpl {
+}

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

+ 15 - 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;
@@ -210,6 +213,7 @@ public class KlRuleFacade extends KlRuleServiceImpl {
                     klRuleCondition.setGroupType(list.getGroupType());
                     klRuleCondition.setRuleBaseId(klRuleBase.getId());
                     klRuleCondition.setRuleId(klRuleInfoSaveVO.getParId());
+                    klRuleCondition.setMsg(list.getSubMsg());
                     res = klRuleConditionFacade.save(klRuleCondition);
                 }
 
@@ -235,4 +239,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);
+    }
+}

+ 0 - 139
src/main/java/com/diagbot/facade/LisConfigFacade.java

@@ -1,139 +0,0 @@
-package com.diagbot.facade;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.diagbot.dto.WordCrfDTO;
-import com.diagbot.entity.LisConfig;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.service.impl.LisConfigServiceImpl;
-import com.diagbot.util.CoreUtil;
-import com.diagbot.util.EntityUtil;
-import com.diagbot.util.ListUtil;
-import com.google.common.collect.Lists;
-import org.springframework.stereotype.Component;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * @Description:
- * @Author:zhaops
- * @time: 2020/7/29 15:03
- */
-@Component
-public class LisConfigFacade extends LisConfigServiceImpl {
-
-    /**
-     * 获取映射关系-id
-     * Map<hisName,Map<hisDetailName,Map<uniqueName,id>>>
-     *
-     * @param hospitalId
-     * @param hisNames
-     * @param uniqueNames
-     * @return
-     */
-    public Map<String, Map<String, Map<String, Long>>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
-        Map<String, Map<String, Map<String, Long>>> retMap = new HashMap<>();
-        QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId);
-        if (ListUtil.isNotEmpty(hisNames)) {
-            queryWrapper.in("his_name", hisNames);
-        }
-        if (ListUtil.isNotEmpty(uniqueNames)) {
-            queryWrapper.in("unique_name", uniqueNames);
-        }
-        List<LisConfig> records = this.list(queryWrapper);
-        if (ListUtil.isEmpty(records)) {
-            return retMap;
-        }
-
-        records.forEach(lisConfig -> {
-            if (lisConfig.getHisDetailName() == null) {
-                lisConfig.setHisDetailName("");
-            }
-        });
-
-        Map<String, List<LisConfig>> hisNameMap = EntityUtil.makeEntityListMap(records, "hisName");
-        for (Map.Entry<String, List<LisConfig>> entry : hisNameMap.entrySet()) {
-            if (ListUtil.isNotEmpty(entry.getValue())) {
-                Map<String, Map<String, Long>> detailNameMap = new HashMap<>();
-                //his名称映射到标准词,1:n
-                Map<String, List<LisConfig>> hisDetailNameMap
-                        = EntityUtil.makeEntityListMap(entry.getValue(), "hisDetailName");
-                for (Map.Entry<String, List<LisConfig>> detailEntry : hisDetailNameMap.entrySet()) {
-                    if (ListUtil.isNotEmpty(detailEntry.getValue())) {
-                        detailNameMap.put(detailEntry.getKey(),
-                                EntityUtil.makeMapWithKeyValue(detailEntry.getValue(), "uniqueName", "id"));
-                    }
-                }
-                retMap.put(entry.getKey(), detailNameMap);
-            }
-        }
-        return retMap;
-    }
-
-    /**
-     * 已映射
-     *
-     * @param name
-     * @return
-     */
-    public Boolean isMapping(String name) {
-        QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("unique_name", name);
-        List<LisConfig> records = this.list(queryWrapper);
-        if (ListUtil.isNotEmpty(records)) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * 标准术语名称修改
-     *
-     * @param oldName
-     * @param newName
-     * @return
-     */
-    public Boolean updateUniqueName(String oldName, String newName) {
-        UpdateWrapper<LisConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("unique_name", oldName)
-                .set("unique_name", newName);
-        this.update(updateWrapper);
-        return true;
-    }
-
-    /**
-     * 获取过滤化验套餐名= 映射套餐名称 + 结构化套餐名称
-     *
-     * @param wordCrfDTO
-     * @return
-     */
-    public List<String> getMappingLisItem(WordCrfDTO wordCrfDTO) {
-        if (ListUtil.isNotEmpty(wordCrfDTO.getLis())) {
-            // 医院化验套餐名
-            List<String> itemList = wordCrfDTO.getLis().stream().map(r -> r.getName()).collect(Collectors.toList());
-            // 获取标准套餐名
-            List<LisConfig> records = this.list(new QueryWrapper<LisConfig>()
-                    .eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", wordCrfDTO.getHospitalId())
-                    .in("his_name", itemList)
-                    .apply("(his_detail_name is null or his_detail_name = '')")
-            );
-            // 获取映射套餐名称
-            List<String> uniqueName = records.stream().map(r -> r.getUniqueName()).collect(Collectors.toList());
-            // 追加医院套餐名称
-            uniqueName.addAll(itemList);
-            // 去重
-            uniqueName = CoreUtil.removeRepeat(uniqueName);
-            return uniqueName;
-        }
-        return Lists.newArrayList();
-    }
-}

+ 163 - 0
src/main/java/com/diagbot/facade/MappingConfigFacade.java

@@ -0,0 +1,163 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.IndexBatchDTO;
+import com.diagbot.entity.MappingConfig;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.MappingConfigService;
+import com.diagbot.service.impl.MappingConfigServiceImpl;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.ConceptVO;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.stereotype.Component;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/6/9 14:19
+ */
+@Component
+public class MappingConfigFacade extends MappingConfigServiceImpl {
+
+    private static Pattern pattern = Pattern.compile("\\s*|\t|\r|\n");
+
+    @Autowired
+    @Qualifier("mappingConfigServiceImpl")
+    private MappingConfigService mappingConfigService;
+
+    @Autowired
+    private KlConceptFacade klConceptFacade;
+
+
+    /**
+     * 根据医院名称分组-返回id
+     *
+     * @param hisNames
+     * @param type
+     * @return
+     */
+    public Map<String, Map<String, Map<Long, List<Long>>>> groupByHisNameWithId(List<String> hisNames, Integer type, Long hospitalId) {
+        Map<String, Map<String, Map<Long, List<Long>>>> retMap = new HashMap<>();
+        QueryWrapper<MappingConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("is_match", 1)
+                .eq("type", type);
+        if (hospitalId != null) {
+            queryWrapper.eq("hospital_id", hospitalId);
+        }
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        List<MappingConfig> list = this.list(queryWrapper);
+
+        if (ListUtil.isEmpty(list)) {
+            return retMap;
+        }
+
+        for (MappingConfig item : list) {
+            if (StringUtil.isBlank(item.getHisDetailName())) {
+                item.setHisDetailName("");
+            }
+        }
+
+        Map<String, List<MappingConfig>> hisMap = list.stream().collect(Collectors.groupingBy(MappingConfig::getHisName));
+        for (Map.Entry<String, List<MappingConfig>> entry : hisMap.entrySet()) {
+            Map<String, Map<Long, List<Long>>> subMap = new HashMap<>();
+            Map<String, List<MappingConfig>> detailMap = entry.getValue().stream()
+                    .collect(Collectors.groupingBy(MappingConfig::getHisDetailName));
+            for (Map.Entry<String, List<MappingConfig>> subEntry : detailMap.entrySet()) {
+                subMap.put(subEntry.getKey(), subEntry.getValue().stream().collect(Collectors.groupingBy(MappingConfig::getConceptId,
+                        Collectors.mapping(MappingConfig::getFormConceptId, Collectors.toList()))));
+            }
+            retMap.put(entry.getKey(), subMap);
+        }
+        return retMap;
+    }
+
+    /**
+     * 根据医院名称分组-返回名称
+     *
+     * @param hisNames
+     * @param type
+     * @param hospitalId
+     * @return
+     */
+    public Map<String, Map<String, Map<String, List<String>>>> groupByHisNameWithName(List<String> hisNames, Integer type, Long hospitalId) {
+        Map<String, Map<String, Map<String, List<String>>>> retMap = new HashMap<>();
+        Map<String, Map<String, Map<Long, List<Long>>>> idMap = groupByHisNameWithId(hisNames, type, hospitalId);
+
+        //conceptIds
+        List<Long> ids = idMap.values()
+                .stream()
+                .flatMap(i -> i.values().stream())
+                .map(i -> i.keySet())
+                .flatMap(Collection::stream)
+                .filter(i -> i != null)
+                .distinct()
+                .collect(Collectors.toList());
+
+        //formConceptId
+        ids.addAll(idMap.values()
+                .stream()
+                .flatMap(i -> i.values().stream())
+                .flatMap(i -> i.values().stream())
+                .flatMap(Collection::stream)
+                .filter(i -> i != null)
+                .distinct()
+                .collect(Collectors.toList()));
+
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setSource(-1);
+        conceptVO.setType(type);
+        conceptVO.setIds(ids);
+        List<IndexBatchDTO> respDTO = klConceptFacade.getConceptNames(conceptVO);
+        List<IndexBatchDTO> indexList = respDTO;
+        if (ListUtil.isNotEmpty(indexList)) {
+            Map<Long, List<IndexBatchDTO>> indexMap
+                    = indexList.stream().collect(Collectors.groupingBy(IndexBatchDTO::getId));
+            for (Map.Entry<String, Map<String, Map<Long, List<Long>>>> entry : idMap.entrySet()) {
+                Map<String, Map<String, List<String>>> subMap = new HashMap<>();
+                for (Map.Entry<String, Map<Long, List<Long>>> subEntry : entry.getValue().entrySet()) {
+                    Map<String, List<String>> thirdMap = new HashMap<>();
+                    List<String> uniqueNames = Lists.newArrayList();
+                    List<String> forms = Lists.newArrayList();
+                    for (Long conceptId : subEntry.getValue().keySet()) {
+                        uniqueNames.addAll(indexMap.get(conceptId).stream().map(IndexBatchDTO::getName).collect(Collectors.toList()));
+                    }
+                    List<Long> formConceptIds = subEntry.getValue().values()
+                            .stream()
+                            .flatMap(Collection::stream)
+                            .distinct()
+                            .collect(Collectors.toList());
+                    for (Long formConceptId : formConceptIds) {
+                        if (formConceptId == null) {
+                            forms.add("");
+                        } else {
+                            forms.addAll(indexMap.get(formConceptId).stream().map(IndexBatchDTO::getName).collect(Collectors.toList()));
+                        }
+                    }
+                    forms = forms.stream().distinct().collect(Collectors.toList());
+                    for (String uniqueName : uniqueNames) {
+                        thirdMap.put(uniqueName, forms);
+                    }
+
+                    subMap.put(subEntry.getKey(), thirdMap);
+                }
+                retMap.put(entry.getKey(), subMap);
+            }
+        }
+        return retMap;
+    }
+
+
+}

+ 41 - 18
src/main/java/com/diagbot/facade/MedRetrievalFacade.java

@@ -8,6 +8,7 @@ import com.diagbot.dto.IndexDTO;
 import com.diagbot.dto.LisDetailDTO;
 import com.diagbot.dto.NurseInfoDTO;
 import com.diagbot.dto.OperationInfoDTO;
+import com.diagbot.dto.RetrievalConceptDTO;
 import com.diagbot.dto.RetrievalDTO;
 import com.diagbot.dto.ScaleInfoDTO;
 import com.diagbot.dto.StaticKnowledgeIndexDTO;
@@ -30,7 +31,6 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 /**
  * @Description:
@@ -63,13 +63,16 @@ public class MedRetrievalFacade {
         /**
          * 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、9-症状、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉
          */
+
         switch (retrievalVO.getType()) {
             case 1:
                 medRetrievalVO.setTypeId(LexiconEnum.LisName.getKey());
                 medRetrievalVO.getTypeIds().add(LexiconEnum.LisName.getKey());
+                List<RetrievalConceptDTO> nameList = new ArrayList<>();
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setLisNames(indexList.stream().map(i -> i.getName()).collect(Collectors.toList()));
+                    nameList = BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class);
+                    retrievalDTO.setNameList(nameList);
                 }
                 break;
             case 2:
@@ -94,11 +97,13 @@ public class MedRetrievalFacade {
                 break;
             case 3:
                 medRetrievalVO.setTypeId(LexiconEnum.PacsName.getKey());
-                medRetrievalVO.getTypeIds().addAll(Arrays.asList(new Integer[] { LexiconEnum.PacsName.getKey(),
-                        LexiconEnum.PacsSubName.getKey() }));
+                medRetrievalVO.getTypeIds().addAll(Arrays.asList(LexiconEnum.PacsName.getKey(),
+                        LexiconEnum.PacsSubName.getKey()));
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setPacsNames(indexList.stream().map(i -> i.getName()).collect(Collectors.toList()));
+                    List<RetrievalConceptDTO> pacsNames = new ArrayList<>();
+                    pacsNames = BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class);
+                    retrievalDTO.setNameList(pacsNames);
                 }
                 break;
             case 4:
@@ -106,7 +111,7 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Disease.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setDiseaseNames(BeanUtil.listCopyTo(indexList, DiseaseInfoDTO.class));
+                    retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
                 }
                 break;
             case 5:
@@ -114,7 +119,7 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Medicine.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setDrugNames(BeanUtil.listCopyTo(indexList, DrugInfoDTO.class));
+                    retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
                 }
                 break;
             case 6:
@@ -122,7 +127,7 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Operation.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setOperationNames(BeanUtil.listCopyTo(indexList, OperationInfoDTO.class));
+                    retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
                 }
                 break;
             case 7:
@@ -130,7 +135,9 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Dept.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setDeptNames(indexList.stream().map(i -> i.getName()).collect(Collectors.toList()));
+                    List<RetrievalConceptDTO> deptNames = new ArrayList<>();
+                    deptNames = BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class);
+                    retrievalDTO.setNameList(deptNames);
                 }
                 break;
             case 8:
@@ -138,7 +145,9 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Transfusion.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setTransfusionNames(indexList.stream().map(i -> i.getName()).collect(Collectors.toList()));
+                    List<RetrievalConceptDTO> transfusionNames = new ArrayList<>();
+                    transfusionNames = BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class);
+                    retrievalDTO.setNameList(transfusionNames);
                 }
                 break;
             case 9:
@@ -146,7 +155,9 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Symptom.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setSymptomNames(indexList.stream().map(i -> i.getName()).collect(Collectors.toList()));
+                    List<RetrievalConceptDTO> symptomNames = new ArrayList<>();
+                    symptomNames = BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class);
+                    retrievalDTO.setNameList(symptomNames);
                 }
                 break;
             case 10:
@@ -154,7 +165,7 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Scale.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setScalenames(BeanUtil.listCopyTo(indexList, ScaleInfoDTO.class));
+                    retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
                 }
                 break;
             case 11:
@@ -162,7 +173,7 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Nurse.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setNursenames(BeanUtil.listCopyTo(indexList, NurseInfoDTO.class));
+                    retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
                 }
                 break;
             case 12:
@@ -170,7 +181,7 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Tcmdisease.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setTcmdiseaseNames(BeanUtil.listCopyTo(indexList, TcmdiseaseInfoDTO.class));
+                    retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
                 }
                 break;
             case 13:
@@ -178,7 +189,7 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Tcmsyndrome.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setTcmsyndromeNames(BeanUtil.listCopyTo(indexList, TcmsyndromeInfoDTO.class));
+                    retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
                 }
                 break;
             case 14:
@@ -186,7 +197,15 @@ public class MedRetrievalFacade {
                 medRetrievalVO.getTypeIds().add(LexiconEnum.Anesthesia.getKey());
                 indexList = klConceptFacade.index(medRetrievalVO);
                 if (ListUtil.isNotEmpty(indexList)) {
-                    retrievalDTO.setAnesthesiaInfonames(BeanUtil.listCopyTo(indexList, AnesthesiaInfoDTO.class));
+                    retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
+                }
+                break;
+            case 15:
+                medRetrievalVO.setTypeId(LexiconEnum.Form.getKey());
+                medRetrievalVO.getTypeIds().add(LexiconEnum.Form.getKey());
+                indexList = klConceptFacade.index(medRetrievalVO);
+                if (ListUtil.isNotEmpty(indexList)) {
+                    retrievalDTO.setNameList(BeanUtil.listCopyTo(indexList, RetrievalConceptDTO.class));
                 }
                 break;
         }
@@ -214,7 +233,7 @@ public class MedRetrievalFacade {
         //检索类型(多选):0-全部、1-诊断、2-药品、3-检验、5-检查、6-手术和操作、8-量表、9-护理
         if (ListUtil.isEmpty(types)
                 || (ListUtil.isNotEmpty(types) && types.contains(0))) {
-            staticKnowledgeIndexVO.getTypeIds().addAll(Arrays.asList(new Integer[] { LexiconEnum.Disease.getKey(),
+            staticKnowledgeIndexVO.getTypeIds().addAll(Arrays.asList(LexiconEnum.Disease.getKey(),
                     LexiconEnum.Medicine.getKey(),
                     LexiconEnum.LisName.getKey(),
                     LexiconEnum.LisSubName.getKey(),
@@ -222,7 +241,8 @@ public class MedRetrievalFacade {
                     LexiconEnum.PacsSubName.getKey(),
                     LexiconEnum.Operation.getKey(),
                     LexiconEnum.Scale.getKey(),
-                    LexiconEnum.Nurse.getKey() }));
+                    LexiconEnum.Nurse.getKey(),
+                    LexiconEnum.Law.getKey()));
         } else {
             if (types.contains(1)) {
                 staticKnowledgeIndexVO.getTypeIds().add(LexiconEnum.Disease.getKey());
@@ -247,6 +267,9 @@ public class MedRetrievalFacade {
             if (types.contains(9)) {
                 staticKnowledgeIndexVO.getTypeIds().add(LexiconEnum.Nurse.getKey());
             }
+            if (types.contains(10)) {
+                staticKnowledgeIndexVO.getTypeIds().add(LexiconEnum.Law.getKey());
+            }
         }
 
         List<StaticKnowledgeIndexDTO> retList = klConceptFacade.staticIndex(staticKnowledgeIndexVO);

+ 29 - 7
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;
@@ -15,6 +16,8 @@ import com.diagbot.entity.TranHospitalFilter;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.PushRelationTypeEnum;
 import com.diagbot.enums.RedisEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
 import com.diagbot.model.entity.PD;
 import com.diagbot.service.KlDiseaseCorrespondingService;
 import com.diagbot.service.SymptomFeatureService;
@@ -31,6 +34,8 @@ import com.diagbot.vo.neoPushEntity.PresentPushVo;
 import com.diagbot.vo.neoPushEntity.Symptom;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import io.github.lvyahui8.spring.facade.DataFacade;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -53,6 +58,7 @@ import static com.diagbot.util.StringUtil.permutationNoRepeat;
  * @time: 2018/8/6 9:11
  */
 @Component
+@Slf4j
 public class NeoFacade {
     @Autowired
     NeoFacade self;
@@ -75,6 +81,8 @@ public class NeoFacade {
     private KlRelationFacade klRelationFacade;
     @Autowired
     private KlDiagnoseBaseFacade klDiagnoseBaseFacade;
+    @Autowired
+    private KlRegulationBaseFacade klRegulationBaseFacade;
 
     /**
      * 返回药品缓存信息
@@ -479,14 +487,21 @@ public class NeoFacade {
     }
 
     public void allRuleCache() {
-        List<RuleDTO> ruleDTOList = klRuleFacade.getAllRule();
-        if (ListUtil.isNotEmpty(ruleDTOList)) {
-            Map map = ruleDTOList.stream().collect(Collectors.toMap(
-                    k -> RedisEnum.allRule.getName() + k.getLibType() + "_" + k.getLibName() + "_" + k.getRuleType(),
-                    v -> v,
-                    (v1, v2) -> (v2)
-            ));
+//        List<RuleDTO> ruleDTOList = klRuleFacade.getAllRule();
+//        if (ListUtil.isNotEmpty(ruleDTOList)) {
+//            Map map = ruleDTOList.stream().collect(Collectors.toMap(
+//                    k -> RedisEnum.allRule.getName() + k.getLibType() + "_" + k.getLibName() + "_" + k.getRuleType(),
+//                    v -> v,
+//                    (v1, v2) -> (v2)
+//            ));
+//            redisTemplate.opsForValue().multiSet(map);
+//        }
+        try {
+            Map<String, Object> invokeParams = new HashMap<>();
+            Map<String, RuleDTO> map = DataFacade.get("getAllRules", invokeParams, Map.class);
             redisTemplate.opsForValue().multiSet(map);
+        } catch (Exception e) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取所有规则失败" + e.getMessage());
         }
     }
 
@@ -496,4 +511,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);
+        }
+    }
 }

+ 0 - 57
src/main/java/com/diagbot/facade/OperationConfigFacade.java

@@ -1,57 +0,0 @@
-package com.diagbot.facade;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.diagbot.entity.OperationConfig;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.service.OperationConfigService;
-import com.diagbot.util.ListUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-
-/**
- * @Description:
- * @Author:zhaops
- * @time: 2020/7/29 15:05
- */
-@Component
-public class OperationConfigFacade {
-    @Autowired
-    private OperationConfigService operationConfigService;
-
-    /**
-     * 已映射
-     *
-     * @param name
-     * @return
-     */
-    public Boolean isMapping(String name) {
-        QueryWrapper<OperationConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("unique_name", name);
-        List<OperationConfig> records = operationConfigService.list(queryWrapper);
-        if (ListUtil.isNotEmpty(records)) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * 标准术语名称修改
-     *
-     * @param oldName
-     * @param newName
-     * @return
-     */
-    public Boolean updateUniqueName(String oldName, String newName) {
-        UpdateWrapper<OperationConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("unique_name", oldName)
-                .set("unique_name", newName);
-        operationConfigService.update(updateWrapper);
-        return true;
-    }
-}

+ 0 - 89
src/main/java/com/diagbot/facade/PacsConfigFacade.java

@@ -1,89 +0,0 @@
-package com.diagbot.facade;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.diagbot.entity.PacsConfig;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.service.impl.PacsConfigServiceImpl;
-import com.diagbot.util.EntityUtil;
-import com.diagbot.util.ListUtil;
-import org.springframework.stereotype.Component;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @Description:
- * @Author:zhaops
- * @time: 2020/7/29 15:03
- */
-@Component
-public class PacsConfigFacade extends PacsConfigServiceImpl {
-
-    /**
-     * 获取映射关系-公表名
-     *
-     * @param hospitalId
-     * @param hisNames
-     * @param uniqueNames
-     * @return
-     */
-    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
-        Map<String, Map<String, Long>> retMap = new HashMap<>();
-        QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", hospitalId);
-        if (ListUtil.isNotEmpty(hisNames)) {
-            queryWrapper.in("his_name", hisNames);
-        }
-        if (ListUtil.isNotEmpty(uniqueNames)) {
-            queryWrapper.in("unique_name", uniqueNames);
-        }
-        List<PacsConfig> records = this.list(queryWrapper);
-        if (ListUtil.isEmpty(records)) {
-            return retMap;
-        }
-        Map<String, List<PacsConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
-        for (Map.Entry<String, List<PacsConfig>> entry : configMap.entrySet()) {
-            if (ListUtil.isNotEmpty(entry.getValue())) {
-                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "uniqueName", "id"));
-            }
-        }
-        return retMap;
-    }
-
-    /**
-     * 已映射
-     *
-     * @param name
-     * @return
-     */
-    public Boolean isMapping(String name) {
-        QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("unique_name", name);
-        List<PacsConfig> records = this.list(queryWrapper);
-        if (ListUtil.isNotEmpty(records)) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * 标准术语名称修改
-     *
-     * @param oldName
-     * @param newName
-     * @return
-     */
-    public Boolean updateUniqueName(String oldName, String newName) {
-        UpdateWrapper<PacsConfig> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("unique_name", oldName)
-                .set("unique_name", newName);
-        this.update(updateWrapper);
-        return true;
-    }
-}

+ 190 - 0
src/main/java/com/diagbot/facade/TermMatchingFacade.java

@@ -0,0 +1,190 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.client.StandConvertServiceClient;
+import com.diagbot.dto.StandConvertCrfDTO;
+import com.diagbot.dto.TermConceptDTO;
+import com.diagbot.entity.KlLibraryInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.LexiconEnum;
+import com.diagbot.enums.StandConvertCrfEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.vo.StandConvertCrfVO;
+import com.diagbot.vo.TermMatchingListVO;
+import com.diagbot.vo.TermMatchingVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author wangfeng
+ * @Description:
+ * @date 2021-06-10 19:48
+ */
+@Component
+public class TermMatchingFacade {
+    @Autowired
+    KlLibraryInfoFacade klLibraryInfoFacade;
+    @Autowired
+    StandConvertServiceClient standConvertServiceClient;
+
+    public List<TermConceptDTO> getTermMatchingAll(TermMatchingVO termMatchingVO) {
+        List<TermConceptDTO> list = new ArrayList<>();
+        Integer type = convertType(termMatchingVO.getType());
+        TermMatchingVO termMatchingVONew = new TermMatchingVO();
+        BeanUtil.copyProperties(termMatchingVO, termMatchingVONew);
+        termMatchingVONew.setType(type);
+        if (type != null) {
+            TermConceptDTO libraryInfo = klLibraryInfoFacade.getConcept(termMatchingVONew);
+            if (null == libraryInfo && type.equals(LexiconEnum.PacsName.getKey())) {
+                termMatchingVONew.setType(LexiconEnum.PacsSubName.getKey());
+                libraryInfo = klLibraryInfoFacade.getConcept(termMatchingVONew);
+            }
+            if (null != libraryInfo) {
+                TermConceptDTO termConceptDTO = new TermConceptDTO();
+                termConceptDTO.setId(libraryInfo.getId());
+                termConceptDTO.setName(libraryInfo.getName());
+                termConceptDTO.setSource(libraryInfo.getSource() == 1 ? 1 : 2);
+                termConceptDTO.setCode(libraryInfo.getCode());
+                list.add(termConceptDTO);
+            }
+        }
+        //没有找到标准词或同义词才找相似词
+        if (ListUtil.isEmpty(list)) {
+            //相似词
+            StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
+            // 类型,疾病: disease,症状: symptom,手术和操作:operation,药品: drug,实验室检查:lis,辅助检查:pacs, 辅助检查:vital
+            String wordType = wordType(termMatchingVO.getType());
+            if (StringUtil.isNotBlank(wordType)) {
+                standConvertCrfVO.setWord_type(wordType);
+                standConvertCrfVO.setWord(termMatchingVO.getInputStr());
+                standConvertCrfVO.setNumber(5);
+                StandConvertCrfDTO standConvertCrfDTO = new StandConvertCrfDTO();
+                try {
+                    standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
+                } catch (Exception e) {
+                    throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "标准词转换【服务器】挂了!" + e.getMessage());
+                }
+
+                List<Map<String, String>> standard_words = standConvertCrfDTO.getStandard_words();
+                List<String> placeToList = new ArrayList<>();
+                if (ListUtil.isNotEmpty(standard_words)) {
+                    for (Map<String, String> map : standard_words) {
+                        String placeTo = map.get("standard_word");
+                        placeToList.add(placeTo);
+                    }
+                    TermMatchingListVO termMatchingListVO = new TermMatchingListVO();
+                    termMatchingListVO.setPlaceToList(placeToList);
+                    termMatchingListVO.setType(type);
+                    QueryWrapper<KlLibraryInfo> klLibraryInfo = new QueryWrapper<>();
+                    klLibraryInfo.eq("is_deleted", IsDeleteEnum.N.getKey())
+                            .eq("type_id", type)
+                            .in("name", placeToList);
+                    List<TermConceptDTO> libraryInfoList = klLibraryInfoFacade.getConceptList(termMatchingListVO);
+                    if (ListUtil.isNotEmpty(libraryInfoList)) {
+                        for (TermConceptDTO data : libraryInfoList) {
+                            TermConceptDTO termConceptDTO = new TermConceptDTO();
+                            termConceptDTO.setId(data.getId());
+                            termConceptDTO.setName(data.getName());
+                            termConceptDTO.setCode(data.getCode());
+                            termConceptDTO.setSource(5);
+                            list.add(termConceptDTO);
+                        }
+                    }
+                }
+            }
+        }
+        return list;
+    }
+
+    public Integer convertType(Integer type) {
+        Integer retType = null;
+        //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候
+        switch (type) {
+            case 1:
+                retType = LexiconEnum.LisName.getKey();
+                break;
+            case 2:
+                retType = LexiconEnum.LisSubName.getKey();
+                break;
+            case 3:
+                retType = LexiconEnum.PacsName.getKey();
+                break;
+            case 4:
+                retType = LexiconEnum.Disease.getKey();
+                break;
+            case 5:
+                retType = LexiconEnum.Medicine.getKey();
+                break;
+            case 6:
+                retType = LexiconEnum.Operation.getKey();
+                break;
+            case 7:
+                retType = LexiconEnum.Dept.getKey();
+                break;
+            case 8:
+                retType = LexiconEnum.Transfusion.getKey();
+                break;
+            case 9:
+                retType = LexiconEnum.Symptom.getKey();
+                break;
+            case 10:
+                retType = LexiconEnum.Scale.getKey();
+                break;
+            case 11:
+                retType = LexiconEnum.Nurse.getKey();
+                break;
+            case 12:
+                retType = LexiconEnum.Tcmdisease.getKey();
+                break;
+            case 13:
+                retType = LexiconEnum.Tcmsyndrome.getKey();
+                break;
+            case 14:
+                retType = LexiconEnum.Anesthesia.getKey();
+                break;
+            case 15:
+                retType = LexiconEnum.Form.getKey();
+                break;
+            default:
+                break;
+        }
+        return retType;
+    }
+
+    public String wordType(Integer type) {
+        String retType = null;
+        //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候
+        //类型,疾病: disease,症状: symptom,手术和操作:operation,药品: drug,实验室检查:lis,辅助检查:pacs, 查体:vital
+        switch (type) {
+            case 1:
+                retType = StandConvertCrfEnum.lis.getName();
+                break;
+            case 2:
+                retType = StandConvertCrfEnum.lis.getName();
+                break;
+            case 3:
+                retType = StandConvertCrfEnum.pacs.getName();
+                break;
+            case 4:
+                retType = StandConvertCrfEnum.disease.getName();
+                break;
+            case 5:
+                retType = StandConvertCrfEnum.drug.getName();
+                break;
+            case 6:
+                retType = StandConvertCrfEnum.operation.getName();
+                break;
+            default:
+                break;
+        }
+        return retType;
+    }
+}

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

+ 8 - 0
src/main/java/com/diagbot/mapper/KlLibraryInfoMapper.java

@@ -1,7 +1,12 @@
 package com.diagbot.mapper;
 
+import com.diagbot.dto.TermConceptDTO;
 import com.diagbot.entity.KlLibraryInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.vo.TermMatchingListVO;
+import com.diagbot.vo.TermMatchingVO;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +18,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface KlLibraryInfoMapper extends BaseMapper<KlLibraryInfo> {
 
+    TermConceptDTO getConcept(TermMatchingVO termMatchingVO);
+
+    List<TermConceptDTO> getConceptList(TermMatchingListVO termMatchingListVO);
 }

+ 0 - 0
src/main/java/com/diagbot/mapper/KlOperationMapper.java


部分文件因文件數量過多而無法顯示