Update Claim
This commit is contained in:
@@ -13,6 +13,8 @@ use Illuminate\Contracts\Support\Renderable;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Routing\Controller;
|
use Illuminate\Routing\Controller;
|
||||||
use Modules\Internal\Transformers\ClaimShowResource;
|
use Modules\Internal\Transformers\ClaimShowResource;
|
||||||
|
use Box\Spout\Reader\Common\Creator\ReaderEntityFactory;
|
||||||
|
use Box\Spout\Writer\Common\Creator\WriterEntityFactory;
|
||||||
use PDF;
|
use PDF;
|
||||||
|
|
||||||
class ClaimController extends Controller
|
class ClaimController extends Controller
|
||||||
@@ -285,4 +287,147 @@ class ClaimController extends Controller
|
|||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function dataClaimReport(Request $request){
|
||||||
|
$file_name = 'Data Claim Report';
|
||||||
|
// Membuat penulis entitas Spout
|
||||||
|
$writer = WriterEntityFactory::createXLSXWriter();
|
||||||
|
// Membuka penulis untuk menulis ke file
|
||||||
|
$writer->openToFile(public_path('files/CorporatePlan&BenefitImportData.xlsx'));
|
||||||
|
|
||||||
|
// Sheet 1
|
||||||
|
$writer->getCurrentSheet()->setName('Worksheet');
|
||||||
|
$headers_map_to_table_fields = Claim::$listing_doc_headers;
|
||||||
|
$headerRow = WriterEntityFactory::createRowFromArray($headers_map_to_table_fields);
|
||||||
|
$writer->addRow($headerRow);
|
||||||
|
|
||||||
|
$claims = Claim::with([
|
||||||
|
'member',
|
||||||
|
'diagnoses' => function ($diagnosis) {
|
||||||
|
return $diagnosis->where('type', 'primary');
|
||||||
|
},
|
||||||
|
'diagnoses.icd',
|
||||||
|
'plan',
|
||||||
|
'benefit',
|
||||||
|
'claimRequest',
|
||||||
|
'claimRequest.service'
|
||||||
|
])
|
||||||
|
// ->latest()
|
||||||
|
->get()->toArray();
|
||||||
|
|
||||||
|
foreach ($claims as $index => $row){
|
||||||
|
$rowData = [
|
||||||
|
'', // Count of Usage
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
$row['code'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// $dataClaim = Claim::query
|
||||||
|
// $dataPlans = Claim::query()
|
||||||
|
// ->filter($request->all())
|
||||||
|
// ->where('corporate_id', $corporate_id)
|
||||||
|
// // ->whereHas('corporatePlan', function ($corporatePlan) use ($corporate_id) {
|
||||||
|
// // $corporatePlan->where('corporate_id', $corporate_id);
|
||||||
|
// // })
|
||||||
|
// // ->with('corporatePlan')
|
||||||
|
// ->orderBy('corporate_plan_id', 'asc')
|
||||||
|
// ->get()->toArray();
|
||||||
|
// foreach ($dataPlans as $index => $row){
|
||||||
|
// $rowData = [
|
||||||
|
// $row['service_code'], // Service
|
||||||
|
// $row['corporate_plan_id'], // Plan
|
||||||
|
// $row['code'], // Customer plans
|
||||||
|
// $row['type'], // Plan Type
|
||||||
|
// $row['start'], // Start Date of Plan
|
||||||
|
// $row['end'], // End Date of Plan
|
||||||
|
// $row['require_referral'], // Referral
|
||||||
|
// $row['referral_source'], // Referral Source
|
||||||
|
// $row['referral_duration'], // Referral Duration
|
||||||
|
// $row['family_plan'], // Family Plan
|
||||||
|
// $row['family_plan_share_rules'], // Family Sharing Overflow
|
||||||
|
// $row['limit_rules'], // Plan Limit
|
||||||
|
// $row['layer'], // Layer ID
|
||||||
|
// $row['layer_conditions'], // Layer Condition
|
||||||
|
// $row['budget_type'], // Budget Type
|
||||||
|
// $row['budget_code'], // Budget Code
|
||||||
|
// $row['budget_conditions'], // Budget Condition
|
||||||
|
// $row['surgery_limit'], // Surgery
|
||||||
|
// $row['non_surgery_limit'], // Non Surgery
|
||||||
|
// $row['max_claim_limit'], // Max/Claim
|
||||||
|
// $row['max_claim_count'], // Max Count of Claim
|
||||||
|
// $row['area_limit'], // Area
|
||||||
|
// $row['limit_shared_plans'], // Shared Plan
|
||||||
|
// $row['limit_shared_plan_type'], // Shared Plan Type
|
||||||
|
// $row['cashless_percentage'], // Cashless(%)
|
||||||
|
// $row['reimbursement_percentage'], // Reimbursement(%)
|
||||||
|
// $row['digital_percentage'], // Digital(%)
|
||||||
|
// $row['co_share_m_percentage'], // CoShareM(%)
|
||||||
|
// $row['co_share_s_percentage'], // CoShareS(%)
|
||||||
|
// $row['co_share_c_percentage'], // CoShareC(%)
|
||||||
|
// $row['cashless_deductible'], // Cashless Deductible
|
||||||
|
// $row['cashless_deductible'], // Reimbursement Deductible
|
||||||
|
// $row['digital_deductible'], // Digital Deductible
|
||||||
|
// $row['co_share_m_deductible'], // DeductibleM
|
||||||
|
// $row['co_share_s_deductible'], // DeductibleS
|
||||||
|
// $row['co_share_c_deductible'], // DeductibleC
|
||||||
|
// $row['co_share_deductible_condition'], // Co-share & Deductible Condition
|
||||||
|
// $row['msc'], // MSC
|
||||||
|
// $row['genders'], // Gender
|
||||||
|
// $row['min_age'], // Min Age
|
||||||
|
// $row['max_age'], // Max Age
|
||||||
|
// $row['rule_of_excess'], // Rule of Excess
|
||||||
|
// $row['max_excess_covered'], // Max Excess Covered
|
||||||
|
// $row['prorate_type'], // Prorate Type
|
||||||
|
// $row['prorate_lookup'], // Prorate Lookup
|
||||||
|
// $row['currency'], // Currency
|
||||||
|
// $row['max_surgery_reinstatement_days'], // Reinstatement days for Surgery NonSurgery
|
||||||
|
// $row['max_surgery_periode_days'], // Max Periode of Surgery Non Surgery
|
||||||
|
// ];
|
||||||
|
// $row = WriterEntityFactory::createRowFromArray($rowData);
|
||||||
|
// $writer->addRow($row);
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
$writer->close();
|
||||||
|
|
||||||
|
return Helper::responseJson([
|
||||||
|
'file_name' => "Data Claim Report " . date('Y-m-d h:i:s'),
|
||||||
|
"file_url" => url('files/CorporatePlan&BenefitImportData.xlsx')
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ Route::prefix('internal')->group(function () {
|
|||||||
Route::post('claims', [ClaimController::class, 'store']);
|
Route::post('claims', [ClaimController::class, 'store']);
|
||||||
Route::get('claims/{id}', [ClaimController::class, 'show']);
|
Route::get('claims/{id}', [ClaimController::class, 'show']);
|
||||||
Route::post('check-limit', [ClaimController::class, 'checkLimit']);
|
Route::post('check-limit', [ClaimController::class, 'checkLimit']);
|
||||||
|
Route::get('claims/1/data-claim', [ClaimController::class, 'dataClaimReport']);
|
||||||
|
|
||||||
Route::get('search-organizations', [OrganizationController::class, 'searchOrganization']);
|
Route::get('search-organizations', [OrganizationController::class, 'searchOrganization']);
|
||||||
Route::get('search-specialities', [SpecialityController::class, 'searchSpeciality']);
|
Route::get('search-specialities', [SpecialityController::class, 'searchSpeciality']);
|
||||||
|
|||||||
@@ -51,6 +51,52 @@ class Claim extends Model
|
|||||||
'declined' => 'Declined'
|
'declined' => 'Declined'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public static $listing_doc_headers = [
|
||||||
|
// Pharmacy permit number Pharmacy Address Pharmacy phone number Delivery Address Claimable Status Benefit Code
|
||||||
|
'Count of Usage',
|
||||||
|
'Claim Number',
|
||||||
|
'Insurar Code',
|
||||||
|
'Policy no',
|
||||||
|
'Corporate Name',
|
||||||
|
'Plan Code',
|
||||||
|
'Member Name',
|
||||||
|
'Member Status',
|
||||||
|
'DOB', // date of brith
|
||||||
|
'Member Number',
|
||||||
|
'Institution Code',
|
||||||
|
'Invoice Line Number',
|
||||||
|
'Claim Status',
|
||||||
|
'Admission Date',
|
||||||
|
'Discharge Date',
|
||||||
|
'Date Of Service',
|
||||||
|
'Place Of Service',
|
||||||
|
'Los',
|
||||||
|
'Provider code',
|
||||||
|
'Treating Doctor Code',
|
||||||
|
'Treating Doctor Name',
|
||||||
|
'Doctor Title',
|
||||||
|
'Diagnosis',
|
||||||
|
'ServiceCode',
|
||||||
|
'ServiceType',
|
||||||
|
'ServiceDescription',
|
||||||
|
'UnitPrice',
|
||||||
|
'Quantity',
|
||||||
|
'Tarif',
|
||||||
|
'Claimable amount',
|
||||||
|
'Paid by customer',
|
||||||
|
'HD Disc',
|
||||||
|
'Doctor Notes',
|
||||||
|
'ConsultationID Date',
|
||||||
|
'Pharmacy Code',
|
||||||
|
'Pharmacy Name',
|
||||||
|
'Pharmacy Permit Number',
|
||||||
|
'Pharmacy Address',
|
||||||
|
'Pharmacy Phone number',
|
||||||
|
'Delivery Address',
|
||||||
|
'Claimable Status',
|
||||||
|
'Benefit Code',
|
||||||
|
];
|
||||||
|
|
||||||
protected static function boot()
|
protected static function boot()
|
||||||
{
|
{
|
||||||
parent::boot();
|
parent::boot();
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const navConfig = [
|
|||||||
title: 'CLAIM MANAGEMENT',
|
title: 'CLAIM MANAGEMENT',
|
||||||
path: '/claims',
|
path: '/claims',
|
||||||
// children: [
|
// children: [
|
||||||
// { title: 'Request', path: '/case-request' },
|
// { title: 'Report', path: '/case-report' },
|
||||||
// ],
|
// ],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,16 +15,17 @@ import {
|
|||||||
Stack,
|
Stack,
|
||||||
Menu,
|
Menu,
|
||||||
ButtonGroup,
|
ButtonGroup,
|
||||||
Link,
|
Tooltip,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||||
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
|
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
|
||||||
import AddIcon from '@mui/icons-material/Add';
|
import AddIcon from '@mui/icons-material/Add';
|
||||||
|
import AssessmentIcon from '@mui/icons-material/Assessment';
|
||||||
import UploadIcon from '@mui/icons-material/Upload';
|
import UploadIcon from '@mui/icons-material/Upload';
|
||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
import CancelIcon from '@mui/icons-material/Cancel';
|
||||||
// hooks
|
// hooks
|
||||||
import React, { ChangeEvent, useEffect, useRef, useState } from 'react';
|
import React, { ChangeEvent, useEffect, useRef, useState } from 'react';
|
||||||
import { Navigate, useNavigate, useSearchParams } from 'react-router-dom';
|
import { Link, Navigate, useNavigate, useSearchParams } from 'react-router-dom';
|
||||||
// components
|
// components
|
||||||
import axios from '../../utils/axios';
|
import axios from '../../utils/axios';
|
||||||
import { LaravelPaginatedData, LaravelPaginatedDataDefault } from '../../@types/paginated-data';
|
import { LaravelPaginatedData, LaravelPaginatedDataDefault } from '../../@types/paginated-data';
|
||||||
@@ -55,6 +56,17 @@ export default function List() {
|
|||||||
props.onSearch({ search: searchText }); // Trigger to Parent
|
props.onSearch({ search: searchText }); // Trigger to Parent
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleGetData = (type :string) => {
|
||||||
|
axios.get(`claims/1/data-claim`)
|
||||||
|
.then((response) => {
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = response.data.data.file_url;
|
||||||
|
link.setAttribute('download', response.data.data.file_name);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Trigger First Search
|
// Trigger First Search
|
||||||
setSearchText(searchParams.get('search') ?? '');
|
setSearchText(searchParams.get('search') ?? '');
|
||||||
@@ -62,15 +74,20 @@ export default function List() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={handleSearchSubmit} style={{ width: '100%' }}>
|
<form onSubmit={handleSearchSubmit} style={{ width: '100%' }}>
|
||||||
<TextField
|
<Stack direction={'row'} spacing={2} sx={{ mb: 2 }}>
|
||||||
id="search-input"
|
<TextField
|
||||||
ref={searchInput}
|
id="search-input"
|
||||||
label="Search"
|
ref={searchInput}
|
||||||
variant="outlined"
|
label="Search"
|
||||||
fullWidth
|
variant="outlined"
|
||||||
onChange={handleSearchChange}
|
fullWidth
|
||||||
value={searchText}
|
onChange={handleSearchChange}
|
||||||
/>
|
value={searchText}
|
||||||
|
/>
|
||||||
|
<Tooltip title="Export Excel">
|
||||||
|
<Button variant="outlined" startIcon={<AssessmentIcon />} sx={{ p: 1.8 }} onClick={handleGetData}/>
|
||||||
|
</Tooltip>
|
||||||
|
</Stack>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user