Skip to content

Commit

Permalink
Feat : add schedule with worklist
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny990628 committed May 26, 2023
1 parent 75e2404 commit 63cbaa8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Components/CustomForm/usePatientForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const usePatientForm = () => {
}

const inputModel = [
{ name: 'blood', label: '抽血編號', type: 'text', value: blood, setValue: setBlood, required: false },
{ name: 'blood', label: '抽血編號(非必填)', type: 'text', value: blood, setValue: setBlood, required: false },
{ name: 'id', label: '身分證字號', type: 'text', value: id, setValue: setId, required: true },
{ name: 'name', label: '姓名', type: 'text', value: name, setValue: setName, required: true },
{ name: 'phone', label: '電話', type: 'text', value: phone, setValue: setPhone, required: true },
Expand Down
15 changes: 13 additions & 2 deletions src/Components/CustomReport/CustomReportForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const CustomReportForm = ({ lists, patient }) => {
</Button>
</Tooltip> */}
<Stack direction="row" spacing={1}>
<Button
{/* <Button
variant="contained"
onClick={() => {
apiAddWorklist(patient.id)
Expand Down Expand Up @@ -248,7 +248,7 @@ const CustomReportForm = ({ lists, patient }) => {
sx={{ borderRadius: '2rem', height: 'auto', color: 'white' }}
>
超音波開單
</Button>
</Button> */}
<Button
variant={Boolean(dicomAnchorEl) ? 'outlined' : 'contained'}
onClick={handleDicomClick}
Expand All @@ -258,6 +258,17 @@ const CustomReportForm = ({ lists, patient }) => {
>
超音波影像
</Button>
<Button
variant="outlined"
onClick={() => {
window.open(`${process.env.REACT_APP_BLUELIGHT_URL}?PatientID=${patient.id}`, '_blank').focus()
}}
startIcon={<Cast />}
color="contrast"
sx={{ borderRadius: '2rem', height: 'auto', color: 'contrast.main' }}
>
新分頁開啟影像
</Button>
</Stack>

{/* <Badge badgeContent={patient?.report?.records.length ? patient?.report?.records.length - 1 : 0} color="primary">
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/Report/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const Report = () => {
>
刪除
</Button>
<Button
{/* <Button
startIcon={<CloudDone />}
color="primary"
sx={{ color: 'primary.main', fontSize: '1.1rem' }}
Expand All @@ -173,7 +173,7 @@ const Report = () => {
}}
>
超音波開單
</Button>
</Button> */}
</Box>
),
},
Expand Down
11 changes: 10 additions & 1 deletion src/Redux/Slices/Schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
apiUpdateScheduleStatus,
} from '../../Axios/Schedule'
import { tokenExpirationHandler } from '../../Utils/ErrorHandle'
import { apiAddWorklist } from '../../Axios/WorkList'

export const fetchSchedule = createAsyncThunk('schedule/fetchSchedule', async (params, thunkAPI) => {
try {
Expand All @@ -31,7 +32,15 @@ export const addSchedule = createAsyncThunk('schedule/addSchedule', async ({ pat
const reportResponse = await apiCreateReport({ patientID })
const reportID = reportResponse.data._id
const bloodResponse = await apiAddBlood({ patientID, number: blood })
await apiAddSchedule({ patientID, reportID, procedureCode, status: 'wait-examination', bloodID: bloodResponse.data._id })
const worklistResponse = await apiAddWorklist(patientID)
await apiAddSchedule({
patientID,
reportID,
procedureCode,
status: 'wait-examination',
bloodID: bloodResponse.data._id,
StudyInstanceUID: worklistResponse.data.studyInstanceUID,
})
} catch (e) {
thunkAPI.dispatch(tokenExpirationHandler(e.response))
return thunkAPI.rejectWithValue()
Expand Down

0 comments on commit 63cbaa8

Please sign in to comment.