use `cdss`;

/*
 Navicat Premium Data Transfer

 Source Server         : 192.168.2.236
 Source Server Type    : MySQL
 Source Server Version : 50731
 Source Host           : 192.168.2.236:3306
 Source Schema         : cdss

 Target Server Type    : MySQL
 Target Server Version : 50731
 File Encoding         : 65001

 Date: 25/03/2021 09:51:07
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for test_case_info
-- ----------------------------
DROP TABLE IF EXISTS `test_case_info`;
CREATE TABLE `test_case_info`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `is_deleted` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime(0) NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime(0) NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  `case_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '测试案例',
  `case_group` int(4) NOT NULL COMMENT '测试组',
  `case_no` int(4) NOT NULL COMMENT '测试编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of test_case_info
-- ----------------------------
INSERT INTO `test_case_info` VALUES (1, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '开单合理性提醒_通用规则', 1, 1);
INSERT INTO `test_case_info` VALUES (2, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '开单合理性提醒_输血规则', 1, 2);
INSERT INTO `test_case_info` VALUES (3, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '危急值提醒_实验室检查规则', 1, 3);
INSERT INTO `test_case_info` VALUES (4, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '危急值提醒_辅助检查规则', 1, 4);
INSERT INTO `test_case_info` VALUES (5, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '高风险提醒_高危药品规则', 1, 5);
INSERT INTO `test_case_info` VALUES (6, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '高风险提醒_高危手术规则', 1, 6);
INSERT INTO `test_case_info` VALUES (7, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '其他提醒_化验规则', 1, 7);
INSERT INTO `test_case_info` VALUES (8, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '其他提醒_辅检规则', 1, 8);
INSERT INTO `test_case_info` VALUES (9, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '其他提醒_输血规则', 1, 9);
INSERT INTO `test_case_info` VALUES (10, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '诊断', 2, 1);
INSERT INTO `test_case_info` VALUES (11, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '检验', 2, 2);
INSERT INTO `test_case_info` VALUES (12, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '检查', 2, 3);
INSERT INTO `test_case_info` VALUES (13, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '药品', 2, 4);
INSERT INTO `test_case_info` VALUES (14, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '手术/操作', 2, 5);
INSERT INTO `test_case_info` VALUES (15, 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '正常项目重复开立规则', 1, 10);

SET FOREIGN_KEY_CHECKS = 1;

/*
 Navicat Premium Data Transfer

 Source Server         : 192.168.2.236
 Source Server Type    : MySQL
 Source Server Version : 50731
 Source Host           : 192.168.2.236:3306
 Source Schema         : cdss

 Target Server Type    : MySQL
 Target Server Version : 50731
 File Encoding         : 65001

 Date: 25/03/2021 09:52:13
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for test_result_info
-- ----------------------------
DROP TABLE IF EXISTS `test_result_info`;
CREATE TABLE `test_result_info`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `is_deleted` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime(0) NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime(0) NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  `hospital_id` bigint(20) NOT NULL COMMENT '医院id',
  `case_id` bigint(20) NOT NULL COMMENT '测试案例id',
  `rule_num` int(7) NULL DEFAULT NULL COMMENT '规则条数',
  `rule_success_num` int(7) NULL DEFAULT NULL COMMENT '规则执行成功条数',
  `rule_failed_num` int(7) NULL DEFAULT NULL COMMENT '规则执行失败条数',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;


/*
 Navicat Premium Data Transfer

 Source Server         : 192.168.2.236
 Source Server Type    : MySQL
 Source Server Version : 50731
 Source Host           : 192.168.2.236:3306
 Source Schema         : cdss

 Target Server Type    : MySQL
 Target Server Version : 50731
 File Encoding         : 65001

 Date: 25/03/2021 09:52:55
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for test_result_rule
-- ----------------------------
DROP TABLE IF EXISTS `test_result_rule`;
CREATE TABLE `test_result_rule`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `is_deleted` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime(0) NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime(0) NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  `result_id` bigint(20) NOT NULL COMMENT '测试结果id',
  `rule_order_no` bigint(20) NULL DEFAULT NULL COMMENT '规则序号',
  `rule_type` int(4) NOT NULL COMMENT '规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)',
  `rule_id` bigint(20) NULL DEFAULT NULL COMMENT '规则id',
  `rule_lib_type` int(4) NULL DEFAULT NULL COMMENT '规则术语类型编码',
  `rule_lib_type_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规则术语类型',
  `rule_lib_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '规则医学标准术语',
  `rule_his_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '规则医院术语',
  `rule_his_detail_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '规则医院术语细项',
  `has_sub_cond` int(1) NOT NULL DEFAULT 0 COMMENT '是否有子条件（0：无，1：有）',
  `rule_base_id` bigint(20) NULL DEFAULT NULL COMMENT '基础规则id',
  `group_type` int(4) NULL DEFAULT NULL COMMENT '规则组别',
  `rule_base_type` int(4) NULL DEFAULT NULL COMMENT '基础规则类型(1:开单外等于术语本身;2:开单外存在比较;3:开单外不等于术语本身;4:过敏原;5:开单项;6:检查结果正则表达式)',
  `rule_base_lib_type` int(4) NULL DEFAULT NULL COMMENT '基础规则术语类型（编码）',
  `rule_base_lib_type_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '基础规则术语类型',
  `rule_base_lib_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '基础规则医学标准术语',
  `rule_base_his_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '基础规则医院术语',
  `rule_base_his_detail_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '基础规则医院术语细则',
  `rule_base_max_value` decimal(10, 4) NULL DEFAULT NULL COMMENT '基础规则参考值（最大值）',
  `rule_base_min_value` decimal(10, 4) NULL DEFAULT NULL COMMENT '基础规则参考值（最小值）',
  `rule_base_unit` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '基础规则单位',
  `rule_base_input_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '基础规则输入值',
  `reference_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '基础规则参考值',
  `output` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '实际输出结果（提醒文本）',
  `expected_output` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '期望输出结果（提醒文本）',
  `success` int(4) NULL DEFAULT NULL COMMENT '成功标志（1：成功，0：失败）',
  `message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '提示信息（异常提醒）',
  `input_params` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '模拟入参',
  `output_params` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '模拟出参',
  `rule_msg` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '附加信息',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;



-- 删除表
DROP TABLE IF EXISTS `test_result_bill`;
DROP TABLE IF EXISTS `test_result_critical`;
DROP TABLE IF EXISTS `test_result_highrisk_drug`;
DROP TABLE IF EXISTS `test_result_highrisk_operation`;
DROP TABLE IF EXISTS `test_result_other_lis`;
DROP TABLE IF EXISTS `test_result_other_pacs`;
DROP TABLE IF EXISTS `test_result_other_transfusion`;


use `sys-user`;

UPDATE `sys-user`.`sys_menu` SET `id`='91', `is_deleted`='N', `gmt_create`='1970-01-01 12:00:00', `gmt_modified`='1970-01-01 12:00:00', `creator`='0', `modifier`='0', `name`='规则测试', `parent_id`='90', `code`='LT-YYSYZDHCS-ZSTPGZCS', `order_no`='10', `remark`='朗通-医院术语自动化测试-规则测试' WHERE (`id`='91');

