Files
hms/apps/miniprogram/src/services/followup.ts
iven c38967a36e fix(mp): 修复小程序角色路由 + 前后端字段对齐 + E2E 测试报告
- 修复 stores/auth.ts 三种登录方式从错误路径提取 roles(resp.roles → resp.user.roles)
- 首页添加医护人员自动跳转医生端(useDidShow + isMedicalStaff)
- services/auth.ts credentialLogin 返回类型补全 roles 字段
- Web 前端 healthData.ts 字段对齐后端 DTO(indicators→items, content→overall_assessment)
- Web 前端 medicationReminders.ts 字段对齐(time_slots→reminder_times)
- 小程序 report.ts / reports 页面字段对齐后端(indicators→items, doctor_interpretation→doctor_notes)
- 小程序 patient.ts / followup.ts / alert.ts 补全缺失字段
- 后端 stats_handler.rs 权限码修正(health.patient.list→health.dashboard.manage)
- 新增 V1 E2E 测试报告和五专家组评审报告
2026-05-17 01:51:02 +08:00

63 lines
1.5 KiB
TypeScript

import { api } from './request';
export interface FollowUpTask {
id: string;
patient_id?: string;
patient_name?: string;
follow_up_type: string;
content_template?: string;
assigned_to?: string;
assigned_to_name?: string;
status: string;
planned_date: string;
completed_at?: string;
notes?: string;
version: number;
}
export interface FollowUpRecord {
id: string;
task_id: string;
executed_by?: string;
executed_date: string;
result?: string;
patient_condition?: string;
medical_advice?: string;
next_follow_up_date?: string;
created_at: string;
}
export async function listTasks(patientId?: string, status?: string) {
return api.get<{ data: FollowUpTask[]; total: number }>('/health/follow-up-tasks', {
page: 1,
page_size: 50,
...(patientId && { patient_id: patientId }),
...(status && { status }),
});
}
export async function getTaskDetail(id: string) {
return api.get<FollowUpTask>(`/health/follow-up-tasks/${id}`);
}
export async function submitRecord(taskId: string, data: {
result?: string;
patient_condition?: string;
medical_advice?: string;
next_follow_up_date?: string;
}) {
return api.post<FollowUpRecord>(`/health/follow-up-tasks/${taskId}/records`, {
task_id: taskId,
...data,
executed_date: new Date().toISOString().slice(0, 10),
});
}
export async function listRecords(taskId?: string) {
return api.get<{ data: FollowUpRecord[]; total: number }>('/health/follow-up-records', {
page: 1,
page_size: 50,
...(taskId && { task_id: taskId }),
});
}