improvement uat 1
This commit is contained in:
@@ -14,6 +14,7 @@ class MemberResources extends JsonResource
|
|||||||
*/
|
*/
|
||||||
public function toArray($request)
|
public function toArray($request)
|
||||||
{
|
{
|
||||||
|
// dd($this->currentPlans);
|
||||||
return [
|
return [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'memberId' => $this->member_id,
|
'memberId' => $this->member_id,
|
||||||
@@ -25,6 +26,7 @@ class MemberResources extends JsonResource
|
|||||||
'percentage' => (!empty($this->currentPlan->limit_rules ?? 0)) ? (($this->claims_sum_total_claim / $this->currentPlan->limit_rules) * 100) : 0
|
'percentage' => (!empty($this->currentPlan->limit_rules ?? 0)) ? (($this->claims_sum_total_claim / $this->currentPlan->limit_rules) * 100) : 0
|
||||||
],
|
],
|
||||||
'status' => $this->active,
|
'status' => $this->active,
|
||||||
|
'service_type' => $this->currentPlans,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,12 +201,21 @@ class ClaimRequestController extends Controller
|
|||||||
{
|
{
|
||||||
$claimRequest = ClaimRequest::findOrFail($claim_request_id);
|
$claimRequest = ClaimRequest::findOrFail($claim_request_id);
|
||||||
|
|
||||||
|
$service_code = $claimRequest->service_code;
|
||||||
if ($claimRequest->status != 'approved') {
|
if ($claimRequest->status != 'approved') {
|
||||||
throw new Exception("Belum Teverifikasi", 1);
|
throw new Exception("Belum Teverifikasi", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$member = Member::findOrFail($claimRequest->member_id)
|
$member = Member::findOrFail($claimRequest->member_id)
|
||||||
->load(['currentPlan', 'currentPolicy', 'currentPlan.corporateBenefits', 'currentPlan.corporateBenefits.benefit']);
|
->load([
|
||||||
|
// 'currentPlan',
|
||||||
|
'currentPlan' => function ($plan) use ($claim_request_id, $service_code) {
|
||||||
|
$plan->where('plans.service_code', $service_code);
|
||||||
|
},
|
||||||
|
'currentPolicy',
|
||||||
|
'currentPlan.corporateBenefits',
|
||||||
|
'currentPlan.corporateBenefits.benefit'
|
||||||
|
]);
|
||||||
|
|
||||||
$pdf = PDF::loadView('pdf.guaranted_leter', compact('member', 'claimRequest'));
|
$pdf = PDF::loadView('pdf.guaranted_leter', compact('member', 'claimRequest'));
|
||||||
return $pdf->download('Guaranted Letter - '.$member->full_name.'.pdf');
|
return $pdf->download('Guaranted Letter - '.$member->full_name.'.pdf');
|
||||||
|
|||||||
@@ -33,11 +33,17 @@ class ClaimController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
|
$serviceCode = 'IP';
|
||||||
$claims = Claim::with([
|
$claims = Claim::with([
|
||||||
'member',
|
'member',
|
||||||
'member.currentCorporate',
|
'member.currentCorporate',
|
||||||
'member.currentCorporate.currentPolicy',
|
'member.currentCorporate.currentPolicy',
|
||||||
'member.currentPlan',
|
// 'member.currentPlan' => function($memberPlan) use ($serviceCode) {
|
||||||
|
// $memberPlan->where('plans.service_code', $serviceCode);
|
||||||
|
// },
|
||||||
|
'member.currentPlan' => function($memberPlan) {
|
||||||
|
$memberPlan->join('claim_requests', 'claim_requests.service_code', '=', 'plans.service_code');
|
||||||
|
},
|
||||||
'diagnoses' => function ($diagnosis) {
|
'diagnoses' => function ($diagnosis) {
|
||||||
$diagnosis->where('type', 'primary');
|
$diagnosis->where('type', 'primary');
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ class ClaimRequestController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $e->getMessage();;
|
return $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $claimRequest;
|
return $claimRequest;
|
||||||
@@ -643,20 +643,47 @@ class ClaimRequestController extends Controller
|
|||||||
$memberList = DB::table('members')
|
$memberList = DB::table('members')
|
||||||
->select('id','member_id','name')
|
->select('id','member_id','name')
|
||||||
->where("name", "like", "%$keyword%")
|
->where("name", "like", "%$keyword%")
|
||||||
|
->orWhere("member_id", "like", "%$keyword%")
|
||||||
->orderBy('created_at', 'asc')
|
->orderBy('created_at', 'asc')
|
||||||
->offset($offset)
|
->offset($offset)
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
$data = [];
|
||||||
|
if(count($memberList)>0){
|
||||||
|
$temp = [];
|
||||||
|
foreach($memberList as $d){
|
||||||
|
$serviceType = $this->getServiceMember($d->id);
|
||||||
|
$temp['id'] = $d->id;
|
||||||
|
$temp['member_id'] = $d->member_id;
|
||||||
|
$temp['name'] = $d->name;
|
||||||
|
$temp['service_type'] = $serviceType;
|
||||||
|
|
||||||
|
|
||||||
|
array_push($data, $temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'error' => false,
|
'error' => false,
|
||||||
'message' => "success",
|
'message' => "success",
|
||||||
'data' => [
|
'data' => [
|
||||||
'member_list'=> $memberList,
|
'member_list'=> $data,
|
||||||
]
|
]
|
||||||
],200);
|
],200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getServiceMember($id){
|
||||||
|
$service = DB::table('member_plans')
|
||||||
|
->select('plans.service_code as code', 'services.name')
|
||||||
|
->join('plans', 'member_plans.plan_id', '=', 'plans.id')
|
||||||
|
->join('services', 'plans.service_code', '=', 'services.code')
|
||||||
|
->where('member_id', $id)
|
||||||
|
->get()
|
||||||
|
->toArray();
|
||||||
|
return $service;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getNextCode()
|
public static function getNextCode()
|
||||||
{
|
{
|
||||||
// $last_number = ClaimRequest::max('code');
|
// $last_number = ClaimRequest::max('code');
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class CorporateMemberController extends Controller
|
|||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
* @return Renderable
|
* @return Renderable
|
||||||
*/
|
*/
|
||||||
public function index(Request $request, $corporate_id)
|
public function index(Request $request, $corporate_id )
|
||||||
{
|
{
|
||||||
$members = Member::query()
|
$members = Member::query()
|
||||||
->joinCorporateEmployees('left')
|
->joinCorporateEmployees('left')
|
||||||
@@ -44,7 +44,13 @@ class CorporateMemberController extends Controller
|
|||||||
// return $claim->whereBetween('requested_at', [now()->startOfYear(), now()->endOfYear()]);
|
// return $claim->whereBetween('requested_at', [now()->startOfYear(), now()->endOfYear()]);
|
||||||
// return $claim->used(now()->startOfYear(), now()->endOfYear());
|
// return $claim->used(now()->startOfYear(), now()->endOfYear());
|
||||||
},
|
},
|
||||||
|
'currentPlans',
|
||||||
'currentPlan',
|
'currentPlan',
|
||||||
|
// 'currentPlan' => function ($currentPlan) use ($service_code){
|
||||||
|
// return $currentPlan->where([
|
||||||
|
// 'plans.service_code' => $service_code
|
||||||
|
// ]);
|
||||||
|
// },
|
||||||
'currentPlan.benefits' => function ($benefit) use ($corporate_id){
|
'currentPlan.benefits' => function ($benefit) use ($corporate_id){
|
||||||
return $benefit->where([
|
return $benefit->where([
|
||||||
'corporate_benefits.active' => 1,
|
'corporate_benefits.active' => 1,
|
||||||
|
|||||||
@@ -273,6 +273,10 @@ Route::prefix('internal')->group(function () {
|
|||||||
Route::get('claim-requests/detail/{id}', [ClaimRequestController::class, 'claimRequestDetail']);
|
Route::get('claim-requests/detail/{id}', [ClaimRequestController::class, 'claimRequestDetail']);
|
||||||
Route::post('claim-requests/{id}/invoice-files', [ClaimRequestController::class, 'invoiceFiles']);
|
Route::post('claim-requests/{id}/invoice-files', [ClaimRequestController::class, 'invoiceFiles']);
|
||||||
Route::post('claim-requests/{id}/request-files', [ClaimRequestController::class, 'requestFiles']);
|
Route::post('claim-requests/{id}/request-files', [ClaimRequestController::class, 'requestFiles']);
|
||||||
|
|
||||||
|
Route::get('claim-requests/service/{id}', [ClaimRequestController::class, 'getServiceMember']);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('province', [ProvinceController::class, 'index']);
|
Route::get('province', [ProvinceController::class, 'index']);
|
||||||
|
|||||||
@@ -732,12 +732,25 @@ class MemberEnrollmentService
|
|||||||
|
|
||||||
// Validate If Plan Exist
|
// Validate If Plan Exist
|
||||||
// TODO validate corporate plan
|
// TODO validate corporate plan
|
||||||
$plan = Plan::query()
|
$plans = explode(",",$row['plan_id']);
|
||||||
->where('code', $row['plan_id'])
|
if (count($plans) > 0) {
|
||||||
->where('corporate_id', $corporate->id)
|
foreach($plans as $d){
|
||||||
->first();
|
$plan = Plan::query()
|
||||||
if (!$plan) {
|
->where('code', $d)
|
||||||
throw new ImportRowException(__('enrollment.PLAN_NOT_FOUND'), 0, null, $row);
|
->where('corporate_id', $corporate->id)
|
||||||
|
->first();
|
||||||
|
if (!$plan) {
|
||||||
|
throw new ImportRowException(__('enrollment.PLAN_NOT_FOUND'), 0, null, $row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$plan = Plan::query()
|
||||||
|
->where('code', $row['plan_id'])
|
||||||
|
->where('corporate_id', $corporate->id)
|
||||||
|
->first();
|
||||||
|
if (!$plan) {
|
||||||
|
throw new ImportRowException(__('enrollment.PLAN_NOT_FOUND'), 0, null, $row);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -788,12 +801,40 @@ class MemberEnrollmentService
|
|||||||
'status' => $row['employment_status']
|
'status' => $row['employment_status']
|
||||||
]);
|
]);
|
||||||
// Bisa disini penyebab data dobel
|
// Bisa disini penyebab data dobel
|
||||||
$member->memberPlans()->create([
|
|
||||||
'plan_id' => $plan->id,
|
$plans = explode(",",$row['plan_id']);
|
||||||
'status' => 'active',
|
if (count($plans) > 0) {
|
||||||
'start' => $this->dateParser($row['member_effective_date']),
|
foreach($plans as $d){
|
||||||
'end' => $this->dateParser($row['member_expiry_date']),
|
$plan = Plan::query()
|
||||||
]);
|
->where('code', $d)
|
||||||
|
->where('corporate_id', $corporate->id)
|
||||||
|
->first();
|
||||||
|
if (!$plan) {
|
||||||
|
throw new ImportRowException(__('enrollment.PLAN_NOT_FOUND'), 0, null, $row);
|
||||||
|
}
|
||||||
|
$member->memberPlans()->create([
|
||||||
|
'plan_id' => $plan->id,
|
||||||
|
'status' => 'active',
|
||||||
|
'start' => $this->dateParser($row['member_effective_date']),
|
||||||
|
'end' => $this->dateParser($row['member_expiry_date']),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$plan = Plan::query()
|
||||||
|
->where('code', $row['plan_id'])
|
||||||
|
->where('corporate_id', $corporate->id)
|
||||||
|
->first();
|
||||||
|
if (!$plan) {
|
||||||
|
throw new ImportRowException(__('enrollment.PLAN_NOT_FOUND'), 0, null, $row);
|
||||||
|
}
|
||||||
|
$member->memberPlans()->create([
|
||||||
|
'plan_id' => $plan->id,
|
||||||
|
'status' => 'active',
|
||||||
|
'start' => $this->dateParser($row['member_effective_date']),
|
||||||
|
'end' => $this->dateParser($row['member_expiry_date']),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
DB::commit();
|
DB::commit();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|||||||
@@ -148,18 +148,35 @@ class Member extends Model
|
|||||||
return $this->hasManyThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id');
|
return $this->hasManyThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function currentPlan()
|
public function currentPlans()
|
||||||
{
|
{
|
||||||
return $this->hasManyThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id');
|
return $this->hasManyThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id');
|
||||||
// ->latest(); // TODO Fix This
|
// ->latest(); // TODO Fix This
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function currentPlan()
|
||||||
|
{
|
||||||
|
return $this->hasOneThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id', )
|
||||||
|
->latest();
|
||||||
|
// ->where('plans.service_code', $this->claimRequest->service_code); // TODO Fix This
|
||||||
|
}
|
||||||
|
|
||||||
// public function currentPlan()
|
// public function currentPlan()
|
||||||
// {
|
// {
|
||||||
// return $this->hasOneThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id')
|
// return $this->hasOneThrough(
|
||||||
// ->latest(); // TODO Fix This
|
// Plan::class,
|
||||||
|
// MemberPlan::class,
|
||||||
|
// 'member_id',
|
||||||
|
// 'id',
|
||||||
|
// 'id',
|
||||||
|
// 'plan_id'
|
||||||
|
// )
|
||||||
|
// ->join('claim_requests', 'claim_requests.service_code', '=', 'plans.service_code')
|
||||||
|
// ->latest('claim_requests.created_at') // Atau sesuaikan dengan kolom timestamp yang sesuai
|
||||||
|
// ->select('plans.*');
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
public function currentEmployeds()
|
public function currentEmployeds()
|
||||||
{
|
{
|
||||||
return $this->hasOneThrough(CorporateEmployee::class, Person::class, 'nik', 'id', 'id', 'nik')
|
return $this->hasOneThrough(CorporateEmployee::class, Person::class, 'nik', 'id', 'id', 'nik')
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class CorporateMemberService
|
|||||||
// ->joinClaimRequests('right')
|
// ->joinClaimRequests('right')
|
||||||
->joinCorporateEmployees('left')
|
->joinCorporateEmployees('left')
|
||||||
->joinCorporateDivisions('left')
|
->joinCorporateDivisions('left')
|
||||||
->with('currentPlan')
|
->with('currentPlans')
|
||||||
->withSum('claims', 'total_claim')
|
->withSum('claims', 'total_claim')
|
||||||
->whereHas('employeds', function (Builder $corporateEmployee) use ($corporateId) {
|
->whereHas('employeds', function (Builder $corporateEmployee) use ($corporateId) {
|
||||||
$corporateEmployee->where('corporate_id', $corporateId);
|
$corporateEmployee->where('corporate_id', $corporateId);
|
||||||
@@ -125,7 +125,7 @@ class CorporateMemberService
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
// ->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active', 'claim_requests.id', 'claim_requests.member_id', 'claim_requests.submission_date'])
|
// ->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active', 'claim_requests.id', 'claim_requests.member_id', 'claim_requests.submission_date'])
|
||||||
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active'])
|
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active', ])
|
||||||
->paginate($limit);
|
->paginate($limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ class CorporateMemberService
|
|||||||
|
|
||||||
$query->getQuery()->orderBy($orderBy, $request->order);
|
$query->getQuery()->orderBy($orderBy, $request->order);
|
||||||
})
|
})
|
||||||
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'member_plans.start AS start_date', 'member_plans.end AS end_date', 'plans.active', 'plans.service_code'])
|
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'members.members_effective_date AS start_date', 'members.members_expire_date AS end_date', 'plans.active', 'plans.service_code'])
|
||||||
->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`")
|
->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`")
|
||||||
->paginate($limit);
|
->paginate($limit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ const DialogDetailClaim = ({ title, openDialog, setOpenDialog, data }: MuiDialog
|
|||||||
personID: item.memberId,
|
personID: item.memberId,
|
||||||
personName: item.fullName,
|
personName: item.fullName,
|
||||||
typePatient: 'IP',
|
typePatient: 'IP',
|
||||||
|
service_type: item.service_type,
|
||||||
anotherDocument: [],
|
anotherDocument: [],
|
||||||
fileRealInvoice: [],
|
fileRealInvoice: [],
|
||||||
laboratoryResult: [],
|
laboratoryResult: [],
|
||||||
@@ -275,71 +276,46 @@ const DialogDetailClaim = ({ title, openDialog, setOpenDialog, data }: MuiDialog
|
|||||||
<Grid item xs={12} key={index}>
|
<Grid item xs={12} key={index}>
|
||||||
<Card sx={{ p: 3 }}>
|
<Card sx={{ p: 3 }}>
|
||||||
<Grid container spacing={4} key={index}>
|
<Grid container spacing={4} key={index}>
|
||||||
|
|
||||||
<Grid item xs={12} paddingX="24px" paddingY="20px">
|
<Grid item xs={12} paddingX="24px" paddingY="20px">
|
||||||
<Stack direction="row" spacing={4}>
|
<Stack direction="row" spacing={4}>
|
||||||
<Button
|
{row.service_type.map((r, i) => {
|
||||||
sx={{
|
return(
|
||||||
padding: 2,
|
<Button
|
||||||
width: '50%',
|
sx={{
|
||||||
border:
|
padding: 2,
|
||||||
row.typePatient === 'OP' ? '1px solid #919EAB52' : '1px solid #19BBBB',
|
width: '50%',
|
||||||
}}
|
border:
|
||||||
variant="outlined"
|
row.typePatient === r.service_code ? '1px solid #919EAB52' : '1px solid #19BBBB',
|
||||||
color={row.typePatient === 'IP' ? 'primary' : 'inherit'}
|
}}
|
||||||
onClick={() => {
|
variant="outlined"
|
||||||
handleServiceCode(row);
|
color={row.typePatient === r.service_code ? 'primary' : 'inherit'}
|
||||||
}}
|
onClick={() => {
|
||||||
>
|
handleServiceCode(row);
|
||||||
Inpatient
|
}}
|
||||||
</Button>
|
>
|
||||||
<Button
|
{r.service_code == 'IP' ? 'Inpatient' : 'Outpatient'}
|
||||||
sx={{
|
</Button>
|
||||||
padding: 2,
|
|
||||||
width: '50%',
|
)
|
||||||
border:
|
})}
|
||||||
row.typePatient === 'IP' ? '1px solid #919EAB52' : '1px solid #19BBBB',
|
{/* <Button
|
||||||
}}
|
sx={{
|
||||||
variant="outlined"
|
padding: 2,
|
||||||
color={row.typePatient === 'OP' ? 'primary' : 'inherit'}
|
width: '50%',
|
||||||
onClick={() => {
|
border:
|
||||||
handleServiceCode(row);
|
row.typePatient === 'IP' ? '1px solid #919EAB52' : '1px solid #19BBBB',
|
||||||
}}
|
}}
|
||||||
>
|
variant="outlined"
|
||||||
Outpatient
|
color={row.typePatient === 'OP' ? 'primary' : 'inherit'}
|
||||||
</Button>
|
onClick={() => {
|
||||||
</Stack>
|
handleServiceCode(row);
|
||||||
</Grid>
|
}}
|
||||||
<Grid item xs={12}>
|
>
|
||||||
<Card sx={{ p: 2 }}>
|
Outpatient
|
||||||
<Stack direction="row" alignContent={'center'}>
|
</Button> */}
|
||||||
<Avatar
|
|
||||||
src="https://minimal-assets-api.vercel.app/assets/images/avatars/avatar_5.jpg"
|
|
||||||
alt={'test'}
|
|
||||||
sx={{ margin: 1, width: 56, height: 56 }}
|
|
||||||
/>
|
|
||||||
<Stack sx={{ p: 1 }}>
|
|
||||||
<Typography variant="h5">{row.personName}</Typography>
|
|
||||||
<Typography variant="subtitle1" color="#637381">
|
|
||||||
{row.personID}
|
|
||||||
</Typography>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
{/* <Stack sx={{ p: 1 }}>
|
</Grid>
|
||||||
<Typography variant="body1" sx={{ marginBottom: 1, fontWeight: 600 }}>
|
|
||||||
Total Limit
|
|
||||||
</Typography>
|
|
||||||
<BorderLinearProgress
|
|
||||||
variant="determinate"
|
|
||||||
value={row.limit && row.limit.percentage}
|
|
||||||
sx={{ mb: 1 }}
|
|
||||||
/>
|
|
||||||
<Typography sx={{ textAlign: 'right', marginTop: 1 }}>
|
|
||||||
{fCurrency(8000000)} / {fCurrency(100000)}
|
|
||||||
</Typography>
|
|
||||||
</Stack> */}
|
|
||||||
</Stack>
|
|
||||||
</Card>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
{/* REAL INVOICE */}
|
{/* REAL INVOICE */}
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ export default function CardFamilyInformation({ data }) {
|
|||||||
Date of Birth
|
Date of Birth
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2" sx={{ fontWeight: 500 }}>
|
<Typography variant="body2" sx={{ fontWeight: 500 }}>
|
||||||
{familyMember?.birth_date ? fDate(familyMember?.birth_date) : ''}
|
{familyMember?.birth_date != '0000-00-00' ? fDate(familyMember?.birth_date) : '-'}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<Stack
|
||||||
|
|||||||
@@ -20,6 +20,6 @@ export type Member = {
|
|||||||
relation_with_principal: string,
|
relation_with_principal: string,
|
||||||
bpjs_class: string,
|
bpjs_class: string,
|
||||||
active: string,
|
active: string,
|
||||||
current_plan: Plan,
|
current_plans: Plan,
|
||||||
current_corporate: Corporate,
|
current_corporate: Corporate,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import FormCreateFilesUpload from './FormCreateFilesUpload';
|
|||||||
import useLoadOnScroll from '@/hooks/useLoadOnScroll';
|
import useLoadOnScroll from '@/hooks/useLoadOnScroll';
|
||||||
import useCollapseDrawer from '@/hooks/useCollapseDrawer';
|
import useCollapseDrawer from '@/hooks/useCollapseDrawer';
|
||||||
import FormCreateBtnChoose from './FormCreateBtnChoose';
|
import FormCreateBtnChoose from './FormCreateBtnChoose';
|
||||||
|
import axios from '../../../utils/axios';
|
||||||
|
|
||||||
export default function FormCreate() {
|
export default function FormCreate() {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
@@ -72,10 +73,9 @@ export default function FormCreate() {
|
|||||||
if (data.id == list.id) {
|
if (data.id == list.id) {
|
||||||
list.patien_type = type
|
list.patien_type = type
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
})
|
})
|
||||||
|
|
||||||
setListChoosed(newListChoosed)
|
setListChoosed(newListChoosed)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,6 +166,8 @@ export default function FormCreate() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let isDirty = listChoosed.some((row) => {
|
let isDirty = listChoosed.some((row) => {
|
||||||
if (row.patien_type == undefined) {
|
if (row.patien_type == undefined) {
|
||||||
return true
|
return true
|
||||||
@@ -251,34 +253,26 @@ export default function FormCreate() {
|
|||||||
</Label>
|
</Label>
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{/* Patien Type */}
|
{/* Patien Type */}
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
<Grid item xs={6}>
|
{row.service_type.map((r,i) => {
|
||||||
<Button
|
const code = r.code
|
||||||
sx={{ padding: 2, width: '100%',border: row.patien_type === 'IP' ? '1px solid #19BBBB' : '1px solid #919EAB52' }}
|
return (
|
||||||
variant="outlined"
|
<Grid item xs={6}>
|
||||||
color={row.patien_type === 'IP' ? 'primary' : 'inherit'}
|
<Button
|
||||||
onClick={() => {
|
sx={{ padding: 2, width: '100%',border: row.patien_type === code ? '1px solid #19BBBB' : '1px solid #919EAB52' }}
|
||||||
handleChoosePatienType(row, 'IP')
|
variant="outlined"
|
||||||
}}
|
color={row.patien_type === code ? 'primary' : 'inherit'}
|
||||||
>
|
onClick={() => {
|
||||||
Inpatient
|
handleChoosePatienType(row, code)
|
||||||
</Button>
|
}}
|
||||||
</Grid>
|
>
|
||||||
<Grid item xs={6}>
|
{r.name}
|
||||||
<Button
|
</Button>
|
||||||
sx={{ padding: 2, width: '100%',border: row.patien_type === 'OP' ? '1px solid #19BBBB' : '1px solid #919EAB52' }}
|
</Grid>
|
||||||
variant="outlined"
|
)
|
||||||
color={row.patien_type === 'OP' ? 'primary' : 'inherit'}
|
})}
|
||||||
onClick={() => {
|
|
||||||
handleChoosePatienType(row, 'OP')
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Outpatient
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export default function FormCreateBtnUpload ({handleChangeInputProp}: Props) {
|
|||||||
style={{ display: 'none' }}
|
style={{ display: 'none' }}
|
||||||
multiple
|
multiple
|
||||||
onChange={(event) => handleChangeInputProp(event.target.files ? event.target.files[0] : {})}
|
onChange={(event) => handleChangeInputProp(event.target.files ? event.target.files[0] : {})}
|
||||||
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain, application/pdf"
|
accept="application/pdf"
|
||||||
/>
|
/>
|
||||||
</ButtonBase>
|
</ButtonBase>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -92,17 +92,17 @@ export default function Detail() {
|
|||||||
setOpenDialogSubmit(false);
|
setOpenDialogSubmit(false);
|
||||||
}
|
}
|
||||||
const handleSubmitData = () => {
|
const handleSubmitData = () => {
|
||||||
if(fileInvoices.length > 0)
|
// if(fileInvoices.length > 0)
|
||||||
{
|
// {
|
||||||
//submit data
|
//submit data
|
||||||
axios
|
axios
|
||||||
.post('claim-requests/'+id+'/approve')
|
.post('claim-requests/'+id+'/approve')
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
enqueueSnackbar('Success Submit Claim Request', { variant: 'success' });
|
enqueueSnackbar('Success Submit Claim Request', { variant: 'success' });
|
||||||
setOpenDialogSubmit(false);
|
setOpenDialogSubmit(false);
|
||||||
})
|
})
|
||||||
.catch(({ response }) => {
|
.catch(({ response }) => {
|
||||||
enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
|
enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
|
||||||
});
|
});
|
||||||
//Upload file invoices
|
//Upload file invoices
|
||||||
const formData = makeFormData({
|
const formData = makeFormData({
|
||||||
@@ -117,11 +117,11 @@ export default function Detail() {
|
|||||||
.catch(({ response }) => {
|
.catch(({ response }) => {
|
||||||
enqueueSnackbar(response.data.message ?? 'Something Went Wrong', { variant: 'error' });
|
enqueueSnackbar(response.data.message ?? 'Something Went Wrong', { variant: 'error' });
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
enqueueSnackbar('Please upload file invoice, before submit', { variant: 'warning' });
|
// enqueueSnackbar('Please upload file invoice, before submit', { variant: 'warning' });
|
||||||
}
|
// }
|
||||||
|
|
||||||
setTimeout(() =>
|
setTimeout(() =>
|
||||||
{
|
{
|
||||||
@@ -158,7 +158,7 @@ export default function Detail() {
|
|||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
{!check_invoice ? (
|
{check_invoice ? (
|
||||||
<Grid item xs={12} md={12}>
|
<Grid item xs={12} md={12}>
|
||||||
<Stack direction="row" alignItems="center">
|
<Stack direction="row" alignItems="center">
|
||||||
<Typography variant="subtitle1">Request Claim</Typography>
|
<Typography variant="subtitle1">Request Claim</Typography>
|
||||||
@@ -231,7 +231,7 @@ export default function Detail() {
|
|||||||
style={{ display: 'none' }}
|
style={{ display: 'none' }}
|
||||||
multiple
|
multiple
|
||||||
onChange={handleInvoiceInputChange}
|
onChange={handleInvoiceInputChange}
|
||||||
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain, application/pdf"
|
accept="application/pdf"
|
||||||
/>
|
/>
|
||||||
</ButtonBase>
|
</ButtonBase>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -12,8 +12,14 @@ export type MemberListType = {
|
|||||||
id : string,
|
id : string,
|
||||||
member_id : string,
|
member_id : string,
|
||||||
name : string,
|
name : string,
|
||||||
|
service_type : ServiceType[],
|
||||||
patien_type? : string,
|
patien_type? : string,
|
||||||
file_kondisi? : any[],
|
file_kondisi? : any[],
|
||||||
file_diagnosa? : any[],
|
file_diagnosa? : any[],
|
||||||
file_penunjang? : any[]
|
file_penunjang? : any[],
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ServiceType = {
|
||||||
|
code : string
|
||||||
|
name : string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ export default function Detail() {
|
|||||||
|
|
||||||
const defaultValues = useMemo(
|
const defaultValues = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
service_code: 'OP',
|
service_code: claim?.service_code,
|
||||||
secondary_diagnosis_id: [{
|
secondary_diagnosis_id: [{
|
||||||
value: {
|
value: {
|
||||||
name: "",
|
name: "",
|
||||||
|
|||||||
@@ -484,7 +484,18 @@ export default function CorporatePlanList({handleSubmitSuccess}) {
|
|||||||
<Typography variant='body2'>{row.name ? row.name : '-'}</Typography>
|
<Typography variant='body2'>{row.name ? row.name : '-'}</Typography>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Typography variant='body2'>{row.current_plan?.code}</Typography>
|
<Typography variant='body2'>
|
||||||
|
{/* {row.current_plan?.code} */}
|
||||||
|
{row.current_plans
|
||||||
|
? row.current_plans.map((plan, index) => (
|
||||||
|
<>
|
||||||
|
{plan.code}
|
||||||
|
{index < row.current_plans.length - 1 && ', '}
|
||||||
|
</>
|
||||||
|
))
|
||||||
|
: '-'}
|
||||||
|
|
||||||
|
</Typography>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Typography variant='body2'>{row.activation_date ? row.activation_date : '-'}</Typography>
|
<Typography variant='body2'>{row.activation_date ? row.activation_date : '-'}</Typography>
|
||||||
|
|||||||
Reference in New Issue
Block a user