update final log

This commit is contained in:
2023-12-12 14:35:12 +07:00
parent 91b7a10f86
commit e76c480ce9
59 changed files with 5524 additions and 583 deletions

View File

@@ -0,0 +1,57 @@
import { Card, Typography } from "@mui/material";
import { Stack } from '@mui/material';
import { DetailFinalLogType } from "../FinalLog/Model/Types";
import { fDate, fDateTimesecond, toTitleCase } from "@/utils/formatTime";
type CardDetail = {
requestLog: DetailFinalLogType|undefined;
}
const style1 = {
color: '#919EAB',
width: '30%'
}
const style2 = {
width: '70%'
}
const marginBottom1 = {
marginBottom: 1,
}
const marginBottom2 = {
marginBottom: 2,
}
export default function CardDetail({requestLog} : CardDetail ) {
return (
<Card sx={{padding:2}} >
<Typography variant='subtitle1' sx={{color: '#19BBBB', marginBottom: 4}} gutterBottom>Detail</Typography>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Name</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.name}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Date Of Birth</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.date_of_birth ? fDate(requestLog?.date_of_birth) : '-'}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Marital Status</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.marital_status}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Submission Date</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.submission_date ? fDateTimesecond(requestLog?.submission_date) : '-'}</Typography>
</Stack>
</Card>
)
}

View File

@@ -0,0 +1,117 @@
import { Accordion, AccordionDetails, AccordionSummary, Card, Typography } from "@mui/material";
import { Stack } from '@mui/material';
import { DetailFinalLogType } from "../FinalLog/Model/Types";
import { toTitleCase } from "@/utils/formatTime";
import Label from '@/components/Label';
import { ExpandMore } from "@mui/icons-material";
type CardDetail = {
requestLog: DetailFinalLogType|undefined;
}
const style1 = {
color: '#919EAB',
width: '30%'
}
const style2 = {
width: '70%'
}
const marginBottom2 = {
marginBottom: 2,
}
export default function CardExclusion({requestLog} : CardDetail ) {
return (
<Card sx={{padding:2}} >
<Typography variant='subtitle1' sx={{color: '#19BBBB', marginBottom: 4}} gutterBottom>Exclusion</Typography>
{requestLog?.exclusion?.length > 0 ? requestLog?.exclusion.map((r, index) => (
<Accordion>
<AccordionSummary
expandIcon={<ExpandMore />}
aria-controls='panelia-content'
id='panel1a-header'
>
<Typography variant='subtitle1'>{r.exclusionable.code}</Typography>
<Typography variant='subtitle1' sx={{marginLeft:3}}>{r.exclusionable.name}</Typography>
</AccordionSummary>
<AccordionDetails>
<Stack direction='row' spacing={2} sx={marginBottom2}>
<Typography variant='subtitle2' sx={style1} gutterBottom>MSC</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>
{r.rules.length > 0 && r?.rules?.map((text, i) => {
return text.name === 'msc' ?
text.values.split(',').map((text2, j) => {
let labelMSC: string = text2;
switch (labelMSC) {
case 'm':
labelMSC = 'Member';
break;
case 'c':
labelMSC = 'Child';
break;
case 's':
labelMSC = 'Spouse';
break;
default:
labelMSC = 'Member';
}
return (
<Label key={j} sx={{marginLeft:1}}>{labelMSC}</Label>
);
})
: null;
})}
</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom2}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Gender</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>
{r.rules.length > 0 && r?.rules?.map((text, i) => {
return text.name === 'gender' ?
text.values.split(',').map((text2, j) => {
let labelGender: string = toTitleCase(text2);
return (
<Label key={j} sx={{marginLeft:1}}>{labelGender}</Label>
);
})
: null;
})}
</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom2}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Min Age</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>
{r.rules.length > 0 && r?.rules?.map((text, i) => {
return text.name === 'min_age' ?
<Typography variant='subtitle1'> {text.values} </Typography> : null
})}
</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom2}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Max Age</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>
{r.rules.length > 0 && r?.rules?.map((text, i) => {
return text.name === 'max_age' ?
<Typography variant='subtitle1'> {text.values} </Typography> : null
})}
</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom2}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Plan</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>
{r.rules.length > 0 && r?.rules?.map((text, i) => {
return text.name === 'plan' ?
<Typography variant='subtitle1'> {text.values} </Typography> : null
})}
</Typography>
</Stack>
</AccordionDetails>
</Accordion>
)) : null}
</Card>
)
}

View File

@@ -0,0 +1,105 @@
import { Card, Typography } from "@mui/material";
import { Stack } from '@mui/material';
import { DetailFinalLogType } from "../FinalLog/Model/Types";
import { fDate, fDateTimesecond, toTitleCase } from "@/utils/formatTime";
import Label from '@/components/Label';
type CardDetail = {
requestLog: DetailFinalLogType|undefined;
isFinalLog: boolean
}
const style1 = {
color: '#919EAB',
width: '30%'
}
const style2 = {
width: '70%'
}
const marginBottom1 = {
marginBottom: 1,
}
const marginBottom2 = {
marginBottom: 2,
}
export default function CardService({requestLog, isFinalLog = true} : CardDetail ) {
return (
<Card sx={{padding:2}} >
<Typography variant='subtitle1' sx={{color: '#19BBBB', marginBottom: 4}} gutterBottom>Service</Typography>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Service Type</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.service_type}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Claim Method</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{toTitleCase(requestLog?.claim_method ?? '-')}</Typography>
</Stack>
{/* <Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={{width:'35%', color: '#919EAB'}} gutterBottom>Benefit</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>
<ul>
{requestLog?.benefit.length > 0 ? requestLog?.benefit.map((r, index) => (
<li key={index}>{r.code } - {r.description}</li>
)) : <li>-</li>}
</ul>
</Typography>
</Stack> */}
{/* General Practitioner */}
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>General Practitioner</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>External Doctor :
{requestLog?.config_service?.gp_external_doctor_online == '1' ? (<Label sx={{marginLeft:2}}> Online</Label>) : '-'}
{requestLog?.config_service?.gp_external_doctor_offline == '1' ? (<Label sx={{marginLeft:1}}> Offfline</Label>) : '-'}
</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom2}>
<Typography variant='subtitle2' sx={style1} gutterBottom></Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>Internal Doctor :
{requestLog?.config_service?.gp_internal_doctor_online == '1' ? (<Label sx={{marginLeft:2}}> Online</Label>) : '-'}
{requestLog?.config_service?.gp_internal_doctor_offline == '1' ? (<Label sx={{marginLeft:1}}> Offfline</Label>) : '-'}
</Typography>
</Stack>
{/* Specialist Practitioner */}
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Specialist Practitioner</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>External Doctor :
{requestLog?.config_service?.sp_external_doctor_online == '1' ? (<Label sx={{marginLeft:2}}> Online</Label>) : '-'}
{requestLog?.config_service?.sp_external_doctor_offline == '1' ? (<Label sx={{marginLeft:1}}> Offfline</Label>) : '-'}
</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom2}>
<Typography variant='subtitle2' sx={style1} gutterBottom></Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>Internal Doctor :
{requestLog?.config_service?.gp_internal_doctor_online == '1' ? (<Label sx={{marginLeft:2}}> Online</Label>) : '-'}
{requestLog?.config_service?.gp_internal_doctor_offline == '1' ? (<Label sx={{marginLeft:1}}> Offfline</Label>) : '-'}
</Typography>
</Stack>
{/* Medicine */}
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={{width:'35%', color: '#919EAB'}} gutterBottom>Medicine</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>
<ul>
{requestLog?.config_service?.vitamins == '1' ? (<li>Suplemen</li>) : (<li>-</li>)}
{requestLog?.config_service?.delivery_fee == '1' ? (<li>Delivery Fee</li>) : (<li>-</li>)}
</ul>
</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom2}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Admin Fee</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>
{requestLog?.config_service?.general_practitioner_fee == '1' ? (<Label sx={{marginLeft:2}}> General Practitioner</Label>) : '-'}
{requestLog?.config_service?.specialist_practitioner_fee == '1' ? (<Label sx={{marginLeft:1}}> Specialist Practitioner</Label>) : '-'}
</Typography>
</Stack>
</Card>
)
}

View File

@@ -0,0 +1,115 @@
import { Card, Grid, Typography } from "@mui/material";
import { Stack } from '@mui/material';
import { DetailFinalLogType } from "../FinalLog/Model/Types";
import { useEffect, useState, useRef, useMemo } from 'react';
import { Box } from "@mui/material";
import { fDate, fDateTimesecond, toTitleCase } from "@/utils/formatTime";
import Label from '@/components/Label';
import AddIcon from '@mui/icons-material/Add';
import { Button } from "@mui/material";
type CardDetail = {
requestLog: DetailFinalLogType|undefined;
}
const style1 = {
color: '#919EAB',
width: '30%'
}
const style2 = {
width: '70%'
}
const marginBottom1 = {
marginBottom: 1,
}
const marginBottom2 = {
marginBottom: 2,
}
export default function DetailBenefit({requestLog} : CardDetail ) {
return (
{requestLog.benefitData?.map((item, index) => (
<Box sx={{ marginTop:'10px', marginBottom:'10px', py: '8px', px: '12px', border:'1px solid #919EAB52', borderRadius: '6px'}}>
<Grid container spacing={2}>
<Grid item xs={12}>
<Typography variant="subtitle1" sx={{ fontWeight: 'bold'}}>
{item.description}
</Typography>
</Grid>
<Grid item xs={2.5}>
<Grid container spacing={2}>
<Grid item xs={12}>
<Typography variant="subtitle1" component="div">
Amount Incurred*
</Typography>
</Grid>
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
</Grid>
</Grid>
</Grid>
<Grid item xs={2.5}>
<Grid container spacing={2}>
<Grid item xs={12}>
<Typography variant="subtitle1" component="div">
Amount Approved*
</Typography>
</Grid>
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
</Grid>
</Grid>
</Grid>
<Grid item xs={2.5}>
<Grid container spacing={2}>
<Grid item xs={12}>
<Typography variant="subtitle1" component="div">
Amount Not Approved*
</Typography>
</Grid>
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
</Grid>
</Grid>
</Grid>
<Grid item xs={2.5}>
<Grid container spacing={2}>
<Grid item xs={12}>
<Typography variant="subtitle1" component="div">
Excess Paid*
</Typography>
</Grid>
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
</Grid>
</Grid>
</Grid>
<Grid item xs={2}>
<Grid container spacing={2}>
<Grid item xs={12}>
<Typography variant="subtitle1" component="div">
Keterangan*
</Typography>
</Grid>
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
</Grid>
</Grid>
</Grid>
</Grid>
</Box>
))}
)
}