Files
AIclinicalresearch/docs/_templates/[AI对接] 快速上下文-模板.md
HaHafeng beb7f7f559 feat(asl): Implement full-text screening core LLM service and validation system (Day 1-3)
Core Components:
- PDFStorageService with Dify/OSS adapters
- LLM12FieldsService with Nougat-first + dual-model + 3-layer JSON parsing
- PromptBuilder for dynamic prompt assembly
- MedicalLogicValidator with 5 rules + fault tolerance
- EvidenceChainValidator for citation integrity
- ConflictDetectionService for dual-model comparison

Prompt Engineering:
- System Prompt (6601 chars, Section-Aware strategy)
- User Prompt template (PICOS context injection)
- JSON Schema (12 fields constraints)
- Cochrane standards (not loaded in MVP)

Key Innovations:
- 3-layer JSON parsing (JSON.parse + json-repair + code block extraction)
- Promise.allSettled for dual-model fault tolerance
- safeGetFieldValue for robust field extraction
- Mixed CN/EN token calculation

Integration Tests:
- integration-test.ts (full test)
- quick-test.ts (quick test)
- cached-result-test.ts (fault tolerance test)

Documentation Updates:
- Development record (Day 2-3 summary)
- Quality assurance strategy (full-text screening)
- Development plan (progress update)
- Module status (v1.1 update)
- Technical debt (10 new items)

Test Results:
- JSON parsing success rate: 100%
- Medical logic validation: 5/5 passed
- Dual-model parallel processing: OK
- Cost per PDF: CNY 0.10

Files: 238 changed, 14383 insertions(+), 32 deletions(-)
Docs: docs/03-涓氬姟妯″潡/ASL-AI鏅鸿兘鏂囩尞/05-寮€鍙戣褰?2025-11-22_Day2-Day3_LLM鏈嶅姟涓庨獙璇佺郴缁熷紑鍙?md
2025-11-22 22:21:12 +08:00

2.9 KiB
Raw Blame History

[AI对接] [模块名]快速上下文

阅读时间: [2-5]分钟
Token消耗 ~[800-2000] tokens
前置阅读: 00-系统总体设计/[AI对接] 快速上下文.md如果是L2级别


📋 模块定位

[一句话描述模块核心功能和价值]

商业价值: [评级]
开发状态: [已完成 / 开发中 / 规划中]
依赖能力: [列出依赖的通用能力]


🎯 核心功能

[列出3-6个核心功能用1-2句话描述每个功能]

  1. 功能1 - 简要描述
  2. 功能2 - 简要描述
  3. 功能3 - 简要描述

本周重点: [当前开发重点]


🏗️ 技术架构一览

前端React

src/pages/[ModuleName]/
  ├── [SubModule1]/
  ├── [SubModule2]/
  └── ...

后端Node.js

backend/src/modules/[module_code]/
  ├── controllers/
  ├── services/
  └── routes/

数据库([module]_schema

CREATE SCHEMA [module]_schema;
  - [table1]       # 1说明
  - [table2]       # 2说明
  - ...

💡 核心业务流程

[用简洁的流程图或步骤描述最核心的业务流程]

1. 用户操作
   ↓
2. 前端处理
   ↓
3. 后端处理
   ↓
4. 数据存储
   ↓
5. 返回结果

📚 已有设计文档

PRD文档

  • 00-项目概述/01-产品需求文档(PRD).md - [简要说明]

技术设计

  • 01-设计文档/02-数据库设计.md - [简要说明]
  • 01-设计文档/03-API设计.md - [简要说明]

UI原型

  • 01-设计文档/07-UI设计/[原型文件].html

🔗 依赖的通用能力

[能力1][状态]

// 接口示例或关键说明

[能力2][状态]

// 接口示例或关键说明

📋 API端点清单

[功能模块1]

POST   /api/v1/[module]/[resource]
GET    /api/v1/[module]/[resource]
...

[功能模块2]

POST   /api/v1/[module]/[resource2]
...

📅 开发计划

Week 1

  • Day 1-2[任务]
  • Day 3-4[任务]
  • Day 5[任务]

Week 2

  • Day 1-2[任务] ...

⚠️ 关键技术难点

  1. 难点1 - [说明和解决方案]
  2. 难点2 - [说明和解决方案]

快速开发检查清单

开始开发前确认:

  • [依赖能力1]是否已实现?
  • 数据库Schema是否已创建
  • Prisma Schema是否已更新
  • API路由是否已注册

常见问题:

  • Q: [问题]
  • A: [答案]

📖 更多详细信息

需要完整PRD00-项目概述/01-产品需求文档(PRD).md
需要数据库详情:01-设计文档/02-数据库设计.md
需要API详情01-设计文档/03-API设计.md
需要UI设计01-设计文档/07-UI设计/


最后更新: [日期]
维护人: [维护人]