| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- /* 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<ReportContent>
- | 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<ReportListResponse> => {
- 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<ReportQueryParams, 'start_time' | 'end_time'>
- ): Promise<Blob> => {
- 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<Blob> => {
- const response = await axiosInstance.post('/auth/report/preview', reportData, {
- responseType: 'blob'
- });
- return response.data;
- };
- // 获取申请科室列表
- export const getDepartment = async (
- params: { scope?: 'all' | 'mine' }
- ): Promise<createdDepartmentResponse> => {
- const response = await axiosInstance.get('/auth/report/department', {
- params,
- });
- return response.data;
- };
- // 新建申请科室
- export const createdDepartment = async (
- params: { departments: string[] }
- ): Promise<DepartmentResponse> => {
- const response = await axiosInstance.post('/auth/report/department', params);
- return response.data;
- };
|