瀏覽代碼

feat(report): add studyid field to report's basic information for constructing path in server API calls

sw 3 周之前
父節點
當前提交
030277fe0b

+ 1 - 0
src/pages/patient/DiagnosticReport/components/BaseInfo.tsx

@@ -51,6 +51,7 @@ export const BaseInfo: React.FC = () => {
           value: selectedStudy.StudyStartDatetime,
         })
       );
+      dispatch(updateField({ key: 'studyId', value: selectedStudy.StudyID }));
       // dispatch(updateField({ key: 'bodyPart', value: selectedStudy. }));
       // dispatch(updateField({ key: 'examDesc', value: selectedStudy.examDesc }));
       // dispatch(updateField({ key: 'examPosition', value: selectedStudy.examPosition }));

+ 2 - 0
src/states/patient/DiagnosticReport/baseInfoSlice.ts

@@ -35,6 +35,7 @@ export interface BaseInfoState {
   patientName: string;
   radiologist: string;
   reviewPhysician: string;
+  studyId: string;
 }
 
 const initialState: BaseInfoState = {
@@ -61,6 +62,7 @@ const initialState: BaseInfoState = {
    * 审核医师
    */
   reviewPhysician: '',
+  studyId: '',
 };
 
 const baseInfoSlice = createSlice({

+ 2 - 1
src/states/patient/DiagnosticReport/saveReportThunk.ts

@@ -5,8 +5,9 @@ import { RootState } from '../../../states/store';
 export const saveReportThunk = createAsyncThunk(
   'diagnosticReport/saveReport',
   // eslint-disable-next-line
-  async (studyId: string, { getState, dispatch }) => {
+  async (_, { getState, dispatch }) => {
     const state = getState() as RootState;
+    const studyId = state.baseInfo.studyId;
     const report = {
       headers: {
         name: state.baseInfo.patientName,