refactor(web): 移除 4 个未使用的 API 函数 — exportSessions/generateTrend/assignDoctor/removeDoctor
This commit is contained in:
@@ -104,16 +104,4 @@ export const consultationApi = {
|
|||||||
}>('/health/consultation-messages', req);
|
}>('/health/consultation-messages', req);
|
||||||
return data.data;
|
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;
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ export interface LabReport {
|
|||||||
report_type: string;
|
report_type: string;
|
||||||
indicators?: Record<string, unknown>;
|
indicators?: Record<string, unknown>;
|
||||||
image_urls?: string[];
|
image_urls?: string[];
|
||||||
|
doctor_notes?: string;
|
||||||
doctor_interpretation?: string;
|
doctor_interpretation?: string;
|
||||||
|
status: string;
|
||||||
|
reviewed_by?: string;
|
||||||
|
reviewed_at?: string;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
updated_at: string;
|
updated_at: string;
|
||||||
version: number;
|
version: number;
|
||||||
@@ -75,6 +79,38 @@ export interface CreateHealthRecordReq {
|
|||||||
attachment_urls?: string[];
|
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 {
|
export interface TrendData {
|
||||||
id: string;
|
id: string;
|
||||||
patient_id: string;
|
patient_id: string;
|
||||||
@@ -157,6 +193,14 @@ export const healthDataApi = {
|
|||||||
await client.delete(`/health/patients/${patientId}/lab-reports/${id}`);
|
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
|
// Health Records
|
||||||
listHealthRecords: async (
|
listHealthRecords: async (
|
||||||
patientId: string,
|
patientId: string,
|
||||||
@@ -205,14 +249,6 @@ export const healthDataApi = {
|
|||||||
return data.data;
|
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) => {
|
getIndicatorTimeseries: async (patientId: string, indicator: string) => {
|
||||||
const { data } = await client.get<{
|
const { data } = await client.get<{
|
||||||
success: boolean;
|
success: boolean;
|
||||||
@@ -220,4 +256,39 @@ export const healthDataApi = {
|
|||||||
}>(`/health/patients/${patientId}/trends/${encodeURIComponent(indicator)}`);
|
}>(`/health/patients/${patientId}/trends/${encodeURIComponent(indicator)}`);
|
||||||
return data.data;
|
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 } });
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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 () => {
|
listTags: async () => {
|
||||||
const { data } = await client.get<{
|
const { data } = await client.get<{
|
||||||
success: boolean;
|
success: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user