/* eslint-disable */ import { extend } from 'cypress/types/lodash'; import axiosInstance from '../interceptor'; // 报告查询参数 export interface ReportQueryParams { start_time?: string; end_time?: string; page?: number; page_size?: number; } // 报告列表项 export interface ReportItem extends ReportContent { study_instance_uid: string; study_id: string; headers: { age: string; bed_number: string; hospitalization_number: string; inspection_method: string; inspection_number: string; medical_record_number: string; name: string; requesting_department: string; sex: string; }; findings: string; impression: string; radiologist: string; review_physician: string; create_time: string; } export interface ReportResponse extends ReportContent { '@type': string; study_instance_uid: string; study_id: string; create_time: string; } export type ReportContentValue = | string | string[] | ReportContent['headers'] | Partial | boolean // 如果将来添加布尔类型的字段 | number; // 报告内容详情 export interface ReportContent { headers: { age: string; bed_number: string; hospitalization_number: string; inspection_method: string; inspection_number: string; medical_record_number: string; name: string; requesting_department: string; sex: string; patient_type?: string }; findings: string; impression: string; radiologist: string; review_physician: string; images: string[]; } // 报告内容响应 export interface ReportContentResponse { code: string; description: string; solution: string; data: ReportContent; } // 报告列表响应 export interface ReportListResponse { code: string; description: string; solution: string; data: { '@type': string; count: number; reports: ReportItem[]; }; } // 报告预览请求 export interface ReportPreviewRequest { headers: { name: string; sex: string; age: string; medical_record_number?: string; hospitalization_number?: string; bed_number?: string; requesting_department: string; inspection_number: string; inspection_method: string; patient_type?: string; owner_name?: string; }; findings: string; impression: string; radiologist: string; review_physician: string; images: string[]; } export interface DepartmentItem { id: number; department: string; user_id: number; } // 申请科室列表 export interface createdDepartmentResponse { code: string; description: string; solution: string; data: { '@type': string; count: number; departments: DepartmentItem[]; }; } // 报告模板响应 export interface DepartmentResponse { code: string; description: string; solution: string; data: any; } // 报告预览响应 export interface ReportPreviewResponse extends Blob { } /** * 获取报告列表 * POST /dr/api/v1/auth/report */ export const getReportList = async ( params: ReportQueryParams ): Promise => { const response = await axiosInstance.post('/auth/report', params); return response.data; }; /** * 批量下载报告(xlsx) * GET /dr/api/v1/auth/report/xls */ export const downloadReportXlsx = async ( params: Pick ): Promise => { const response = await axiosInstance.get('/auth/report/xls', { params, responseType: 'blob' }); return response.data; }; /** * 报告预览 * POST /dr/api/v1/auth/report/preview */ export const previewReport = async ( reportData: ReportPreviewRequest ): Promise => { const response = await axiosInstance.post('/auth/report/preview', reportData, { responseType: 'blob' }); return response.data; }; // 获取申请科室列表 export const getDepartment = async ( params: { scope?: 'all' | 'mine' } ): Promise => { const response = await axiosInstance.get('/auth/report/department', { params, }); return response.data; }; // 新建申请科室 export const createdDepartment = async ( params: { departments: string[] } ): Promise => { const response = await axiosInstance.post('/auth/report/department', params); return response.data; };