-- ===========================================================================
-- 医保影像云图像质控规范 - CT检查部位质控标准 (第3批)
-- 基于《医保影像云图像质控规范 (YXY-QC-2025-A1)》
-- 
-- 本文件包含以下部位的CT质控标准：
--   - 5.4.5 颈部软组织 (6个检查项目)
--   - 5.4.6 胸部 (4个检查项目)
-- 
-- 检查项目总数: 10
-- 质控因子总数: 70
-- 
-- 创建时间: 2026-01-13
-- ===========================================================================

-- 5.4.5.1 颈部CT平扫 - 因子1: 检查范围
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_1_1', 'CT_NECK_5_4_5_1_1', '检查范围', 3, 'boolean',
'检查范围从枕骨大孔至第1胸椎',
'{"type": "dicom_check", "method": "checkSCAN_RANGE", "params": {"minSliceCount": 30, "expectedBodyPart": "颈部软组织", "checkCoverage": true}, "isVeto": false, "description": "检查范围从枕骨大孔至第1胸椎"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.1 颈部CT平扫 - 因子2: 图像偏中心
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_1_2', 'CT_NECK_5_4_5_1_2', '图像偏中心', 3, 'boolean',
'断层位于图像正中',
'{"type": "opencv_check", "method": "checkIMAGE_CENTERING", "params": {"maxOffsetRatio": 0.15}, "isVeto": false, "description": "断层位于图像正中"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.1 颈部CT平扫 - 因子3: 重建参数
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_1_3', 'CT_NECK_5_4_5_1_3', '重建参数', 3, 'boolean',
'厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm',
'{"type": "dicom_check", "method": "checkRECONSTRUCTION_PARAMS", "params": {"thickSliceMax": 3.0, "thickIntervalMax": 3.0, "thinSliceMax": 1.25, "thinIntervalMax": 1.25, "dfov": 18, "dfovTolerance": 2.0}, "isVeto": false, "description": "厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.1 颈部CT平扫 - 因子4: 窗口技术
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_1_4', 'CT_NECK_5_4_5_1_4', '窗口技术', 3, 'boolean',
'软组织窗：窗宽350~400HU，窗位35~45HU',
'{"type": "dicom_check", "method": "checkWINDOW_TECHNIQUE", "params": {"softTissueWindow": {"windowWidth": {"min": 350, "max": 400}, "windowCenter": {"min": 35, "max": 45}}}, "isVeto": true, "description": "软组织窗：窗宽350~400HU，窗位35~45HU"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.1 颈部CT平扫 - 因子5: 扫描体位
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_1_5', 'CT_NECK_5_4_5_1_5', '扫描体位', 3, 'boolean',
'仰卧位',
'{"type": "dicom_check", "method": "checkSCAN_POSITION", "params": {"expectedPosition": ["HFS", "FFS"]}, "isVeto": false, "description": "仰卧位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.1 颈部CT平扫 - 因子6: 图像标识
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_1_6', 'CT_NECK_5_4_5_1_6', '图像标识', 3, 'boolean',
'影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位',
'{"type": "dicom_check", "method": "checkImageAnnotation", "params": {"requiredFields": ["StudyInstanceUID", "BodyPartExamined", "PatientName", "PatientSex", "PatientAge", "StudyDate", "StudyTime", "KVP", "ScanDirection"]}, "isVeto": true, "description": "影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.1 颈部CT平扫 - 因子7: 图像伪影
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_1_7', 'CT_NECK_5_4_5_1_7', '图像伪影', 3, 'boolean',
'无明显运动、呼吸、设备或体外金属等原因产生的图像伪影',
'{"type": "opencv_check", "method": "checkIMAGE_ARTIFACTS", "params": {"motionThreshold": 30.0, "beamHardeningThreshold": 50.0}, "isVeto": true, "description": "无明显运动、呼吸、设备或体外金属等原因产生的图像伪影"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.1 颈部CT平扫 - 因子8: 图像清晰度
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_1_8', 'CT_NECK_5_4_5_1_8', '图像清晰度', 3, 'boolean',
'组织结构显示清晰，默认窗宽窗位合适',
'{"type": "opencv_check", "method": "checkIMAGE_CLARITY", "params": {"sharpnessThreshold": 100.0, "contrastThreshold": 50.0}, "isVeto": false, "description": "组织结构显示清晰，默认窗宽窗位合适"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.1 颈部CT平扫 - 质控标准
INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `pass_score`, `description`, `status`, `create_time`, `update_time`) VALUES
('STD_CT_5_4_5_1', 'CT_5_4_5_1', '颈部CT平扫质控标准', 'CT', '颈部软组织', '平扫', '颈部CT平扫', 80,
'颈部CT平扫质控标准，包含8个质控因子',
1, NOW(), NOW());

-- 5.4.5.1 颈部CT平扫 - 标准-因子关联
INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
('SF_CT_5_4_5_1_1', 'STD_CT_5_4_5_1', 'CT_NECK_5_4_5_1_1', 10.00, 1, 1, NOW(), NOW()),
('SF_CT_5_4_5_1_2', 'STD_CT_5_4_5_1', 'CT_NECK_5_4_5_1_2', 8.00, 1, 2, NOW(), NOW()),
('SF_CT_5_4_5_1_3', 'STD_CT_5_4_5_1', 'CT_NECK_5_4_5_1_3', 10.00, 1, 3, NOW(), NOW()),
('SF_CT_5_4_5_1_4', 'STD_CT_5_4_5_1', 'CT_NECK_5_4_5_1_4', 20.00, 1, 4, NOW(), NOW()),
('SF_CT_5_4_5_1_5', 'STD_CT_5_4_5_1', 'CT_NECK_5_4_5_1_5', 8.00, 1, 5, NOW(), NOW()),
('SF_CT_5_4_5_1_6', 'STD_CT_5_4_5_1', 'CT_NECK_5_4_5_1_6', 20.00, 1, 6, NOW(), NOW()),
('SF_CT_5_4_5_1_7', 'STD_CT_5_4_5_1', 'CT_NECK_5_4_5_1_7', 16.00, 1, 7, NOW(), NOW()),
('SF_CT_5_4_5_1_8', 'STD_CT_5_4_5_1', 'CT_NECK_5_4_5_1_8', 8.00, 1, 8, NOW(), NOW());


-- 5.4.5.2 颈部CT增强 - 因子1: 检查范围
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_2_1', 'CT_NECK_5_4_5_2_1', '检查范围', 3, 'boolean',
'检查范围从枕骨大孔至第1胸椎',
'{"type": "dicom_check", "method": "checkSCAN_RANGE", "params": {"minSliceCount": 30, "expectedBodyPart": "颈部软组织", "checkCoverage": true}, "isVeto": false, "description": "检查范围从枕骨大孔至第1胸椎"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.2 颈部CT增强 - 因子2: 图像偏中心
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_2_2', 'CT_NECK_5_4_5_2_2', '图像偏中心', 3, 'boolean',
'断层位于图像正中',
'{"type": "opencv_check", "method": "checkIMAGE_CENTERING", "params": {"maxOffsetRatio": 0.15}, "isVeto": false, "description": "断层位于图像正中"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.2 颈部CT增强 - 因子3: 重建参数
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_2_3', 'CT_NECK_5_4_5_2_3', '重建参数', 3, 'boolean',
'厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm',
'{"type": "dicom_check", "method": "checkRECONSTRUCTION_PARAMS", "params": {"thickSliceMax": 3.0, "thickIntervalMax": 3.0, "thinSliceMax": 1.25, "thinIntervalMax": 1.25, "dfov": 18, "dfovTolerance": 2.0}, "isVeto": false, "description": "厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.2 颈部CT增强 - 因子4: 窗口技术
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_2_4', 'CT_NECK_5_4_5_2_4', '窗口技术', 3, 'boolean',
'软组织窗：窗宽350~400HU，窗位35~45HU',
'{"type": "dicom_check", "method": "checkWINDOW_TECHNIQUE", "params": {"softTissueWindow": {"windowWidth": {"min": 350, "max": 400}, "windowCenter": {"min": 35, "max": 45}}}, "isVeto": true, "description": "软组织窗：窗宽350~400HU，窗位35~45HU"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.2 颈部CT增强 - 因子5: 扫描体位
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_2_5', 'CT_NECK_5_4_5_2_5', '扫描体位', 3, 'boolean',
'仰卧位',
'{"type": "dicom_check", "method": "checkSCAN_POSITION", "params": {"expectedPosition": ["HFS", "FFS"]}, "isVeto": false, "description": "仰卧位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.2 颈部CT增强 - 因子6: 图像标识
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_2_6', 'CT_NECK_5_4_5_2_6', '图像标识', 3, 'boolean',
'影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位',
'{"type": "dicom_check", "method": "checkImageAnnotation", "params": {"requiredFields": ["StudyInstanceUID", "BodyPartExamined", "PatientName", "PatientSex", "PatientAge", "StudyDate", "StudyTime", "KVP", "ScanDirection"]}, "isVeto": true, "description": "影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.2 颈部CT增强 - 因子7: 图像伪影
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_2_7', 'CT_NECK_5_4_5_2_7', '图像伪影', 3, 'boolean',
'无明显运动、呼吸、设备或体外金属等原因产生的图像伪影',
'{"type": "opencv_check", "method": "checkIMAGE_ARTIFACTS", "params": {"motionThreshold": 30.0, "beamHardeningThreshold": 50.0}, "isVeto": true, "description": "无明显运动、呼吸、设备或体外金属等原因产生的图像伪影"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.2 颈部CT增强 - 因子8: 图像清晰度
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_NECK_5_4_5_2_8', 'CT_NECK_5_4_5_2_8', '图像清晰度', 3, 'boolean',
'组织结构显示清晰，默认窗宽窗位合适',
'{"type": "opencv_check", "method": "checkIMAGE_CLARITY", "params": {"sharpnessThreshold": 100.0, "contrastThreshold": 50.0}, "isVeto": false, "description": "组织结构显示清晰，默认窗宽窗位合适"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.2 颈部CT增强 - 质控标准
INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `pass_score`, `description`, `status`, `create_time`, `update_time`) VALUES
('STD_CT_5_4_5_2', 'CT_5_4_5_2', '颈部CT增强质控标准', 'CT', '颈部软组织', '增强', '颈部CT增强', 80,
'颈部CT增强质控标准，包含8个质控因子',
1, NOW(), NOW());

-- 5.4.5.2 颈部CT增强 - 标准-因子关联
INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
('SF_CT_5_4_5_2_1', 'STD_CT_5_4_5_2', 'CT_NECK_5_4_5_2_1', 10.00, 1, 1, NOW(), NOW()),
('SF_CT_5_4_5_2_2', 'STD_CT_5_4_5_2', 'CT_NECK_5_4_5_2_2', 8.00, 1, 2, NOW(), NOW()),
('SF_CT_5_4_5_2_3', 'STD_CT_5_4_5_2', 'CT_NECK_5_4_5_2_3', 10.00, 1, 3, NOW(), NOW()),
('SF_CT_5_4_5_2_4', 'STD_CT_5_4_5_2', 'CT_NECK_5_4_5_2_4', 20.00, 1, 4, NOW(), NOW()),
('SF_CT_5_4_5_2_5', 'STD_CT_5_4_5_2', 'CT_NECK_5_4_5_2_5', 8.00, 1, 5, NOW(), NOW()),
('SF_CT_5_4_5_2_6', 'STD_CT_5_4_5_2', 'CT_NECK_5_4_5_2_6', 20.00, 1, 6, NOW(), NOW()),
('SF_CT_5_4_5_2_7', 'STD_CT_5_4_5_2', 'CT_NECK_5_4_5_2_7', 16.00, 1, 7, NOW(), NOW()),
('SF_CT_5_4_5_2_8', 'STD_CT_5_4_5_2', 'CT_NECK_5_4_5_2_8', 8.00, 1, 8, NOW(), NOW());


-- 5.4.5.3 喉部CT平扫 - 因子1: 检查范围
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_3_1', 'CT_LARYNX_5_4_5_3_1', '检查范围', 3, 'boolean',
'检查范围从枕骨大孔到胸廓入口',
'{"type": "dicom_check", "method": "checkSCAN_RANGE", "params": {"minSliceCount": 30, "expectedBodyPart": "颈部软组织", "checkCoverage": true}, "isVeto": false, "description": "检查范围从枕骨大孔到胸廓入口"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.3 喉部CT平扫 - 因子2: 图像偏中心
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_3_2', 'CT_LARYNX_5_4_5_3_2', '图像偏中心', 3, 'boolean',
'断层位于图像正中',
'{"type": "opencv_check", "method": "checkIMAGE_CENTERING", "params": {"maxOffsetRatio": 0.15}, "isVeto": false, "description": "断层位于图像正中"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.3 喉部CT平扫 - 因子3: 重建参数
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_3_3', 'CT_LARYNX_5_4_5_3_3', '重建参数', 3, 'boolean',
'厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm',
'{"type": "dicom_check", "method": "checkRECONSTRUCTION_PARAMS", "params": {"thickSliceMax": 3.0, "thickIntervalMax": 3.0, "thinSliceMax": 1.25, "thinIntervalMax": 1.25, "dfov": 18, "dfovTolerance": 2.0}, "isVeto": false, "description": "厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.3 喉部CT平扫 - 因子4: 窗口技术
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_3_4', 'CT_LARYNX_5_4_5_3_4', '窗口技术', 3, 'boolean',
'软组织窗：窗宽350~400HU，窗位35~45HU',
'{"type": "dicom_check", "method": "checkWINDOW_TECHNIQUE", "params": {"softTissueWindow": {"windowWidth": {"min": 350, "max": 400}, "windowCenter": {"min": 35, "max": 45}}}, "isVeto": true, "description": "软组织窗：窗宽350~400HU，窗位35~45HU"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.3 喉部CT平扫 - 因子5: 扫描体位
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_3_5', 'CT_LARYNX_5_4_5_3_5', '扫描体位', 3, 'boolean',
'仰卧位',
'{"type": "dicom_check", "method": "checkSCAN_POSITION", "params": {"expectedPosition": ["HFS", "FFS"]}, "isVeto": false, "description": "仰卧位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.3 喉部CT平扫 - 因子6: 图像标识
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_3_6', 'CT_LARYNX_5_4_5_3_6', '图像标识', 3, 'boolean',
'影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位',
'{"type": "dicom_check", "method": "checkImageAnnotation", "params": {"requiredFields": ["StudyInstanceUID", "BodyPartExamined", "PatientName", "PatientSex", "PatientAge", "StudyDate", "StudyTime", "KVP", "ScanDirection"]}, "isVeto": true, "description": "影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.3 喉部CT平扫 - 因子7: 图像伪影
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_3_7', 'CT_LARYNX_5_4_5_3_7', '图像伪影', 3, 'boolean',
'无明显运动、呼吸、设备或体外金属等原因产生的图像伪影',
'{"type": "opencv_check", "method": "checkIMAGE_ARTIFACTS", "params": {"motionThreshold": 30.0, "beamHardeningThreshold": 50.0}, "isVeto": true, "description": "无明显运动、呼吸、设备或体外金属等原因产生的图像伪影"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.3 喉部CT平扫 - 因子8: 图像清晰度
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_3_8', 'CT_LARYNX_5_4_5_3_8', '图像清晰度', 3, 'boolean',
'组织结构显示清晰，默认窗宽窗位合适',
'{"type": "opencv_check", "method": "checkIMAGE_CLARITY", "params": {"sharpnessThreshold": 100.0, "contrastThreshold": 50.0}, "isVeto": false, "description": "组织结构显示清晰，默认窗宽窗位合适"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.3 喉部CT平扫 - 质控标准
INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `pass_score`, `description`, `status`, `create_time`, `update_time`) VALUES
('STD_CT_5_4_5_3', 'CT_5_4_5_3', '喉部CT平扫质控标准', 'CT', '颈部软组织', '平扫', '喉部CT平扫', 80,
'喉部CT平扫质控标准，包含8个质控因子',
1, NOW(), NOW());

-- 5.4.5.3 喉部CT平扫 - 标准-因子关联
INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
('SF_CT_5_4_5_3_1', 'STD_CT_5_4_5_3', 'CT_LARYNX_5_4_5_3_1', 10.00, 1, 1, NOW(), NOW()),
('SF_CT_5_4_5_3_2', 'STD_CT_5_4_5_3', 'CT_LARYNX_5_4_5_3_2', 8.00, 1, 2, NOW(), NOW()),
('SF_CT_5_4_5_3_3', 'STD_CT_5_4_5_3', 'CT_LARYNX_5_4_5_3_3', 10.00, 1, 3, NOW(), NOW()),
('SF_CT_5_4_5_3_4', 'STD_CT_5_4_5_3', 'CT_LARYNX_5_4_5_3_4', 20.00, 1, 4, NOW(), NOW()),
('SF_CT_5_4_5_3_5', 'STD_CT_5_4_5_3', 'CT_LARYNX_5_4_5_3_5', 8.00, 1, 5, NOW(), NOW()),
('SF_CT_5_4_5_3_6', 'STD_CT_5_4_5_3', 'CT_LARYNX_5_4_5_3_6', 20.00, 1, 6, NOW(), NOW()),
('SF_CT_5_4_5_3_7', 'STD_CT_5_4_5_3', 'CT_LARYNX_5_4_5_3_7', 16.00, 1, 7, NOW(), NOW()),
('SF_CT_5_4_5_3_8', 'STD_CT_5_4_5_3', 'CT_LARYNX_5_4_5_3_8', 8.00, 1, 8, NOW(), NOW());


-- 5.4.5.4 喉部CT增强 - 因子1: 检查范围
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_4_1', 'CT_LARYNX_5_4_5_4_1', '检查范围', 3, 'boolean',
'检查范围从枕骨大孔到胸廓入口',
'{"type": "dicom_check", "method": "checkSCAN_RANGE", "params": {"minSliceCount": 30, "expectedBodyPart": "颈部软组织", "checkCoverage": true}, "isVeto": false, "description": "检查范围从枕骨大孔到胸廓入口"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.4 喉部CT增强 - 因子2: 图像偏中心
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_4_2', 'CT_LARYNX_5_4_5_4_2', '图像偏中心', 3, 'boolean',
'断层位于图像正中',
'{"type": "opencv_check", "method": "checkIMAGE_CENTERING", "params": {"maxOffsetRatio": 0.15}, "isVeto": false, "description": "断层位于图像正中"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.4 喉部CT增强 - 因子3: 重建参数
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_4_3', 'CT_LARYNX_5_4_5_4_3', '重建参数', 3, 'boolean',
'厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm',
'{"type": "dicom_check", "method": "checkRECONSTRUCTION_PARAMS", "params": {"thickSliceMax": 3.0, "thickIntervalMax": 3.0, "thinSliceMax": 1.25, "thinIntervalMax": 1.25, "dfov": 18, "dfovTolerance": 2.0}, "isVeto": false, "description": "厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.4 喉部CT增强 - 因子4: 窗口技术
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_4_4', 'CT_LARYNX_5_4_5_4_4', '窗口技术', 3, 'boolean',
'软组织窗：窗宽350~400HU，窗位35~45HU',
'{"type": "dicom_check", "method": "checkWINDOW_TECHNIQUE", "params": {"softTissueWindow": {"windowWidth": {"min": 350, "max": 400}, "windowCenter": {"min": 35, "max": 45}}}, "isVeto": true, "description": "软组织窗：窗宽350~400HU，窗位35~45HU"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.4 喉部CT增强 - 因子5: 扫描体位
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_4_5', 'CT_LARYNX_5_4_5_4_5', '扫描体位', 3, 'boolean',
'仰卧位',
'{"type": "dicom_check", "method": "checkSCAN_POSITION", "params": {"expectedPosition": ["HFS", "FFS"]}, "isVeto": false, "description": "仰卧位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.4 喉部CT增强 - 因子6: 图像标识
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_4_6', 'CT_LARYNX_5_4_5_4_6', '图像标识', 3, 'boolean',
'影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位',
'{"type": "dicom_check", "method": "checkImageAnnotation", "params": {"requiredFields": ["StudyInstanceUID", "BodyPartExamined", "PatientName", "PatientSex", "PatientAge", "StudyDate", "StudyTime", "KVP", "ScanDirection"]}, "isVeto": true, "description": "影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.4 喉部CT增强 - 因子7: 图像伪影
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_4_7', 'CT_LARYNX_5_4_5_4_7', '图像伪影', 3, 'boolean',
'无明显运动、呼吸、设备或体外金属等原因产生的图像伪影',
'{"type": "opencv_check", "method": "checkIMAGE_ARTIFACTS", "params": {"motionThreshold": 30.0, "beamHardeningThreshold": 50.0}, "isVeto": true, "description": "无明显运动、呼吸、设备或体外金属等原因产生的图像伪影"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.4 喉部CT增强 - 因子8: 图像清晰度
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LARYNX_5_4_5_4_8', 'CT_LARYNX_5_4_5_4_8', '图像清晰度', 3, 'boolean',
'组织结构显示清晰，默认窗宽窗位合适',
'{"type": "opencv_check", "method": "checkIMAGE_CLARITY", "params": {"sharpnessThreshold": 100.0, "contrastThreshold": 50.0}, "isVeto": false, "description": "组织结构显示清晰，默认窗宽窗位合适"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.4 喉部CT增强 - 质控标准
INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `pass_score`, `description`, `status`, `create_time`, `update_time`) VALUES
('STD_CT_5_4_5_4', 'CT_5_4_5_4', '喉部CT增强质控标准', 'CT', '颈部软组织', '增强', '喉部CT增强', 80,
'喉部CT增强质控标准，包含8个质控因子',
1, NOW(), NOW());

-- 5.4.5.4 喉部CT增强 - 标准-因子关联
INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
('SF_CT_5_4_5_4_1', 'STD_CT_5_4_5_4', 'CT_LARYNX_5_4_5_4_1', 10.00, 1, 1, NOW(), NOW()),
('SF_CT_5_4_5_4_2', 'STD_CT_5_4_5_4', 'CT_LARYNX_5_4_5_4_2', 8.00, 1, 2, NOW(), NOW()),
('SF_CT_5_4_5_4_3', 'STD_CT_5_4_5_4', 'CT_LARYNX_5_4_5_4_3', 10.00, 1, 3, NOW(), NOW()),
('SF_CT_5_4_5_4_4', 'STD_CT_5_4_5_4', 'CT_LARYNX_5_4_5_4_4', 20.00, 1, 4, NOW(), NOW()),
('SF_CT_5_4_5_4_5', 'STD_CT_5_4_5_4', 'CT_LARYNX_5_4_5_4_5', 8.00, 1, 5, NOW(), NOW()),
('SF_CT_5_4_5_4_6', 'STD_CT_5_4_5_4', 'CT_LARYNX_5_4_5_4_6', 20.00, 1, 6, NOW(), NOW()),
('SF_CT_5_4_5_4_7', 'STD_CT_5_4_5_4', 'CT_LARYNX_5_4_5_4_7', 16.00, 1, 7, NOW(), NOW()),
('SF_CT_5_4_5_4_8', 'STD_CT_5_4_5_4', 'CT_LARYNX_5_4_5_4_8', 8.00, 1, 8, NOW(), NOW());


-- 5.4.5.5 甲状腺CT平扫 - 因子1: 检查范围
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_5_1', 'CT_THYROID_5_4_5_5_1', '检查范围', 3, 'boolean',
'检查范围从枢椎底部至胸廓入口下3cm',
'{"type": "dicom_check", "method": "checkSCAN_RANGE", "params": {"minSliceCount": 30, "expectedBodyPart": "颈部软组织", "checkCoverage": true}, "isVeto": false, "description": "检查范围从枢椎底部至胸廓入口下3cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.5 甲状腺CT平扫 - 因子2: 图像偏中心
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_5_2', 'CT_THYROID_5_4_5_5_2', '图像偏中心', 3, 'boolean',
'断层位于图像正中',
'{"type": "opencv_check", "method": "checkIMAGE_CENTERING", "params": {"maxOffsetRatio": 0.15}, "isVeto": false, "description": "断层位于图像正中"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.5 甲状腺CT平扫 - 因子3: 重建参数
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_5_3', 'CT_THYROID_5_4_5_5_3', '重建参数', 3, 'boolean',
'厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm',
'{"type": "dicom_check", "method": "checkRECONSTRUCTION_PARAMS", "params": {"thickSliceMax": 3.0, "thickIntervalMax": 3.0, "thinSliceMax": 1.25, "thinIntervalMax": 1.25, "dfov": 18, "dfovTolerance": 2.0}, "isVeto": false, "description": "厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.5 甲状腺CT平扫 - 因子4: 窗口技术
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_5_4', 'CT_THYROID_5_4_5_5_4', '窗口技术', 3, 'boolean',
'软组织窗：窗宽350~400HU，窗位35~45HU',
'{"type": "dicom_check", "method": "checkWINDOW_TECHNIQUE", "params": {"softTissueWindow": {"windowWidth": {"min": 350, "max": 400}, "windowCenter": {"min": 35, "max": 45}}}, "isVeto": true, "description": "软组织窗：窗宽350~400HU，窗位35~45HU"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.5 甲状腺CT平扫 - 因子5: 扫描体位
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_5_5', 'CT_THYROID_5_4_5_5_5', '扫描体位', 3, 'boolean',
'仰卧位',
'{"type": "dicom_check", "method": "checkSCAN_POSITION", "params": {"expectedPosition": ["HFS", "FFS"]}, "isVeto": false, "description": "仰卧位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.5 甲状腺CT平扫 - 因子6: 图像标识
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_5_6', 'CT_THYROID_5_4_5_5_6', '图像标识', 3, 'boolean',
'影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位',
'{"type": "dicom_check", "method": "checkImageAnnotation", "params": {"requiredFields": ["StudyInstanceUID", "BodyPartExamined", "PatientName", "PatientSex", "PatientAge", "StudyDate", "StudyTime", "KVP", "ScanDirection"]}, "isVeto": true, "description": "影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.5 甲状腺CT平扫 - 因子7: 图像伪影
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_5_7', 'CT_THYROID_5_4_5_5_7', '图像伪影', 3, 'boolean',
'无明显运动、呼吸、设备或体外金属等原因产生的图像伪影',
'{"type": "opencv_check", "method": "checkIMAGE_ARTIFACTS", "params": {"motionThreshold": 30.0, "beamHardeningThreshold": 50.0}, "isVeto": true, "description": "无明显运动、呼吸、设备或体外金属等原因产生的图像伪影"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.5 甲状腺CT平扫 - 因子8: 图像清晰度
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_5_8', 'CT_THYROID_5_4_5_5_8', '图像清晰度', 3, 'boolean',
'组织结构显示清晰，默认窗宽窗位合适',
'{"type": "opencv_check", "method": "checkIMAGE_CLARITY", "params": {"sharpnessThreshold": 100.0, "contrastThreshold": 50.0}, "isVeto": false, "description": "组织结构显示清晰，默认窗宽窗位合适"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.5 甲状腺CT平扫 - 质控标准
INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `pass_score`, `description`, `status`, `create_time`, `update_time`) VALUES
('STD_CT_5_4_5_5', 'CT_5_4_5_5', '甲状腺CT平扫质控标准', 'CT', '颈部软组织', '平扫', '甲状腺CT平扫', 80,
'甲状腺CT平扫质控标准，包含8个质控因子',
1, NOW(), NOW());

-- 5.4.5.5 甲状腺CT平扫 - 标准-因子关联
INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
('SF_CT_5_4_5_5_1', 'STD_CT_5_4_5_5', 'CT_THYROID_5_4_5_5_1', 10.00, 1, 1, NOW(), NOW()),
('SF_CT_5_4_5_5_2', 'STD_CT_5_4_5_5', 'CT_THYROID_5_4_5_5_2', 8.00, 1, 2, NOW(), NOW()),
('SF_CT_5_4_5_5_3', 'STD_CT_5_4_5_5', 'CT_THYROID_5_4_5_5_3', 10.00, 1, 3, NOW(), NOW()),
('SF_CT_5_4_5_5_4', 'STD_CT_5_4_5_5', 'CT_THYROID_5_4_5_5_4', 20.00, 1, 4, NOW(), NOW()),
('SF_CT_5_4_5_5_5', 'STD_CT_5_4_5_5', 'CT_THYROID_5_4_5_5_5', 8.00, 1, 5, NOW(), NOW()),
('SF_CT_5_4_5_5_6', 'STD_CT_5_4_5_5', 'CT_THYROID_5_4_5_5_6', 20.00, 1, 6, NOW(), NOW()),
('SF_CT_5_4_5_5_7', 'STD_CT_5_4_5_5', 'CT_THYROID_5_4_5_5_7', 16.00, 1, 7, NOW(), NOW()),
('SF_CT_5_4_5_5_8', 'STD_CT_5_4_5_5', 'CT_THYROID_5_4_5_5_8', 8.00, 1, 8, NOW(), NOW());


-- 5.4.5.6 甲状腺CT增强 - 因子1: 检查范围
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_6_1', 'CT_THYROID_5_4_5_6_1', '检查范围', 3, 'boolean',
'检查范围从枢椎底部至胸廓入口下3cm',
'{"type": "dicom_check", "method": "checkSCAN_RANGE", "params": {"minSliceCount": 30, "expectedBodyPart": "颈部软组织", "checkCoverage": true}, "isVeto": false, "description": "检查范围从枢椎底部至胸廓入口下3cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.6 甲状腺CT增强 - 因子2: 图像偏中心
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_6_2', 'CT_THYROID_5_4_5_6_2', '图像偏中心', 3, 'boolean',
'断层位于图像正中',
'{"type": "opencv_check", "method": "checkIMAGE_CENTERING", "params": {"maxOffsetRatio": 0.15}, "isVeto": false, "description": "断层位于图像正中"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.6 甲状腺CT增强 - 因子3: 重建参数
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_6_3', 'CT_THYROID_5_4_5_6_3', '重建参数', 3, 'boolean',
'厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm',
'{"type": "dicom_check", "method": "checkRECONSTRUCTION_PARAMS", "params": {"thickSliceMax": 3.0, "thickIntervalMax": 3.0, "thinSliceMax": 1.25, "thinIntervalMax": 1.25, "dfov": 18, "dfovTolerance": 2.0}, "isVeto": false, "description": "厚层≤3.0mm，薄层≤1.25mm，DFOV：18cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.6 甲状腺CT增强 - 因子4: 窗口技术
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_6_4', 'CT_THYROID_5_4_5_6_4', '窗口技术', 3, 'boolean',
'软组织窗：窗宽350~400HU，窗位35~45HU',
'{"type": "dicom_check", "method": "checkWINDOW_TECHNIQUE", "params": {"softTissueWindow": {"windowWidth": {"min": 350, "max": 400}, "windowCenter": {"min": 35, "max": 45}}}, "isVeto": true, "description": "软组织窗：窗宽350~400HU，窗位35~45HU"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.6 甲状腺CT增强 - 因子5: 扫描体位
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_6_5', 'CT_THYROID_5_4_5_6_5', '扫描体位', 3, 'boolean',
'仰卧位',
'{"type": "dicom_check", "method": "checkSCAN_POSITION", "params": {"expectedPosition": ["HFS", "FFS"]}, "isVeto": false, "description": "仰卧位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.6 甲状腺CT增强 - 因子6: 图像标识
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_6_6', 'CT_THYROID_5_4_5_6_6', '图像标识', 3, 'boolean',
'影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位',
'{"type": "dicom_check", "method": "checkImageAnnotation", "params": {"requiredFields": ["StudyInstanceUID", "BodyPartExamined", "PatientName", "PatientSex", "PatientAge", "StudyDate", "StudyTime", "KVP", "ScanDirection"]}, "isVeto": true, "description": "影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.6 甲状腺CT增强 - 因子7: 图像伪影
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_6_7', 'CT_THYROID_5_4_5_6_7', '图像伪影', 3, 'boolean',
'无明显运动、呼吸、设备或体外金属等原因产生的图像伪影',
'{"type": "opencv_check", "method": "checkIMAGE_ARTIFACTS", "params": {"motionThreshold": 30.0, "beamHardeningThreshold": 50.0}, "isVeto": true, "description": "无明显运动、呼吸、设备或体外金属等原因产生的图像伪影"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.6 甲状腺CT增强 - 因子8: 图像清晰度
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_THYROID_5_4_5_6_8', 'CT_THYROID_5_4_5_6_8', '图像清晰度', 3, 'boolean',
'组织结构显示清晰，默认窗宽窗位合适',
'{"type": "opencv_check", "method": "checkIMAGE_CLARITY", "params": {"sharpnessThreshold": 100.0, "contrastThreshold": 50.0}, "isVeto": false, "description": "组织结构显示清晰，默认窗宽窗位合适"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.5.6 甲状腺CT增强 - 质控标准
INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `pass_score`, `description`, `status`, `create_time`, `update_time`) VALUES
('STD_CT_5_4_5_6', 'CT_5_4_5_6', '甲状腺CT增强质控标准', 'CT', '颈部软组织', '增强', '甲状腺CT增强', 80,
'甲状腺CT增强质控标准，包含8个质控因子',
1, NOW(), NOW());

-- 5.4.5.6 甲状腺CT增强 - 标准-因子关联
INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
('SF_CT_5_4_5_6_1', 'STD_CT_5_4_5_6', 'CT_THYROID_5_4_5_6_1', 10.00, 1, 1, NOW(), NOW()),
('SF_CT_5_4_5_6_2', 'STD_CT_5_4_5_6', 'CT_THYROID_5_4_5_6_2', 8.00, 1, 2, NOW(), NOW()),
('SF_CT_5_4_5_6_3', 'STD_CT_5_4_5_6', 'CT_THYROID_5_4_5_6_3', 10.00, 1, 3, NOW(), NOW()),
('SF_CT_5_4_5_6_4', 'STD_CT_5_4_5_6', 'CT_THYROID_5_4_5_6_4', 20.00, 1, 4, NOW(), NOW()),
('SF_CT_5_4_5_6_5', 'STD_CT_5_4_5_6', 'CT_THYROID_5_4_5_6_5', 8.00, 1, 5, NOW(), NOW()),
('SF_CT_5_4_5_6_6', 'STD_CT_5_4_5_6', 'CT_THYROID_5_4_5_6_6', 20.00, 1, 6, NOW(), NOW()),
('SF_CT_5_4_5_6_7', 'STD_CT_5_4_5_6', 'CT_THYROID_5_4_5_6_7', 16.00, 1, 7, NOW(), NOW()),
('SF_CT_5_4_5_6_8', 'STD_CT_5_4_5_6', 'CT_THYROID_5_4_5_6_8', 8.00, 1, 8, NOW(), NOW());


-- 5.4.6.1 胸部CT平扫 - 因子1: 检查范围
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_1_1', 'CT_CHEST_5_4_6_1_1', '检查范围', 3, 'boolean',
'检查范围从肺尖至较低侧肋膈角下2~3cm',
'{"type": "dicom_check", "method": "checkSCAN_RANGE", "params": {"minSliceCount": 30, "expectedBodyPart": "胸部", "checkCoverage": true}, "isVeto": false, "description": "检查范围从肺尖至较低侧肋膈角下2~3cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.1 胸部CT平扫 - 因子2: 图像偏中心
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_1_2', 'CT_CHEST_5_4_6_1_2', '图像偏中心', 3, 'boolean',
'断层位于图像正中',
'{"type": "opencv_check", "method": "checkIMAGE_CENTERING", "params": {"maxOffsetRatio": 0.15}, "isVeto": false, "description": "断层位于图像正中"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.1 胸部CT平扫 - 因子3: 重建参数
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_1_3', 'CT_CHEST_5_4_6_1_3', '重建参数', 3, 'boolean',
'厚层≤5.0mm，薄层≤1.25mm，DFOV：33cm',
'{"type": "dicom_check", "method": "checkRECONSTRUCTION_PARAMS", "params": {"thickSliceMax": 5.0, "thickIntervalMax": 5.0, "thinSliceMax": 1.25, "thinIntervalMax": 1.25, "dfov": 33, "dfovTolerance": 2.0}, "isVeto": false, "description": "厚层≤5.0mm，薄层≤1.25mm，DFOV：33cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.1 胸部CT平扫 - 因子4: 窗口技术
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_1_4', 'CT_CHEST_5_4_6_1_4', '窗口技术', 3, 'boolean',
'软组织窗：窗宽300~500HU，窗位30~50HU',
'{"type": "dicom_check", "method": "checkWINDOW_TECHNIQUE", "params": {"softTissueWindow": {"windowWidth": {"min": 300, "max": 500}, "windowCenter": {"min": 30, "max": 50}}}, "isVeto": true, "description": "软组织窗：窗宽300~500HU，窗位30~50HU"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.1 胸部CT平扫 - 因子5: 扫描体位
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_1_5', 'CT_CHEST_5_4_6_1_5', '扫描体位', 3, 'boolean',
'仰卧位，双手上举',
'{"type": "dicom_check", "method": "checkSCAN_POSITION", "params": {"expectedPosition": ["HFS", "FFS"]}, "isVeto": false, "description": "仰卧位，双手上举"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.1 胸部CT平扫 - 因子6: 图像标识
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_1_6', 'CT_CHEST_5_4_6_1_6', '图像标识', 3, 'boolean',
'影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位',
'{"type": "dicom_check", "method": "checkImageAnnotation", "params": {"requiredFields": ["StudyInstanceUID", "BodyPartExamined", "PatientName", "PatientSex", "PatientAge", "StudyDate", "StudyTime", "KVP", "ScanDirection"]}, "isVeto": true, "description": "影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.1 胸部CT平扫 - 因子7: 图像伪影
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_1_7', 'CT_CHEST_5_4_6_1_7', '图像伪影', 3, 'boolean',
'无明显运动、呼吸、设备或体外金属等原因产生的图像伪影',
'{"type": "opencv_check", "method": "checkIMAGE_ARTIFACTS", "params": {"motionThreshold": 30.0, "beamHardeningThreshold": 50.0}, "isVeto": true, "description": "无明显运动、呼吸、设备或体外金属等原因产生的图像伪影"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.1 胸部CT平扫 - 因子8: 图像清晰度
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_1_8', 'CT_CHEST_5_4_6_1_8', '图像清晰度', 3, 'boolean',
'组织结构显示清晰，默认窗宽窗位合适',
'{"type": "opencv_check", "method": "checkIMAGE_CLARITY", "params": {"sharpnessThreshold": 100.0, "contrastThreshold": 50.0}, "isVeto": false, "description": "组织结构显示清晰，默认窗宽窗位合适"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.1 胸部CT平扫 - 质控标准
INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `pass_score`, `description`, `status`, `create_time`, `update_time`) VALUES
('STD_CT_5_4_6_1', 'CT_5_4_6_1', '胸部CT平扫质控标准', 'CT', '胸部', '平扫', '胸部CT平扫', 80,
'胸部CT平扫质控标准，包含8个质控因子',
1, NOW(), NOW());

-- 5.4.6.1 胸部CT平扫 - 标准-因子关联
INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
('SF_CT_5_4_6_1_1', 'STD_CT_5_4_6_1', 'CT_CHEST_5_4_6_1_1', 10.00, 1, 1, NOW(), NOW()),
('SF_CT_5_4_6_1_2', 'STD_CT_5_4_6_1', 'CT_CHEST_5_4_6_1_2', 8.00, 1, 2, NOW(), NOW()),
('SF_CT_5_4_6_1_3', 'STD_CT_5_4_6_1', 'CT_CHEST_5_4_6_1_3', 10.00, 1, 3, NOW(), NOW()),
('SF_CT_5_4_6_1_4', 'STD_CT_5_4_6_1', 'CT_CHEST_5_4_6_1_4', 20.00, 1, 4, NOW(), NOW()),
('SF_CT_5_4_6_1_5', 'STD_CT_5_4_6_1', 'CT_CHEST_5_4_6_1_5', 8.00, 1, 5, NOW(), NOW()),
('SF_CT_5_4_6_1_6', 'STD_CT_5_4_6_1', 'CT_CHEST_5_4_6_1_6', 20.00, 1, 6, NOW(), NOW()),
('SF_CT_5_4_6_1_7', 'STD_CT_5_4_6_1', 'CT_CHEST_5_4_6_1_7', 16.00, 1, 7, NOW(), NOW()),
('SF_CT_5_4_6_1_8', 'STD_CT_5_4_6_1', 'CT_CHEST_5_4_6_1_8', 8.00, 1, 8, NOW(), NOW());


-- 5.4.6.2 胸部CT增强 - 因子1: 检查范围
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_2_1', 'CT_CHEST_5_4_6_2_1', '检查范围', 3, 'boolean',
'检查范围从肺尖至较低侧肋膈角下2~3cm',
'{"type": "dicom_check", "method": "checkSCAN_RANGE", "params": {"minSliceCount": 30, "expectedBodyPart": "胸部", "checkCoverage": true}, "isVeto": false, "description": "检查范围从肺尖至较低侧肋膈角下2~3cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.2 胸部CT增强 - 因子2: 图像偏中心
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_2_2', 'CT_CHEST_5_4_6_2_2', '图像偏中心', 3, 'boolean',
'断层位于图像正中',
'{"type": "opencv_check", "method": "checkIMAGE_CENTERING", "params": {"maxOffsetRatio": 0.15}, "isVeto": false, "description": "断层位于图像正中"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.2 胸部CT增强 - 因子3: 重建参数
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_2_3', 'CT_CHEST_5_4_6_2_3', '重建参数', 3, 'boolean',
'厚层≤5.0mm，薄层≤2.0mm，DFOV：33cm',
'{"type": "dicom_check", "method": "checkRECONSTRUCTION_PARAMS", "params": {"thickSliceMax": 5.0, "thickIntervalMax": 5.0, "thinSliceMax": 2.0, "thinIntervalMax": 2.0, "dfov": 33, "dfovTolerance": 2.0}, "isVeto": false, "description": "厚层≤5.0mm，薄层≤2.0mm，DFOV：33cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.2 胸部CT增强 - 因子4: 窗口技术
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_2_4', 'CT_CHEST_5_4_6_2_4', '窗口技术', 3, 'boolean',
'软组织窗：窗宽300~500HU，窗位30~50HU',
'{"type": "dicom_check", "method": "checkWINDOW_TECHNIQUE", "params": {"softTissueWindow": {"windowWidth": {"min": 300, "max": 500}, "windowCenter": {"min": 30, "max": 50}}}, "isVeto": true, "description": "软组织窗：窗宽300~500HU，窗位30~50HU"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.2 胸部CT增强 - 因子5: 扫描体位
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_2_5', 'CT_CHEST_5_4_6_2_5', '扫描体位', 3, 'boolean',
'仰卧位，双手上举',
'{"type": "dicom_check", "method": "checkSCAN_POSITION", "params": {"expectedPosition": ["HFS", "FFS"]}, "isVeto": false, "description": "仰卧位，双手上举"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.2 胸部CT增强 - 因子6: 图像标识
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_2_6', 'CT_CHEST_5_4_6_2_6', '图像标识', 3, 'boolean',
'影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位',
'{"type": "dicom_check", "method": "checkImageAnnotation", "params": {"requiredFields": ["StudyInstanceUID", "BodyPartExamined", "PatientName", "PatientSex", "PatientAge", "StudyDate", "StudyTime", "KVP", "ScanDirection"]}, "isVeto": true, "description": "影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.2 胸部CT增强 - 因子7: 图像伪影
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_2_7', 'CT_CHEST_5_4_6_2_7', '图像伪影', 3, 'boolean',
'无明显运动、呼吸、设备或体外金属等原因产生的图像伪影',
'{"type": "opencv_check", "method": "checkIMAGE_ARTIFACTS", "params": {"motionThreshold": 30.0, "beamHardeningThreshold": 50.0}, "isVeto": true, "description": "无明显运动、呼吸、设备或体外金属等原因产生的图像伪影"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.2 胸部CT增强 - 因子8: 图像清晰度
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_CHEST_5_4_6_2_8', 'CT_CHEST_5_4_6_2_8', '图像清晰度', 3, 'boolean',
'组织结构显示清晰，默认窗宽窗位合适',
'{"type": "opencv_check", "method": "checkIMAGE_CLARITY", "params": {"sharpnessThreshold": 100.0, "contrastThreshold": 50.0}, "isVeto": false, "description": "组织结构显示清晰，默认窗宽窗位合适"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.2 胸部CT增强 - 质控标准
INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `pass_score`, `description`, `status`, `create_time`, `update_time`) VALUES
('STD_CT_5_4_6_2', 'CT_5_4_6_2', '胸部CT增强质控标准', 'CT', '胸部', '增强', '胸部CT增强', 80,
'胸部CT增强质控标准，包含8个质控因子',
1, NOW(), NOW());

-- 5.4.6.2 胸部CT增强 - 标准-因子关联
INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
('SF_CT_5_4_6_2_1', 'STD_CT_5_4_6_2', 'CT_CHEST_5_4_6_2_1', 10.00, 1, 1, NOW(), NOW()),
('SF_CT_5_4_6_2_2', 'STD_CT_5_4_6_2', 'CT_CHEST_5_4_6_2_2', 8.00, 1, 2, NOW(), NOW()),
('SF_CT_5_4_6_2_3', 'STD_CT_5_4_6_2', 'CT_CHEST_5_4_6_2_3', 10.00, 1, 3, NOW(), NOW()),
('SF_CT_5_4_6_2_4', 'STD_CT_5_4_6_2', 'CT_CHEST_5_4_6_2_4', 20.00, 1, 4, NOW(), NOW()),
('SF_CT_5_4_6_2_5', 'STD_CT_5_4_6_2', 'CT_CHEST_5_4_6_2_5', 8.00, 1, 5, NOW(), NOW()),
('SF_CT_5_4_6_2_6', 'STD_CT_5_4_6_2', 'CT_CHEST_5_4_6_2_6', 20.00, 1, 6, NOW(), NOW()),
('SF_CT_5_4_6_2_7', 'STD_CT_5_4_6_2', 'CT_CHEST_5_4_6_2_7', 16.00, 1, 7, NOW(), NOW()),
('SF_CT_5_4_6_2_8', 'STD_CT_5_4_6_2', 'CT_CHEST_5_4_6_2_8', 8.00, 1, 8, NOW(), NOW());


-- 5.4.6.3 肋骨CT平扫 - 因子1: 检查范围
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_RIB_5_4_6_3_1', 'CT_RIB_5_4_6_3_1', '检查范围', 3, 'boolean',
'检查范围从第一肋上缘至终末肋下缘',
'{"type": "dicom_check", "method": "checkSCAN_RANGE", "params": {"minSliceCount": 30, "expectedBodyPart": "胸部", "checkCoverage": true}, "isVeto": false, "description": "检查范围从第一肋上缘至终末肋下缘"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.3 肋骨CT平扫 - 因子2: 图像偏中心
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_RIB_5_4_6_3_2', 'CT_RIB_5_4_6_3_2', '图像偏中心', 3, 'boolean',
'断层位于图像正中',
'{"type": "opencv_check", "method": "checkIMAGE_CENTERING", "params": {"maxOffsetRatio": 0.15}, "isVeto": false, "description": "断层位于图像正中"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.3 肋骨CT平扫 - 因子3: 重建参数
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_RIB_5_4_6_3_3', 'CT_RIB_5_4_6_3_3', '重建参数', 3, 'boolean',
'厚层≤5.0mm，薄层≤1.25mm，DFOV：33cm',
'{"type": "dicom_check", "method": "checkRECONSTRUCTION_PARAMS", "params": {"thickSliceMax": 5.0, "thickIntervalMax": 5.0, "thinSliceMax": 1.25, "thinIntervalMax": 1.25, "dfov": 33, "dfovTolerance": 2.0}, "isVeto": false, "description": "厚层≤5.0mm，薄层≤1.25mm，DFOV：33cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.3 肋骨CT平扫 - 因子4: 窗口技术
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_RIB_5_4_6_3_4', 'CT_RIB_5_4_6_3_4', '窗口技术', 3, 'boolean',
'软组织窗：窗宽2000~2500HU，窗位550~750HU',
'{"type": "dicom_check", "method": "checkWINDOW_TECHNIQUE", "params": {"softTissueWindow": {"windowWidth": {"min": 2000, "max": 2500}, "windowCenter": {"min": 550, "max": 750}}}, "isVeto": true, "description": "软组织窗：窗宽2000~2500HU，窗位550~750HU"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.3 肋骨CT平扫 - 因子5: 扫描体位
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_RIB_5_4_6_3_5', 'CT_RIB_5_4_6_3_5', '扫描体位', 3, 'boolean',
'仰卧位，双手上举',
'{"type": "dicom_check", "method": "checkSCAN_POSITION", "params": {"expectedPosition": ["HFS", "FFS"]}, "isVeto": false, "description": "仰卧位，双手上举"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.3 肋骨CT平扫 - 因子6: 图像标识
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_RIB_5_4_6_3_6', 'CT_RIB_5_4_6_3_6', '图像标识', 3, 'boolean',
'影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位',
'{"type": "dicom_check", "method": "checkImageAnnotation", "params": {"requiredFields": ["StudyInstanceUID", "BodyPartExamined", "PatientName", "PatientSex", "PatientAge", "StudyDate", "StudyTime", "KVP", "ScanDirection"]}, "isVeto": true, "description": "影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.3 肋骨CT平扫 - 因子7: 图像伪影
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_RIB_5_4_6_3_7', 'CT_RIB_5_4_6_3_7', '图像伪影', 3, 'boolean',
'无明显运动、呼吸、设备或体外金属等原因产生的图像伪影',
'{"type": "opencv_check", "method": "checkIMAGE_ARTIFACTS", "params": {"motionThreshold": 30.0, "beamHardeningThreshold": 50.0}, "isVeto": true, "description": "无明显运动、呼吸、设备或体外金属等原因产生的图像伪影"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.3 肋骨CT平扫 - 因子8: 图像清晰度
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_RIB_5_4_6_3_8', 'CT_RIB_5_4_6_3_8', '图像清晰度', 3, 'boolean',
'组织结构显示清晰，默认窗宽窗位合适',
'{"type": "opencv_check", "method": "checkIMAGE_CLARITY", "params": {"sharpnessThreshold": 100.0, "contrastThreshold": 50.0}, "isVeto": false, "description": "组织结构显示清晰，默认窗宽窗位合适"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.3 肋骨CT平扫 - 质控标准
INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `pass_score`, `description`, `status`, `create_time`, `update_time`) VALUES
('STD_CT_5_4_6_3', 'CT_5_4_6_3', '肋骨CT平扫质控标准', 'CT', '胸部', '平扫', '肋骨CT平扫', 80,
'肋骨CT平扫质控标准，包含8个质控因子',
1, NOW(), NOW());

-- 5.4.6.3 肋骨CT平扫 - 标准-因子关联
INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
('SF_CT_5_4_6_3_1', 'STD_CT_5_4_6_3', 'CT_RIB_5_4_6_3_1', 10.00, 1, 1, NOW(), NOW()),
('SF_CT_5_4_6_3_2', 'STD_CT_5_4_6_3', 'CT_RIB_5_4_6_3_2', 8.00, 1, 2, NOW(), NOW()),
('SF_CT_5_4_6_3_3', 'STD_CT_5_4_6_3', 'CT_RIB_5_4_6_3_3', 10.00, 1, 3, NOW(), NOW()),
('SF_CT_5_4_6_3_4', 'STD_CT_5_4_6_3', 'CT_RIB_5_4_6_3_4', 20.00, 1, 4, NOW(), NOW()),
('SF_CT_5_4_6_3_5', 'STD_CT_5_4_6_3', 'CT_RIB_5_4_6_3_5', 8.00, 1, 5, NOW(), NOW()),
('SF_CT_5_4_6_3_6', 'STD_CT_5_4_6_3', 'CT_RIB_5_4_6_3_6', 20.00, 1, 6, NOW(), NOW()),
('SF_CT_5_4_6_3_7', 'STD_CT_5_4_6_3', 'CT_RIB_5_4_6_3_7', 16.00, 1, 7, NOW(), NOW()),
('SF_CT_5_4_6_3_8', 'STD_CT_5_4_6_3', 'CT_RIB_5_4_6_3_8', 8.00, 1, 8, NOW(), NOW());


-- 5.4.6.4 肺低剂量CT平扫 - 因子1: 检查范围
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LUNG_LD_5_4_6_4_1', 'CT_LUNG_LD_5_4_6_4_1', '检查范围', 3, 'boolean',
'检查范围从肺尖至较低侧肋膈角下2~3cm',
'{"type": "dicom_check", "method": "checkSCAN_RANGE", "params": {"minSliceCount": 30, "expectedBodyPart": "胸部", "checkCoverage": true}, "isVeto": false, "description": "检查范围从肺尖至较低侧肋膈角下2~3cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.4 肺低剂量CT平扫 - 因子2: 图像偏中心
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LUNG_LD_5_4_6_4_2', 'CT_LUNG_LD_5_4_6_4_2', '图像偏中心', 3, 'boolean',
'断层位于图像正中',
'{"type": "opencv_check", "method": "checkIMAGE_CENTERING", "params": {"maxOffsetRatio": 0.15}, "isVeto": false, "description": "断层位于图像正中"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.4 肺低剂量CT平扫 - 因子3: 重建参数
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LUNG_LD_5_4_6_4_3', 'CT_LUNG_LD_5_4_6_4_3', '重建参数', 3, 'boolean',
'厚层≤5.0mm，薄层≤2.0mm，DFOV：33cm',
'{"type": "dicom_check", "method": "checkRECONSTRUCTION_PARAMS", "params": {"thickSliceMax": 5.0, "thickIntervalMax": 5.0, "thinSliceMax": 2.0, "thinIntervalMax": 2.0, "dfov": 33, "dfovTolerance": 2.0}, "isVeto": false, "description": "厚层≤5.0mm，薄层≤2.0mm，DFOV：33cm"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.4 肺低剂量CT平扫 - 因子4: 窗口技术
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LUNG_LD_5_4_6_4_4', 'CT_LUNG_LD_5_4_6_4_4', '窗口技术', 3, 'boolean',
'软组织窗：窗宽800~1500HU，窗位-800~-600HU',
'{"type": "dicom_check", "method": "checkWINDOW_TECHNIQUE", "params": {"softTissueWindow": {"windowWidth": {"min": 800, "max": 1500}, "windowCenter": {"min": -800, "max": -600}}}, "isVeto": true, "description": "软组织窗：窗宽800~1500HU，窗位-800~-600HU"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.4 肺低剂量CT平扫 - 因子5: 扫描体位
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LUNG_LD_5_4_6_4_5', 'CT_LUNG_LD_5_4_6_4_5', '扫描体位', 3, 'boolean',
'仰卧位，双手上举',
'{"type": "dicom_check", "method": "checkSCAN_POSITION", "params": {"expectedPosition": ["HFS", "FFS"]}, "isVeto": false, "description": "仰卧位，双手上举"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.4 肺低剂量CT平扫 - 因子6: 图像标识
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LUNG_LD_5_4_6_4_6', 'CT_LUNG_LD_5_4_6_4_6', '图像标识', 3, 'boolean',
'影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位',
'{"type": "dicom_check", "method": "checkImageAnnotation", "params": {"requiredFields": ["StudyInstanceUID", "BodyPartExamined", "PatientName", "PatientSex", "PatientAge", "StudyDate", "StudyTime", "KVP", "ScanDirection"]}, "isVeto": true, "description": "影像号、检查部位、姓名、性别、年龄、日期、时间、kV、mAs值、扫描方位"}',
'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.4 肺低剂量CT平扫 - 因子7: 图像伪影
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LUNG_LD_5_4_6_4_7', 'CT_LUNG_LD_5_4_6_4_7', '图像伪影', 3, 'boolean',
'无明显运动、呼吸、设备或体外金属等原因产生的图像伪影',
'{"type": "opencv_check", "method": "checkIMAGE_ARTIFACTS", "params": {"motionThreshold": 30.0, "beamHardeningThreshold": 50.0}, "isVeto": true, "description": "无明显运动、呼吸、设备或体外金属等原因产生的图像伪影"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.4 肺低剂量CT平扫 - 因子8: 图像清晰度
INSERT INTO `qc_factor` (`id`, `factor_code`, `factor_name`, `factor_category`, `factor_type`, `description`, `check_rule`, `data_source`, `status`, `create_time`, `update_time`, `modality`, `body_part`, `scan_type`) VALUES
('CT_LUNG_LD_5_4_6_4_8', 'CT_LUNG_LD_5_4_6_4_8', '图像清晰度', 3, 'boolean',
'组织结构显示清晰，默认窗宽窗位合适',
'{"type": "opencv_check", "method": "checkIMAGE_CLARITY", "params": {"sharpnessThreshold": 100.0, "contrastThreshold": 50.0}, "isVeto": false, "description": "组织结构显示清晰，默认窗宽窗位合适"}',
'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);

-- 5.4.6.4 肺低剂量CT平扫 - 质控标准
INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `pass_score`, `description`, `status`, `create_time`, `update_time`) VALUES
('STD_CT_5_4_6_4', 'CT_5_4_6_4', '肺低剂量CT平扫质控标准', 'CT', '胸部', '平扫', '肺低剂量CT平扫', 80,
'肺低剂量CT平扫质控标准，包含8个质控因子',
1, NOW(), NOW());

-- 5.4.6.4 肺低剂量CT平扫 - 标准-因子关联
INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
('SF_CT_5_4_6_4_1', 'STD_CT_5_4_6_4', 'CT_LUNG_LD_5_4_6_4_1', 10.00, 1, 1, NOW(), NOW()),
('SF_CT_5_4_6_4_2', 'STD_CT_5_4_6_4', 'CT_LUNG_LD_5_4_6_4_2', 8.00, 1, 2, NOW(), NOW()),
('SF_CT_5_4_6_4_3', 'STD_CT_5_4_6_4', 'CT_LUNG_LD_5_4_6_4_3', 10.00, 1, 3, NOW(), NOW()),
('SF_CT_5_4_6_4_4', 'STD_CT_5_4_6_4', 'CT_LUNG_LD_5_4_6_4_4', 20.00, 1, 4, NOW(), NOW()),
('SF_CT_5_4_6_4_5', 'STD_CT_5_4_6_4', 'CT_LUNG_LD_5_4_6_4_5', 8.00, 1, 5, NOW(), NOW()),
('SF_CT_5_4_6_4_6', 'STD_CT_5_4_6_4', 'CT_LUNG_LD_5_4_6_4_6', 20.00, 1, 6, NOW(), NOW()),
('SF_CT_5_4_6_4_7', 'STD_CT_5_4_6_4', 'CT_LUNG_LD_5_4_6_4_7', 16.00, 1, 7, NOW(), NOW()),
('SF_CT_5_4_6_4_8', 'STD_CT_5_4_6_4', 'CT_LUNG_LD_5_4_6_4_8', 8.00, 1, 8, NOW(), NOW());

