feat(health+miniprogram): 预约/报告/随访/资讯/家庭管理 — Chunk 4-6
后端: - 添加 articles 表迁移 + Entity + Service + Handler - 健康数据趋势 API (get_mini_trend) 注册路由 - article CRUD (list/get) + DTO 前端 (11个新页面 + 5个服务): - 预约挂号: 列表/创建向导/详情页 - 报告管理: 列表/详情页 - 随访管理: 任务列表/记录详情页 - 资讯文章: 文章详情页 - 个人中心: 就诊人管理/新增/我的报告/我的随访/用药提醒/设置 - 更新 app.config.ts 注册全部路由 - 更新 profile/article 页面为真实功能
This commit is contained in:
50
apps/miniprogram/src/services/appointment.ts
Normal file
50
apps/miniprogram/src/services/appointment.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { api } from './request';
|
||||
|
||||
export interface Appointment {
|
||||
id: string;
|
||||
patient_name: string;
|
||||
doctor_name: string;
|
||||
department: string;
|
||||
appointment_date: string;
|
||||
time_slot: string;
|
||||
status: string;
|
||||
version: number;
|
||||
}
|
||||
|
||||
export async function listAppointments(page = 1) {
|
||||
return api.get<{ data: Appointment[]; total: number }>(`/health/appointments?page=${page}&page_size=20`);
|
||||
}
|
||||
|
||||
export async function createAppointment(data: {
|
||||
patient_id: string;
|
||||
doctor_id: string;
|
||||
schedule_id: string;
|
||||
appointment_date: string;
|
||||
time_slot: string;
|
||||
reason?: string;
|
||||
}) {
|
||||
return api.post<Appointment>('/health/appointments', data);
|
||||
}
|
||||
|
||||
export async function cancelAppointment(id: string, version: number) {
|
||||
return api.put(`/health/appointments/${id}/status`, {
|
||||
status: 'cancelled',
|
||||
version,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getDoctorSchedules(doctorId: string, startDate: string, endDate: string) {
|
||||
return api.get<{ data: any[]; total: number }>(
|
||||
`/health/doctor-schedules?doctor_id=${doctorId}&start_date=${startDate}&end_date=${endDate}&page_size=50`
|
||||
);
|
||||
}
|
||||
|
||||
export async function listDoctors(department?: string) {
|
||||
const deptParam = department ? `&department=${department}` : '';
|
||||
return api.get<{ data: any[]; total: number }>(`/health/doctors?page_size=100${deptParam}`);
|
||||
}
|
||||
|
||||
export async function calendarView(startDate: string, endDate: string, doctorId?: string) {
|
||||
const docParam = doctorId ? `&doctor_id=${doctorId}` : '';
|
||||
return api.get<any[]>(`/health/doctor-schedules/calendar?start_date=${startDate}&end_date=${endDate}${docParam}`);
|
||||
}
|
||||
19
apps/miniprogram/src/services/article.ts
Normal file
19
apps/miniprogram/src/services/article.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { api } from './request';
|
||||
|
||||
export interface Article {
|
||||
id: string;
|
||||
title: string;
|
||||
summary?: string;
|
||||
content?: string;
|
||||
cover_image?: string;
|
||||
category?: string;
|
||||
published_at?: string;
|
||||
}
|
||||
|
||||
export async function listArticles(page = 1) {
|
||||
return api.get<{ data: Article[]; total: number }>(`/health/articles?page=${page}&page_size=20`);
|
||||
}
|
||||
|
||||
export async function getArticleDetail(id: string) {
|
||||
return api.get<Article>(`/health/articles/${id}`);
|
||||
}
|
||||
36
apps/miniprogram/src/services/followup.ts
Normal file
36
apps/miniprogram/src/services/followup.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { api } from './request';
|
||||
|
||||
export interface FollowUpTask {
|
||||
id: string;
|
||||
patient_name: string;
|
||||
task_type: string;
|
||||
description: string;
|
||||
status: string;
|
||||
due_date: string;
|
||||
version: number;
|
||||
}
|
||||
|
||||
export interface FollowUpRecord {
|
||||
id: string;
|
||||
task_id: string;
|
||||
content: any;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export async function listTasks(status?: string) {
|
||||
const statusParam = status ? `&status=${status}` : '';
|
||||
return api.get<{ data: FollowUpTask[]; total: number }>(
|
||||
`/health/follow-up-tasks?page=1&page_size=50${statusParam}`
|
||||
);
|
||||
}
|
||||
|
||||
export async function submitRecord(data: { task_id: string; content: any }) {
|
||||
return api.post<FollowUpRecord>('/health/follow-up-records', data);
|
||||
}
|
||||
|
||||
export async function listRecords(taskId?: string) {
|
||||
const taskParam = taskId ? `&task_id=${taskId}` : '';
|
||||
return api.get<{ data: FollowUpRecord[]; total: number }>(
|
||||
`/health/follow-up-records?page=1&page_size=50${taskParam}`
|
||||
);
|
||||
}
|
||||
30
apps/miniprogram/src/services/patient.ts
Normal file
30
apps/miniprogram/src/services/patient.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { api } from './request';
|
||||
|
||||
export interface Patient {
|
||||
id: string;
|
||||
name: string;
|
||||
gender?: string;
|
||||
birthday?: string;
|
||||
phone?: string;
|
||||
id_number?: string;
|
||||
relation?: string;
|
||||
version: number;
|
||||
}
|
||||
|
||||
export async function listPatients() {
|
||||
return api.get<{ data: Patient[]; total: number }>('/health/patients?page=1&page_size=100');
|
||||
}
|
||||
|
||||
export async function createPatient(data: {
|
||||
name: string;
|
||||
gender?: string;
|
||||
birthday?: string;
|
||||
phone?: string;
|
||||
id_number?: string;
|
||||
}) {
|
||||
return api.post<Patient>('/health/patients', data);
|
||||
}
|
||||
|
||||
export async function updatePatient(id: string, data: any, version: number) {
|
||||
return api.put<Patient>(`/health/patients/${id}`, { ...data, version });
|
||||
}
|
||||
21
apps/miniprogram/src/services/report.ts
Normal file
21
apps/miniprogram/src/services/report.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { api } from './request';
|
||||
|
||||
export interface LabReport {
|
||||
id: string;
|
||||
report_date: string;
|
||||
report_type: string;
|
||||
indicators: any;
|
||||
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}&page_size=20`
|
||||
);
|
||||
}
|
||||
|
||||
export async function getReportDetail(patientId: string, id: string) {
|
||||
return api.get<LabReport>(`/health/patients/${patientId}/lab-reports/${id}`);
|
||||
}
|
||||
Reference in New Issue
Block a user