feat(medications): 添加用药AI总结功能,支持生成用户用药计划的重点解读
This commit is contained in:
@@ -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} 的记录`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user