update ecard dan daily monitoring
This commit is contained in:
@@ -22,6 +22,8 @@ import TableMoreMenu from '@/components/table/TableMoreMenu';
|
||||
*/
|
||||
import { fDate } from "@/utils/formatTime";
|
||||
import { ClaimListType } from "../Model/Types";
|
||||
import { ClearOutlined, LoopOutlined } from "@mui/icons-material";
|
||||
import DialogConfirmation from "./DialogConfirmation";
|
||||
|
||||
type Props = {
|
||||
row: ClaimListType,
|
||||
@@ -30,6 +32,14 @@ type Props = {
|
||||
|
||||
export default function ClaimListRow ({ ...props }: Props) {
|
||||
const navigate = useNavigate()
|
||||
const [openDialogSubmit, setOpenDialogSubmit] = useState(false);
|
||||
const [code, setCode] = useState('');
|
||||
const [member_id, setMemberId] = useState('');
|
||||
const handleUpdate = (code: string, member_id: string) => {
|
||||
setOpenDialogSubmit(true)
|
||||
setMemberId(member_id)
|
||||
setCode(code)
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
@@ -87,21 +97,45 @@ export default function ClaimListRow ({ ...props }: Props) {
|
||||
</TableCell>
|
||||
<TableCell align="right" onClick={(e) => e.stopPropagation()}>
|
||||
<Stack direction="row" justifyContent="flex-end" spacing={1}>
|
||||
<TableMoreMenu actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/${props.row.member_id}/claims/${props.row.code}/list_monitoring`)}>
|
||||
<Visibility />
|
||||
View
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/${props.row.member_id}/claims/${props.row.code}/add_monitoring`)}>
|
||||
<AddIcon />
|
||||
Daily Monitoring
|
||||
</MenuItem>
|
||||
</>
|
||||
} />
|
||||
{props.row.discharge_date == null ?
|
||||
(
|
||||
<TableMoreMenu actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/${props.row.member_id}/claims/${props.row.code}/list_monitoring`)}>
|
||||
<Visibility />
|
||||
View
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/${props.row.member_id}/claims/${props.row.code}/add_monitoring`)}>
|
||||
<AddIcon />
|
||||
Daily Monitoring
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => handleUpdate(props.row.code, props.row.member_id)}>
|
||||
<LoopOutlined />
|
||||
Update Status
|
||||
</MenuItem>
|
||||
</>
|
||||
} />
|
||||
) :
|
||||
(
|
||||
<TableMoreMenu actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/${props.row.member_id}/claims/${props.row.code}/list_monitoring`)}>
|
||||
<Visibility />
|
||||
View
|
||||
</MenuItem>
|
||||
</>
|
||||
} />
|
||||
)
|
||||
}
|
||||
|
||||
</Stack>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<DialogConfirmation
|
||||
setOpenDialog={setOpenDialogSubmit}
|
||||
row={props.row}
|
||||
openDialog={openDialogSubmit}
|
||||
/>
|
||||
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { useFieldArray, useForm } from 'react-hook-form';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { Box, IconButton, Typography, Grid, Card, Button, ButtonBase } from '@mui/material';
|
||||
import { Box, IconButton, Typography, Grid, Card, Button, ButtonBase, Stack } from '@mui/material';
|
||||
import { LoadingButton } from "@mui/lab";
|
||||
|
||||
/**
|
||||
@@ -13,6 +13,7 @@ import { LoadingButton } from "@mui/lab";
|
||||
*/
|
||||
import Page from '@/components/Page';
|
||||
import { FormProvider, RHFTextField } from '@/components/hook-form';
|
||||
import RHFDatePickerV2 from '@/components/hook-form/RHFDatePickerV2';
|
||||
|
||||
/**
|
||||
* Icon
|
||||
@@ -21,6 +22,7 @@ import { FormProvider, RHFTextField } from '@/components/hook-form';
|
||||
import ArrowBackIosNew from '@mui/icons-material/ArrowBackIosNew';
|
||||
import AddIcon from '@mui/icons-material/Add';
|
||||
import RemoveIcon from '@mui/icons-material/Remove';
|
||||
import InsertDriveFileIcon from '@mui/icons-material/InsertDriveFile';
|
||||
|
||||
/**
|
||||
* Utils, Types, Functions
|
||||
@@ -37,7 +39,9 @@ export default function DetailMonitoringList() {
|
||||
const { member_id, claim_code } = useParams();
|
||||
const navigate = useNavigate()
|
||||
const pageTitle = claim_code??'_ _ _ _';
|
||||
const fileInput = useRef<HTMLInputElement>(null);
|
||||
const fileInput1 = useRef<HTMLInputElement>(null);
|
||||
const fileInput2 = useRef<HTMLInputElement>(null);
|
||||
const fileInput3 = useRef<HTMLInputElement>(null);
|
||||
|
||||
// setup form
|
||||
// ====================================
|
||||
@@ -58,7 +62,13 @@ export default function DetailMonitoringList() {
|
||||
non_medikamentosa_plan : [{
|
||||
non_medikamentosa_plan_str: ''
|
||||
}],
|
||||
created_at : ''
|
||||
confirmation_medical_leter : [],
|
||||
medical_action_letter : [],
|
||||
result : [],
|
||||
created_at : '',
|
||||
lab_date : '',
|
||||
provider : '',
|
||||
examination : '',
|
||||
};
|
||||
|
||||
const methods = useForm<any>({
|
||||
@@ -72,29 +82,75 @@ export default function DetailMonitoringList() {
|
||||
const formValues = watch();
|
||||
// Handle File Input
|
||||
// =====================================
|
||||
const handleInputChange = (event: any) => {
|
||||
const handleInputChangeConfirmationMedicalLeter = (event: any) => {
|
||||
if (event.target.files[0]) {
|
||||
|
||||
let arr_lab_result_file = formValues.lab_result_file;
|
||||
arr_lab_result_file.push(event.target.files[0]);
|
||||
let arr_confirmation_medical_leter_file = formValues.confirmation_medical_leter;
|
||||
arr_confirmation_medical_leter_file.push(event.target.files[0]);
|
||||
|
||||
setValue('lab_result_file', arr_lab_result_file)
|
||||
setValue('confirmation_medical_leter', arr_confirmation_medical_leter_file);
|
||||
}
|
||||
else {
|
||||
console.log('NO FILE');
|
||||
}
|
||||
};
|
||||
const handleInputChangeMedicalActionLetter = (event: any) => {
|
||||
if (event.target.files[0]) {
|
||||
|
||||
let arr_medical_action_letter = formValues.medical_action_letter;
|
||||
arr_medical_action_letter.push(event.target.files[0]);
|
||||
|
||||
setValue('medical_action_letter', arr_medical_action_letter)
|
||||
console.log('test2')
|
||||
}
|
||||
else {
|
||||
console.log('NO FILE');
|
||||
}
|
||||
};
|
||||
|
||||
const handleInputChangeResult = (event: any) => {
|
||||
if (event.target.files[0]) {
|
||||
|
||||
let arr_result = formValues.result;
|
||||
arr_result.push(event.target.files[0]);
|
||||
|
||||
setValue('result', arr_result)
|
||||
console.log('test3')
|
||||
}
|
||||
else {
|
||||
console.log('NO FILE');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Handle Remove File
|
||||
// =====================================
|
||||
const handleRemoveFile = (target_index: number) => {
|
||||
let arr_lab_result_file = formValues.lab_result_file.filter((file: any, index: number) =>{
|
||||
const handleRemoveFileConfirmationMedicalLeter = (target_index: number) => {
|
||||
let arr_confirmation_medical_leter_file = formValues.confirmation_medical_leter.filter((file: any, index: number) =>{
|
||||
if (target_index !== index) {
|
||||
return file;
|
||||
}
|
||||
});
|
||||
|
||||
setValue('lab_result_file', arr_lab_result_file)
|
||||
setValue('confirmation_medical_leter', arr_confirmation_medical_leter_file)
|
||||
};
|
||||
const handleRemoveFileMedicalActionLetter = (target_index: number) => {
|
||||
let arr_medical_action_letter = formValues.medical_action_letter.filter((file: any, index: number) =>{
|
||||
if (target_index !== index) {
|
||||
return file;
|
||||
}
|
||||
});
|
||||
|
||||
setValue('medical_action_letter', arr_medical_action_letter)
|
||||
};
|
||||
const handleRemoveFileResult = (target_index: number) => {
|
||||
let arr_result = formValues.result.filter((file: any, index: number) =>{
|
||||
if (target_index !== index) {
|
||||
return file;
|
||||
}
|
||||
});
|
||||
|
||||
setValue('result', arr_result)
|
||||
};
|
||||
|
||||
// Submit Form
|
||||
@@ -106,8 +162,8 @@ export default function DetailMonitoringList() {
|
||||
|
||||
if (response == true) {
|
||||
reset();
|
||||
navigate('case_management/daily_monitoring/'+claim_code+'claims');
|
||||
window.location.reload()
|
||||
navigate('/case_management/daily_monitoring/'+member_id+'/claims', { replace: true });
|
||||
// window.location.reload()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,7 +426,7 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
{
|
||||
formValues.lab_result_file.map((file: any, index: number) => (
|
||||
formValues.confirmation_medical_leter.map((file: any, index: number) => (
|
||||
<Stack direction="row" justifyContent={'space-between'} key={index} sx={{ mb: '16px' }}>
|
||||
<Stack direction="row" spacing={1} sx={{color: '#19BBBB'}}>
|
||||
<InsertDriveFileIcon />
|
||||
@@ -379,7 +435,7 @@ export default function DetailMonitoringList() {
|
||||
<Iconify
|
||||
icon="eva:trash-2-outline"
|
||||
color={'darkred'}
|
||||
onClick={() => handleRemoveFile(index)}
|
||||
onClick={() => handleRemoveFileConfirmationMedicalLeter(index)}
|
||||
sx={{cursor: 'pointer'}}
|
||||
></Iconify>
|
||||
</Stack>
|
||||
@@ -387,7 +443,7 @@ export default function DetailMonitoringList() {
|
||||
}
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<ButtonBase sx={{ p: 4, border: '2px dashed #F9FAFB',bgcolor: '#919EAB52',borderRadius: '8px',width: '100%', height: '60px'}} onClick={() => fileInput.current?.click()}>
|
||||
<ButtonBase sx={{ p: 4, border: '2px dashed #F9FAFB',bgcolor: '#919EAB52',borderRadius: '8px',width: '100%', height: '60px'}} onClick={() => fileInput1.current?.click()}>
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
@@ -398,16 +454,16 @@ export default function DetailMonitoringList() {
|
||||
>
|
||||
<Iconify icon="icon-park-outline:upload-one" fontSize="3em" />
|
||||
<Typography variant="body1" fontWeight="bold">
|
||||
Upload Result
|
||||
Upload File
|
||||
</Typography>
|
||||
</Box>
|
||||
<input
|
||||
type="file"
|
||||
id="file"
|
||||
ref={fileInput}
|
||||
id="file_input"
|
||||
ref={fileInput1}
|
||||
style={{ display: 'none' }}
|
||||
multiple
|
||||
onChange={handleInputChange}
|
||||
onChange={(e) => handleInputChangeConfirmationMedicalLeter(e)}
|
||||
accept="application/pdf"
|
||||
/>
|
||||
</ButtonBase>
|
||||
@@ -417,8 +473,165 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
|
||||
{/* Medical Action Letter */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Medical Action Letter*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
{
|
||||
formValues.medical_action_letter.map((file: any, index: number) => (
|
||||
<Stack direction="row" justifyContent={'space-between'} key={index} sx={{ mb: '16px' }}>
|
||||
<Stack direction="row" spacing={1} sx={{color: '#19BBBB'}}>
|
||||
<InsertDriveFileIcon />
|
||||
<Typography variant="body2" gutterBottom>{file.name ? file.name : '-'}</Typography>
|
||||
</Stack>
|
||||
<Iconify
|
||||
icon="eva:trash-2-outline"
|
||||
color={'darkred'}
|
||||
onClick={() => handleRemoveFileMedicalActionLetter(index)}
|
||||
sx={{cursor: 'pointer'}}
|
||||
></Iconify>
|
||||
</Stack>
|
||||
))
|
||||
}
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<ButtonBase sx={{ p: 4, border: '2px dashed #F9FAFB',bgcolor: '#919EAB52',borderRadius: '8px',width: '100%', height: '60px'}} onClick={() => fileInput2.current?.click()}>
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
placeItems: 'center',
|
||||
gap: 1,
|
||||
placeContent: 'center',
|
||||
}}
|
||||
>
|
||||
<Iconify icon="icon-park-outline:upload-one" fontSize="3em" />
|
||||
<Typography variant="body1" fontWeight="bold">
|
||||
Upload File
|
||||
</Typography>
|
||||
</Box>
|
||||
<input
|
||||
type="file"
|
||||
id="file_2"
|
||||
ref={fileInput2}
|
||||
style={{ display: 'none' }}
|
||||
multiple
|
||||
onChange={handleInputChangeMedicalActionLetter}
|
||||
accept="application/pdf"
|
||||
/>
|
||||
</ButtonBase>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* Button Cancle & Save */}
|
||||
|
||||
{/* Laboratorium */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Laboratorium Result*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body1" component="div">
|
||||
Date*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body1" component="div">
|
||||
Provider*
|
||||
</Typography>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={6} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFDatePickerV2
|
||||
label='Date'
|
||||
name="lab_date"
|
||||
dateFormat='dd MMM yyyy'
|
||||
fullWidth
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={6} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFTextField
|
||||
id="provider"
|
||||
name='provider'
|
||||
placeholder='Provider'
|
||||
label='Provider'
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Examination*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFTextField
|
||||
id="examination"
|
||||
name='examination'
|
||||
placeholder='examination'
|
||||
label='Examination'
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Laboratorium Result*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
{
|
||||
formValues.result.map((file: any, index: number) => (
|
||||
<Stack direction="row" justifyContent={'space-between'} key={index} sx={{ mb: '16px' }}>
|
||||
<Stack direction="row" spacing={1} sx={{color: '#19BBBB'}}>
|
||||
<InsertDriveFileIcon />
|
||||
<Typography variant="body2" gutterBottom>{file.name ? file.name : '-'}</Typography>
|
||||
</Stack>
|
||||
<Iconify
|
||||
icon="eva:trash-2-outline"
|
||||
color={'darkred'}
|
||||
onClick={() => handleRemoveFileResult(index)}
|
||||
sx={{cursor: 'pointer'}}
|
||||
></Iconify>
|
||||
</Stack>
|
||||
))
|
||||
}
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<ButtonBase sx={{ p: 4, border: '2px dashed #F9FAFB',bgcolor: '#919EAB52',borderRadius: '8px',width: '100%', height: '60px'}} onClick={() => fileInput3.current?.click()}>
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
placeItems: 'center',
|
||||
gap: 1,
|
||||
placeContent: 'center',
|
||||
}}
|
||||
>
|
||||
<Iconify icon="icon-park-outline:upload-one" fontSize="3em" />
|
||||
<Typography variant="body1" fontWeight="bold">
|
||||
Upload File
|
||||
</Typography>
|
||||
</Box>
|
||||
<input
|
||||
type="file"
|
||||
id="file_3"
|
||||
ref={fileInput3}
|
||||
style={{ display: 'none' }}
|
||||
multiple
|
||||
onChange={handleInputChangeResult}
|
||||
accept="application/pdf"
|
||||
/>
|
||||
</ButtonBase>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
{/* Button Cancel & Save */}
|
||||
<Grid item xs={12} md={12}>
|
||||
<Box display="flex" justifyContent={'flex-end'}>
|
||||
<Box display="flex" gap={1}>
|
||||
@@ -426,7 +639,7 @@ export default function DetailMonitoringList() {
|
||||
Cancel
|
||||
</Button>
|
||||
<LoadingButton disabled={!isDirty} type="submit" variant="contained" loading={isSubmitting}>
|
||||
Save Changes
|
||||
Add
|
||||
</LoadingButton>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
@@ -27,7 +27,7 @@ import FiberManualRecord from '@mui/icons-material/FiberManualRecord';
|
||||
* Utils, Types, Functions
|
||||
* ============================================
|
||||
*/
|
||||
import { fDate } from "@/utils/formatTime";
|
||||
import { fDate, fDateOnly } from '@/utils/formatTime';
|
||||
import { getMonitoringDetailList } from '../Model/Functions';
|
||||
import { DetailMonitoringListType } from '../Model/Types';
|
||||
|
||||
@@ -87,6 +87,22 @@ export default function DetailMonitoringList() {
|
||||
>
|
||||
{row.created_at ? fDate(row.created_at) : '-'}
|
||||
</Label>
|
||||
|
||||
{row.discharge_date.discharge_date ?
|
||||
(<Label
|
||||
variant="ghost"
|
||||
color="success"
|
||||
sx={{marginLeft: '85%'}}
|
||||
>
|
||||
Close Monitoring
|
||||
</Label>) : (<Label
|
||||
variant="ghost"
|
||||
color="warning"
|
||||
sx={{marginLeft: '77%'}}
|
||||
>
|
||||
On Monitoring
|
||||
</Label>)}
|
||||
|
||||
</Box>
|
||||
|
||||
{/* card body */}
|
||||
@@ -160,21 +176,6 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Grid container gap={1}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" sx={{ fontWeight: 'bold' }}>
|
||||
Subject :
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" color={"GrayText"}>
|
||||
{row.subject}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Grid container gap={1}>
|
||||
<Grid item xs={12}>
|
||||
@@ -190,21 +191,6 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Grid container gap={1}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" sx={{ fontWeight: 'bold' }}>
|
||||
Complaints :
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" color={"GrayText"}>
|
||||
{row.complaints}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Grid container gap={1}>
|
||||
<Grid item xs={12}>
|
||||
@@ -215,7 +201,7 @@ export default function DetailMonitoringList() {
|
||||
<Grid item xs={12}>
|
||||
<List sx={{ color: 'GrayText' }}>
|
||||
{
|
||||
row.medical_plan.map((data, index) => {
|
||||
row.medical_plan?.map((data, index) => {
|
||||
return (
|
||||
<ListItem key={index}>
|
||||
<FiberManualRecord sx={{ fontSize: '8px', mr: '10px' }} /> {data.medical_plan_str}
|
||||
@@ -227,6 +213,164 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Grid container gap={1}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" sx={{ fontWeight: 'bold' }}>
|
||||
Non Medikamentosa Plan :
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<List sx={{ color: 'GrayText' }}>
|
||||
{
|
||||
row.non_medikamentosa_plan?.map((data, index) => {
|
||||
return (
|
||||
<ListItem key={index}>
|
||||
<FiberManualRecord sx={{ fontSize: '8px', mr: '10px' }} /> {data.non_medikamentosa_plan_str}
|
||||
</ListItem>
|
||||
)
|
||||
})
|
||||
}
|
||||
</List>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Grid container gap={1}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" sx={{ fontWeight: 'bold' }}>
|
||||
Laboratorium Result :
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body1" sx={{ fontWeight: 'bold' }}>
|
||||
Date
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body2" color={"GrayText"}>
|
||||
{ row.lab_date != null ? fDate(row.lab_date) : '-'}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body1" sx={{ fontWeight: 'bold' }}>
|
||||
Location
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body2" color={"GrayText"}>
|
||||
{row.provider}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body1" sx={{ fontWeight: 'bold' }}>
|
||||
Examination
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Typography variant="body2" color={"GrayText"}>
|
||||
{row.examination}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Grid container gap={1}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" sx={{ fontWeight: 'bold' }}>
|
||||
Document Confirmation Medical Letter:
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<List sx={{ color: 'GrayText' }}>
|
||||
{row.document?.map((data, index) => (
|
||||
<ListItem key={index}>
|
||||
{data.type === 'confirmation-medical-letter' ? (
|
||||
<>
|
||||
<FiberManualRecord sx={{ fontSize: '8px', mr: '10px' }} />
|
||||
<a
|
||||
href={data.path} // Replace 'data.download_link' with the actual download link
|
||||
target="_blank" // Optional: Open the link in a new tab
|
||||
rel="noopener noreferrer" // Recommended when using target="_blank"
|
||||
>
|
||||
{data.file_name}
|
||||
</a>
|
||||
</>
|
||||
) : null}
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Grid container gap={1}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" sx={{ fontWeight: 'bold' }}>
|
||||
Document Medical Action Letter:
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<List sx={{ color: 'GrayText' }}>
|
||||
{row.document?.map((data, index) => (
|
||||
<ListItem key={index}>
|
||||
{data.type === 'medical-action-letter' ? (
|
||||
<>
|
||||
<FiberManualRecord sx={{ fontSize: '8px', mr: '10px' }} />
|
||||
<a
|
||||
href={data.path} // Replace 'data.download_link' with the actual download link
|
||||
target="_blank" // Optional: Open the link in a new tab
|
||||
rel="noopener noreferrer" // Recommended when using target="_blank"
|
||||
>
|
||||
{data.file_name}
|
||||
</a>
|
||||
</>
|
||||
) : null}
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Grid container gap={1}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" sx={{ fontWeight: 'bold' }}>
|
||||
Document Laboratorium Result:
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<List sx={{ color: 'GrayText' }}>
|
||||
{row.document?.map((data, index) => (
|
||||
<ListItem key={index}>
|
||||
{data.type === 'laboratorium-result' ? (
|
||||
<>
|
||||
<FiberManualRecord sx={{ fontSize: '8px', mr: '10px' }} />
|
||||
<a
|
||||
href={data.path} // Replace 'data.download_link' with the actual download link
|
||||
target="_blank" // Optional: Open the link in a new tab
|
||||
rel="noopener noreferrer" // Recommended when using target="_blank"
|
||||
>
|
||||
{data.file_name}
|
||||
</a>
|
||||
</>
|
||||
) : null}
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Card>
|
||||
</Grid>
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
import MuiDialog from "@/components/MuiDialog";
|
||||
import { Button, Card, Checkbox, DialogActions, Grid, Typography } from "@mui/material";
|
||||
import { Paper } from "@mui/material";
|
||||
import { Stack } from '@mui/material';
|
||||
import React, { useState } from 'react';
|
||||
import { fDate, fDateTimesecond, toTitleCase } from "@/utils/formatTime";
|
||||
import axios from "@/utils/axios";
|
||||
import { enqueueSnackbar } from "notistack";
|
||||
import { useNavigate } from "react-router";
|
||||
import { replace } from "lodash";
|
||||
import { ClaimListType } from "../Model/Types";
|
||||
import Label from "@/components/Label";
|
||||
|
||||
|
||||
type DialogConfirmationType = {
|
||||
openDialog: boolean;
|
||||
setOpenDialog: any;
|
||||
onSubmit?: void;
|
||||
row: ClaimListType;
|
||||
}
|
||||
|
||||
export default function DialogConfirmation({ setOpenDialog, openDialog, row} : DialogConfirmationType ) {
|
||||
|
||||
const navigate = useNavigate();
|
||||
const handleSubmit = () => {
|
||||
axios
|
||||
.post(`case_management/daily_monitoring/detail/${row.code}/update-status`)
|
||||
.then((response) => {
|
||||
enqueueSnackbar('Close Monitoring Success', { variant: 'success' });
|
||||
setOpenDialog(false);
|
||||
navigate(`/case_management/daily_monitoring/${row.member_id}/claims`, { replace: true })
|
||||
window.location.reload();
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
|
||||
});
|
||||
}
|
||||
|
||||
const style1 = {
|
||||
color: '#919EAB',
|
||||
width: '30%'
|
||||
}
|
||||
const style2 = {
|
||||
width: '70%'
|
||||
}
|
||||
const marginBottom1 = {
|
||||
marginBottom: 1,
|
||||
}
|
||||
|
||||
const handleCloseDialog = () => {
|
||||
setOpenDialog(false);
|
||||
}
|
||||
|
||||
const getContent = () => (
|
||||
<Stack spacing={1} marginTop={2}>
|
||||
<Typography variant="subtitle2">Are you sure to closed this monitoring ?</Typography>
|
||||
<Grid item xs={12} md={12} marginTop={4}>
|
||||
<Card sx={{padding:2, marginTop:2}} >
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Name</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{row.name}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Code</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{row.code}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Admision Date</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom> <Label variant="ghost">{fDate(row.admission_date)}</Label></Typography>
|
||||
</Stack>
|
||||
</Card>
|
||||
</Grid>
|
||||
<DialogActions>
|
||||
<Button variant="outlined" sx={{color: '#212B36', borderColor: '#919EAB52'}} onClick={handleCloseDialog}>Cancel</Button>
|
||||
<Button color="primary" variant="contained" onClick={handleSubmit}>Yes</Button>
|
||||
|
||||
|
||||
</DialogActions>
|
||||
</Stack>
|
||||
);
|
||||
|
||||
|
||||
return (
|
||||
<MuiDialog
|
||||
title={{name: "Confirmation"}}
|
||||
openDialog={openDialog}
|
||||
setOpenDialog={setOpenDialog}
|
||||
content={getContent()}
|
||||
maxWidth="sm"
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import axios from '@/utils/axios';
|
||||
import { makeFormData } from '@/utils/jsonToFormData';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
import { DailyMonitoringListType, DetailMonitoringListType, ResponseListingClaimType } from "./Types";
|
||||
import { fDate, fDateOnly } from '@/utils/formatTime';
|
||||
|
||||
/**
|
||||
* Listing Daily Monitoring
|
||||
@@ -44,9 +46,11 @@ export const getClaimList = async ( member_id: string ): Promise<ResponseListing
|
||||
* Add Monitoring Detail
|
||||
*/
|
||||
export const AddMonitoringDetail = async ( claim_code: string,data: DetailMonitoringListType ): Promise<boolean> => {
|
||||
const response = await axios.post(`/case_management/daily_monitoring/detail/${claim_code}/add`, {
|
||||
...data
|
||||
})
|
||||
data.lab_date = data.lab_date != '' && data.lab_date != null ? fDateOnly(data.lab_date) : '';
|
||||
|
||||
const formData = makeFormData({...data});
|
||||
|
||||
const response = await axios.post(`/case_management/daily_monitoring/detail/${claim_code}/add-request`, formData)
|
||||
.then((res) =>{
|
||||
enqueueSnackbar(res.data.message, {
|
||||
variant: 'success',
|
||||
|
||||
@@ -35,6 +35,7 @@ export type ClaimListType = {
|
||||
admission_date : string,
|
||||
discharge_date : string,
|
||||
claim_code : string,
|
||||
name : string,
|
||||
code : string,
|
||||
service_name : string,
|
||||
claim_status : string,
|
||||
@@ -56,8 +57,15 @@ export type DetailMonitoringListType = {
|
||||
diastole : string
|
||||
analysis : string,
|
||||
complaints : string,
|
||||
lab_date : string,
|
||||
provider : string,
|
||||
examination : string,
|
||||
medical_plan : MedicalPlanStrType[],
|
||||
non_medikamentosa_plan : NonMedikamentosaPlanType[],
|
||||
confirmation_medical_leter : files[],
|
||||
medical_action_letter : files[],
|
||||
result : files[],
|
||||
document : document[],
|
||||
created_at : string|null
|
||||
}
|
||||
|
||||
@@ -68,3 +76,13 @@ export type MedicalPlanStrType = {
|
||||
export type NonMedikamentosaPlanType = {
|
||||
non_medikamentosa_plan_str: string
|
||||
}
|
||||
|
||||
export type files = {
|
||||
file: string
|
||||
}
|
||||
|
||||
export type document = {
|
||||
file_name: string,
|
||||
path: string,
|
||||
type: string
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ export default function CorporatePlanList({handleSubmitSuccess}) {
|
||||
const { corporate_id } = useParams();
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const [importResult, setImportResult] = useState(null);
|
||||
const [sendResult, setSendResult] = useState(null);
|
||||
|
||||
const [openDialog, setOpenDialog] = useState(false);
|
||||
const [isDialog, setIsDialog] = useState('');
|
||||
@@ -267,6 +268,25 @@ export default function CorporatePlanList({handleSubmitSuccess}) {
|
||||
});
|
||||
}
|
||||
|
||||
const handleSendAllEcard = () => {
|
||||
setImportLoading(true);
|
||||
setDataTableLoading(true);
|
||||
axios
|
||||
.get(`send_card/${corporate_id}`)
|
||||
.then((response) => {
|
||||
loadDataTableData();
|
||||
})
|
||||
|
||||
.catch((response) => {
|
||||
enqueueSnackbar(
|
||||
'Looks like something went wrong. Please check your data and try again.',
|
||||
{ variant: 'error' }
|
||||
);
|
||||
setImportLoading(false);
|
||||
loadDataTableData();
|
||||
});
|
||||
}
|
||||
|
||||
const handleCancelImportButton = () => {
|
||||
importPlan.current.value = '';
|
||||
importPlan.current.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
@@ -363,6 +383,9 @@ export default function CorporatePlanList({handleSubmitSuccess}) {
|
||||
<MenuItem onClick={handleMemberList}>
|
||||
<Typography variant='body2'>Download Member</Typography>
|
||||
</MenuItem>
|
||||
<MenuItem onClick={handleSendAllEcard}>
|
||||
<Typography variant='body2'>Send All Ecard</Typography>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Stack>
|
||||
)}
|
||||
@@ -413,6 +436,7 @@ export default function CorporatePlanList({handleSubmitSuccess}) {
|
||||
</Box>
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -470,6 +494,21 @@ export default function CorporatePlanList({handleSubmitSuccess}) {
|
||||
const style1 = {
|
||||
color: '#637381'
|
||||
}
|
||||
|
||||
|
||||
const handleDownloadEcard = (id: number) => {
|
||||
axios
|
||||
.get(`view_card/${id}`, {
|
||||
responseType: 'blob',
|
||||
})
|
||||
.then((response) => {
|
||||
window.open(URL.createObjectURL(response.data));
|
||||
})
|
||||
.catch((response) => {
|
||||
enqueueSnackbar(response.message, { variant: 'error' });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
@@ -527,6 +566,10 @@ export default function CorporatePlanList({handleSubmitSuccess}) {
|
||||
<CachedOutlinedIcon />
|
||||
Update Status
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => handleDownloadEcard(row.id)}>
|
||||
<DownloadIcon />
|
||||
Download E-card
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate ('/corporates/'+corporate_id+'/members/'+row.id+'/history')}>
|
||||
<HistoryIcon />
|
||||
History
|
||||
|
||||
Reference in New Issue
Block a user