-- ============================================================
-- 质控标准样例数据
-- ============================================================
USE `qconline`;

-- 清空质控标准表
TRUNCATE TABLE `qc_standard_factor`;
TRUNCATE TABLE `qc_standard`;

-- ============================================
-- 1. 数据质控标准
-- ============================================

-- 标准B1：基础数据完整性标准
INSERT INTO `qc_standard` VALUES
('STD_DATA_001', 'STD_DATA_001', '基础数据完整性标准', 1,
 '检查患者基本信息、检查信息等核心数据的完整性', 85, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_DATA_001_1', 'STD_DATA_001', 'DATA_001', 25.00, 1, NULL, 0, NOW()),
('SF_DATA_001_2', 'STD_DATA_001', 'DATA_002', 25.00, 1, NULL, 1, NOW()),
('SF_DATA_001_3', 'STD_DATA_001', 'DATA_003', 25.00, 1, NULL, 2, NOW()),
('SF_DATA_001_4', 'STD_DATA_001', 'DATA_004', 15.00, 1, NULL, 3, NOW()),
('SF_DATA_001_5', 'STD_DATA_001', 'DATA_005', 10.00, 1, NULL, 4, NOW());

-- 标准B2：严格数据完整性标准
INSERT INTO `qc_standard` VALUES
('STD_DATA_002', 'STD_DATA_002', '严格数据完整性标准', 1,
 '对所有数据项进行严格检查，不允许任何缺失', 90, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_DATA_002_1', 'STD_DATA_002', 'DATA_001', 20.00, 1, NULL, 0, NOW()),
('SF_DATA_002_2', 'STD_DATA_002', 'DATA_002', 20.00, 1, NULL, 1, NOW()),
('SF_DATA_002_3', 'STD_DATA_002', 'DATA_003', 20.00, 1, NULL, 2, NOW()),
('SF_DATA_002_4', 'STD_DATA_002', 'DATA_004', 20.00, 1, NULL, 3, NOW()),
('SF_DATA_002_5', 'STD_DATA_002', 'DATA_005', 20.00, 1, NULL, 4, NOW());

-- 标准B3：核心数据标准
INSERT INTO `qc_standard` VALUES
('STD_DATA_003', 'STD_DATA_003', '核心数据标准', 1,
 '仅检查最核心的患者标识和检查信息', 80, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_DATA_003_1', 'STD_DATA_003', 'DATA_001', 30.00, 1, NULL, 0, NOW()),
('SF_DATA_003_2', 'STD_DATA_003', 'DATA_002', 30.00, 1, NULL, 1, NOW()),
('SF_DATA_003_3', 'STD_DATA_003', 'DATA_003', 20.00, 1, NULL, 2, NOW()),
('SF_DATA_003_4', 'STD_DATA_003', 'DATA_004', 10.00, 0, NULL, 3, NOW()),
('SF_DATA_003_5', 'STD_DATA_003', 'DATA_005', 10.00, 0, NULL, 4, NOW());

-- ============================================
-- 2. 影像质控标准
-- ============================================

-- 标准Y1：胸部DR影像质控标准
INSERT INTO `qc_standard` VALUES
('STD_IMAGE_001', 'STD_IMAGE_001', '胸部DR影像质控标准', 2,
 '胸部DR检查的影像质量标准', 80, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_IMAGE_001_1', 'STD_IMAGE_001', 'IMAGE_001', 15.00, 1, NULL, 0, NOW()),
('SF_IMAGE_001_2', 'STD_IMAGE_001', 'IMAGE_002', 15.00, 1, NULL, 1, NOW()),
('SF_IMAGE_001_3', 'STD_IMAGE_001', 'IMAGE_003', 20.00, 1, NULL, 2, NOW()),
('SF_IMAGE_001_4', 'STD_IMAGE_001', 'IMAGE_004', 20.00, 1, NULL, 3, NOW()),
('SF_IMAGE_001_5', 'STD_IMAGE_001', 'IMAGE_005', 20.00, 1, NULL, 4, NOW()),
('SF_IMAGE_001_6', 'STD_IMAGE_001', 'IMAGE_006', 10.00, 0, NULL, 5, NOW());

-- 标准Y2：CT影像质控标准
INSERT INTO `qc_standard` VALUES
('STD_IMAGE_002', 'STD_IMAGE_002', 'CT影像质控标准', 2,
 'CT检查的影像质量标准，包含序列要求', 75, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_IMAGE_002_1', 'STD_IMAGE_002', 'IMAGE_001', 12.00, 1, NULL, 0, NOW()),
('SF_IMAGE_002_2', 'STD_IMAGE_002', 'IMAGE_002', 12.00, 1, NULL, 1, NOW()),
('SF_IMAGE_002_3', 'STD_IMAGE_002', 'IMAGE_003', 18.00, 1, NULL, 2, NOW()),
('SF_IMAGE_002_4', 'STD_IMAGE_002', 'IMAGE_004', 18.00, 1, NULL, 3, NOW()),
('SF_IMAGE_002_5', 'STD_IMAGE_002', 'IMAGE_005', 20.00, 1, NULL, 4, NOW()),
('SF_IMAGE_002_6', 'STD_IMAGE_002', 'IMAGE_006', 10.00, 0, NULL, 5, NOW()),
('SF_IMAGE_002_7', 'STD_IMAGE_002', 'IMAGE_007', 10.00, 1, NULL, 6, NOW());

-- 标准Y3：MRI影像质控标准
INSERT INTO `qc_standard` VALUES
('STD_IMAGE_003', 'STD_IMAGE_003', 'MRI影像质控标准', 2,
 'MRI检查的影像质量标准，强调序列完整性', 75, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_IMAGE_003_1', 'STD_IMAGE_003', 'IMAGE_001', 10.00, 1, NULL, 0, NOW()),
('SF_IMAGE_003_2', 'STD_IMAGE_003', 'IMAGE_002', 10.00, 1, NULL, 1, NOW()),
('SF_IMAGE_003_3', 'STD_IMAGE_003', 'IMAGE_003', 15.00, 1, NULL, 2, NOW()),
('SF_IMAGE_003_4', 'STD_IMAGE_003', 'IMAGE_004', 15.00, 1, NULL, 3, NOW()),
('SF_IMAGE_003_5', 'STD_IMAGE_003', 'IMAGE_005', 20.00, 1, NULL, 4, NOW()),
('SF_IMAGE_003_6', 'STD_IMAGE_003', 'IMAGE_006', 10.00, 0, NULL, 5, NOW()),
('SF_IMAGE_003_7', 'STD_IMAGE_003', 'IMAGE_007', 20.00, 1, NULL, 6, NOW());

-- 标准Y4：超声影像质控标准
INSERT INTO `qc_standard` VALUES
('STD_IMAGE_004', 'STD_IMAGE_004', '超声影像质控标准', 2,
 '超声检查的影像质量标准', 78, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_IMAGE_004_1', 'STD_IMAGE_004', 'IMAGE_001', 15.00, 1, NULL, 0, NOW()),
('SF_IMAGE_004_2', 'STD_IMAGE_004', 'IMAGE_002', 15.00, 1, NULL, 1, NOW()),
('SF_IMAGE_004_3', 'STD_IMAGE_004', 'IMAGE_003', 18.00, 1, NULL, 2, NOW()),
('SF_IMAGE_004_4', 'STD_IMAGE_004', 'IMAGE_004', 17.00, 1, NULL, 3, NOW()),
('SF_IMAGE_004_5', 'STD_IMAGE_004', 'IMAGE_005', 20.00, 1, NULL, 4, NOW()),
('SF_IMAGE_004_6', 'STD_IMAGE_004', 'IMAGE_006', 15.00, 0, NULL, 5, NOW());

-- 标准Y5：通用影像质控标准
INSERT INTO `qc_standard` VALUES
('STD_IMAGE_005', 'STD_IMAGE_005', '通用影像质控标准', 2,
 '适用于所有模态的通用影像质控标准', 75, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_IMAGE_005_1', 'STD_IMAGE_005', 'IMAGE_001', 14.00, 1, NULL, 0, NOW()),
('SF_IMAGE_005_2', 'STD_IMAGE_005', 'IMAGE_002', 14.00, 1, NULL, 1, NOW()),
('SF_IMAGE_005_3', 'STD_IMAGE_005', 'IMAGE_003', 18.00, 1, NULL, 2, NOW()),
('SF_IMAGE_005_4', 'STD_IMAGE_005', 'IMAGE_004', 18.00, 1, NULL, 3, NOW()),
('SF_IMAGE_005_5', 'STD_IMAGE_005', 'IMAGE_005', 18.00, 1, NULL, 4, NOW()),
('SF_IMAGE_005_6', 'STD_IMAGE_005', 'IMAGE_006', 9.00, 0, NULL, 5, NOW()),
('SF_IMAGE_005_7', 'STD_IMAGE_005', 'IMAGE_007', 9.00, 0, NULL, 6, NOW());

-- 标准Y6：严格影像质控标准
INSERT INTO `qc_standard` VALUES
('STD_IMAGE_006', 'STD_IMAGE_006', '严格影像质控标准', 2,
 '对所有影像指标进行严格检查', 85, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_IMAGE_006_1', 'STD_IMAGE_006', 'IMAGE_001', 14.00, 1, NULL, 0, NOW()),
('SF_IMAGE_006_2', 'STD_IMAGE_006', 'IMAGE_002', 14.00, 1, NULL, 1, NOW()),
('SF_IMAGE_006_3', 'STD_IMAGE_006', 'IMAGE_003', 15.00, 1, NULL, 2, NOW()),
('SF_IMAGE_006_4', 'STD_IMAGE_006', 'IMAGE_004', 15.00, 1, NULL, 3, NOW()),
('SF_IMAGE_006_5', 'STD_IMAGE_006', 'IMAGE_005', 14.00, 1, NULL, 4, NOW()),
('SF_IMAGE_006_6', 'STD_IMAGE_006', 'IMAGE_006', 14.00, 1, NULL, 5, NOW()),
('SF_IMAGE_006_7', 'STD_IMAGE_006', 'IMAGE_007', 14.00, 1, NULL, 6, NOW());

-- ============================================
-- 3. 报告质控标准
-- ============================================

-- 标准R1：基础报告质控标准
INSERT INTO `qc_standard` VALUES
('STD_REPORT_001', 'STD_REPORT_001', '基础报告质控标准', 3,
 '检查报告的基本完整性和规范性', 80, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_REPORT_001_1', 'STD_REPORT_001', 'REPORT_001', 20.00, 1, NULL, 0, NOW()),
('SF_REPORT_001_2', 'STD_REPORT_001', 'REPORT_002', 15.00, 1, NULL, 1, NOW()),
('SF_REPORT_001_3', 'STD_REPORT_001', 'REPORT_003', 20.00, 1, NULL, 2, NOW()),
('SF_REPORT_001_4', 'STD_REPORT_001', 'REPORT_004', 15.00, 1, NULL, 3, NOW()),
('SF_REPORT_001_5', 'STD_REPORT_001', 'REPORT_006', 15.00, 1, NULL, 4, NOW()),
('SF_REPORT_001_6', 'STD_REPORT_001', 'REPORT_007', 15.00, 1, NULL, 5, NOW());

-- 标准R2：完整报告质控标准
INSERT INTO `qc_standard` VALUES
('STD_REPORT_002', 'STD_REPORT_002', '完整报告质控标准', 3,
 '包含时效性和所有签名检查的完整标准', 85, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_REPORT_002_1', 'STD_REPORT_002', 'REPORT_001', 18.00, 1, NULL, 0, NOW()),
('SF_REPORT_002_2', 'STD_REPORT_002', 'REPORT_002', 14.00, 1, NULL, 1, NOW()),
('SF_REPORT_002_3', 'STD_REPORT_002', 'REPORT_003', 18.00, 1, NULL, 2, NOW()),
('SF_REPORT_002_4', 'STD_REPORT_002', 'REPORT_004', 14.00, 1, NULL, 3, NOW()),
('SF_REPORT_002_5', 'STD_REPORT_002', 'REPORT_005', 12.00, 1, NULL, 4, NOW()),
('SF_REPORT_002_6', 'STD_REPORT_002', 'REPORT_006', 12.00, 1, NULL, 5, NOW()),
('SF_REPORT_002_7', 'STD_REPORT_002', 'REPORT_007', 12.00, 1, NULL, 6, NOW());

-- 标准R3：诊断质量标准
INSERT INTO `qc_standard` VALUES
('STD_REPORT_003', 'STD_REPORT_003', '诊断质量标准', 3,
 '重点关注诊断结论的质量', 82, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_REPORT_003_1', 'STD_REPORT_003', 'REPORT_001', 20.00, 1, NULL, 0, NOW()),
('SF_REPORT_003_2', 'STD_REPORT_003', 'REPORT_002', 18.00, 1, NULL, 1, NOW()),
('SF_REPORT_003_3', 'STD_REPORT_003', 'REPORT_003', 25.00, 1, NULL, 2, NOW()),
('SF_REPORT_003_4', 'STD_REPORT_003', 'REPORT_004', 22.00, 1, NULL, 3, NOW()),
('SF_REPORT_003_5', 'STD_REPORT_003', 'REPORT_006', 15.00, 0, NULL, 4, NOW());

-- 标准R4：严格报告质控标准
INSERT INTO `qc_standard` VALUES
('STD_REPORT_004', 'STD_REPORT_004', '严格报告质控标准', 3,
 '对报告质量进行严格检查，不允许任何缺陷', 90, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_REPORT_004_1', 'STD_REPORT_004', 'REPORT_001', 16.00, 1, NULL, 0, NOW()),
('SF_REPORT_004_2', 'STD_REPORT_004', 'REPORT_002', 14.00, 1, NULL, 1, NOW()),
('SF_REPORT_004_3', 'STD_REPORT_004', 'REPORT_003', 16.00, 1, NULL, 2, NOW()),
('SF_REPORT_004_4', 'STD_REPORT_004', 'REPORT_004', 14.00, 1, NULL, 3, NOW()),
('SF_REPORT_004_5', 'STD_REPORT_004', 'REPORT_005', 15.00, 1, NULL, 4, NOW()),
('SF_REPORT_004_6', 'STD_REPORT_004', 'REPORT_006', 12.50, 1, NULL, 5, NOW()),
('SF_REPORT_004_7', 'STD_REPORT_004', 'REPORT_007', 12.50, 1, NULL, 6, NOW());

-- 标准R5：急诊报告质控标准
INSERT INTO `qc_standard` VALUES
('STD_REPORT_005', 'STD_REPORT_005', '急诊报告质控标准', 3,
 '急诊报告的质控标准，强调时效性', 78, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_REPORT_005_1', 'STD_REPORT_005', 'REPORT_001', 18.00, 1, NULL, 0, NOW()),
('SF_REPORT_005_2', 'STD_REPORT_005', 'REPORT_002', 14.00, 0, NULL, 1, NOW()),
('SF_REPORT_005_3', 'STD_REPORT_005', 'REPORT_003', 20.00, 1, NULL, 2, NOW()),
('SF_REPORT_005_4', 'STD_REPORT_005', 'REPORT_004', 16.00, 0, NULL, 3, NOW()),
('SF_REPORT_005_5', 'STD_REPORT_005', 'REPORT_005', 20.00, 1, NULL, 4, NOW()),
('SF_REPORT_005_6', 'STD_REPORT_005', 'REPORT_006', 12.00, 1, NULL, 5, NOW());

-- ============================================
-- 4. 综合质控标准（跨类别）
-- ============================================

-- 标准Z1：数据+影像综合标准
INSERT INTO `qc_standard` VALUES
('STD_COMBI_001', 'STD_COMBI_001', '数据影像综合标准', 1,
 '数据完整性和影像质量的综合标准', 82, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_COMBI_001_1', 'STD_COMBI_001', 'DATA_001', 15.00, 1, NULL, 0, NOW()),
('SF_COMBI_001_2', 'STD_COMBI_001', 'DATA_002', 15.00, 1, NULL, 1, NOW()),
('SF_COMBI_001_3', 'STD_COMBI_001', 'DATA_003', 10.00, 1, NULL, 2, NOW()),
('SF_COMBI_001_4', 'STD_COMBI_001', 'IMAGE_001', 12.00, 1, NULL, 3, NOW()),
('SF_COMBI_001_5', 'STD_COMBI_001', 'IMAGE_002', 12.00, 1, NULL, 4, NOW()),
('SF_COMBI_001_6', 'STD_COMBI_001', 'IMAGE_003', 12.00, 1, NULL, 5, NOW()),
('SF_COMBI_001_7', 'STD_COMBI_001', 'IMAGE_004', 12.00, 1, NULL, 6, NOW()),
('SF_COMBI_001_8', 'STD_COMBI_001', 'IMAGE_005', 12.00, 1, NULL, 7, NOW());

-- 标准Z2：全流程质控标准
INSERT INTO `qc_standard` VALUES
('STD_COMBI_002', 'STD_COMBI_002', '全流程质控标准', 2,
 '从数据到报告的全流程质控', 80, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_COMBI_002_1', 'STD_COMBI_002', 'DATA_001', 8.00, 1, NULL, 0, NOW()),
('SF_COMBI_002_2', 'STD_COMBI_002', 'DATA_002', 8.00, 1, NULL, 1, NOW()),
('SF_COMBI_002_3', 'STD_COMBI_002', 'DATA_003', 8.00, 1, NULL, 2, NOW()),
('SF_COMBI_002_4', 'STD_COMBI_002', 'IMAGE_001', 11.00, 1, NULL, 3, NOW()),
('SF_COMBI_002_5', 'STD_COMBI_002', 'IMAGE_002', 11.00, 1, NULL, 4, NOW()),
('SF_COMBI_002_6', 'STD_COMBI_002', 'IMAGE_003', 11.00, 1, NULL, 5, NOW()),
('SF_COMBI_002_7', 'STD_COMBI_002', 'IMAGE_004', 11.00, 1, NULL, 6, NOW()),
('SF_COMBI_002_8', 'STD_COMBI_002', 'IMAGE_005', 11.00, 1, NULL, 7, NOW()),
('SF_COMBI_002_9', 'STD_COMBI_002', 'REPORT_001', 7.00, 1, NULL, 8, NOW()),
('SF_COMBI_002_10', 'STD_COMBI_002', 'REPORT_003', 7.00, 1, NULL, 9, NOW()),
('SF_COMBI_002_11', 'STD_COMBI_002', 'REPORT_006', 7.00, 1, NULL, 10, NOW());

-- ============================================
-- 5. 特殊用途标准
-- ============================================

-- 标准S1：教学医院标准（高要求）
INSERT INTO `qc_standard` VALUES
('STD_SPECIAL_001', 'STD_SPECIAL_001', '教学医院质控标准', 2,
 '适用于教学医院的高标准质控要求', 88, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_SPECIAL_001_1', 'STD_SPECIAL_001', 'DATA_001', 12.00, 1, NULL, 0, NOW()),
('SF_SPECIAL_001_2', 'STD_SPECIAL_001', 'DATA_002', 12.00, 1, NULL, 1, NOW()),
('SF_SPECIAL_001_3', 'STD_SPECIAL_001', 'DATA_003', 10.00, 1, NULL, 2, NOW()),
('SF_SPECIAL_001_4', 'STD_SPECIAL_001', 'IMAGE_001', 13.00, 1, NULL, 3, NOW()),
('SF_SPECIAL_001_5', 'STD_SPECIAL_001', 'IMAGE_002', 13.00, 1, NULL, 4, NOW()),
('SF_SPECIAL_001_6', 'STD_SPECIAL_001', 'IMAGE_003', 13.00, 1, NULL, 5, NOW()),
('SF_SPECIAL_001_7', 'STD_SPECIAL_001', 'IMAGE_004', 13.00, 1, NULL, 6, NOW()),
('SF_SPECIAL_001_8', 'STD_SPECIAL_001', 'IMAGE_005', 14.00, 1, NULL, 7, NOW());

-- 标准S2：社区医院标准（基础要求）
INSERT INTO `qc_standard` VALUES
('STD_SPECIAL_002', 'STD_SPECIAL_002', '社区医院质控标准', 2,
 '适用于社区医院的基础质控要求', 75, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_SPECIAL_002_1', 'STD_SPECIAL_002', 'DATA_001', 20.00, 1, NULL, 0, NOW()),
('SF_SPECIAL_002_2', 'STD_SPECIAL_002', 'DATA_002', 20.00, 1, NULL, 1, NOW()),
('SF_SPECIAL_002_3', 'STD_SPECIAL_002', 'DATA_003', 15.00, 1, NULL, 2, NOW()),
('SF_SPECIAL_002_4', 'STD_SPECIAL_002', 'IMAGE_001', 15.00, 1, NULL, 3, NOW()),
('SF_SPECIAL_002_5', 'STD_SPECIAL_002', 'IMAGE_003', 15.00, 1, NULL, 4, NOW()),
('SF_SPECIAL_002_6', 'STD_SPECIAL_002', 'IMAGE_005', 15.00, 1, NULL, 5, NOW());

-- 标准S3：体检中心标准
INSERT INTO `qc_standard` VALUES
('STD_SPECIAL_003', 'STD_SPECIAL_003', '体检中心质控标准', 2,
 '体检中心的专项质控标准', 78, 1, NOW(), NOW());

INSERT INTO `qc_standard_factor` VALUES
('SF_SPECIAL_003_1', 'STD_SPECIAL_003', 'DATA_001', 18.00, 1, NULL, 0, NOW()),
('SF_SPECIAL_003_2', 'STD_SPECIAL_003', 'DATA_002', 18.00, 1, NULL, 1, NOW()),
('SF_SPECIAL_003_3', 'STD_SPECIAL_003', 'DATA_003', 16.00, 1, NULL, 2, NOW()),
('SF_SPECIAL_003_4', 'STD_SPECIAL_003', 'IMAGE_001', 16.00, 1, NULL, 3, NOW()),
('SF_SPECIAL_003_5', 'STD_SPECIAL_003', 'IMAGE_003', 16.00, 1, NULL, 4, NOW()),
('SF_SPECIAL_003_6', 'STD_SPECIAL_003', 'IMAGE_005', 16.00, 1, NULL, 5, NOW());

-- ============================================
-- 统计信息
-- ============================================
-- 数据质控标准：3个
-- 影像质控标准：6个
-- 报告质控标准：5个
-- 综合质控标准：2个
-- 特殊用途标准：3个
-- 合计：19个标准，共计126条标准-因子关联记录
-- ============================================
