feat(medications): 添加用药AI总结功能,支持生成用户用药计划的重点解读

This commit is contained in:
richarjiang
2025-12-01 11:21:57 +08:00
parent ae41a2b643
commit 7ce51409af
7 changed files with 402 additions and 3 deletions

View File

@@ -93,6 +93,20 @@ export class MedicationsService {
return { rows, total: count };
}
/**
* 获取用户所有正在进行的用药计划
*/
async findActiveMedications(userId: string): Promise<Medication[]> {
return this.medicationModel.findAll({
where: {
userId,
isActive: true,
deleted: false,
},
order: [['startDate', 'ASC']],
});
}
/**
* 根据ID获取药物详情
*/
@@ -330,4 +344,4 @@ export class MedicationsService {
`成功批量软删除了 ${affectedCount}${medication.id} 的记录`,
);
}
}
}