use `qc`;

/**
执行脚本前请先看注意事项：
    此脚本默认医院为北仑医院，其他医院执行此脚本需要更改为对应医院id
    下面此表的新增操作，执行此脚本的医院需要修改对应的医院id,此脚本默认北仑医院id
    1、qc_cases_relevance_entry
    2、qc_cases_entry_hospital
    3、sys_hospital_set
    4、sys_task_cron              param参数修改为医院的id


 */
INSERT INTO `sys_dictionary_info` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `group_type`, `name`, `val`, `return_type`, `order_no`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '2', 'gmtCreate', '创建时间', '2', '0', '病案首页');

DROP TABLE IF EXISTS `qc_cases_relevance_entry`;
CREATE TABLE `qc_cases_relevance_entry` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `type` tinyint(4) DEFAULT '1' COMMENT '指标编号',
  `hospital_id` bigint(20) DEFAULT NULL COMMENT '医院ID',
  `cases_name` varchar(255) DEFAULT NULL COMMENT '指标名称',
  `relevance_id` bigint(20) DEFAULT NULL COMMENT '关联质控条目',
  `name` varchar(255) DEFAULT NULL COMMENT '条目',
  `is_deleted` varchar(255) DEFAULT 'N',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='质控关联条目表';

-- ----------------------------

/**
编码添加
 */
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3107', '248', '围手术期病历讨论', '17', 'OPE03107', '手术记录次数与手术次数不一致', '2', '1', '0', '1', '2', '', NULL, '', 'N', '2021-04-19 11:54:19', '2021-04-19 11:54:19', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3117', '241', '三级查房制度', '4', 'THR03117', '病理检查存在病程记录中无病理报告结果', '2', '1', '0', '1', '2', '', NULL, '', 'N', '2021-04-19 11:56:50', '2021-04-19 11:56:50', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3116', '241', '三级查房制度', '35', 'THR03116', '病理检查缺少病理检查报告单', '2', '1', '0', '1', '2', '', NULL, '', 'N', '2021-04-28 11:14:18', '2021-04-28 11:14:18', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3115', '241', '三级查房制度', '4', 'THR03115', '医嘱存在CT,病程记录未记录', '2', '1', '0', '1', '3', '', NULL, '', 'N', '2021-04-19 11:55:38', '2021-04-19 11:55:38', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3114', '241', '三级查房制度', '4', 'THR03114', '医嘱存在CT,报告单未记录', '2', '1', '0', '1', '2', '', NULL, '', 'N', '2021-04-28 11:11:46', '2021-04-28 11:11:46', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3113', '241', '三级查房制度', '4', 'THR3113', '医嘱存在MR,病程记录未记录', '2', '1', '0', '1', '2', '', NULL, '', 'N', '2021-04-19 11:55:18', '2021-04-19 11:55:18', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3112', '241', '三级查房制度', '4', 'THR03112', '医嘱存在MR,报告单未记录', '2', '1', '0', '1', '3', '', NULL, '', 'N', '2021-04-28 11:16:28', '2021-04-28 11:16:28', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3111', '248', '围手术期病历讨论', '17', 'OPE03111', '手术病理检查存在手术记录中无病理相关记录', '1', '1', '0', '1', '2', '', NULL, '', 'N', '2021-04-19 11:57:52', '2021-04-19 11:57:52', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3110', '243', '病案首页', '6', 'FIRP03110', '病案首页未在患者出院院24小时内完成', '1', '1', '0', '1', '1', '', NULL, '', 'N', '2021-04-19 11:57:14', '2021-04-19 11:57:14', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3118', '283', '病历书写规范', '53', 'MEDI03118', '知情同意书无患方签名或患方签名未授权', '2', '1', '1', '1', '3', '', NULL, '', 'N', '2021-05-18 21:58:57', '2021-05-18 21:58:57', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3119', '248', '围手术期病历讨论', '17', 'OPE03119', '使用植入物但手术记录或病程记录未记录相关信息', '2', '1', '1', '1', '3', '', NULL, '', 'N', '2021-05-18 22:21:40', '2021-05-18 22:21:40', '0', '医学人员');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3120', '241', '三级查房制度', '4', 'THR03120', '病程记录未记录恶性肿瘤放射治疗相关信息', '2', '1', '0', '1', '3', '', NULL, '', 'N', '2021-05-12 16:50:11', '2021-05-12 16:50:11', '0', '邵启华');

INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3123', '241', '三级查房制度', '4', 'THR03123', '病程记录未记录恶性肿瘤化学治疗相关信息', '2', '1', '0', '1', '2', '', NULL, '', 'N', '2021-05-12 10:00:43', '2021-05-12 10:00:43', '0', '邵启华');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3122', '241', '三级查房制度', '4', 'THR03122', '有抗菌药物使用病程无记录', '2', '1', '0', '1', '1', '', NULL, '【指标十一】抗菌药物使用记录符合率(MER-D&T-01)', 'N', '2021-05-11 14:31:38', '2021-05-11 14:31:38', '0', '邵启华');
INSERT INTO `qc_cases_entry` (`id`, `cases_id`, `cases_name`, `mode_id`, `code`, `name`, `drgs`, `type`, `rule_type`, `dev_type`, `accuracy_type`, `precond`, `order_no`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ('3121', '241', '三级查房制度', '4', 'THR03121', '报告单或病程记录缺少细菌培养记录', '2', '1', '0', '1', '1', '', NULL, '【指标十】细菌培养检查记录符合率(MER-ME-03)', 'N', '2021-05-11 14:27:57', '2021-05-11 14:27:57', '0', '邵启华');


/**
qc_cases_entry_hospital、qc_type_cases_entry 分值确定添加
 */
 -- 需要修改对应的医院id,此脚本默认北仑医院id
SET @id ='4';
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-04-19 11:54:19', '2021-04-19 11:54:19', '0', '医学人员', '3107', @id, '1.0', '1.0', '手术记录次数与手术次数不一致', '1', '0', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-04-19 11:56:50', '2021-04-19 11:56:50', '0', '医学人员', '3117', @id, '1.0', '1.0', '病理检查存在病程记录中无病理报告结果', '1', '0', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-04-19 11:56:23', '2021-04-19 11:56:23', '0', '医学人员', '3116', @id, '1.0', '1.0', '病理检查缺少病理检查报告单', '1', '0', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-04-19 11:55:38', '2021-04-19 11:55:38', '0', '医学人员', '3115', @id, '1.0', '1.0', '医嘱存在CT,病程记录未记录', '1', '0', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-04-19 11:55:59', '2021-04-19 11:55:59', '0', '医学人员', '3114', @id, '1.0', '1.0', '医嘱存在CT,报告单未记录', '1', '0', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-04-19 11:55:18', '2021-04-19 11:55:18', '0', '医学人员', '3113', @id, '1.0', '1.0', '医嘱存在MR,病程记录未记录', '1', '0', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-04-19 11:57:30', '2021-04-19 11:57:30', '0', '医学人员', '3112', @id, '1.0', '1.0', '医嘱存在MR,报告单未记录', '1', '0', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-04-19 11:57:52', '2021-04-19 11:57:52', '0', '医学人员', '3111', @id, '1.0', '1.0', '手术病理检查存在手术记录中无病理相关记录', '1', '0', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-04-19 11:57:14', '2021-04-19 11:57:14', '0', '医学人员', '3110', @id, '1.0', '1.0', '病案首页未在患者出院院24小时内完成', '1', '0', '0', '');

INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-05-18 21:58:57', '2021-05-18 21:58:57', '0', '医学人员', '3118', @id,  '0.0', '0.0', '知情同意书无患方签名或患方签名未授权', '1', '0', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-05-18 22:21:40', '2021-05-18 22:21:40', '0', '医学人员', '3119', @id,  '0.0', '0.0', '使用植入物但手术记录或病程记录未记录相关信息', '1', '0', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-05-12 16:50:11', '2021-05-12 16:50:11', '0', '邵启华', '3120', @id,  '0.0', '0.0', '病程记录未记录恶性肿瘤放射治疗相关信息', '1', '0', '0', '');

INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-05-12 10:00:43', '2021-05-12 10:00:43', '0', '邵启华', '3123', @id, '0.0', '0.0', '病程记录未记录恶性肿瘤化学治疗相关信息', '1', '1', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-05-11 14:31:38', '2021-05-11 14:31:38', '0', '邵启华', '3122', @id, '0.0', '0.0', '有抗菌药物使用病程无记录', '1', '1', '0', '');
INSERT INTO `qc_cases_entry_hospital` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cases_entry_id`, `hospital_id`, `score`, `score_run`, `msg`, `is_used`, `is_used_run`, `is_reject`, `remark`) VALUES ( 'N', '2021-05-11 14:27:57', '2021-05-11 14:27:57', '0', '邵启华', '3121', @id, '0.0', '0.0', '报告单或病程记录缺少细菌培养记录', '1', '1', '0', '');



INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3117', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3117', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3117', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3117', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3117', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3117', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3116', NULL, 'N', '2021-04-19 12:48:09', '2021-04-19 12:48:09', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3116', NULL, 'N', '2021-04-19 12:48:09', '2021-04-19 12:48:09', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3116', NULL, 'N', '2021-04-19 12:48:09', '2021-04-19 12:48:09', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3116', NULL, 'N', '2021-04-19 12:48:09', '2021-04-19 12:48:09', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3116', NULL, 'N', '2021-04-19 12:48:09', '2021-04-19 12:48:09', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3116', NULL, 'N', '2021-04-19 12:48:09', '2021-04-19 12:48:09', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3115', NULL, 'N', '2021-04-19 12:48:57', '2021-04-19 12:48:57', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3115', NULL, 'N', '2021-04-19 12:48:57', '2021-04-19 12:48:57', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3115', NULL, 'N', '2021-04-19 12:48:57', '2021-04-19 12:48:57', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3115', NULL, 'N', '2021-04-19 12:48:57', '2021-04-19 12:48:57', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3115', NULL, 'N', '2021-04-19 12:48:57', '2021-04-19 12:48:57', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3115', NULL, 'N', '2021-04-19 12:48:57', '2021-04-19 12:48:57', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3114', NULL, 'N', '2021-04-19 12:48:42', '2021-04-19 12:48:42', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3114', NULL, 'N', '2021-04-19 12:48:42', '2021-04-19 12:48:42', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3114', NULL, 'N', '2021-04-19 12:48:42', '2021-04-19 12:48:42', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3114', NULL, 'N', '2021-04-19 12:48:42', '2021-04-19 12:48:42', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3114', NULL, 'N', '2021-04-19 12:48:42', '2021-04-19 12:48:42', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3114', NULL, 'N', '2021-04-19 12:48:42', '2021-04-19 12:48:42', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3113', NULL, 'N', '2021-04-19 12:49:11', '2021-04-19 12:49:11', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3113', NULL, 'N', '2021-04-19 12:49:11', '2021-04-19 12:49:11', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3113', NULL, 'N', '2021-04-19 12:49:11', '2021-04-19 12:49:11', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3113', NULL, 'N', '2021-04-19 12:49:11', '2021-04-19 12:49:11', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3113', NULL, 'N', '2021-04-19 12:49:11', '2021-04-19 12:49:11', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3113', NULL, 'N', '2021-04-19 12:49:11', '2021-04-19 12:49:11', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3112', NULL, 'N', '2021-04-19 12:47:20', '2021-04-19 12:47:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3112', NULL, 'N', '2021-04-19 12:47:20', '2021-04-19 12:47:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3112', NULL, 'N', '2021-04-19 12:47:20', '2021-04-19 12:47:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3112', NULL, 'N', '2021-04-19 12:47:20', '2021-04-19 12:47:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3112', NULL, 'N', '2021-04-19 12:47:20', '2021-04-19 12:47:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3112', NULL, 'N', '2021-04-19 12:47:20', '2021-04-19 12:47:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3111', NULL, 'N', '2021-04-19 12:47:02', '2021-04-19 12:47:02', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3111', NULL, 'N', '2021-04-19 12:47:02', '2021-04-19 12:47:02', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3111', NULL, 'N', '2021-04-19 12:47:02', '2021-04-19 12:47:02', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3111', NULL, 'N', '2021-04-19 12:47:02', '2021-04-19 12:47:02', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3111', NULL, 'N', '2021-04-19 12:47:02', '2021-04-19 12:47:02', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3111', NULL, 'N', '2021-04-19 12:47:02', '2021-04-19 12:47:02', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3110', NULL, 'N', '2021-04-19 12:47:35', '2021-04-19 12:47:35', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3110', NULL, 'N', '2021-04-19 12:47:35', '2021-04-19 12:47:35', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3110', NULL, 'N', '2021-04-19 12:47:35', '2021-04-19 12:47:35', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3110', NULL, 'N', '2021-04-19 12:47:35', '2021-04-19 12:47:35', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3110', NULL, 'N', '2021-04-19 12:47:35', '2021-04-19 12:47:35', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3110', NULL, 'N', '2021-04-19 12:47:35', '2021-04-19 12:47:35', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3107', NULL, 'N', '2021-04-19 11:58:03', '2021-04-19 11:58:03', '98', '98');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3107', NULL, 'N', '2021-04-19 11:58:03', '2021-04-19 11:58:03', '98', '98');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3107', NULL, 'N', '2021-04-19 11:58:03', '2021-04-19 11:58:03', '98', '98');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3107', NULL, 'N', '2021-04-19 11:58:03', '2021-04-19 11:58:03', '98', '98');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3107', NULL, 'N', '2021-04-19 11:58:03', '2021-04-19 11:58:03', '98', '98');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3107', NULL, 'N', '2021-04-19 11:58:03', '2021-04-19 11:58:03', '98', '98');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3120', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3120', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3120', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3120', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3120', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3120', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');

INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3118', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3118', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3118', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3118', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3118', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3118', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');

INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3119', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3119', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3119', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3119', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3119', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3119', NULL, 'N', '2021-04-19 12:47:51', '2021-04-19 12:47:51', '99', '99');

INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3123', NULL, 'N', '2021-05-14 15:42:39', '2021-05-14 15:42:39', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3123', NULL, 'N', '2021-05-14 15:42:39', '2021-05-14 15:42:39', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3123', NULL, 'N', '2021-05-14 15:42:39', '2021-05-14 15:42:39', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3123', NULL, 'N', '2021-05-14 15:42:39', '2021-05-14 15:42:39', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3123', NULL, 'N', '2021-05-14 15:42:39', '2021-05-14 15:42:39', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3123', NULL, 'N', '2021-05-14 15:42:39', '2021-05-14 15:42:39', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3122', NULL, 'N', '2021-05-14 15:42:32', '2021-05-14 15:42:32', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3122', NULL, 'N', '2021-05-14 15:42:32', '2021-05-14 15:42:32', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3122', NULL, 'N', '2021-05-14 15:42:32', '2021-05-14 15:42:32', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3122', NULL, 'N', '2021-05-14 15:42:32', '2021-05-14 15:42:32', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3122', NULL, 'N', '2021-05-14 15:42:32', '2021-05-14 15:42:32', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3122', NULL, 'N', '2021-05-14 15:42:32', '2021-05-14 15:42:32', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '65', '3121', NULL, 'N', '2021-05-14 15:42:20', '2021-05-14 15:42:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '66', '3121', NULL, 'N', '2021-05-14 15:42:20', '2021-05-14 15:42:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '74', '3121', NULL, 'N', '2021-05-14 15:42:20', '2021-05-14 15:42:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '80', '3121', NULL, 'N', '2021-05-14 15:42:20', '2021-05-14 15:42:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '109', '3121', NULL, 'N', '2021-05-14 15:42:20', '2021-05-14 15:42:20', '99', '99');
INSERT INTO `qc_type_cases_entry` ( `type_id`, `case_entry_id`, `remark`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '110', '3121', NULL, 'N', '2021-05-14 15:42:20', '2021-05-14 15:42:20', '99', '99');



-- ----------------------------
-- Records of qc_cases_relevance_entry
-- ----------------------------
-- 执行此脚本的医院需要修改对应的医院id,此脚本默认北仑医院id
SET @id ='4';
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('4', @id, '入院记录24小时内完成率', '2658', '入院记录未在患者入院24小时内完成', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('5', @id, '手术记录24小时内完成率', '2170', '手术记录未在术后24h内完成', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('6', @id, '出院记录24小时完成率', '2635', '出院记录未在患者入院24小时内完成', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('7', @id,  '病案首页24小时完成率', '3110', '病案首页未在患者出院24小时内完成', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('8', @id,  'CT检查记录24小时内完成率', '3114', '医嘱存在CT,报告单未记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('9', @id,  'MR检查记录24小时完成率', '3112', '医嘱存在MR,报告单未记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('8', @id,  'CT检查记录24小时内完成率', '3115', '医嘱存在CT,病程记录未记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('9', @id,  'MR检查记录24小时完成率', '3113', '医嘱存在MR,病程记录未记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('10', @id, '病理检查完成率', '3116', '病理检查缺少病理检查报告单', 'N');

INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('10', @id,  '病理检查完成率', '3111', '手术病理检查存在手术记录中无病理相关记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('10', @id,  '病理检查完成率', '3117', '病理检查存在病程记录中无病理报告结果', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('15', @id,  '指标十五：手术相关记录完整率', '3107', '手术记录次数与手术次数不一致', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('15', @id,  '指标十五：手术相关记录完整率', '2439', '手术记录中术前诊断未填写', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('15', @id,  '指标十五：手术相关记录完整率', '2438', '手术记录中术(中)后诊断未填写', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('15', @id,  '指标十五：手术相关记录完整率', '2437', '手术记录中手术经过未填写', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('15', @id,  '指标十五：手术相关记录完整率', '2429', '手术患者缺麻醉记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('15', @id,  '指标十五：手术相关记录完整率', '2480', '缺手术安全核查表', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('15', @id,  '指标十五：手术相关记录完整率', '2467', '手术患者缺术前讨论或术前小结', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('15', @id, '指标十五：手术相关记录完整率', '2471', '手术患者无手术记录', 'N');

INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id, '指标十七：临床用血相关记录符合率', '2247', '输血记录血型未填写', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2245', '输血记录Rh血型未填写', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id, '指标十七：临床用血相关记录符合率', '2243', '输血记录输注前评估未填写', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2248', '输血记录输血记录时间未填写', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2249', '输血记录输血记录者未签名', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`)  VALUES('17', @id,  '指标十七：临床用血相关记录符合率', '2250', '输血记录输血结束时间填写不规范', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2251', '输血记录输血结束时间未填写', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2252', '输血记录开始输血时间填写不规范', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2253', '输血记录开始输血时间未填写', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2483', '输血记录中未记录有无不良反应', 'N');

INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2484', '输血记录中无血液制品种类及量', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2485', '输血记录中无输血指征', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id, '指标十七：临床用血相关记录符合率', '2486', '输血记录未在输注结束后24小时内完成', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2491', '输血指征不严格', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2492', '无输血/血制品病程记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id, '指标十七：临床用血相关记录符合率', '2482', '无输血或使用血液制品后效果评价', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('17', @id,  '指标十七：临床用血相关记录符合率', '2490', '无输血或使用血液制品知情同意书', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', @id, '指标十八：医师查房记录完成率', '2655', '每周无2次副主任医师/主任医师查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`)  VALUES ('18', @id,  '指标十八：医师查房记录完成率', '2654', '每周无3次主治医师查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', @id,  '指标十八：医师查房记录完成率', '2468', '缺少术后首次病程记录', 'N');

INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', @id,  '指标十八：医师查房记录完成率', '2215', '整份病历无主治医师查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', @id, '指标十八：医师查房记录完成率', '2639', '患者出院前无上级医师(主治及以上)同意出院的病程记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', @id,  '指标十八：医师查房记录完成率', '2214', '主刀医师在术后48小时内无查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', @id,  '指标十八：医师查房记录完成率', '2378', '危重患者无上级医师(副高及以上)查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', @id,  '指标十八：医师查房记录完成率', '2377', '疑难患者无上级医师(副高及以上)查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', @id,  '指标十八：医师查房记录完成率', '2376', '抢救患者无上级医师(副高及以上)查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES('18', @id,  '指标十八：医师查房记录完成率', '2900', '术后24小时内无主刀或一助查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', @id,  '指标十八：医师查房记录完成率', '2229', '术后查房没有连续记录3天', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', @id,  '指标十八：医师查房记录完成率', '2468', '缺少术后首次病程记', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('19', @id,  '指标十九：患者抢救记录及时完成率', '2852', '抢救记录未在抢救结束后6小时内完成', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('14', @id, '指标十四：恶性肿瘤放射治疗记录符合率', '3120', '病程记录未记录恶性肿瘤放射治疗相关信息', 'N');
INSERT INTO `qc_cases_relevance_entry` ( `type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('22',@id, '指标二十二：不合理复制病历发生率', '2696', '病例特点与现病史内容雷同', 'N');
INSERT INTO `qc_cases_relevance_entry` ( `type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('23',@id, '指标二十三：知情同意书规范签署率', '3118', '知情同意书无患方签名或患方签名未授权', 'N');
INSERT INTO `qc_cases_relevance_entry` ( `type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('16',@id, '指标十六：植入物相关记录符合率', '3119', '使用植入物但手术记录或病程记录未记录相关信息', 'N');


INSERT INTO `qc_cases_relevance_entry` ( `type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ( '11', @id, '指标十一：细菌培养检查记录符合率', '3121', '报告单或病程记录缺少细菌培养记录', 'N');
INSERT INTO `qc_cases_relevance_entry` ( `type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ( '12', @id, '指标十二：抗菌药物使用记录符合率', '3122', '有抗菌药物使用病程无记录', 'N');
INSERT INTO `qc_cases_relevance_entry` ( `type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ( '13', @id, '指标十三：恶性肿瘤化学治疗记录符合率', '3123', '病程记录未记录恶性肿瘤化学治疗相关信息', 'N');




DROP TABLE IF EXISTS `med_management_info`;
CREATE TABLE `med_management_info` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `hospital_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '医院ID',
  `position_id` tinyint(7) NOT NULL DEFAULT '0' COMMENT '1：住院病案管理人员 2：病案编码人员 3:门诊病案管理人员 ',
  `start_date` datetime NOT NULL COMMENT '开始时间',
  `end_date` datetime DEFAULT NULL COMMENT '结束时间',
  `work_person` varchar(10) DEFAULT NULL COMMENT '单位时间内管理人员总人数',
  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(60) DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='病案管理人员统计表';

-- ----------------------------
-- Records of med_management_info
-- ----------------------------
-- -- 测试数据
-- INSERT INTO `med_management_info` ( `hospital_id`, `position_id`, `start_date`, `end_date`, `work_person`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '4', '1', '2020-06-01 00:00:00', '2020-06-30 00:00:00', '15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0');
-- INSERT INTO `med_management_info` ( `hospital_id`, `position_id`, `start_date`, `end_date`, `work_person`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '4', '3', '2021-05-01 00:00:00', '2021-05-31 00:00:00', '12', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0');
-- INSERT INTO `med_management_info` ( `hospital_id`, `position_id`, `start_date`, `end_date`, `work_person`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '4', '2', '2021-05-01 00:00:00', '2021-05-31 00:00:00', '10', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0');
-- INSERT INTO `med_management_info` ( `hospital_id`, `position_id`, `start_date`, `end_date`, `work_person`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '4', '2', '2020-06-01 00:00:00', '2020-06-30 00:00:00', '4', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0');
-- INSERT INTO `med_management_info` ( `hospital_id`, `position_id`, `start_date`, `end_date`, `work_person`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '4', '1', '2020-04-01 00:00:00', '2020-04-30 00:00:00', '17', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0');
-- INSERT INTO `med_management_info` ( `hospital_id`, `position_id`, `start_date`, `end_date`, `work_person`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '4', '2', '2020-12-01 00:00:00', '2020-12-31 00:00:00', '19', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0');
-- INSERT INTO `med_management_info` ( `hospital_id`, `position_id`, `start_date`, `end_date`, `work_person`, `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`) VALUES ( '4', '1', '2020-07-17 00:00:00', '2020-07-31 00:00:00', '15', 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0');



-- Table structure for med_outpatient_info
-- ----------------------------
DROP TABLE IF EXISTS `med_outpatient_info`;
CREATE TABLE `med_outpatient_info` (
  `behospital_code` varchar(16) NOT NULL COMMENT '病人住院ID',
  `hospital_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '医院ID',
  `name` varchar(32) NOT NULL COMMENT '姓名',
  `sex` varchar(2) DEFAULT NULL COMMENT '性别（男，女）',
  `birthday` datetime DEFAULT NULL COMMENT '出生日期',
  `file_code` varchar(16) DEFAULT NULL COMMENT '档案号',
  `qc_type_id` bigint(20) DEFAULT '0' COMMENT '质控类型',
  `ward_code` varchar(16) DEFAULT NULL COMMENT '病区编码',
  `ward_name` varchar(32) DEFAULT NULL COMMENT '病区名称',
  `beh_dept_id` varchar(16) NOT NULL COMMENT '住院科室ID',
  `beh_dept_name` varchar(64) DEFAULT NULL COMMENT '住院科室名称',
  `bed_code` varchar(12) DEFAULT NULL COMMENT '床位号',
  `bed_name` varchar(12) DEFAULT NULL COMMENT '床位名称',
  `insurance_name` varchar(50) DEFAULT NULL COMMENT '医保类别',
  `job_type` varchar(30) DEFAULT NULL COMMENT '职业',
  `behospital_date` datetime DEFAULT NULL COMMENT '入院时间',
  `leave_hospital_date` datetime DEFAULT NULL COMMENT '出院时间',
  `visit_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '就诊时间',
  `item_type` varchar(255) DEFAULT '' COMMENT '就诊类型 1-体检',
  `diagnose_icd` varchar(50) DEFAULT NULL COMMENT '疾病ICD编码',
  `diagnose` text COMMENT '疾病名称',
  `doctor_id` varchar(16) DEFAULT '' COMMENT '主管医生ID',
  `doctor_name` varchar(50) DEFAULT '' COMMENT '主管医生姓名',
  `beh_doctor_id` varchar(16) DEFAULT '' COMMENT '住院医生ID',
  `beh_doctor_name` varchar(50) DEFAULT '' COMMENT '住院医生姓名',
  `director_doctor_id` varchar(16) DEFAULT '' COMMENT '主任医生ID',
  `director_doctor_name` varchar(50) DEFAULT '' COMMENT '主任医生姓名',
  `is_placefile` varchar(2) NOT NULL DEFAULT '0' COMMENT '是否归档（0：未归档，1：已归档）',
  `placefile_date` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '归档时间',
  `in_state` varchar(20) DEFAULT NULL COMMENT 'R-住院登记I-病房接诊B-出院登记O-出院结算P-预约出院N-无费退院',
  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(60) DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  PRIMARY KEY (`behospital_code`,`hospital_id`),
  KEY `idx_hospital_id_behospital_code` (`hospital_id`,`behospital_code`) USING BTREE,
  KEY `idx_leave_hospital_date` (`leave_hospital_date`) USING BTREE,
  KEY `idx_beh_dept_id` (`beh_dept_id`) USING BTREE,
  KEY `med_behospital_info_hospital_id` (`hospital_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='门诊病历信息表';

-- ----------------------------
-- Records of med_outpatient_info
-- ----------------------------


--  菜单添加
INSERT INTO `sys_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `parent_id`, `code`, `show_status`, `maintain_status`, `order_no`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '医疗质量控制', '-1', 'YH-ZKK-YLZLKZZB_XQ', '1', '1', '-4', '用户-医疗质量');
SET @id =@@identity;
INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', @id, NULL);
INSERT INTO `sys_role_menu` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `menu_id`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @id, NULL);
INSERT INTO `sys_permission` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `name`, `code`, `permissionUrl`, `method`, `descritpion`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '医疗质量控制指标', 'FUNC000110', '/console/medicalRecordIndicator', 'ALL', '医疗质量控制指标表', NULL);
SET @id3 =@@identity;
INSERT INTO `sys_role_permission` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '1', @id3, NULL);
INSERT INTO `sys_role_permission` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `role_id`, `permission_id`, `remark`) VALUES ('N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', '-1', @id3, NULL);

INSERT INTO `sys_menu_permission` (`is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `menu_id`, `permission_id`, `remark`, `order_nu`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @id , @id3, '医疗质量控制指标表', NULL);


-- 需要修改对应的医院id,此脚本默认北仑医院id
-- 病案指标列表返回
SET @id ='4';
INSERT INTO `sys_hospital_set` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `hospital_id`, `name`, `code`, `value`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', @id, '病案管理指标(北仑)', 'med_quality_control', '1--住院病案管理人员月均负担出院患者病历数,2--病案编码人员月均负担出院患者病历数,3--门诊病案管理人员月均负担门诊患者病历数,4--入院记录24小时内完成率,5--手术记录24小时内完成率,6--出院记录24小时内完成率,7--病案首页24小时内完成率,8--CT检查记录符合率,9--MRI检查记录符合率,10--病理检查记录符合率,11--细菌培养检查记录符合率,12--抗菌药物使用记录符合率,13--恶性肿瘤化学治疗记录符合率,14--恶性肿瘤放射治疗记录符合率,15--手术相关记录完成率,16--植入物相关记录符合率,17--临床用血相关记录符合率,18--医师查房记录完成率,19--患者抢救记录及时完成率,20--出院患者病历2日归档率,21--出院患者病历归档完整率,22--不合理复制病历发生率,23--知情同意书规范签署率,24--甲级病历率', '病案管理指标(北仑)');



SET FOREIGN_KEY_CHECKS=0;

DROP TABLE IF EXISTS `med_index_result`;
CREATE TABLE `med_index_result` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `hospital_id` tinyint(3) DEFAULT NULL COMMENT '医院ID',
  `admission_result` double(5,0) DEFAULT '0' COMMENT '入院记录24小时内完成率--分母',
  `operation_result` double(5,0) DEFAULT '0' COMMENT '手术记录24小时内完成率-分母',
  `ct_result` double(5,0) DEFAULT '0' COMMENT 'CT检查记录符合率-分母',
  `mri_result` double(5,0) DEFAULT '0' COMMENT 'MRI检查记录符合率-分母',
  `pathology_result` double(5,0)DEFAULT '0' COMMENT '病理检查记录符合率-分母',
  `germ_result` double(5,0) DEFAULT '0' COMMENT '细菌培养检查记录符合率-分母',
  `antibiosis_result` double(5,0) DEFAULT '0' COMMENT '抗菌药物使用记录符合率-分母',
  `tumor_chemistry_result` double(5,0) DEFAULT '0' COMMENT '恶性肿瘤化学治疗记录符合率-分母',
  `tumor_radiation_result` double(5,0) DEFAULT '0' COMMENT '恶性肿瘤放射治疗记录符合率-分母',
  `operation_complete_result` double(5,0) DEFAULT '0' COMMENT '手术相关记录完成率-分母',
  `implants_result` double(5,0) DEFAULT '0' COMMENT '植入物相关记录符合率-分母',
  `blood_result` double(5,0) DEFAULT '0' COMMENT '临床用血相关记录符合率-分母',
  `rescue_result` double(5,0) DEFAULT '0' COMMENT '患者抢救记录及时完成率-分母',
  `sec_file_result` double(5,0) DEFAULT '0' COMMENT '出院患者病历2日归档率-分子',
  `file_complete_result` double(5,0) DEFAULT '0' COMMENT '出院患者病历归档完整率-分子',
  `start_date` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
  `end_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(60) DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;


CREATE TABLE `med_index_relevance` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `index_result_id` int(10) DEFAULT NULL COMMENT '主缓存表id',
  `relevance_type` int(10) DEFAULT NULL COMMENT '病历条目关联表type',
  `hospital_id` tinyint(3) DEFAULT NULL COMMENT '医院ID',
  `behospital_code` varchar(255) DEFAULT NULL COMMENT '病人病历号',
  `start_date` datetime DEFAULT NULL,
  `end_date` datetime DEFAULT NULL,
  `is_deleted` char(3) DEFAULT 'N' COMMENT '是否删除,N:未删除，Y:删除',
  `gmt_create` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
  `gmt_modified` datetime DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
  `creator` varchar(60) DEFAULT '0' COMMENT '创建人，0表示无创建人值',
  `modifier` varchar(60) DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
  PRIMARY KEY (`id`),
  UNIQUE KEY `index_all` (`relevance_type`,`hospital_id`,`behospital_code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- 执行此脚本的医院需要修改对应的医院id,此脚本默认北仑医院id
-- 注意 param参数为医院id，需要更新此版本的各家医院需在脚本中改动此sql对应的param参数（如邵逸夫医院只存邵逸夫医院的id）
SET @id ='4';
INSERT INTO `sys_task_cron` ( `is_deleted`, `gmt_create`, `gmt_modified`, `creator`, `modifier`, `cron_code`, `cron`, `param`, `is_used`, `remark`) VALUES ( 'N', '1970-01-01 12:00:00', '1970-01-01 12:00:00', '0', '0', 'TASK_INDEX', '0 0 3 * * ?', @id, '1', '获取当前时间前一天的病案指标');

alter table str_informed_consent  modify column content text COMMENT '文书解析内容'


