use `qc`;

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=60 DEFAULT CHARSET=utf8 COMMENT='质控关联条目表';

-- ----------------------------
-- Records of qc_cases_relevance_entry
-- ----------------------------
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('4', '4', '入院记录24小时内完成率', '2658', '入院记录未在患者入院24小时内完成', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('5', '4', '手术记录24小时内完成率', '2170', '手术记录未在术后24h内完成', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('6', '4', '出院记录24小时完成率', '2635', '出院记录未在患者入院24小时内完成', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('7', '4', '病案首页24小时完成率', '3110', '病案首页未在患者出院24小时内完成', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('8', '4', 'CT检查记录24小时内完成率', '3114', '医嘱存在CT,报告单未记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('9', '4', 'MR检查记录24小时完成率', '3112', '医嘱存在MR,报告单未记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('8', '4', 'CT检查记录24小时内完成率', '3115', '医嘱存在CT,病程记录未记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('9', '4', 'MR检查记录24小时完成率', '3113', '医嘱存在MR,病程记录未记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('10', '4', '病理检查完成率', '3116', '病理检查缺少病理检查报告单', 'N');

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

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

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

INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', '4', '指标十八：医师查房记录完成率', '2215', '整份病历无主治医师查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', '4', '指标十八：医师查房记录完成率', '2639', '患者出院前无上级医师(主治及以上)同意出院的病程记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', '4', '指标十八：医师查房记录完成率', '2214', '主刀医师在术后48小时内无查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', '4', '指标十八：医师查房记录完成率', '2378', '危重患者无上级医师(副高及以上)查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', '4', '指标十八：医师查房记录完成率', '2377', '疑难患者无上级医师(副高及以上)查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', '4', '指标十八：医师查房记录完成率', '2376', '抢救患者无上级医师(副高及以上)查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES('18', '4', '指标十八：医师查房记录完成率', '2900', '术后24小时内无主刀或一助查房记录', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', '4', '指标十八：医师查房记录完成率', '2229', '术后查房没有连续记录3天', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('18', '4', '指标十八：医师查房记录完成率', '2468', '缺少术后首次病程记', 'N');
INSERT INTO `qc_cases_relevance_entry` (`type`, `hospital_id`, `cases_name`, `relevance_id`, `name`, `is_deleted`) VALUES ('19', '4', '指标十九：患者抢救记录及时完成率', '2852', '抢救记录未在抢救结束后6小时内完成', 'N');



/**
编码添加
 */

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 ('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 ('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 ('3112', '283', '病历书写规范', '57', 'MEDI03112', '医嘱存在MR,报告单未记录', '2', '1', '0', '1', '3', '', NULL, '', 'N', '2021-04-20 17:45:41', '2021-04-20 17:45:41', '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 ('3114', '283', '病历书写规范', '57', 'MEDI03114', '医嘱存在CT,报告单未记录', '2', '1', '0', '1', '2', '', NULL, '', 'N', '2021-04-20 17:46:14', '2021-04-20 17:46: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 ('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 ('3116', '283', '病历书写规范', '57', 'MEDI03116', '病理检查缺少病理检查报告单', '2', '1', '0', '1', '2', '', NULL, '', 'N', '2021-04-20 17:46:02', '2021-04-20 17:46:02', '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', '医学人员');

/**
qc_cases_entry_hospital、qc_type_cases_entry 分值确定添加
 */
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', '4', '1.0', '1.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-04-19 11:56:50', '2021-04-19 11:56:50', '0', '医学人员', '3117', '4', '1.0', '1.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-04-19 11:56:23', '2021-04-19 11:56:23', '0', '医学人员', '3116', '4', '1.0', '1.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-04-19 11:55:38', '2021-04-19 11:55:38', '0', '医学人员', '3115', '4', '1.0', '1.0', '医嘱存在CT,病程记录未记录', '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-04-19 11:55:59', '2021-04-19 11:55:59', '0', '医学人员', '3114', '4', '1.0', '1.0', '医嘱存在CT,报告单未记录', '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-04-19 11:55:18', '2021-04-19 11:55:18', '0', '医学人员', '3113', '4', '1.0', '1.0', '医嘱存在MR,病程记录未记录', '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-04-19 11:57:30', '2021-04-19 11:57:30', '0', '医学人员', '3112', '4', '1.0', '1.0', '医嘱存在MR,报告单未记录', '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-04-19 11:57:52', '2021-04-19 11:57:52', '0', '医学人员', '3111', '4', '1.0', '1.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-04-19 11:57:14', '2021-04-19 11:57:14', '0', '医学人员', '3110', '4', '1.0', '1.0', '病案首页未在患者出院院24小时内完成', '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');



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=8 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-YLZLKZ', '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_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', '医疗质量控制指标', @id, 'YH-ZKK-YLZLKZZB_XQ', '1', '1', '0', '用户-科室主任-医疗质量控制指标_详情');
SET @id2 =@@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', @id2, 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', @id2, 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', '/qc/behospitalInfo/getMedQualityCoList', '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', @id2, @id3, '医疗质量控制指标表', NULL);


-- 病案指标列表返回
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', '4', '病案管理指标（北仑）', '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 NULL COMMENT '入院记录24小时内完成率--分母',
  `operation_result` double(5,0) DEFAULT NULL COMMENT '手术记录24小时内完成率-分母',
  `ct_result` double(5,0) DEFAULT NULL COMMENT 'CT检查记录符合率-分母',
  `mri_result` double(5,0) DEFAULT NULL COMMENT 'MRI检查记录符合率-分母',
  `pathology_result` double(5,0) DEFAULT NULL COMMENT '病理检查记录符合率-分母',
  `germ_result` double(5,0) DEFAULT NULL COMMENT '细菌培养检查记录符合率-分母',
  `antibiosis_result` double(5,0) DEFAULT NULL COMMENT '抗菌药物使用记录符合率-分母',
  `tumor_chemistry_result` double(5,0) DEFAULT NULL COMMENT '恶性肿瘤化学治疗记录符合率-分母',
  `tumor_radiation_result` double(5,0) DEFAULT NULL COMMENT '恶性肿瘤放射治疗记录符合率-分母',
  `operation_complete_result` double(5,0) DEFAULT NULL COMMENT '手术相关记录完成率-分母',
  `implants_result` double(5,0) DEFAULT NULL COMMENT '植入物相关记录符合率-分母',
  `blood_result` double(5,0) DEFAULT NULL COMMENT '临床用血相关记录符合率-分母',
  `
ward_round_result` double(5,0) DEFAULT NULL COMMENT '医师查房记录完整率-分母',
  `rescue_result` double(5,0) DEFAULT NULL COMMENT '患者抢救记录及时完成率-分母',
  `sec_file_result` double(5,0) DEFAULT NULL COMMENT '出院患者病历2日归档率-分子',
  `file_complete_result` double(5,0) DEFAULT NULL COMMENT '出院患者病历归档完整率-分母',
  `no_copy_result` double(5,0) DEFAULT NULL COMMENT '不合理复制病历发生率-分母',
  `record_sign_result` double(5,0) DEFAULT NULL COMMENT '知情同意书规范签署率-分母',
  `fir_record_result` double(5,0) DEFAULT NULL 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`,`start_date`),
  UNIQUE KEY `index_time` (`start_date`,`end_date`)
) ENGINE=InnoDB AUTO_INCREMENT=1207 DEFAULT CHARSET=utf8;


