-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8abd4e6
commit 67fb8ae
Showing
8 changed files
with
321 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { | ||
ListItemButton, | ||
ListItemText, | ||
ListItemAvatar, | ||
} from '@mui/material'; | ||
import DoctorIcon from '../../assets/images/icons/DoctorIcon.png'; | ||
|
||
const DoctorPatientCard = ({ patient, setSelectedPatient }) => { | ||
const title = (patient.gender=='MALE')? 'Mr.':'Miss.'; | ||
|
||
return( | ||
<ListItemButton onClick={() => setSelectedPatient(patient)}> | ||
<ListItemAvatar sx={{ paddingRight: '2%' }}> | ||
<img | ||
src={DoctorIcon} | ||
alt={patient.name} | ||
width='40' | ||
height='40' | ||
/> | ||
</ListItemAvatar> | ||
<ListItemText | ||
primary={`${title} ${patient.name}`} | ||
secondary={patient.email} | ||
sx={{ | ||
width: '60%', | ||
lineHeight: '1.5em', | ||
maxHeight: '3em', | ||
}} | ||
/> | ||
</ListItemButton> | ||
); | ||
}; | ||
|
||
export default DoctorPatientCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import { Typography, Button } from '@mui/material'; | ||
import DoctorIcon from '../../assets/images/icons/DoctorIcon.png'; | ||
import EmailIcon from '@mui/icons-material/Email'; | ||
import PregnantWomanIcon from '@mui/icons-material/PregnantWoman'; | ||
import WcIcon from '@mui/icons-material/Wc'; | ||
import PhoneIcon from '@mui/icons-material/Phone'; | ||
import ContactEmergencyIcon from '@mui/icons-material/ContactEmergency'; | ||
import { useNavigate } from 'react-router'; | ||
import { getDay } from '../../utils/DateFormatter.js'; | ||
|
||
const DoctorPatientDetails = ({ selectedPatient }) => { | ||
const navigate = useNavigate(); | ||
let title = ''; | ||
if(selectedPatient){ | ||
title = (selectedPatient.gender=='MALE')? 'Mr.':'Miss.'; | ||
} | ||
return ( | ||
<> | ||
{ | ||
selectedPatient && | ||
( | ||
<> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'space-around', | ||
alignItems: 'center', | ||
flexDirection: 'row', | ||
marginBottom: '5em', | ||
}} | ||
> | ||
<div> | ||
<img | ||
src={DoctorIcon} | ||
alt={`${title} ${selectedPatient.name}`} | ||
width='100' | ||
height='100' | ||
/> | ||
<Typography variant='h4' sx={{ marginTop: '1em' }}> | ||
{`${title} ${selectedPatient.name}`} | ||
</Typography> | ||
</div> | ||
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.7em' }}> | ||
<div style={{ display: 'flex', alignItems: 'center', flexDirection: 'row' }}> | ||
<EmailIcon style={{ marginRight: '0.4em' }}/> | ||
<Typography variant='body1'> | ||
{`${selectedPatient.email}`} | ||
</Typography> | ||
</div> | ||
<div style={{ display: 'flex', alignItems: 'center', flexDirection: 'row' }}> | ||
<PregnantWomanIcon style={{ marginRight: '0.4em' }}/> | ||
<Typography variant='body1'> | ||
{`Born on ${getDay(selectedPatient.dateOfBirth)}`} | ||
</Typography> | ||
</div> | ||
<div style={{ display: 'flex', alignItems: 'center', flexDirection: 'row' }}> | ||
<WcIcon style={{ marginRight: '0.4em' }}/> | ||
<Typography variant='body1'> | ||
{`${selectedPatient.gender}`} | ||
</Typography> | ||
</div> | ||
<div style={{ display: 'flex', alignItems: 'center', flexDirection: 'row' }}> | ||
<PhoneIcon style={{ marginRight: '0.4em' }}/> | ||
<Typography variant='body1'> | ||
{`${selectedPatient.mobileNumber}`} | ||
</Typography> | ||
</div> | ||
<div style={{ display: 'flex', alignItems: 'center', flexDirection: 'row' }}> | ||
<ContactEmergencyIcon style={{ marginRight: '0.4em' }}/> | ||
<Typography variant='body1'> | ||
{`${selectedPatient.emergencyContact.name} - ${selectedPatient.emergencyContact.mobile}`} | ||
</Typography> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<div style={{ display: 'flex', justifyContent: 'center' }}> | ||
<Button variant='outlined' sx={{ marginTop: '2%' }} onClick={() => { navigate(`/doctor/pages/profile/${selectedPatient._id}`); }}> | ||
View Pofile | ||
</Button> | ||
|
||
<Button variant='outlined' sx={{ marginTop: '2%', marginLeft: '5%' }} onClick={() => { navigate(`/doctor/pages/patients/${selectedPatient._id}/prescriptions`); }}> | ||
View Prescriptions | ||
</Button> | ||
</div> | ||
</> | ||
) | ||
} | ||
</> | ||
); | ||
}; | ||
|
||
export default DoctorPatientDetails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
Dialog, | ||
DialogTitle, | ||
DialogContent, | ||
DialogActions, | ||
Tab, | ||
Box, | ||
Button | ||
} from '@mui/material'; | ||
import TabContext from '@mui/lab/TabContext'; | ||
import TabList from '@mui/lab/TabList'; | ||
import TabPanel from '@mui/lab/TabPanel'; | ||
import DoctorPatientDetails from './DoctorPatientDetails'; | ||
import FollowUp from './FollowUp'; | ||
|
||
const DoctorPatientDialog = ({ | ||
selectedPatient, | ||
handleDialogClose, | ||
loggedInDoctor, | ||
setLoggedInDoctor | ||
}) => { | ||
const [tabValue, setTabValue] = useState('1'); | ||
const handleTabChange = (event, newTabValue) => { | ||
setTabValue(newTabValue); | ||
}; | ||
const handleDialogCloseHelper = () => { | ||
setTabValue('1'); | ||
handleDialogClose(); | ||
}; | ||
return ( | ||
<Dialog | ||
open={selectedPatient} | ||
onClose={handleDialogCloseHelper} | ||
PaperProps={{ | ||
sx: { | ||
minWidth: window.outerWidth > 800 ? 700 : 500, | ||
height: 500 | ||
} | ||
}} | ||
> | ||
<TabContext value={tabValue}> | ||
<DialogTitle align='center' variant='h2' sx={{ marginBottom: '1em' }}> | ||
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}> | ||
<TabList value={tabValue} onChange={handleTabChange}> | ||
<Tab label="Patient Details" value='1' /> | ||
<Tab label="Follow Up" value='2' /> | ||
</TabList> | ||
</Box> | ||
</DialogTitle> | ||
<DialogContent> | ||
<TabPanel value='1'> | ||
<DoctorPatientDetails | ||
selectedPatient={selectedPatient} | ||
/> | ||
</TabPanel> | ||
<TabPanel value='2'> | ||
<FollowUp | ||
selectedPatient={selectedPatient} | ||
loggedInDoctor={loggedInDoctor} | ||
setLoggedInDoctor={setLoggedInDoctor} | ||
/> | ||
</TabPanel> | ||
</DialogContent> | ||
</TabContext> | ||
|
||
<DialogActions> | ||
<Button onClick={handleDialogCloseHelper} color='primary'> | ||
Close | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
); | ||
}; | ||
|
||
export default DoctorPatientDialog; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.