|
@@ -1,6 +1,8 @@
|
|
import { Series } from '@/domain/series';
|
|
import { Series } from '@/domain/series';
|
|
import axiosInstance from '../interceptor';
|
|
import axiosInstance from '../interceptor';
|
|
import { Task } from '@/domain/work';
|
|
import { Task } from '@/domain/work';
|
|
|
|
+import { dview } from '@/domain/dview';
|
|
|
|
+import { XImage } from '@/domain/xImage';
|
|
|
|
|
|
interface View {
|
|
interface View {
|
|
view_id: string;
|
|
view_id: string;
|
|
@@ -85,6 +87,98 @@ export interface RegisterWorkResponse {
|
|
solution: string;
|
|
solution: string;
|
|
data: RegisterWorkResponseData;
|
|
data: RegisterWorkResponseData;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+export interface AcquisitionContext {
|
|
|
|
+ WorkStationID: number;
|
|
|
|
+ PatientSize: string;
|
|
|
|
+ KVP: number;
|
|
|
|
+ MA: number;
|
|
|
|
+ MAS: number;
|
|
|
|
+ MS: number;
|
|
|
|
+ TechMode: number;
|
|
|
|
+ AECDensity: number;
|
|
|
|
+ AECField: number;
|
|
|
|
+ AECFilm: number;
|
|
|
|
+ DAP: number;
|
|
|
|
+ DOSE: number;
|
|
|
|
+ FocalSpot: string;
|
|
|
|
+ SID: number;
|
|
|
|
+ TOD: number;
|
|
|
|
+ TubeLoad: string;
|
|
|
|
+ GridType: string;
|
|
|
|
+ FilterType: string;
|
|
|
|
+ EXI: number;
|
|
|
|
+ DI: number;
|
|
|
|
+ PositionNumber: string;
|
|
|
|
+ CollimatorFilter: string;
|
|
|
|
+ CollimatorLength: string;
|
|
|
|
+ CollimatorWidth: string;
|
|
|
|
+ CollimatorCenter: string;
|
|
|
|
+ FpdAcquisitionMode: string;
|
|
|
|
+ FrameRate: number;
|
|
|
|
+ EntranceDoseInmGy: number;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export interface ImageFunctionParameter {
|
|
|
|
+ Name: string;
|
|
|
|
+ Min: number;
|
|
|
|
+ Max: number;
|
|
|
|
+ Step: number;
|
|
|
|
+ Value: number;
|
|
|
|
+ ValueType: string;
|
|
|
|
+ IsEnabled: boolean;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export interface ImageFunction {
|
|
|
|
+ FunctionName: string;
|
|
|
|
+ ImageStyle: string;
|
|
|
|
+ Parameters: ImageFunctionParameter[];
|
|
|
|
+ CurveType: ImageFunctionParameter;
|
|
|
|
+ WindowLevelGradeParameters: ImageFunctionParameter[];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export interface ImageProcessingContext {
|
|
|
|
+ ImageFunction: ImageFunction;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export interface CopyPositionResponseData {
|
|
|
|
+ series_instance_uid: string;
|
|
|
|
+ study_instance_uid: string;
|
|
|
|
+ study_id: string;
|
|
|
|
+ procedure_id: string;
|
|
|
|
+ body_part: string;
|
|
|
|
+ performed_datetime: string | null;
|
|
|
|
+ performed_protocol_code_meaning: string;
|
|
|
|
+ performed_protocol_code_value: string;
|
|
|
|
+ sort: number;
|
|
|
|
+ product: string;
|
|
|
|
+ is_pre_install: boolean;
|
|
|
|
+ images: {
|
|
|
|
+ sop_instance_id: string;
|
|
|
|
+ series_instance_uid: string;
|
|
|
|
+ study_instance_uid: string;
|
|
|
|
+ secondary_sop_uid: string;
|
|
|
|
+ study_id: string;
|
|
|
|
+ view_id: string;
|
|
|
|
+ view_description: string;
|
|
|
|
+ image_status: string;
|
|
|
|
+ image_file_path: string;
|
|
|
|
+ acquisition_mode: string;
|
|
|
|
+ acquisition_context: AcquisitionContext | null;
|
|
|
|
+ img_proc_context: ImageProcessingContext | null;
|
|
|
|
+ sort: number;
|
|
|
|
+ product: string;
|
|
|
|
+ is_pre_install: boolean;
|
|
|
|
+ }[];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export interface CopyPositionResponse {
|
|
|
|
+ code: string;
|
|
|
|
+ description: string;
|
|
|
|
+ solution: string;
|
|
|
|
+ data: CopyPositionResponseData;
|
|
|
|
+}
|
|
|
|
+
|
|
// 充当列表框架的filter
|
|
// 充当列表框架的filter
|
|
export interface TaskListQuery {
|
|
export interface TaskListQuery {
|
|
patient_id?: string;
|
|
patient_id?: string;
|
|
@@ -192,4 +286,28 @@ const fetchTaskDetails = async (
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
-export { fetchTaskDetails };
|
|
|
|
|
|
+const copyImage = async (instanceUid: string): Promise<dview[]> => {
|
|
|
|
+ try {
|
|
|
|
+ const response = await axiosInstance.post('/auth/image/copy', {
|
|
|
|
+ instance_uid: instanceUid,
|
|
|
|
+ });
|
|
|
|
+ const dviews: dview[] = response.data.series.flatMap((series: Series) =>
|
|
|
|
+ series.images.map((image: XImage) => ({
|
|
|
|
+ view_id: image.view_id,
|
|
|
|
+ series_instance_uid: image.series_instance_uid,
|
|
|
|
+ study_instance_uid: image.study_instance_uid,
|
|
|
|
+ study_id: image.study_id,
|
|
|
|
+ procedure_id: series.procedure_id,
|
|
|
|
+ view_description: image.view_description,
|
|
|
|
+ view_type: image.view_id, // Assuming view_type is the same as view_id
|
|
|
|
+ }))
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ return dviews;
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error('Error copying image:', error);
|
|
|
|
+ throw error;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+export { copyImage, fetchTaskDetails };
|