|
@@ -1,15 +1,37 @@
|
|
|
+/* eslint-disable */
|
|
|
import { createAsyncThunk } from '@reduxjs/toolkit';
|
|
|
import { previewDiagnosisReport } from '@/API/patient/DiagnosisReportActions';
|
|
|
+import { RootState } from '@/states/store';
|
|
|
+import _ from 'cypress/types/lodash';
|
|
|
|
|
|
-interface PreviewReportThunkArgs {
|
|
|
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
- report: any;
|
|
|
-}
|
|
|
+// interface PreviewReportThunkArgs {
|
|
|
+// // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
+// report: any;
|
|
|
+// }
|
|
|
|
|
|
export const previewReportThunk = createAsyncThunk(
|
|
|
'diagnosticReport/previewReport',
|
|
|
- async ({ report }: PreviewReportThunkArgs) => {
|
|
|
- const response = await previewDiagnosisReport(report);
|
|
|
+
|
|
|
+ async (_, { getState }) => {
|
|
|
+ const state = getState() as RootState;
|
|
|
+ const report0 = {
|
|
|
+ headers: {
|
|
|
+ name: state.baseInfo.patientName,
|
|
|
+ sex: state.baseInfo.gender,
|
|
|
+ age: state.baseInfo.age,
|
|
|
+ medical_record_number: state.baseInfo.patientNo,
|
|
|
+ hospitalization_number: state.baseInfo.clinicNo,
|
|
|
+ bed_number: state.baseInfo.department,
|
|
|
+ requesting_department: state.baseInfo.department,
|
|
|
+ inspection_number: state.baseInfo.patientNo, //todo 暂时使用患者编号
|
|
|
+ inspection_method: state.baseInfo.examDesc,
|
|
|
+ },
|
|
|
+ findings: state.findings.diagnosticDescriptionFromImage,
|
|
|
+ impression: state.diagnosis.diagnosisDescription,
|
|
|
+ radiologist: state.baseInfo.radiologist,
|
|
|
+ review_physician: state.baseInfo.reviewPhysician,
|
|
|
+ };
|
|
|
+ const response = await previewDiagnosisReport(report0);
|
|
|
return response;
|
|
|
}
|
|
|
);
|