diff --git a/Modules/Internal/Transformers/RequestLogResource.php b/Modules/Internal/Transformers/RequestLogResource.php index 06b43fa2..8f0c6458 100644 --- a/Modules/Internal/Transformers/RequestLogResource.php +++ b/Modules/Internal/Transformers/RequestLogResource.php @@ -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, diff --git a/Modules/Internal/Transformers/RequestLogShowResource.php b/Modules/Internal/Transformers/RequestLogShowResource.php index 4bb86bce..11aff959 100644 --- a/Modules/Internal/Transformers/RequestLogShowResource.php +++ b/Modules/Internal/Transformers/RequestLogShowResource.php @@ -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'], ]; diff --git a/frontend/dashboard/src/pages/CaseManagement/InpatientMonitoring/List.tsx b/frontend/dashboard/src/pages/CaseManagement/InpatientMonitoring/List.tsx index f734db68..c8a20a05 100644 --- a/frontend/dashboard/src/pages/CaseManagement/InpatientMonitoring/List.tsx +++ b/frontend/dashboard/src/pages/CaseManagement/InpatientMonitoring/List.tsx @@ -354,6 +354,7 @@ export default function List() { */} {row.code} + {row.provider} {row.member_name} {row.service_name} @@ -482,6 +483,9 @@ export default function List() { Code + + Provider + Name diff --git a/frontend/dashboard/src/pages/CustomerService/Components/CardDetail.tsx b/frontend/dashboard/src/pages/CustomerService/Components/CardDetail.tsx index 39db8867..7faf7ed8 100644 --- a/frontend/dashboard/src/pages/CustomerService/Components/CardDetail.tsx +++ b/frontend/dashboard/src/pages/CustomerService/Components/CardDetail.tsx @@ -27,6 +27,10 @@ export default function CardDetail({requestLog} : CardDetail ) { return ( Detail + + Provider + {requestLog?.provider} + Member ID {requestLog?.member_id} @@ -51,6 +55,27 @@ export default function CardDetail({requestLog} : CardDetail ) { Submission Date {requestLog?.submission_date ? fDateTimesecond(requestLog?.submission_date) : '-'} + + + No KTP + {requestLog?.no_identitas ? requestLog?.no_identitas : '-'} + + + Keterangan + {requestLog?.keterangan ? requestLog?.keterangan : '-'} + + + Hak Kamar Pasien + {requestLog?.hak_kamar_pasien ? requestLog?.hak_kamar_pasien : '-'} + + + Penempatan Kamar + {requestLog?.penempatan_kamar ? requestLog?.penempatan_kamar : '-'} + + + Catatan + {requestLog?.catatan ? requestLog?.catatan : '-'} + ) diff --git a/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogConfirmation.tsx b/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogConfirmation.tsx index 061739d0..a2204481 100644 --- a/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogConfirmation.tsx +++ b/frontend/dashboard/src/pages/CustomerService/FinalLog/Components/DialogConfirmation.tsx @@ -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 {requestLog?.service_type} + + + + Catatan + handleChange('catatan', e.target.value)} + /> + + {approve == 'approved' ? ( - + ) : ( - + ) } diff --git a/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx b/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx index a70fb942..d00eb098 100644 --- a/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx +++ b/frontend/dashboard/src/pages/CustomerService/FinalLog/List.tsx @@ -354,6 +354,7 @@ export default function List() { */} {row.code} + {row.provider} {row.member_name} {row.service_name} diff --git a/frontend/dashboard/src/pages/CustomerService/FinalLog/Model/Types.tsx b/frontend/dashboard/src/pages/CustomerService/FinalLog/Model/Types.tsx index ad56d099..bad6c293 100644 --- a/frontend/dashboard/src/pages/CustomerService/FinalLog/Model/Types.tsx +++ b/frontend/dashboard/src/pages/CustomerService/FinalLog/Model/Types.tsx @@ -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, diff --git a/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx b/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx index 3cec05cd..90add7dd 100644 --- a/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx +++ b/frontend/dashboard/src/pages/CustomerService/Request/Detail.tsx @@ -80,6 +80,10 @@ export default function Detail() { Detail + + Provider Name + {requestLog?.provider} + Member ID {requestLog?.member_id} diff --git a/frontend/dashboard/src/pages/CustomerService/Request/List.tsx b/frontend/dashboard/src/pages/CustomerService/Request/List.tsx index 1a2b3179..dd68d356 100644 --- a/frontend/dashboard/src/pages/CustomerService/Request/List.tsx +++ b/frontend/dashboard/src/pages/CustomerService/Request/List.tsx @@ -357,6 +357,7 @@ export default function List() { */} {row.code} + {row.provider} {row.member_name} {row.service_name} @@ -482,6 +483,9 @@ export default function List() { Code + + Provider + Name diff --git a/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx b/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx index 44bdbec7..5cd12404 100644 --- a/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx +++ b/frontend/dashboard/src/pages/CustomerService/Request/Model/Types.tsx @@ -49,6 +49,7 @@ export type DetailRequestLogType = { keterangan : string, hak_kamar_pasien : string, penempatan_kamar : string, + provider : string, status : string, benefit : Benefit[], }