fix: 批量/手动匹配排除同一试验已匹配患者,防止重复记录
matching_service.py:
- run_matching 改为 upsert:同一 (patient_id, trial_id) 存在记录时
直接更新 LLM 结果,不再插入新行,彻底消除重复记录
- 仅首次匹配时向医生发送通知,重新匹配不重复推送
batch_matching_service.py:
- existing_pairs 查询从全表扫描改为按目标试验过滤,提升性能
- 只查 MatchingResult 的 patient_id/trial_id 列(select 子集)
Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
Showing
Please register or sign in to comment