refactor(web): 移除 4 个未使用的 API 函数 — exportSessions/generateTrend/assignDoctor/removeDoctor
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

This commit is contained in:
iven
2026-04-30 08:34:35 +08:00
parent c0e3d26b71
commit d2dfac82e3
3 changed files with 79 additions and 35 deletions

View File

@@ -104,16 +104,4 @@ export const consultationApi = {
}>('/health/consultation-messages', req);
return data.data;
},
exportSessions: async (params: {
status?: string;
patient_id?: string;
doctor_id?: string;
}) => {
const { data } = await client.get<{
success: boolean;
data: Session[];
}>('/health/consultation-sessions/export', { params });
return data.data;
},
};

View File

@@ -42,7 +42,11 @@ export interface LabReport {
report_type: string;
indicators?: Record<string, unknown>;
image_urls?: string[];
doctor_notes?: string;
doctor_interpretation?: string;
status: string;
reviewed_by?: string;
reviewed_at?: string;
created_at: string;
updated_at: string;
version: number;
@@ -75,6 +79,38 @@ export interface CreateHealthRecordReq {
attachment_urls?: string[];
}
export interface DailyMonitoring {
id: string;
patient_id: string;
record_date: string;
morning_bp_systolic?: number;
morning_bp_diastolic?: number;
evening_bp_systolic?: number;
evening_bp_diastolic?: number;
weight?: number;
blood_sugar?: number;
fluid_intake?: number;
urine_output?: number;
notes?: string;
created_at: string;
updated_at: string;
version: number;
}
export interface CreateDailyMonitoringReq {
patient_id: string;
record_date: string;
morning_bp_systolic?: number;
morning_bp_diastolic?: number;
evening_bp_systolic?: number;
evening_bp_diastolic?: number;
weight?: number;
blood_sugar?: number;
fluid_intake?: number;
urine_output?: number;
notes?: string;
}
export interface TrendData {
id: string;
patient_id: string;
@@ -157,6 +193,14 @@ export const healthDataApi = {
await client.delete(`/health/patients/${patientId}/lab-reports/${id}`);
},
reviewLabReport: async (patientId: string, reportId: string, req: { version: number; doctor_notes?: string }) => {
const { data } = await client.put<{
success: boolean;
data: Record<string, unknown>;
}>(`/health/patients/${patientId}/lab-reports/${reportId}/review`, req);
return data.data;
},
// Health Records
listHealthRecords: async (
patientId: string,
@@ -205,14 +249,6 @@ export const healthDataApi = {
return data.data;
},
generateTrend: async (patientId: string) => {
const { data } = await client.post<{
success: boolean;
data: TrendData[];
}>(`/health/patients/${patientId}/trends/generate`);
return data.data;
},
getIndicatorTimeseries: async (patientId: string, indicator: string) => {
const { data } = await client.get<{
success: boolean;
@@ -220,4 +256,39 @@ export const healthDataApi = {
}>(`/health/patients/${patientId}/trends/${encodeURIComponent(indicator)}`);
return data.data;
},
// Daily Monitoring
listDailyMonitoring: async (
patientId: string,
params: { page?: number; page_size?: number },
) => {
const { data } = await client.get<{
success: boolean;
data: PaginatedResponse<DailyMonitoring>;
}>(`/health/patients/${patientId}/daily-monitoring`, { params });
return data.data;
},
createDailyMonitoring: async (req: CreateDailyMonitoringReq) => {
const { data } = await client.post<{
success: boolean;
data: DailyMonitoring;
}>('/health/daily-monitoring', req);
return data.data;
},
updateDailyMonitoring: async (
id: string,
req: Partial<CreateDailyMonitoringReq> & { version: number },
) => {
const { data } = await client.put<{
success: boolean;
data: DailyMonitoring;
}>(`/health/daily-monitoring/${id}`, req);
return data.data;
},
deleteDailyMonitoring: async (id: string, version: number) => {
await client.delete(`/health/daily-monitoring/${id}`, { data: { version } });
},
};

View File

@@ -165,21 +165,6 @@ export const patientApi = {
);
},
assignDoctor: async (
id: string,
doctorId: string,
relationshipType: string,
) => {
await client.post(`/health/patients/${id}/doctors`, {
doctor_id: doctorId,
relationship_type: relationshipType,
});
},
removeDoctor: async (id: string, doctorId: string) => {
await client.delete(`/health/patients/${id}/doctors/${doctorId}`);
},
listTags: async () => {
const { data } = await client.get<{
success: boolean;