|
@@ -199,6 +199,114 @@ export interface TaskListQuery {
|
|
|
page_size?: number;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * fetchTaskList 专用的研究数据结构 - 基于后端实际响应
|
|
|
+ */
|
|
|
+export interface FetchTaskListStudy {
|
|
|
+ study_instance_uid: string;
|
|
|
+ study_id: string;
|
|
|
+ public_study_id: string;
|
|
|
+ specific_character_set: string;
|
|
|
+ accession_number: string;
|
|
|
+ ref_physician: string;
|
|
|
+ patient_id: string;
|
|
|
+ patient_name: string;
|
|
|
+ /** 患者英文名 */
|
|
|
+ patient_english_name: string;
|
|
|
+ /** 患者曾用名 */
|
|
|
+ patient_former_name: string;
|
|
|
+ patient_size: string;
|
|
|
+ other_patient_ids: string;
|
|
|
+ other_patient_names: string;
|
|
|
+ patient_age: string;
|
|
|
+ patient_dob: string;
|
|
|
+ patient_sex: string;
|
|
|
+ /** 性别绝育状态 */
|
|
|
+ sex_neutered: string;
|
|
|
+ /** 妊娠状态 */
|
|
|
+ pregnancy_status: string;
|
|
|
+ patient_state: string;
|
|
|
+ admitting_time: string | null;
|
|
|
+ priority: string;
|
|
|
+ reg_source: string;
|
|
|
+ study_description: string;
|
|
|
+ study_start_datetime: string | null;
|
|
|
+ study_end_datetime: string | null;
|
|
|
+ scheduled_procedure_step_start_date: string | null;
|
|
|
+ performed_physician: string;
|
|
|
+ study_lock: string;
|
|
|
+ folder_path: string;
|
|
|
+ operator_name: string;
|
|
|
+ modality: string;
|
|
|
+ weight: number;
|
|
|
+ thickness: number;
|
|
|
+ length: number;
|
|
|
+ patient_type: string;
|
|
|
+ study_type: string;
|
|
|
+ /** 宠物主人姓名 */
|
|
|
+ owner_name: string;
|
|
|
+ /** 芯片号码 */
|
|
|
+ chip_number: string;
|
|
|
+ /** 品种 */
|
|
|
+ variety: string;
|
|
|
+ /** 麻醉状态 */
|
|
|
+ is_anaesthesia: boolean;
|
|
|
+ /** 是否镇静 */
|
|
|
+ is_sedation: boolean;
|
|
|
+ mwl: string;
|
|
|
+ is_exported: boolean;
|
|
|
+ is_edited: boolean;
|
|
|
+ is_appended: boolean;
|
|
|
+ department: string;
|
|
|
+ mapped_status: boolean;
|
|
|
+ qc_result: boolean;
|
|
|
+ comment: string;
|
|
|
+ study_status: string;
|
|
|
+ sort: number;
|
|
|
+ product: string;
|
|
|
+ /** 创建时间 */
|
|
|
+ create_time: string;
|
|
|
+ series: Series[];
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 研究列表数据类型 - 基于后端实际响应结构
|
|
|
+ */
|
|
|
+export interface StudyListData {
|
|
|
+ /** 类型标识 */
|
|
|
+ '@type': string;
|
|
|
+ /** 总数 */
|
|
|
+ count: number;
|
|
|
+ /** 研究列表 */
|
|
|
+ studies: RegisterWorkResponseData[];
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * fetchTaskList 专用的数据结构
|
|
|
+ */
|
|
|
+export interface FetchTaskListData {
|
|
|
+ /** 类型标识 */
|
|
|
+ '@type': string;
|
|
|
+ /** 总数 */
|
|
|
+ count: number;
|
|
|
+ /** 研究列表 */
|
|
|
+ studies: FetchTaskListStudy[];
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * fetchTaskList 响应类型 - 完整的研究列表响应结构
|
|
|
+ */
|
|
|
+export interface FetchTaskListResponse {
|
|
|
+ /** 响应码 */
|
|
|
+ code: string;
|
|
|
+ /** 描述信息 */
|
|
|
+ description: string;
|
|
|
+ /** 解决方案 */
|
|
|
+ solution: string;
|
|
|
+ /** 数据内容 */
|
|
|
+ data: FetchTaskListData;
|
|
|
+}
|
|
|
+
|
|
|
const registerWork = async (
|
|
|
work: RegisterInfo
|
|
|
): Promise<RegisterWorkResponse> => {
|
|
@@ -216,6 +324,7 @@ const registerWork = async (
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
const mapToTask = (study: RegisterWorkResponseData): Task => ({
|
|
|
StudyInstanceUID: study.study_instance_uid,
|
|
|
StudyID: study.study_id,
|
|
@@ -255,9 +364,51 @@ const mapToTask = (study: RegisterWorkResponseData): Task => ({
|
|
|
IsDelete: false,
|
|
|
});
|
|
|
|
|
|
+/**
|
|
|
+ * 将 FetchTaskListStudy 映射到 Task - fetchTaskList 专用
|
|
|
+ */
|
|
|
+const mapFetchTaskListStudyToTask = (study: FetchTaskListStudy): Task => ({
|
|
|
+ StudyInstanceUID: study.study_instance_uid,
|
|
|
+ StudyID: study.study_id,
|
|
|
+ SpecificCharacterSet: study.specific_character_set,
|
|
|
+ AccessionNumber: study.accession_number,
|
|
|
+ PatientID: study.patient_id,
|
|
|
+ PatientName: study.patient_name,
|
|
|
+ DisplayPatientName: study.patient_name,
|
|
|
+ PatientSize: study.patient_size,
|
|
|
+ PatientAge: study.patient_age,
|
|
|
+ PatientSex: study.patient_sex,
|
|
|
+ AdmittingTime: study.admitting_time ?? '',
|
|
|
+ RegSource: study.reg_source,
|
|
|
+ StudyStatus: study.study_status,
|
|
|
+ RequestedProcedureID: '',
|
|
|
+ PerformedProtocolCodeValue: '',
|
|
|
+ PerformedProtocolCodeMeaning: '',
|
|
|
+ PerformedProcedureStepID: '',
|
|
|
+ StudyDescription: study.study_description,
|
|
|
+ StudyStartDatetime: study.study_start_datetime ?? '',
|
|
|
+ ScheduledProcedureStepStartDate:
|
|
|
+ study.scheduled_procedure_step_start_date ?? '',
|
|
|
+ StudyLock: study.study_lock,
|
|
|
+ OperatorID: study.operator_name,
|
|
|
+ Modality: study.modality,
|
|
|
+ Views: [],
|
|
|
+ Thickness: study.thickness,
|
|
|
+ PatientType: study.patient_type,
|
|
|
+ StudyType: study.study_type,
|
|
|
+ QRCode: '',
|
|
|
+ IsExported: study.is_exported,
|
|
|
+ IsEdited: study.is_edited,
|
|
|
+ WorkRef: '',
|
|
|
+ IsAppended: study.is_appended,
|
|
|
+ CreationTime: study.create_time,
|
|
|
+ MappedStatus: study.mapped_status,
|
|
|
+ IsDelete: false,
|
|
|
+});
|
|
|
+
|
|
|
const fetchTaskList = async (
|
|
|
- page,
|
|
|
- pageSize,
|
|
|
+ page: number,
|
|
|
+ pageSize: number,
|
|
|
filter: TaskListQuery
|
|
|
): Promise<{ items: Task[]; total: number }> => {
|
|
|
console.log(
|
|
@@ -275,9 +426,12 @@ const fetchTaskList = async (
|
|
|
status: filter.status,
|
|
|
},
|
|
|
});
|
|
|
- const { studies } = response.data.data;
|
|
|
- const tasks = studies.map(mapToTask);
|
|
|
- return { items: tasks, total: tasks.length };
|
|
|
+
|
|
|
+ // 使用新的响应类型
|
|
|
+ const responseData = response.data as FetchTaskListResponse;
|
|
|
+ const { studies, count } = responseData.data;
|
|
|
+ const tasks = studies.map(mapFetchTaskListStudyToTask);
|
|
|
+ return { items: tasks, total: count };
|
|
|
};
|
|
|
|
|
|
export { registerWork, fetchTaskList };
|