feat(health): 健康数据统计 — 透析/化验/预约/体征上报率
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- 新增 6 个统计端点: dialysis, lab-reports, appointments,
  vital-signs-report-rate, health-data(综合)
- 透析统计: 类型分布/并发症率/平均超滤/平均时长
- 化验统计: 类型分布/异常项计数/审核状态
- 预约统计: 状态/类型分布/取消率
- 体征上报率: 月度上报率 + 近 7 天趋势
- Web 统计面板增加健康数据中心区块
This commit is contained in:
iven
2026-04-26 14:19:38 +08:00
parent 55ec57b2c0
commit c9bf5f6139
6 changed files with 832 additions and 3 deletions

View File

@@ -148,6 +148,62 @@ export interface OverviewStatistics {
points: PointsStatistics;
}
// --- Health Data Statistics Types ---
export interface NameValue {
name: string;
value: number;
}
export interface DialysisStatistics {
total_records: number;
this_month: number;
type_distribution: NameValue[];
complication_rate: number;
avg_ultrafiltration: number | null;
avg_duration: number | null;
pending_review: number;
}
export interface LabReportStatistics {
total_reports: number;
this_month: number;
type_distribution: NameValue[];
abnormal_items: number;
pending_review: number;
reviewed: number;
}
export interface AppointmentStatistics {
total_appointments: number;
this_month: number;
status_distribution: NameValue[];
type_distribution: NameValue[];
cancel_rate: number;
}
export interface DailyReportRate {
date: string;
reported: number;
total: number;
rate: number;
}
export interface VitalSignsReportRate {
total_patients: number;
reported_patients: number;
report_rate: number;
total_records: number;
daily_trend: DailyReportRate[];
}
export interface HealthDataStats {
dialysis: DialysisStatistics;
lab_reports: LabReportStatistics;
appointments: AppointmentStatistics;
vital_signs_report_rate: VitalSignsReportRate;
}
// --- API ---
export const pointsApi = {
@@ -295,4 +351,12 @@ export const pointsApi = {
}>('/health/admin/statistics/follow-ups');
return data.data;
},
getHealthDataStats: async (): Promise<HealthDataStats> => {
const { data } = await client.get<{
success: boolean;
data: HealthDataStats;
}>('/health/admin/statistics/health-data');
return data.data;
},
};