RVW module (V3.0 Smart Review Enhancement): - Add LLM data validation via PromptService (RVW_DATA_VALIDATION) - Add ClinicalAssessmentSkill with FINER-based evaluation (RVW_CLINICAL) - Remove all numeric scores from UI (editorial, methodology, overall) - Implement partial_completed status with Promise.allSettled - Add error_details JSON field to ReviewTask for granular failure info - Fix overallStatus logic: warning status now counts as success - Restructure ForensicsReport: per-table LLM results, remove top-level block - Refactor ClinicalReport: structured collapsible sections - Increase all skill timeouts to 300s for long manuscripts (20+ pages) - Increase DataForensics LLM timeout to 180s, pg-boss to 15min - Executor default fallback timeout 30s -> 60s ASL module: - Add deep research history with sidebar accordion UI - Implement waterfall flow for historical task display - Upgrade Unifuncs DeepSearch API from S2 to S3 with fallback - Add ASL_SR module seed for admin configurability - Fix new search button inconsistency Docs: - Update RVW module status to V3.0 - Update deployment changelist - Add 0305 deployment summary DB Migration: - Add error_details JSONB column to rvw_schema.review_tasks Tested: All 4 review modules verified, partial completion working Made-with: Cursor
141 lines
3.6 KiB
JavaScript
141 lines
3.6 KiB
JavaScript
/**
|
||
* 初始化 modules 表数据
|
||
*
|
||
* 运行: node scripts/seed-modules.js
|
||
*/
|
||
|
||
import { PrismaClient } from '@prisma/client';
|
||
|
||
const prisma = new PrismaClient();
|
||
|
||
const MODULES = [
|
||
{
|
||
code: 'RVW',
|
||
name: '智能审稿',
|
||
description: '基于AI的稿件自动审查系统,支持稿约规范性评估和方法学评估',
|
||
icon: 'FileTextOutlined',
|
||
is_active: true,
|
||
sort_order: 1,
|
||
},
|
||
{
|
||
code: 'PKB',
|
||
name: '个人知识库',
|
||
description: '个人文档管理与智能检索系统,支持多格式文档上传和语义搜索',
|
||
icon: 'BookOutlined',
|
||
is_active: true,
|
||
sort_order: 2,
|
||
},
|
||
{
|
||
code: 'ASL',
|
||
name: '智能文献',
|
||
description: '文献筛选与管理系统,支持批量导入、AI辅助筛选和全文复筛',
|
||
icon: 'ReadOutlined',
|
||
is_active: true,
|
||
sort_order: 3,
|
||
},
|
||
{
|
||
code: 'DC',
|
||
name: '数据清洗',
|
||
description: '智能数据清洗与整理工具,支持双模型提取和AI辅助数据处理',
|
||
icon: 'DatabaseOutlined',
|
||
is_active: true,
|
||
sort_order: 4,
|
||
},
|
||
{
|
||
code: 'IIT',
|
||
name: 'CRA质控',
|
||
description: 'IIT项目管理系统,支持REDCap集成和项目协作',
|
||
icon: 'ProjectOutlined',
|
||
is_active: true,
|
||
sort_order: 5,
|
||
},
|
||
{
|
||
code: 'AIA',
|
||
name: '智能问答',
|
||
description: 'AI智能问答助手,提供临床研究相关问题的智能解答',
|
||
icon: 'RobotOutlined',
|
||
is_active: true,
|
||
sort_order: 6,
|
||
},
|
||
{
|
||
code: 'SSA',
|
||
name: '智能统计分析',
|
||
description: 'AI驱动的智能统计分析系统,提供高级统计方法和自动化分析',
|
||
icon: 'BarChartOutlined',
|
||
is_active: true,
|
||
sort_order: 7,
|
||
},
|
||
{
|
||
code: 'ST',
|
||
name: '统计工具',
|
||
description: '统计分析工具集,提供常用统计方法和数据可视化功能',
|
||
icon: 'LineChartOutlined',
|
||
is_active: true,
|
||
sort_order: 8,
|
||
},
|
||
{
|
||
code: 'RM',
|
||
name: '研究管理',
|
||
description: '研究项目管理系统,支持项目全流程管理',
|
||
icon: 'ProjectOutlined',
|
||
is_active: true,
|
||
sort_order: 9,
|
||
},
|
||
{
|
||
code: 'AIA_PROTOCOL',
|
||
name: '全流程研究方案制定',
|
||
description: 'AI问答模块内的Protocol Agent功能,可按用户/租户独立配置开关',
|
||
icon: 'ExperimentOutlined',
|
||
is_active: true,
|
||
sort_order: 100,
|
||
},
|
||
{
|
||
code: 'ASL_SR',
|
||
name: '系统综述项目',
|
||
description: 'AI智能文献模块内的系统综述全流程功能(初筛/复筛/提取/图表/Meta),可按用户/租户独立配置开关',
|
||
icon: 'FolderOutlined',
|
||
is_active: true,
|
||
sort_order: 101,
|
||
},
|
||
];
|
||
|
||
async function main() {
|
||
console.log('🚀 开始初始化 modules 表...\n');
|
||
|
||
for (const module of MODULES) {
|
||
const result = await prisma.modules.upsert({
|
||
where: { code: module.code },
|
||
update: {
|
||
name: module.name,
|
||
description: module.description,
|
||
icon: module.icon,
|
||
is_active: module.is_active,
|
||
sort_order: module.sort_order,
|
||
},
|
||
create: module,
|
||
});
|
||
console.log(`✅ ${result.code} - ${result.name}`);
|
||
}
|
||
|
||
console.log('\n========== 当前 modules 表数据 ==========\n');
|
||
|
||
const allModules = await prisma.modules.findMany({
|
||
orderBy: { sort_order: 'asc' },
|
||
});
|
||
|
||
console.table(allModules.map(m => ({
|
||
代码: m.code,
|
||
名称: m.name,
|
||
描述: m.description?.substring(0, 30) + '...',
|
||
状态: m.is_active ? '✅ 上线' : '❌ 下线',
|
||
排序: m.sort_order,
|
||
})));
|
||
|
||
console.log('\n✨ 初始化完成!');
|
||
}
|
||
|
||
main()
|
||
.catch(console.error)
|
||
.finally(() => prisma.$disconnect());
|
||
|