- refactor(web): PatientDetail.tsx 拆分为 4 个子组件(737→334行) - refactor(web): 提取 usePaginatedData hook 消除重复分页状态 - feat(db): patient.id_number varchar(20)→varchar(255) 容纳加密值 - test(health): 添加预约模块集成测试(创建/列表/租户隔离) - test(plugin): 添加 6 个 SQL 注入 sanitize 测试 - fix(miniprogram): 7 个 service 文件 URL 构建规范化(params 对象) - fix(miniprogram): 跨平台字段名对齐(birth_date/start_time/end_time)
31 lines
754 B
TypeScript
31 lines
754 B
TypeScript
import { api } from './request';
|
|
|
|
export interface IndicatorDetail {
|
|
value: number;
|
|
unit?: string;
|
|
reference_min?: number;
|
|
reference_max?: number;
|
|
status?: string;
|
|
}
|
|
|
|
export interface LabReport {
|
|
id: string;
|
|
report_date: string;
|
|
report_type: string;
|
|
indicators: Record<string, IndicatorDetail>;
|
|
doctor_interpretation?: string;
|
|
image_urls?: string[];
|
|
version: number;
|
|
}
|
|
|
|
export async function listReports(patientId: string, page = 1) {
|
|
return api.get<{ data: LabReport[]; total: number }>(
|
|
`/health/patients/${patientId}/lab-reports`,
|
|
{ page, page_size: 20 },
|
|
);
|
|
}
|
|
|
|
export async function getReportDetail(patientId: string, id: string) {
|
|
return api.get<LabReport>(`/health/patients/${patientId}/lab-reports/${id}`);
|
|
}
|