MedShard: Privacy-Preserving EMR QC with Rule Sharding and Multi-agent Collaboration
摘要
Electronic medical records (EMRs) are widely digitized, yet their utility depends on data quality that is complete, correct, and temporally and semantically consistent. Relying on closed large models for automated quality control (QC) is costly and raises privacy concerns because clinical text contains protected information. Local small models are attractive but they have weaker long-context handling, more limited reasoning, and narrower knowledge coverage. We present MedShard, a training-free, privacy-preserving pipeline that configures locally deployable LLMs to perform EMR QC effectively. The method reduces context length through rule-aware sharding, simplifies complex rule logic with explicit templates, and injects lightweight domain knowledge using curated few-shot exemplars, all without updating model weights. The system coordinates four agents–Cleaning, QC, Reflection, and Output–to deliver high recall with precise final decisions and structured rationales. MedShard runs on a single on-premises A100 GPU with a vLLM backend. On the CHIP 2025 benchmark, it achieves rank 1 with an overall score of 70.23, while reducing text token usage and rule token cost by 89.18% and 90.96% compared with naive long-context prompting. Ablation studies indicate additive gains from rule sharding, regex gating, and reflection. We release prompts, rule schemas, and deployment scripts to support reproducibility and regional adaptation.