Files
AIclinicalresearch/docs/03-业务模块/IIT Manager Agent/05-测试文档/Phase 1 补充任务清单.md
HaHafeng 5db4a7064c feat(iit): Implement real-time quality control system
Summary:

- Add 4 new database tables: iit_field_metadata, iit_qc_logs, iit_record_summary, iit_qc_project_stats

- Implement pg-boss debounce mechanism in WebhookController

- Refactor QC Worker for dual output: QC logs + record summary

- Enhance HardRuleEngine to support form-based rule filtering

- Create QcService for QC data queries

- Optimize ChatService with new intents: query_enrollment, query_qc_status

- Add admin batch operations: one-click full QC + one-click full summary

- Create IIT Admin management module: project config, QC rules, user mapping

Status: Code complete, pending end-to-end testing
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-07 21:56:11 +08:00

38 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# **Phase 1.5 补充任务:隐私安全与自动化工具**
**优先级:** P0 (必须在正式处理患者数据前完成)
**目的:** 解决合规性风险,降低项目部署的人力成本
## **1\. PII 数据脱敏中间件 (Anonymizer Middleware)**
在 SoftRuleEngine 和 ChatService 调用 LLM 之前,必须对文本进行处理。
* \[ \] **实现 PII 识别正则库**
* 识别身份证号、手机号、中文姓名2-4字、MRN 号。
* \[ \] **实现脱敏/还原逻辑**
* **发送前 (Masking)**: 张三 (ID: 420101...) \-\> \[PATIENT\_NAME\_1\] (ID: \[ID\_CARD\_1\])
* **接收后 (Unmasking)**: 将 LLM 回复中的 \[PATIENT\_NAME\_1\] 还原为 张三 显示给前端。
* \[ \] **安全审计日志**
* 记录所有发送给 LLM 的原始 Payload加密存储用于事后合规审计。
## **2\. Redcap Schema 自动对齐工具 (Auto-Mapper)**
减少 iit\_field\_mapping 的人工配置工作量。
* \[ \] **Data Dictionary 解析器**
* 读取 Redcap 导出的 Data Dictionary (CSV/JSON)。
* 提取所有字段的 Variable Name 和 Field Label。
* \[ \] **LLM 语义映射 Job**
* 输入:系统标准字段列表(如 age, gender, visit\_date
* 输入Redcap 字段列表(如 nl\_age, sex\_v2, d\_visit
* Prompt: "请将以下 Redcap 字段与系统标准字段进行语义匹配,返回 JSON 映射表。"
* \[ \] **人工确认 UI**
* 在管理后台提供一个界面,显示 LLM 猜测的映射关系,管理员点击 "Confirm" 后写入数据库。
## **3\. 错误处理与熔断机制**
* \[ \] **ReAct 循环熔断**
* 设置 SoftRuleEngine 最大重试次数为 3。
* 设置 ReActEngine 最大 Step 为 5。
* 超过限制时,返回固定的 Fallback 回复:"抱歉,该任务过于复杂或数据不足,请人工介入。"