use `qc`;

INSERT INTO `qc`.`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 ('3117', '241', '三级查房制度', '4', 'THR03117', '病理检查存在病程记录中无病理报告结果', '2', '1', '0', '0', '3', '', NULL, '', 'N', '2021-04-16 11:04:42', '2021-04-16 11:04:42', '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', '病历书写规范', '8', 'MEDI03116', '病理检查缺少病理检查报告单', '2', '1', '0', '0', '3', '', NULL, '', 'N', '2021-04-16 11:07:28', '2021-04-16 11:07: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 ('3115', '241', '三级查房制度', '4', 'THR03115', '医嘱存在CT,病程记录未记录', '2', '1', '0', '0', '3', '', NULL, '', 'N', '2021-04-16 11:17:24', '2021-04-16 11:17:24', '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', '病历书写规范', '8', 'MEDI03114', '医嘱存在CT,报告单未记录', '2', '1', '0', '0', '3', '', NULL, '', 'N', '2021-04-16 11:16:51', '2021-04-16 11:16:51', '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', '0', '3', '', NULL, '', 'N', '2021-04-16 11:17:46', '2021-04-16 11:17: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 ('3112', '283', '病历书写规范', '8', 'MEDI03112', '医嘱存在MR,报告单未记录', '2', '1', '0', '0', '3', '', NULL, '', 'N', '2021-04-16 10:58:38', '2021-04-16 10:58: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 ('3111', '248', '围手术期病历讨论', '17', 'OPE03111', '手术病理检查存在手术记录中无病理相关记录', '1', '1', '0', '0', '3', '', NULL, '', 'N', '2021-04-16 11:03:55', '2021-04-16 11:03:55', '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', '0', '1', '', NULL, '', 'N', '2021-04-07 17:13:57', '2021-04-07 17:13: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 ('3107', '248', '围手术期病历讨论', '17', 'OPE03107', '手术记录次数与手术次数不一致', '2', '1', '0', '1', '2', '', NULL, '', 'N', '2021-04-15 14:18:44', '2021-04-15 14:18:44', '0', '医学人员');

/**
qc_cases_entry_hospital、qc_type_cases_entry 分值确定添加
 */


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 '0:门诊病案管理人员 1：住院病案管理人员 2：病案编码人员 ',
  `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` VALUES ('1', '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` VALUES ('2', '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` VALUES ('3', '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` VALUES ('4', '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` VALUES ('5', '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` VALUES ('6', '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` VALUES ('7', '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 `med_outpatient_info` VALUES ('200630106000153', '4', '项洪桥', '女', '1993-08-05 11:00:00', '', '0', '12', '九西病区', '180', '胃肠疝血管科', '', '', '', '', '2020-06-30 11:21:36', '2020-07-05 00:57:04', '2021-04-18 12:17:08', '1', '', '', '', '', '1592', '', '1592', '', '1', '2020-07-05 00:57:04', null, 'N', '2020-10-15 02:55:51', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000001', '4', '杨茜', '女', '1999-02-16 10:00:00', '', '0', '3', '产后病区', '48', '产科住院', '', '', '', '', '2020-06-30 15:00:00', '2020-07-05 21:04:12', '2020-07-02 00:57:04', '', '', '', '', '', '1947', '', '392', '', '1', '2020-07-05 21:04:12', null, 'N', '2020-10-15 02:55:55', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000003', '4', '王水芝', '男', '1948-02-21 10:00:00', '', '0', '19', '十二东病区', '94', '肛肠科', '', '', '', '', '2020-06-30 19:17:30', '2020-07-04 20:44:04', '2020-07-02 00:57:04', '', '', '', '', '', '357', '', '357', '', '1', '2020-07-04 20:44:04', null, 'N', '2020-10-15 02:53:48', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000004', '4', '王乐乐', '女', '2016-12-24 10:00:00', '', '0', '5', '儿科病区', '49', '儿科', '', '', '', '', '2020-06-30 19:39:09', '2020-07-08 20:25:28', '2020-07-06 00:57:04', '', '', '', '', '', '309', '', '48', '', '1', '2020-07-08 20:25:28', null, 'N', '2020-10-15 02:53:52', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000005', '4', '史龙英', '女', '1952-12-31 10:00:00', '', '0', '19', '十二东病区', '94', '肛肠科', '', '', '', '', '2020-06-01 19:16:53', '2020-07-01 21:32:20', '2020-06-02 00:57:04', '', '', '', '', '', '357', '', '357', '', '1', '2020-07-01 21:32:20', null, 'N', '2020-10-15 02:53:55', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000006', '4', '李益平', '男', '1982-09-04 11:00:00', '', '0', '19', '十二东病区', '94', '肛肠科', '', '', '', '', '2020-06-30 19:23:07', '2020-07-11 20:20:31', '2020-07-06 00:57:04', '', '', '', '', '', '357', '', '357', '', '1', '2020-07-11 20:20:31', null, 'N', '2020-10-15 02:53:57', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000008', '4', '朱志宝', '男', '1933-05-07 11:00:00', '', '0', '11', '九东病区', '66', '神经内科', '', '', '', '', '2020-06-30 20:02:53', '2020-07-17 20:52:33', '2020-07-06 00:57:04', '', '', '', '', '', '1552', '', '510', '', '1', '2020-07-17 20:52:33', null, 'N', '2020-10-15 02:56:35', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000009', '4', '査小琴', '女', '1972-02-19 10:00:00', '', '0', '2', '四西病区', '46', '妇科住院', '', '', '', '', '2020-06-30 21:17:37', '2020-07-04 19:57:55', '2020-07-02 00:57:04', '', '', '', '', '', '1274', '', '', '', '1', '2020-07-04 19:57:55', null, 'N', '2020-10-15 02:54:36', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000010', '4', '王清梅', '女', '1985-03-24 10:00:00', '', '0', '2', '四西病区', '46', '妇科住院', '', '', '', '', '2020-06-30 19:31:55', '2020-07-04 20:13:36', '2021-04-18 12:17:09', '1', '', '', '', '', '1274', '', '', '', '1', '2020-07-04 20:13:36', null, 'N', '2020-10-15 02:56:43', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000011', '4', '严明光', '男', '1953-12-28 10:00:00', '', '0', '10', '八西病区', '180', '胃肠疝血管科', '', '', '', '', '2020-06-30 19:41:20', '2020-07-15 20:50:09', '2020-07-06 00:57:04', '', '', '', '', '', '1592', '', '', '', '1', '2020-07-15 20:50:09', null, 'N', '2020-10-15 02:54:41', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000012', '4', '周建蓉', '女', '1977-05-19 11:00:00', '', '0', '12', '九西病区', '97', '耳鼻喉科', '', '', '', '', '2020-06-30 19:39:32', '2020-07-05 20:30:29', '2020-07-02 00:57:04', '', '', '', '', '', '1591', '', '', '', '1', '2020-07-05 20:30:29', null, 'N', '2020-10-15 02:56:49', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000013', '4', '张春芝', '女', '1960-08-26 11:00:00', '', '0', '15', '十一西病区', '75', '血液肿瘤科', '', '', '', '', '2020-06-30 19:59:03', '2020-07-25 21:43:03', '2020-07-06 00:57:04', '', '', '', '', '', '1013', '', '270', '', '1', '2020-07-25 21:43:03', null, 'N', '2020-10-15 02:54:47', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000014', '4', '郭爱明', '女', '1971-02-01 10:00:00', '', '0', '20', '十一东病区', '91', '泌尿外科', '', '', '', '', '2020-06-30 19:40:05', '2020-07-11 20:44:02', '2020-07-02 00:57:04', '', '', '', '', '', '13', '', '', '', '1', '2020-07-11 20:44:02', null, 'N', '2020-10-15 02:55:02', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000015', '4', '邱赛良', '男', '1964-11-15 10:00:00', '', '0', '1', '三西病区', '59', '肾内科', '', '', '', '', '2020-06-30 19:41:11', '2020-07-06 19:38:01', '2021-04-18 12:17:10', '1', '', '', '', '', '2214', '', '', '', '1', '2020-07-06 19:38:01', null, 'N', '2020-10-15 02:55:08', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000017', '4', '杨苗', '女', '1983-10-17 11:00:00', '', '0', '2', '四西病区', '46', '妇科住院', '', '', '', '', '2020-06-30 20:05:15', '2020-07-06 20:13:52', '2020-07-04 00:57:04', '', '', '', '', '', '1408', '', '', '', '1', '2020-07-06 20:13:52', null, 'N', '2020-10-15 02:55:19', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000018', '4', '蔡旭波', '男', '1982-10-08 11:00:00', '', '0', '16', '感染二病区', '53', '肝病-感染科', '', '', '', '', '2020-06-30 20:08:56', '2020-07-05 20:05:47', '2020-07-02 00:57:04', '', '', '', '', '', '672', '', '672', '', '1', '2020-07-05 20:05:47', null, 'N', '2020-10-15 02:55:24', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000019', '4', '黄立群', '男', '1964-11-01 10:00:00', '', '0', '14', '十西病区', '72', '心血管科', '', '', '', '', '2020-06-30 20:18:45', '2020-07-04 19:24:17', '2020-07-02 00:57:04', '', '', '', '', '', '1648', '', '15', '', '1', '2020-07-04 19:24:17', null, 'N', '2020-10-15 02:55:34', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000020', '4', '王元菊', '女', '1967-05-22 11:00:00', '', '0', '12', '九西病区', '97', '耳鼻喉科', '', '', '', '', '2020-06-30 20:01:27', '2020-07-06 19:59:34', '2020-07-04 00:57:04', '', '', '', '', '', '2207', '', '', '', '1', '2020-07-06 19:59:34', null, 'N', '2020-10-15 02:55:38', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000023', '4', '夏才国', '男', '1954-07-13 11:00:00', '', '0', '1', '三西病区', '59', '肾内科', '', '', '', '', '2020-06-30 20:20:00', '2020-07-08 20:56:25', '2020-07-02 00:57:04', '', '', '', '', '', '2056', '', '', '', '1', '2020-07-08 20:56:25', null, 'N', '2020-10-15 02:56:56', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000024', '4', '章兆品', '男', '1934-11-14 10:00:00', '', '0', '14', '十西病区', '72', '心血管科', '', '', '', '', '2020-06-30 20:26:27', '2020-07-07 20:45:37', '2021-04-18 12:17:10', '1', '', '', '', '', '1648', '', '15', '', '1', '2020-07-07 20:45:37', null, 'N', '2020-10-15 02:47:56', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000025', '4', '杜利别', '男', '1947-09-14 10:00:00', '', '0', '15', '十一西病区', '91', '泌尿外科', '', '', '', '', '2020-06-30 20:24:53', '2020-07-11 21:56:28', '2020-07-04 00:57:04', '', '', '', '', '', '517', '', '13', '', '1', '2020-07-11 21:56:28', null, 'N', '2020-10-15 02:57:32', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000026', '4', '叶爱勋', '男', '1970-06-20 11:00:00', '', '0', '14', '十西病区', '72', '心血管科', '', '', '', '', '2020-06-30 20:19:53', '2020-07-04 19:57:49', '2020-07-02 00:57:04', '', '', '', '', '', '1179', '', '30', '', '1', '2020-07-04 19:57:49', null, 'N', '2020-10-15 02:48:05', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000027', '4', '胡美云', '女', '1954-02-03 10:00:00', '', '0', '11', '九东病区', '66', '神经内科', '', '', '', '', '2020-06-30 20:24:38', '2020-07-15 20:00:07', '2020-07-02 00:57:04', '', '', '', '', '', '641', '', '', '', '1', '2020-07-15 20:00:07', null, 'N', '2020-10-15 02:57:38', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000028', '4', '李银娟', '女', '1966-01-13 10:00:00', '', '0', '12', '九西病区', '97', '耳鼻喉科', '', '', '', '', '2020-06-30 20:29:25', '2020-07-05 20:51:39', '2021-04-18 12:17:13', '1', '', '', '', '', '2207', '', '', '', '1', '2020-07-05 20:51:39', null, 'N', '2020-10-15 02:57:44', '1970-01-01 12:00:00', '0', '0');
INSERT INTO `med_outpatient_info` VALUES ('200701106000029', '4', '马立站', '男', '1972-05-21 11:00:00', '', '0', '9', '八东病区', '63', '消化内科', '', '', '', '', '2020-06-30 20:24:55', '2020-07-05 21:41:48', '2020-07-04 00:57:04', '', '', '', '', '', '524', '', '', '', '1', '2020-07-05 21:41:48', null, 'N', '2020-10-15 02:48:09', '1970-01-01 12:00:00', '0', '0');


--  菜单添加
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', '用户-医疗质量');
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', '医疗质量控制指标', '50', 'YH-ZKK-YLZLKZZB_XQ', '1', '1', '0', '用户-科室主任-医疗质量控制指标_详情');

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', '50', 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', '50', 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', '51', 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', '51', NULL);


