feat(health+mp): S2-3 Patient DTO 最小化

后端:
- 新增 PatientSummary DTO(id/name/gender/birth_date/status 5 字段)
- 新增 GET /health/patients/summary 端点(权限 health.patient.list)
- patient_service::list_summaries 仅查询非敏感字段

前端:
- 新增 PatientSummary 类型 + getPatientSummaries() API
- auth store loadPatients 改用 summary 端点
- setCurrentPatient 仅存储非敏感字段到 secureSet
This commit is contained in:
iven
2026-05-22 10:56:03 +08:00
parent 437f5d1ae9
commit 490ae075b7
7 changed files with 111 additions and 7 deletions

View File

@@ -57,3 +57,18 @@ export async function getPatients() {
const res = await api.get<PaginatedData<PatientInfo>>('/health/patients');
return Array.isArray(res?.data) ? res.data : (Array.isArray(res) ? res : []);
}
/** 患者摘要 — 列表用,字段最小化,不含敏感信息 */
export interface PatientSummary {
id: string;
name: string;
gender?: string;
birth_date?: string;
status: string;
}
/** 获取患者摘要列表(字段最小化,替代 getPatients */
export async function getPatientSummaries() {
const res = await api.get<PaginatedData<PatientSummary>>('/health/patients/summary');
return Array.isArray(res?.data) ? res.data : (Array.isArray(res) ? res : []);
}