part1.sql 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. -- ============================================================================
  2. -- 医保影像云图像质控规范 - SQL数据导入脚本
  3. --
  4. -- 文档:医保影像云图像质控规范 (YXY-QC-2025-A1)
  5. -- 创建时间:2026-01-13
  6. --
  7. -- 本文件包含:
  8. -- - Part 1: 影像检查图像基础要求(4.1-4.7)
  9. -- - Part 2: CT图像质量控制整体要求(5.3)
  10. -- - Part 3: CT颅脑平扫质控标准(5.4.1.1)
  11. -- - Part 4: CT颅脑增强质控标准(5.4.1.2)
  12. --
  13. -- 说明:根据现有表结构生成,适用于 qc_factor、qc_standard、qc_standard_factor 表
  14. -- ============================================================================
  15. SET NAMES utf8mb4;
  16. SET FOREIGN_KEY_CHECKS = 0;
  17. -- ===================================
  18. -- Part 1: 影像检查图像基础要求(适用于所有影像模态)
  19. -- ===================================
  20. -- 4.1 有效图像(否决项)
  21. 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
  22. ('BASIC_4_1', 'BASIC_4_1', '有效图像', 1, 'boolean',
  23. '影像检查图像须确保清晰度与可辨识性,能够为诊断提供准确依据,严禁出现全黑、全白等无效影像',
  24. '{
  25. "type": "opencv_check",
  26. "method": "checkValidImage",
  27. "params": {
  28. "minSharpness": 50.0,
  29. "minBrightness": 10.0,
  30. "maxBrightness": 245.0,
  31. "minStdDev": 20.0
  32. },
  33. "isVeto": true,
  34. "description": "使用Laplacian方差检测清晰度,检查亮度范围和标准差,识别全黑、全白图像"
  35. }',
  36. 'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);
  37. -- 4.2 真实人体图像(否决项)
  38. 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
  39. ('BASIC_4_2', 'BASIC_4_2', '真实人体图像', 1, 'boolean',
  40. '影像检查图像须真实反映人体解剖结构,严禁使用非真实人体图像,如:仿人体模型、质控水模、动植物等',
  41. '{
  42. "type": "opencv_check",
  43. "method": "checkRealHumanBody",
  44. "params": {
  45. "minEdgeRatio": 0.015,
  46. "maxEdgeRatio": 0.50,
  47. "minTextureComplexity": 3.0
  48. },
  49. "isVeto": true,
  50. "description": "检查边缘密度和纹理复杂度,识别非真实人体图像(模型、水模、动植物等)"
  51. }',
  52. 'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);
  53. -- 4.3 原始完整图像
  54. 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
  55. ('BASIC_4_3', 'BASIC_4_3', '原始完整图像', 1, 'boolean',
  56. '影像检查图像须为原始采集内容,严禁篡改、添加、删减、伪造处理',
  57. '{
  58. "type": "opencv_check",
  59. "method": "checkOriginalComplete",
  60. "params": {
  61. "maxAvgEdgeCount": 500.0,
  62. "checkCompressionArtifacts": true
  63. },
  64. "isVeto": false,
  65. "description": "检测图像是否经过篡改、添加、删减或伪造处理"
  66. }',
  67. 'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);
  68. -- 4.4 非拼接图像
  69. 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
  70. ('BASIC_4_4', 'BASIC_4_4', '非拼接图像', 1, 'boolean',
  71. '影像检查图像须完整包含患者同一次检查的全部图像,禁止将不同机构、不同患者、不同时间采集的检查图像拼接为同一次影像检查图像',
  72. '{
  73. "type": "opencv_check",
  74. "method": "checkNonStitched",
  75. "params": {
  76. "detectSeams": true,
  77. "maxSeamEdges": 10,
  78. "checkInconsistentLighting": true
  79. },
  80. "isVeto": false,
  81. "description": "检测图像是否存在拼接痕迹、接缝或光照不一致"
  82. }',
  83. 'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);
  84. -- 4.5 非重复图像
  85. 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
  86. ('BASIC_4_5', 'BASIC_4_5', '非重复图像', 1, 'boolean',
  87. '同一患者的同次影像检查图像不得被重复使用于不同的检查记录中,严禁将部分影像检查图像跨患者、跨机构重复使用',
  88. '{
  89. "type": "dicom_check",
  90. "method": "checkNonDuplicate",
  91. "params": {
  92. "checkAcrossStudies": true,
  93. "checkAcrossPatients": true,
  94. "checkAcrossInstitutions": true
  95. },
  96. "isVeto": false,
  97. "description": "通过SOP Instance UID和图像哈希值检查图像是否被重复使用"
  98. }',
  99. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  100. -- 4.6 患者信息相符
  101. 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
  102. ('BASIC_4_6', 'BASIC_4_6', '患者信息相符', 1, 'boolean',
  103. '影像检查图像特征须与患者年龄、性别、病史等信息相符',
  104. '{
  105. "type": "dicom_check",
  106. "method": "checkPatientInfoMatch",
  107. "params": {
  108. "checkAgeConsistency": true,
  109. "checkSexConsistency": true,
  110. "allowAgeDeviation": 5
  111. },
  112. "isVeto": false,
  113. "description": "验证DICOM中的患者年龄、性别与图像特征是否一致"
  114. }',
  115. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  116. -- 4.7 检查部位一致
  117. 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
  118. ('BASIC_4_7', 'BASIC_4_7', '检查部位一致', 1, 'boolean',
  119. '影像检查图像显示的检查部位须与检查报告、医保结算对应信息保持一致',
  120. '{
  121. "type": "dicom_check",
  122. "method": "checkBodyPartConsistent",
  123. "params": {
  124. "compareWithReport": true,
  125. "compareWithSettlement": true,
  126. "allowSynonyms": true
  127. },
  128. "isVeto": false,
  129. "description": "验证图像显示的检查部位与检查报告、医保结算信息是否一致"
  130. }',
  131. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  132. -- ===================================
  133. -- Part 2: CT图像质量控制整体要求(5.3)
  134. -- ===================================
  135. -- 5.3.1 图像信息(需包含DICOM元数据)(否决项)
  136. 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
  137. ('CT_5_3_1', 'CT_5_3_1', 'CT图像信息完整性', 2, 'boolean',
  138. '需包含患者标识、扫描参数等DICOM元数据信息',
  139. '{
  140. "type": "dicom_check",
  141. "method": "checkCTDicomMetadata",
  142. "params": {
  143. "requiredFields": [
  144. "PatientID",
  145. "PatientName",
  146. "StudyDate",
  147. "Modality",
  148. "SliceThickness",
  149. "KVP"
  150. ]
  151. },
  152. "isVeto": true,
  153. "description": "检查CT DICOM文件是否包含必需的元数据字段"
  154. }',
  155. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  156. -- 5.3.2 图像质量(窗技术应用)
  157. 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
  158. ('CT_5_3_2', 'CT_5_3_2', 'CT窗技术应用', 2, 'boolean',
  159. '图像对比度和灰度,应依检查部位的规范,合理应用窗技术,满足组织间的不同层次对比',
  160. '{
  161. "type": "dicom_check",
  162. "method": "checkCTWindowTechnique",
  163. "params": {
  164. "requireWindowCenter": true,
  165. "requireWindowWidth": true,
  166. "checkAppropriateWindow": true
  167. },
  168. "isVeto": false,
  169. "description": "检查是否正确应用窗技术(窗宽窗位)"
  170. }',
  171. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  172. -- ===================================
  173. -- Part 3: CT颅脑质控标准(5.4.1)
  174. -- ===================================
  175. -- 5.4.1.1 头颅CT平扫
  176. INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `modality`, `body_part`, `scan_type`, `exam_item`, `factor_category`, `description`, `pass_score`, `status`, `create_time`, `update_time`) VALUES
  177. ('STD_CT_5_4_1_1', 'CT_5_4_1_1', '头颅CT平扫质控标准', 'CT', '颅脑', '平扫', '头颅CT平扫', 2,
  178. '基于医保影像云规范的颅脑CT平扫质控标准,包含检查范围、重建参数、窗口技术、图像标识、伪影、清晰度等要求',
  179. 80, 1, NOW(), NOW());
  180. -- 头颅CT平扫 - 检查范围
  181. 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
  182. ('CT_5_4_1_1_1', 'CT_5_4_1_1_1', '检查范围(颅脑)', 2, 'string',
  183. '检查范围:从颅底至颅顶',
  184. '{
  185. "type": "dicom_check",
  186. "method": "checkScanRangeSkullBaseToTop",
  187. "params": {
  188. "minSliceCount": 30,
  189. "expectedBodyPart": "BRAIN",
  190. "checkCoverage": true
  191. },
  192. "isVeto": false,
  193. "description": "验证扫描范围是否覆盖颅底至颅顶"
  194. }',
  195. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  196. -- 头颅CT平扫 - 图像偏中心
  197. 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
  198. ('CT_5_4_1_1_2', 'CT_5_4_1_1_2', '图像偏中心', 2, 'string',
  199. '图像偏中心:断层位于图像正中',
  200. '{
  201. "type": "opencv_check",
  202. "method": "checkImageCentering",
  203. "params": {
  204. "maxOffsetRatio": 0.10
  205. },
  206. "isVeto": false,
  207. "description": "检测图像内容重心是否偏离中心"
  208. }',
  209. 'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);
  210. -- 头颅CT平扫 - 重建参数
  211. 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
  212. ('CT_5_4_1_1_3', 'CT_5_4_1_1_3', '重建参数', 2, 'object',
  213. '重建参数:厚层层厚/层间隔≤5mm/5mm,薄层层厚/层间隔≤1.25mm/1.25mm,DFOV:23cm',
  214. '{
  215. "type": "dicom_check",
  216. "method": "checkReconstructionParams",
  217. "params": {
  218. "thickSlice": {
  219. "maxSliceThickness": 5.0,
  220. "maxSliceInterval": 5.0
  221. },
  222. "thinSlice": {
  223. "maxSliceThickness": 1.25,
  224. "maxSliceInterval": 1.25
  225. },
  226. "dfov": {
  227. "nominal": 23.0,
  228. "tolerance": 3.0
  229. }
  230. },
  231. "isVeto": false,
  232. "description": "检查层厚、层间隔和DFOV参数"
  233. }',
  234. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  235. -- 头颅CT平扫 - 窗口技术(脑窗+骨窗)(否决项)
  236. 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
  237. ('CT_5_4_1_1_4', 'CT_5_4_1_1_4', '窗口技术', 2, 'object',
  238. '窗口技术:脑窗窗宽80~100HU,窗位35~45HU;骨窗窗宽3500~4000HU,窗位500~700HU',
  239. '{
  240. "type": "dicom_check",
  241. "method": "checkWindowTechnique",
  242. "params": {
  243. "brainWindow": {
  244. "windowWidth": {"min": 80, "max": 100},
  245. "windowCenter": {"min": 35, "max": 45}
  246. },
  247. "boneWindow": {
  248. "windowWidth": {"min": 3500, "max": 4000},
  249. "windowCenter": {"min": 500, "max": 700}
  250. }
  251. },
  252. "isVeto": true,
  253. "description": "检查脑窗和骨窗的窗宽窗位是否符合标准"
  254. }',
  255. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  256. -- 头颅CT平扫 - 扫描体位
  257. 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
  258. ('CT_5_4_1_1_5', 'CT_5_4_1_1_5', '扫描体位', 2, 'string',
  259. '扫描体位:仰卧位',
  260. '{
  261. "type": "dicom_check",
  262. "method": "checkScanPosition",
  263. "params": {
  264. "expectedPosition": "HFS",
  265. "allowedPositions": ["HFS", "FFS"]
  266. },
  267. "isVeto": false,
  268. "description": "验证患者体位是否符合标准(HFS-仰卧位头先进)"
  269. }',
  270. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  271. -- 头颅CT平扫 - 图像标识(否决项)
  272. 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
  273. ('CT_5_4_1_1_6', 'CT_5_4_1_1_6', '图像标识', 2, 'boolean',
  274. '图像标识:影像号、检查部位、姓名、性别、年龄、检查日期、检查时间、kV、mAs值、扫描方位',
  275. '{
  276. "type": "dicom_check",
  277. "method": "checkImageAnnotation",
  278. "params": {
  279. "requiredFields": [
  280. "StudyInstanceUID",
  281. "BodyPartExamined",
  282. "PatientName",
  283. "PatientSex",
  284. "PatientAge",
  285. "StudyDate",
  286. "StudyTime",
  287. "KVP",
  288. "Exposure"
  289. ]
  290. },
  291. "isVeto": true,
  292. "description": "检查DICOM文件是否包含所有必需的图像标识信息"
  293. }',
  294. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  295. -- 头颅CT平扫 - 图像伪影(否决项)
  296. 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
  297. ('CT_5_4_1_1_7', 'CT_5_4_1_1_7', '图像伪影', 2, 'boolean',
  298. '图像伪影:没有运动伪影以及高衰减伪影',
  299. '{
  300. "type": "opencv_check",
  301. "method": "checkImageArtifact",
  302. "params": {
  303. "maxMotionArtifactLevel": 2,
  304. "checkBeamHardening": true,
  305. "checkMetalArtifact": true,
  306. "maxArtifactRatio": 0.15
  307. },
  308. "isVeto": true,
  309. "description": "检测运动伪影、束硬化伪影、金属伪影等CT常见伪影"
  310. }',
  311. 'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);
  312. -- 头颅CT平扫 - 图像清晰度
  313. 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
  314. ('CT_5_4_1_1_8', 'CT_5_4_1_1_8', '图像清晰度', 2, 'number',
  315. '图像清晰度:颅脑组织显示清晰',
  316. '{
  317. "type": "opencv_check",
  318. "method": "checkImageClarity",
  319. "params": {
  320. "minSharpness": 100.0,
  321. "minContrast": 30.0
  322. },
  323. "isVeto": false,
  324. "description": "检测颅脑组织显示的清晰度"
  325. }',
  326. 'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);
  327. -- ===================================
  328. -- 关联质控因子到头颅CT平扫标准
  329. -- ===================================
  330. DELETE FROM qc_standard_factor WHERE standard_id = 'STD_CT_5_4_1_1';
  331. -- 基础要求(4.1-4.7)
  332. INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `weight`, `is_required`, `sort_order`, `create_time`, `update_time`) VALUES
  333. ('SF_CT_5_4_1_1_4_1', 'STD_CT_5_4_1_1', 'BASIC_4_1', 15.00, 1, 1, NOW(), NOW()),
  334. ('SF_CT_5_4_1_1_4_2', 'STD_CT_5_4_1_1', 'BASIC_4_2', 15.00, 1, 2, NOW(), NOW()),
  335. ('SF_CT_5_4_1_1_4_3', 'STD_CT_5_4_1_1', 'BASIC_4_3', 5.00, 0, 3, NOW(), NOW()),
  336. ('SF_CT_5_4_1_1_4_4', 'STD_CT_5_4_1_1', 'BASIC_4_4', 5.00, 0, 4, NOW(), NOW()),
  337. ('SF_CT_5_4_1_1_4_5', 'STD_CT_5_4_1_1', 'BASIC_4_5', 5.00, 0, 5, NOW(), NOW()),
  338. ('SF_CT_5_4_1_1_4_6', 'STD_CT_5_4_1_1', 'BASIC_4_6', 5.00, 0, 6, NOW(), NOW()),
  339. ('SF_CT_5_4_1_1_4_7', 'STD_CT_5_4_1_1', 'BASIC_4_7', 5.00, 0, 7, NOW(), NOW()),
  340. -- CT整体要求(5.3)
  341. ('SF_CT_5_4_1_1_5_3_1', 'STD_CT_5_4_1_1', 'CT_5_3_1', 10.00, 1, 8, NOW(), NOW()),
  342. ('SF_CT_5_4_1_1_5_3_2', 'STD_CT_5_4_1_1', 'CT_5_3_2', 5.00, 0, 9, NOW(), NOW()),
  343. -- 颅脑专项要求
  344. ('SF_CT_5_4_1_1_SPEC_1', 'STD_CT_5_4_1_1', 'CT_5_4_1_1_1', 5.00, 0, 10, NOW(), NOW()),
  345. ('SF_CT_5_4_1_1_SPEC_2', 'STD_CT_5_4_1_1', 'CT_5_4_1_1_2', 5.00, 0, 11, NOW(), NOW()),
  346. ('SF_CT_5_4_1_1_SPEC_3', 'STD_CT_5_4_1_1', 'CT_5_4_1_1_3', 5.00, 0, 12, NOW(), NOW()),
  347. ('SF_CT_5_4_1_1_SPEC_4', 'STD_CT_5_4_1_1', 'CT_5_4_1_1_4', 10.00, 1, 13, NOW(), NOW()),
  348. ('SF_CT_5_4_1_1_SPEC_5', 'STD_CT_5_4_1_1', 'CT_5_4_1_1_5', 5.00, 0, 14, NOW(), NOW()),
  349. ('SF_CT_5_4_1_1_SPEC_6', 'STD_CT_5_4_1_1', 'CT_5_4_1_1_6', 10.00, 1, 15, NOW(), NOW()),
  350. ('SF_CT_5_4_1_1_SPEC_7', 'STD_CT_5_4_1_1', 'CT_5_4_1_1_7', 10.00, 1, 16, NOW(), NOW()),
  351. ('SF_CT_5_4_1_1_SPEC_8', 'STD_CT_5_4_1_1', 'CT_5_4_1_1_8', 5.00, 0, 17, NOW(), NOW());
  352. -- ============================================================================
  353. -- Part 4: CT颅脑增强质控标准(5.4.1.2)
  354. -- ============================================================================
  355. -- ===================================
  356. -- 5.4.1.2 头颅CT增强 - 质控因子(qc_factor)
  357. -- ===================================
  358. -- 因子1:检查范围 - 从颅底至颅顶
  359. 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
  360. ('CT_HEAD_ENH_5_4_1_2_1', 'CT_HEAD_ENH_5_4_1_2_1', '检查范围', 3, 'boolean', '检查范围从颅底至颅顶,确保覆盖完整颅脑区域',
  361. '{
  362. "type": "dicom_check",
  363. "method": "checkScanRangeSkullBaseToTop",
  364. "params": {
  365. "minSliceCount": 30,
  366. "expectedBodyPart": "BRAIN",
  367. "checkCoverage": true
  368. },
  369. "isVeto": false,
  370. "description": "通过DICOM序列图像数量和BodyPart标签验证扫描范围是否覆盖颅底至颅顶"
  371. }',
  372. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  373. -- 因子2:图像偏中心 - 断层位于图像正中
  374. 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
  375. ('CT_HEAD_ENH_5_4_1_2_2', 'CT_HEAD_ENH_5_4_1_2_2', '图像偏中心', 3, 'string', '断层位于图像正中,允许适度偏移',
  376. '{
  377. "type": "opencv_check",
  378. "method": "checkImageCentering",
  379. "params": {
  380. "maxOffsetRatio": 0.15,
  381. "checkCenterOfMass": true
  382. },
  383. "isVeto": false,
  384. "description": "检测图像内容重心是否偏离中心超过15%"
  385. }',
  386. 'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);
  387. -- 因子3:重建参数 - 层厚/层间隔、DFOV
  388. 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
  389. ('CT_HEAD_ENH_5_4_1_2_3', 'CT_HEAD_ENH_5_4_1_2_3', '重建参数', 3, 'object', '厚层层厚/层间隔≤5mm/5mm,薄层层厚/层间隔≤1.25mm/1.25mm,DFOV:23cm',
  390. '{
  391. "type": "dicom_check",
  392. "method": "checkReconstructionParams",
  393. "params": {
  394. "thickSlice": {
  395. "maxSliceThickness": 5.0,
  396. "maxSliceInterval": 5.0
  397. },
  398. "thinSlice": {
  399. "maxSliceThickness": 1.25,
  400. "maxSliceInterval": 1.25
  401. },
  402. "dfov": {
  403. "nominal": 23.0,
  404. "tolerance": 5.0
  405. }
  406. },
  407. "isVeto": false,
  408. "description": "检查DICOM标签中的层厚、层间隔和DFOV是否符合规范"
  409. }',
  410. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  411. -- 因子4:窗口技术 - 脑窗静脉期(否决项)
  412. 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
  413. ('CT_HEAD_ENH_5_4_1_2_4', 'CT_HEAD_ENH_5_4_1_2_4', '窗口技术', 3, 'object', '常规包含脑窗静脉期:窗宽80~100HU,窗位35~45HU',
  414. '{
  415. "type": "dicom_check",
  416. "method": "checkWindowTechnique",
  417. "params": {
  418. "brainWindowVenous": {
  419. "windowWidth": {"min": 80, "max": 100},
  420. "windowCenter": {"min": 35, "max": 45}
  421. }
  422. },
  423. "isVeto": true,
  424. "description": "检查窗宽窗位是否符合脑窗静脉期标准(增强CT关键参数)"
  425. }',
  426. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  427. -- 因子5:扫描体位 - 仰卧位
  428. 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
  429. ('CT_HEAD_ENH_5_4_1_2_5', 'CT_HEAD_ENH_5_4_1_2_5', '扫描体位', 3, 'string', '扫描体位:仰卧位',
  430. '{
  431. "type": "dicom_check",
  432. "method": "checkScanPosition",
  433. "params": {
  434. "expectedPosition": "HFS",
  435. "allowedPositions": ["HFS", "FFS", "HFP", "FFP"],
  436. "checkPatientOrientation": true
  437. },
  438. "isVeto": false,
  439. "description": "验证患者体位是否符合标准(Head First Supine - HFS表示仰卧位头先进)"
  440. }',
  441. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  442. -- 因子6:图像标识(否决项)
  443. 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
  444. ('CT_HEAD_ENH_5_4_1_2_6', 'CT_HEAD_ENH_5_4_1_2_6', '图像标识', 3, 'boolean', '图像标识须包含:影像号、检查部位、姓名、性别、年龄、检查日期、检查时间、kV、mAs值、扫描方位',
  445. '{
  446. "type": "dicom_check",
  447. "method": "checkImageAnnotation",
  448. "params": {
  449. "requiredFields": [
  450. "StudyInstanceUID", -- 影像号
  451. "BodyPartExamined", -- 检查部位
  452. "PatientName", -- 姓名
  453. "PatientSex", -- 性别
  454. "PatientAge", -- 年龄
  455. "StudyDate", -- 检查日期
  456. "StudyTime", -- 检查时间
  457. "KVP", -- kV值
  458. "Exposure", -- mAs值
  459. "ScanOrientation" -- 扫描方位
  460. ]
  461. },
  462. "isVeto": true,
  463. "description": "检查DICOM文件是否包含所有必需的图像标识信息"
  464. }',
  465. 'dicom_metadata', 1, NOW(), NOW(), NULL, NULL, NULL);
  466. -- 因子7:图像伪影(否决项)
  467. 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
  468. ('CT_HEAD_ENH_5_4_1_2_7', 'CT_HEAD_ENH_5_4_1_2_7', '图像伪影', 3, 'boolean', '没有运动伪影以及高衰减伪影',
  469. '{
  470. "type": "opencv_check",
  471. "method": "checkImageArtifactEnhanced",
  472. "params": {
  473. "maxMotionArtifactLevel": 2,
  474. "checkBeamHardening": true,
  475. "checkMetalArtifact": true,
  476. "maxArtifactRatio": 0.15
  477. },
  478. "isVeto": true,
  479. "description": "检测运动伪影、束硬化伪影、金属伪影等增强CT常见伪影"
  480. }',
  481. 'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);
  482. -- 因子8:图像清晰度 - 增强CT脑部血管明显强化
  483. 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
  484. ('CT_HEAD_ENH_5_4_1_2_8', 'CT_HEAD_ENH_5_4_1_2_8', '图像清晰度', 3, 'number', '增强CT脑部血管明显强化,血管对比度清晰',
  485. '{
  486. "type": "opencv_check",
  487. "method": "checkImageClarityEnhanced",
  488. "params": {
  489. "minVesselContrast": 50.0,
  490. "minSharpness": 100.0,
  491. "checkEnhancement": true,
  492. "expectedEnhancementRatio": 1.5
  493. },
  494. "isVeto": false,
  495. "description": "检测增强CT血管强化程度和清晰度,评估血管显示质量"
  496. }',
  497. 'opencv_analysis', 1, NOW(), NOW(), NULL, NULL, NULL);
  498. -- ===================================
  499. -- 2. 创建质控标准(qc_standard)
  500. -- ===================================
  501. INSERT INTO `qc_standard` (`id`, `standard_code`, `standard_name`, `standard_category`, `description`, `pass_score`, `status`, `create_time`, `update_time`) VALUES
  502. ('STD_CT_HEAD_ENHANCED', 'STD_CT_HEAD_ENHANCED', '头颅CT增强质控标准', 3, '基于国家医保局要求的头颅CT增强影像质量控制标准(GB 5.4.1.2),包含检查范围、重建参数、窗口技术、增强效果等专项要求',
  503. 80, 1, NOW(), NOW());
  504. -- ===================================
  505. -- 3. 关联质控因子到标准(qc_standard_factor)
  506. -- ===================================
  507. -- 删除旧的关联(如果存在)
  508. DELETE FROM qc_standard_factor WHERE standard_id = 'STD_CT_HEAD_ENHANCED';
  509. -- 插入新的关联(权重分配)
  510. -- 头颅CT增强专项因子(权重分配:总计100)
  511. INSERT INTO `qc_standard_factor` (`id`, `standard_id`, `factor_id`, `check_rule`, `weight`, `is_required`, `threshold_value`, `sort_order`, `create_time`, `update_time`, `pass_value`) VALUES
  512. ('SF_CT_ENH_1', 'STD_CT_HEAD_ENHANCED', 'CT_HEAD_ENH_5_4_1_2_1', NULL, 10.00, 1, NULL, 1, NOW(), NOW(), '{"passed": true}'), -- 检查范围
  513. ('SF_CT_ENH_2', 'STD_CT_HEAD_ENHANCED', 'CT_HEAD_ENH_5_4_1_2_2', NULL, 8.00, 1, NULL, 2, NOW(), NOW(), '{"result": "normal"}'), -- 图像偏中心
  514. ('SF_CT_ENH_3', 'STD_CT_HEAD_ENHANCED', 'CT_HEAD_ENH_5_4_1_2_3', NULL, 12.00, 1, NULL, 3, NOW(), NOW(), '{"passed": true}'), -- 重建参数
  515. ('SF_CT_ENH_4', 'STD_CT_HEAD_ENHANCED', 'CT_HEAD_ENH_5_4_1_2_4', NULL, 20.00, 1, NULL, 4, NOW(), NOW(), '{"passed": true}'), -- 窗口技术(否决项)
  516. ('SF_CT_ENH_5', 'STD_CT_HEAD_ENHANCED', 'CT_HEAD_ENH_5_4_1_2_5', NULL, 8.00, 1, NULL, 5, NOW(), NOW(), '{"position": "HFS"}'), -- 扫描体位
  517. ('SF_CT_ENH_6', 'STD_CT_HEAD_ENHANCED', 'CT_HEAD_ENH_5_4_1_2_6', NULL, 17.00, 1, NULL, 6, NOW(), NOW(), '{"passed": true}'), -- 图像标识(否决项)
  518. ('SF_CT_ENH_7', 'STD_CT_HEAD_ENHANCED', 'CT_HEAD_ENH_5_4_1_2_7', NULL, 15.00, 1, NULL, 7, NOW(), NOW(), '{"passed": true}'), -- 图像伪影(否决项)
  519. ('SF_CT_ENH_8', 'STD_CT_HEAD_ENHANCED', 'CT_HEAD_ENH_5_4_1_2_8', NULL, 10.00, 1, NULL, 8, NOW(), NOW(), '{"value": {"$gte": 50}}') -- 图像清晰度
  520. -- ===================================
  521. -- ===================================
  522. -- 验证查询
  523. -- ===================================
  524. -- 查看所有头颅CT平扫质控因子
  525. SELECT
  526. f.factor_code,
  527. f.factor_name,
  528. f.description,
  529. JSON_EXTRACT(f.check_rule, '$.isVeto') as is_veto,
  530. JSON_EXTRACT(f.check_rule, '$.method') as check_method
  531. FROM qc_factor f
  532. WHERE f.id LIKE 'CT_5_4_1_1_%' OR f.id LIKE 'BASIC_%'
  533. ORDER BY f.factor_code;
  534. -- 查看头颅CT平扫标准及其关联的因子
  535. SELECT
  536. s.standard_code,
  537. s.standard_name,
  538. s.modality,
  539. s.body_part,
  540. s.scan_type,
  541. f.factor_code,
  542. f.factor_name,
  543. sf.weight,
  544. sf.is_required,
  545. sf.sort_order
  546. FROM qc_standard s
  547. JOIN qc_standard_factor sf ON s.id = sf.standard_id
  548. JOIN qc_factor f ON sf.factor_id = f.id
  549. WHERE s.id = 'STD_CT_5_4_1_1'
  550. ORDER BY sf.sort_order;
  551. -- 统计信息
  552. SELECT '基础质控因子' as type, COUNT(*) as count FROM qc_factor WHERE id LIKE 'BASIC_%'
  553. UNION ALL
  554. SELECT '头颅CT平扫质控因子', COUNT(*) FROM qc_factor WHERE id LIKE 'CT_5_4_1_1_%'
  555. UNION ALL
  556. SELECT '头颅CT平扫标准-因子关联', COUNT(*) FROM qc_standard_factor WHERE standard_id = 'STD_CT_5_4_1_1';
  557. SET FOREIGN_KEY_CHECKS = 1;
  558. -- ===================================
  559. -- 文件说明
  560. -- ===================================
  561. -- 本文件包含了基础的影像质控因子和头颅CT平扫的完整质控标准
  562. -- 下一步将创建其他CT部位的质控标准(口腔颌面、眼部、鼻咽部、颈部、胸部、腹部、盆腔)
  563. -- 以及MR相关的质控标准