tambah kolom provider di final log dan request log

This commit is contained in:
2024-01-09 09:15:16 +07:00
parent b5862650cb
commit e2be94f0d0
10 changed files with 115 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ namespace Modules\Internal\Transformers;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Str;
use App\Models\Organization;
class RequestLogResource extends JsonResource
{
@@ -18,6 +19,7 @@ class RequestLogResource extends JsonResource
$filesGroupByType = $this->files->mapToGroups(function($file) {
return [Str::slug($file->type, '_') => $file];
});
$provider = Organization::where('id', $this->organization_id)->first();
$data = [
'id' => $this->id,
@@ -25,6 +27,7 @@ class RequestLogResource extends JsonResource
'submission_date' => $this->submission_date,
'member_name' => $this->member->name,
'status' => $this->status ?? 'unknown',
'provider' => $provider ? $provider->name : '-',
'status_final_log' => $this->status_final_log ?? 'unknown',
'service_name' => $this->service ? $this->service->name : '',
'payment_type' => $this->payment_type,

View File

@@ -8,6 +8,9 @@ use App\Models\ClaimRequest;
use App\Models\CorporateService;
use App\Models\RequestLogBenefit;
use App\Models\RequestLogMedicine;
use App\Models\Organization;
use App\Models\MemberPlan;
use App\Models\Plan;
use App\Models\Exclusion;
use App\Models\Icd;
use App\Helpers\Helper;
@@ -25,10 +28,15 @@ class RequestLogShowResource extends JsonResource
{
$requestLog = parent::toArray($request);
$corporateId = $requestLog['member']['current_plan']['corporate_id'] ?? 0;
$benefit = CorporateBenefit::with('benefit')->where('plan_id', $corporateId)->get()->toArray();
$member_id = $requestLog['member_id'];
$planMember = MemberPlan::where('member_id', $member_id)->get('plan_id');
$planId = Plan::whereIn('id', $planMember)->where('service_code', $requestLog['service_code'])->first();
$benefit = CorporateBenefit::with('benefit')->where('plan_id', $planId->id)->get()->toArray();
$benefitDetailLog = RequestLogBenefit::with('benefit')->where('request_log_id', $requestLog['id'])->get()->toArray();
$medicineDetailLog = RequestLogMedicine::where('request_log_id', $requestLog['id'])->get()->toArray();
$provider = Organization::where('id', $requestLog['organization_id'])->first();
$benefitData = [];
if (count($benefit)){
foreach($benefit as $data){
array_push($benefitData, $data['benefit']);
@@ -84,11 +92,13 @@ class RequestLogShowResource extends JsonResource
'exclusion' => $exclusions,
'medicine' => $medicineData,
'files' => $requestLog['files'],
'provider' => $provider->name,
'no_identitas' => $requestLog['no_identitas'],
'keterangan' => $requestLog['keterangan'],
'hak_kamar_pasien' => $requestLog['hak_kamar_pasien'],
'penempatan_kamar' => $requestLog['penempatan_kamar'],
'catatan' => $requestLog['catatan'],
];

View File

@@ -354,6 +354,7 @@ export default function List() {
</Typography>
</TableCell> */}
<TableCell align="left">{row.code}</TableCell>
<TableCell align="left">{row.provider}</TableCell>
<TableCell align="left">{row.member_name}</TableCell>
<TableCell align="left"><Label>{fDateTimesecond(row.submission_date)}</Label></TableCell>
<TableCell align="left">{row.service_name}</TableCell>
@@ -482,6 +483,9 @@ export default function List() {
<TableCell style={headStyle} align="left">
Code
</TableCell>
<TableCell style={headStyle} align="left">
Provider
</TableCell>
<TableCell style={headStyle} align="left">
Name
</TableCell>

View File

@@ -27,6 +27,10 @@ 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>Provider</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.provider}</Typography>
</Stack>
<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>
@@ -51,6 +55,27 @@ export default function CardDetail({requestLog} : CardDetail ) {
<Typography variant='subtitle2' sx={style1} gutterBottom>Submission Date</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.submission_date ? fDateTimesecond(requestLog?.submission_date) : '-'}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>No KTP</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.no_identitas ? requestLog?.no_identitas : '-'}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Keterangan</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.keterangan ? requestLog?.keterangan : '-'}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Hak Kamar Pasien</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.hak_kamar_pasien ? requestLog?.hak_kamar_pasien : '-'}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Penempatan Kamar</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.penempatan_kamar ? requestLog?.penempatan_kamar : '-'}</Typography>
</Stack>
<Stack direction='row' spacing={2} sx={marginBottom1}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Catatan</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.catatan ? requestLog?.catatan : '-'}</Typography>
</Stack>
</Card>
)

View File

@@ -1,8 +1,8 @@
import MuiDialog from "@/components/MuiDialog";
import { Button, Card, Checkbox, DialogActions, Grid, Typography } from "@mui/material";
import { Button, Card, Checkbox, DialogActions, Grid, TextField, Typography } from "@mui/material";
import { Paper } from "@mui/material";
import { Stack } from '@mui/material';
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import { DetailFinalLogType } from "../Model/Types";
import { fDateTimesecond, toTitleCase } from "@/utils/formatTime";
import axios from "@/utils/axios";
@@ -21,23 +21,51 @@ type DialogConfirmationType = {
export default function DialogConfirmation({requestLog, setOpenDialog, openDialog, approve, onSubmit} : DialogConfirmationType ) {
const navigate = useNavigate();
const [formData, setFormData] = useState({
id: requestLog?.id,
status: approve || '',
catatan: '',
});
useEffect(() => {
// Update formData setiap kali approve berubah
setFormData(prevData => ({
...prevData,
status: approve || '',
}));
}, [approve]);
const handleChange = (field, value) => {
setFormData((prevData) => ({
...prevData,
[field]: value,
}));
};
const handleApprove = () => {
setFormData((prevData) => ({
...prevData,
status: approve,
}));
handleSubmit();
};
const handleSubmit = () => {
const formData = {
status : approve,
id: requestLog?.id
}
axios
.post(`customer-service/request/final-log`, formData)
.then((response) => {
enqueueSnackbar('Verification Final LOG Success', { variant: 'success' });
enqueueSnackbar('Verification Request LOG Success', { variant: 'success' });
setOpenDialog(false);
navigate('/custormer-service/final-log')
navigate('/case_management/inpatient_monitoring')
})
.catch(({ response }) => {
enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
});
}
const style1 = {
color: '#919EAB',
width: '30%'
@@ -48,7 +76,9 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
const marginBottom1 = {
marginBottom: 1,
}
const marginBottom2 = {
marginBottom: 2,
}
const handleCloseDialog = () => {
setOpenDialog(false);
}
@@ -83,14 +113,27 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.service_type}</Typography>
</Stack>
</Card>
<Card sx={{padding:2, marginTop:2}} >
<Stack direction='row' spacing={2} sx={marginBottom2}>
<Typography variant='subtitle2' sx={style1} gutterBottom>Catatan</Typography>
<TextField
label="Catatan"
variant="outlined"
fullWidth
value={formData.catatan}
onChange={(e) => handleChange('catatan', e.target.value)}
/>
</Stack>
</Card>
</Grid>
<DialogActions>
<Button variant="outlined" sx={{color: '#212B36', borderColor: '#919EAB52'}} onClick={handleCloseDialog}>Cancel</Button>
{approve == 'approved' ? (
<Button color="primary" variant="contained" onClick={handleSubmit}>Approve</Button>
<Button color="primary" variant="contained" onClick={() => handleApprove()}>Approve</Button>
) : (
<Button color="error" variant="contained" onClick={handleSubmit}>Decline</Button>
<Button color="error" variant="contained" onClick={() => handleApprove()}>Decline</Button>
) }
</DialogActions>

View File

@@ -354,6 +354,7 @@ export default function List() {
</Typography>
</TableCell> */}
<TableCell align="left">{row.code}</TableCell>
<TableCell align="left">{row.provider}</TableCell>
<TableCell align="left">{row.member_name}</TableCell>
<TableCell align="left"><Label>{fDateTimesecond(row.submission_date)}</Label></TableCell>
<TableCell align="left">{row.service_name}</TableCell>

View File

@@ -19,6 +19,7 @@ export type FinalLogType = {
service_name : string,
payment_type_name : string,
status_final_log : string,
provider : string,
status : string,
files_by_type : files_by_type,
}
@@ -27,7 +28,8 @@ export type FinalLogType = {
export type DetailFinalLogType = {
id : number,
code : string,
member_id : string,
member_id : string,
provider : string,
policy_number : string,
name : string|any,
date_of_birth : string,
@@ -38,6 +40,11 @@ export type DetailFinalLogType = {
claim_method : string,
status : string,
status_final_log : string,
no_identitas : string,
keterangan : string,
hak_kamar_pasien : string,
penempatan_kamar : string,
catatan : string,
benefit : Benefit[],
benefit_data : BenefitData[],
config_service : ConfigService,

View File

@@ -80,6 +80,10 @@ export default function Detail() {
<Grid item xs={12} md={12}>
<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>Provider Name</Typography>
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.provider}</Typography>
</Stack>
<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>

View File

@@ -357,6 +357,7 @@ export default function List() {
</Typography>
</TableCell> */}
<TableCell align="left">{row.code}</TableCell>
<TableCell align="left">{row.provider}</TableCell>
<TableCell align="left">{row.member_name}</TableCell>
<TableCell align="left"><Label>{fDateTimesecond(row.submission_date)}</Label></TableCell>
<TableCell align="left">{row.service_name}</TableCell>
@@ -482,6 +483,9 @@ export default function List() {
<TableCell style={headStyle} align="left">
Code
</TableCell>
<TableCell style={headStyle} align="left">
Provider
</TableCell>
<TableCell style={headStyle} align="left">
Name
</TableCell>

View File

@@ -49,6 +49,7 @@ export type DetailRequestLogType = {
keterangan : string,
hak_kamar_pasien : string,
penempatan_kamar : string,
provider : string,
status : string,
benefit : Benefit[],
}