Merge branch 'feature/flag-log-status' into staging
This commit is contained in:
@@ -237,6 +237,7 @@ class RequestLogController extends Controller
|
|||||||
'request_logs.service_code',
|
'request_logs.service_code',
|
||||||
'request_logs.specialities_id',
|
'request_logs.specialities_id',
|
||||||
'request_logs.dppj',
|
'request_logs.dppj',
|
||||||
|
'request_logs.log_type',
|
||||||
DB::raw('
|
DB::raw('
|
||||||
CASE
|
CASE
|
||||||
WHEN request_logs.status = "requested" THEN "requested"
|
WHEN request_logs.status = "requested" THEN "requested"
|
||||||
@@ -316,6 +317,7 @@ class RequestLogController extends Controller
|
|||||||
'members.id AS member_id',
|
'members.id AS member_id',
|
||||||
'request_logs.service_code',
|
'request_logs.service_code',
|
||||||
'members.birth_date',
|
'members.birth_date',
|
||||||
|
'request_logs.log_type',
|
||||||
DB::raw('
|
DB::raw('
|
||||||
CASE
|
CASE
|
||||||
WHEN request_logs.status_final_log = "requested" THEN "requested"
|
WHEN request_logs.status_final_log = "requested" THEN "requested"
|
||||||
@@ -375,14 +377,14 @@ class RequestLogController extends Controller
|
|||||||
DB::table('request_logs')
|
DB::table('request_logs')
|
||||||
->where('request_logs.id', '=', $request->request_logs_id)
|
->where('request_logs.id', '=', $request->request_logs_id)
|
||||||
->update([
|
->update([
|
||||||
'status_final_log' => 'requested',
|
'status_final_log' => $request->edit ? null : 'requested',
|
||||||
'final_log' => 1,
|
'final_log' => $request->edit ? 0 : 1,
|
||||||
'service_code' =>$request->service_code,
|
'service_code' =>$request->service_code,
|
||||||
'discharge_date' => $request->discharge_date,
|
'discharge_date' => $request->discharge_date,
|
||||||
'dppj' => $request->dppj,
|
'dppj' => $request->dppj,
|
||||||
'specialities_id' => $request->spescialis_id,
|
'specialities_id' => $request->spescialis_id,
|
||||||
'created_final_by'=> auth()->user()->id,
|
'created_final_by'=> $request->edit ? null : auth()->user()->id,
|
||||||
'created_final_at'=> date('Y-m-d H:i:s'),
|
'created_final_at'=> $request->edit ? null : date('Y-m-d H:i:s'),
|
||||||
]);
|
]);
|
||||||
if ($request->hasFile('result_files')) {
|
if ($request->hasFile('result_files')) {
|
||||||
foreach ($request->result_files as $file) {
|
foreach ($request->result_files as $file) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use Modules\HospitalPortal\Http\Middleware\Authentication;
|
|||||||
use Modules\HospitalPortal\Http\Middleware\Authorization;
|
use Modules\HospitalPortal\Http\Middleware\Authorization;
|
||||||
use Modules\Internal\Http\Controllers\Api\NavigationController;
|
use Modules\Internal\Http\Controllers\Api\NavigationController;
|
||||||
use Modules\Linksehat\Http\Controllers\Api\AutocompleteController;
|
use Modules\Linksehat\Http\Controllers\Api\AutocompleteController;
|
||||||
|
use Modules\Primaya\Http\Controllers\Api\MasterController;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -128,6 +129,8 @@ Route::prefix('v1')->group(function() {
|
|||||||
Route::get('get-claim-requests', [ClaimRequestController::class, 'get_claim_requests'])->name('claim-requests.get_claim_requests');
|
Route::get('get-claim-requests', [ClaimRequestController::class, 'get_claim_requests'])->name('claim-requests.get_claim_requests');
|
||||||
Route::get('detail-claim-requests/{id}', [ClaimRequestController::class, 'detail_claim_requests'])->name('claim-requests.detail_claim_requests');
|
Route::get('detail-claim-requests/{id}', [ClaimRequestController::class, 'detail_claim_requests'])->name('claim-requests.detail_claim_requests');
|
||||||
Route::post('claim-requests/{id}/request-files', [ClaimRequestController::class, 'requestFiles']);
|
Route::post('claim-requests/{id}/request-files', [ClaimRequestController::class, 'requestFiles']);
|
||||||
|
|
||||||
|
Route::get('organizations', [MasterController::class, 'organizations']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,16 @@ class OrganizationController extends Controller
|
|||||||
return response()->json(OrganizationResource::collection($organizations));
|
return response()->json(OrganizationResource::collection($organizations));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function organizations()
|
||||||
|
{
|
||||||
|
$data = Organization::hospital()->select('id', 'name', 'code')->get();
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'status' => 'success',
|
||||||
|
'data' => OrganizationResource::collection($data)
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the form for creating a new resource.
|
* Show the form for creating a new resource.
|
||||||
* @return Renderable
|
* @return Renderable
|
||||||
|
|||||||
@@ -517,9 +517,7 @@ class RequestLogController extends Controller
|
|||||||
} else {
|
} else {
|
||||||
$requestLog->diagnosis = '';
|
$requestLog->diagnosis = '';
|
||||||
}
|
}
|
||||||
if (!empty($request->status)) {
|
|
||||||
$requestLog->status_final_log = $status;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($request->reason)) {
|
if (!empty($request->reason)) {
|
||||||
$requestLog->reason_final = $request->reason;
|
$requestLog->reason_final = $request->reason;
|
||||||
@@ -529,9 +527,25 @@ class RequestLogController extends Controller
|
|||||||
$requestLog->type_of_member = $request->type_of_member;
|
$requestLog->type_of_member = $request->type_of_member;
|
||||||
}
|
}
|
||||||
|
|
||||||
$requestLog->final_log = 1;
|
if (!empty($request->organization_id)){
|
||||||
$requestLog->approved_final_log_by = auth()->user()->id;
|
$requestLog->organization_id = $request->organization_id;
|
||||||
$requestLog->approved_final_log_at = Carbon::now();
|
}
|
||||||
|
|
||||||
|
if(empty($request->edit)) {
|
||||||
|
if (!empty($request->status)) {
|
||||||
|
$requestLog->status_final_log = $status;
|
||||||
|
if($request->status == 'requested') {
|
||||||
|
$requestLog->final_log = 1;
|
||||||
|
$requestLog->created_final_by = auth()->user()->id;
|
||||||
|
$requestLog->created_final_at = date('Y-m-d H:i:s');
|
||||||
|
}
|
||||||
|
if($request->status == 'approved') {
|
||||||
|
$requestLog->approved_final_log_by = auth()->user()->id;
|
||||||
|
$requestLog->approved_final_log_at = Carbon::now();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if($requestLog->service_code != 'IP'){
|
// if($requestLog->service_code != 'IP'){
|
||||||
// $requestLog->discharge_date = Carbon::now();
|
// $requestLog->discharge_date = Carbon::now();
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ use Modules\Internal\Http\Controllers\ClaimEncounterController;
|
|||||||
use Modules\Linksehat\Http\Controllers\Api\AutocompleteController;
|
use Modules\Linksehat\Http\Controllers\Api\AutocompleteController;
|
||||||
use Modules\HospitalPortal\Http\Controllers\Api\MemberController as MemberControllerHospitalPortal;
|
use Modules\HospitalPortal\Http\Controllers\Api\MemberController as MemberControllerHospitalPortal;
|
||||||
use Modules\HospitalPortal\Http\Controllers\Api\RequestLogController as RequestLogControllerHospitalPortal;
|
use Modules\HospitalPortal\Http\Controllers\Api\RequestLogController as RequestLogControllerHospitalPortal;
|
||||||
|
use Modules\Primaya\Http\Controllers\Api\MasterController;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -397,6 +398,8 @@ Route::prefix('internal')->group(function () {
|
|||||||
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']);
|
||||||
Route::resource('organizations', OrganizationController::class);
|
Route::resource('organizations', OrganizationController::class);
|
||||||
|
Route::get('organizations', [MasterController::class, 'organizations']);
|
||||||
|
|
||||||
Route::resource('appointments', AppointmentController::class);
|
Route::resource('appointments', AppointmentController::class);
|
||||||
Route::get('live-chat/export', [LivechatController::class, 'export']);
|
Route::get('live-chat/export', [LivechatController::class, 'export']);
|
||||||
Route::resource('live-chat', LivechatController::class);
|
Route::resource('live-chat', LivechatController::class);
|
||||||
|
|||||||
@@ -245,14 +245,13 @@ class CorporateService
|
|||||||
->where('corporate_plan_id', $benefit_data['plan_code'])
|
->where('corporate_plan_id', $benefit_data['plan_code'])
|
||||||
->first();
|
->first();
|
||||||
$benefit_data['plan_code'] = $plan->id;
|
$benefit_data['plan_code'] = $plan->id;
|
||||||
$benefit = Benefit::updateOrCreate([
|
$benefit = Benefit::firstOrCreate([
|
||||||
'code' => $benefit_data['code'],
|
'code' => $benefit_data['code'],
|
||||||
'service_code' => $plan->service_code,
|
'service_code' => $plan->service_code,
|
||||||
], [
|
], [
|
||||||
'code' => $benefit_data['code'],
|
'description' => $benefit_data['description'], // hanya initial
|
||||||
'service_code' => $plan->service_code,
|
|
||||||
'description' => $benefit_data['description'],
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$corporateBenefit = $corporate->corporateBenefits()->updateOrCreate([
|
$corporateBenefit = $corporate->corporateBenefits()->updateOrCreate([
|
||||||
'benefit_id' => $benefit->id,
|
'benefit_id' => $benefit->id,
|
||||||
'plan_id' => $plan->id,
|
'plan_id' => $plan->id,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use App\Models\ClaimRequest;
|
|||||||
use App\Models\Icd;
|
use App\Models\Icd;
|
||||||
use App\Models\Speciality;
|
use App\Models\Speciality;
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
|
use App\Models\Corporate;
|
||||||
use App\Models\CorporatePolicy;
|
use App\Models\CorporatePolicy;
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
@@ -135,6 +136,8 @@ class RequestLogShowResource extends JsonResource
|
|||||||
} else {
|
} else {
|
||||||
$dppj = '-';
|
$dppj = '-';
|
||||||
}
|
}
|
||||||
|
//cek untuk view omt non omt
|
||||||
|
$code_corporate = Corporate::where('id', $corporateId)->first();
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $requestLog['id'],
|
'id' => $requestLog['id'],
|
||||||
'code' => $requestLog['code'],
|
'code' => $requestLog['code'],
|
||||||
@@ -174,6 +177,7 @@ class RequestLogShowResource extends JsonResource
|
|||||||
'medicine' => $medicineData,
|
'medicine' => $medicineData,
|
||||||
'files' => $requestLog['files'],
|
'files' => $requestLog['files'],
|
||||||
'provider' => $providerName,
|
'provider' => $providerName,
|
||||||
|
'organization_id' => $requestLog['organization_id'],
|
||||||
'no_identitas' => $requestLog['member']['nric'],
|
'no_identitas' => $requestLog['member']['nric'],
|
||||||
'keterangan' => $requestLog['keterangan'],
|
'keterangan' => $requestLog['keterangan'],
|
||||||
'hak_kamar_pasien' => $requestLog['hak_kamar_pasien'],
|
'hak_kamar_pasien' => $requestLog['hak_kamar_pasien'],
|
||||||
@@ -185,7 +189,7 @@ class RequestLogShowResource extends JsonResource
|
|||||||
'diagnosis' => $icd,
|
'diagnosis' => $icd,
|
||||||
'url_approval' => env('LMS_WEB_URL') . '/custormer-service/final-log/detail/'.$requestLog['id'] . '/' . auth()->user()->id,
|
'url_approval' => env('LMS_WEB_URL') . '/custormer-service/final-log/detail/'.$requestLog['id'] . '/' . auth()->user()->id,
|
||||||
'is_reversal' => $isReversal, // untuk penjagaan, jika true tidak bisa di edit/hapus lagi
|
'is_reversal' => $isReversal, // untuk penjagaan, jika true tidak bisa di edit/hapus lagi
|
||||||
|
'view_type_member' => $code_corporate->code == 'VALEIND' ? true : false,
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ use App\Models\ClaimRequest;
|
|||||||
use App\Models\CorporateBenefit;
|
use App\Models\CorporateBenefit;
|
||||||
use App\Models\RequestLogBenefit;
|
use App\Models\RequestLogBenefit;
|
||||||
use App\Models\Speciality;
|
use App\Models\Speciality;
|
||||||
|
use Modules\Internal\Transformers\OrganizationResource;
|
||||||
|
|
||||||
class MasterController extends Controller
|
class MasterController extends Controller
|
||||||
{
|
{
|
||||||
@@ -53,11 +54,11 @@ class MasterController extends Controller
|
|||||||
|
|
||||||
public function organizations()
|
public function organizations()
|
||||||
{
|
{
|
||||||
$data = Organization::select('id', 'name', 'code')->get();
|
$data = Organization::hospital()->select('id', 'name', 'code')->get();
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'data' => $data
|
'data' => OrganizationResource::collection($data)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ class MemberController extends Controller
|
|||||||
->select(
|
->select(
|
||||||
'members.id',
|
'members.id',
|
||||||
'members.name',
|
'members.name',
|
||||||
|
'persons.phone',
|
||||||
|
'persons.email as email2',
|
||||||
|
'persons.gender as gender2',
|
||||||
|
'persons.marital_status',
|
||||||
'members.member_id',
|
'members.member_id',
|
||||||
'member_policies.policy_id',
|
'member_policies.policy_id',
|
||||||
'persons.nik',
|
'persons.nik',
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ class RequestLogController extends Controller
|
|||||||
'organization_name' => !empty($request->organization_name) ? $request->organization_name : null,
|
'organization_name' => !empty($request->organization_name) ? $request->organization_name : null,
|
||||||
'address_provider' => !empty($request->address_provider) ? $request->address_provider : null,
|
'address_provider' => !empty($request->address_provider) ? $request->address_provider : null,
|
||||||
'submission_date' => $request->submission_date,
|
'submission_date' => $request->submission_date,
|
||||||
|
'approved_at' => $request->approved_at,
|
||||||
|
'approved_final_log_at' => $request->approved_final_log_at,
|
||||||
'discharge_date' => $request->discharge_date,
|
'discharge_date' => $request->discharge_date,
|
||||||
'corporate_id_partner' => !empty($request->corporate_id_partner) ? $request->corporate_id_partner : [],
|
'corporate_id_partner' => !empty($request->corporate_id_partner) ? $request->corporate_id_partner : [],
|
||||||
'specialities_id' => $request->specialities_id,
|
'specialities_id' => $request->specialities_id,
|
||||||
@@ -46,6 +48,8 @@ class RequestLogController extends Controller
|
|||||||
'member_id' => 'required',
|
'member_id' => 'required',
|
||||||
'service_code' => 'required',
|
'service_code' => 'required',
|
||||||
'submission_date' => 'required',
|
'submission_date' => 'required',
|
||||||
|
'approved_at' => 'required',
|
||||||
|
'approved_final_log_at' => 'required',
|
||||||
'discharge_date' => 'required',
|
'discharge_date' => 'required',
|
||||||
'specialities_id' => 'required',
|
'specialities_id' => 'required',
|
||||||
'dppj' => 'required',
|
'dppj' => 'required',
|
||||||
@@ -53,6 +57,8 @@ class RequestLogController extends Controller
|
|||||||
'member_id.required' => trans('Validation.required',['attribute' => 'Member ID']),
|
'member_id.required' => trans('Validation.required',['attribute' => 'Member ID']),
|
||||||
'service_code.required' => trans('Validation.required',['attribute' => 'Service Code']),
|
'service_code.required' => trans('Validation.required',['attribute' => 'Service Code']),
|
||||||
'submission_date.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
'submission_date.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
||||||
|
'approved_at.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
||||||
|
'approved_final_log_at.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
||||||
'discharge_date.required' => trans('Validation.required',['attribute' => 'Discharge Date']),
|
'discharge_date.required' => trans('Validation.required',['attribute' => 'Discharge Date']),
|
||||||
'specialities_id.required' => trans('Validation.required',['attribute' => 'Specialities']),
|
'specialities_id.required' => trans('Validation.required',['attribute' => 'Specialities']),
|
||||||
'dppj.required' => trans('Validation.required',['attribute' => 'DPJP']),
|
'dppj.required' => trans('Validation.required',['attribute' => 'DPJP']),
|
||||||
@@ -64,6 +70,8 @@ class RequestLogController extends Controller
|
|||||||
'member_id' => 'required',
|
'member_id' => 'required',
|
||||||
'service_code' => 'required',
|
'service_code' => 'required',
|
||||||
'submission_date' => 'required',
|
'submission_date' => 'required',
|
||||||
|
'approved_at' => 'required',
|
||||||
|
'approved_final_log_at' => 'required',
|
||||||
'discharge_date' => 'required',
|
'discharge_date' => 'required',
|
||||||
'specialities_id' => 'required',
|
'specialities_id' => 'required',
|
||||||
'dppj' => 'required',
|
'dppj' => 'required',
|
||||||
@@ -72,6 +80,8 @@ class RequestLogController extends Controller
|
|||||||
'member_id.required' => trans('Validation.required',['attribute' => 'Member ID']),
|
'member_id.required' => trans('Validation.required',['attribute' => 'Member ID']),
|
||||||
'service_code.required' => trans('Validation.required',['attribute' => 'Service Code']),
|
'service_code.required' => trans('Validation.required',['attribute' => 'Service Code']),
|
||||||
'submission_date.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
'submission_date.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
||||||
|
'approved_at.required' => trans('Validation.required',['attribute' => 'Approved At Date']),
|
||||||
|
'approved_final_log_at.required' => trans('Validation.required',['attribute' => 'Approved Final Log At Date']),
|
||||||
'discharge_date.required' => trans('Validation.required',['attribute' => 'Discharge Date']),
|
'discharge_date.required' => trans('Validation.required',['attribute' => 'Discharge Date']),
|
||||||
'specialities_id.required' => trans('Validation.required',['attribute' => 'Specialities']),
|
'specialities_id.required' => trans('Validation.required',['attribute' => 'Specialities']),
|
||||||
'dppj.required' => trans('Validation.required',['attribute' => 'DPJP']),
|
'dppj.required' => trans('Validation.required',['attribute' => 'DPJP']),
|
||||||
@@ -150,13 +160,16 @@ class RequestLogController extends Controller
|
|||||||
'status' => 'approved',
|
'status' => 'approved',
|
||||||
'status_final_log' => 'approved',
|
'status_final_log' => 'approved',
|
||||||
'final_log' => 1,
|
'final_log' => 1,
|
||||||
|
'approved_at' => $request->approved_at ?? now(),
|
||||||
|
'approved_final_log_at' => $request->approved_final_log_at ?? now(),
|
||||||
'payment_type' => 'cashless',
|
'payment_type' => 'cashless',
|
||||||
'service_code' => $request->service_code,
|
'service_code' => $request->service_code,
|
||||||
'policy_id' => $member->currentPolicy->id ?? null,
|
'policy_id' => $member->currentPolicy->id ?? null,
|
||||||
'organization_id' => $request->organization_id ?? 0,
|
'organization_id' => $request->organization_id ?? 0,
|
||||||
'source' => $request->source,
|
'source' => $request->source,
|
||||||
'specialities_id' => $request->specialities_id,
|
'specialities_id' => $request->specialities_id,
|
||||||
'dppj' => $request->dppj
|
'dppj' => $request->dppj,
|
||||||
|
'log_type' => $request->type ?? 'final'
|
||||||
];
|
];
|
||||||
|
|
||||||
// SIMPAN LOG
|
// SIMPAN LOG
|
||||||
@@ -256,6 +269,8 @@ class RequestLogController extends Controller
|
|||||||
'organization_name' => !empty($request->organization_name) ? $request->organization_name : null,
|
'organization_name' => !empty($request->organization_name) ? $request->organization_name : null,
|
||||||
'address_provider' => !empty($request->address_provider) ? $request->address_provider : null,
|
'address_provider' => !empty($request->address_provider) ? $request->address_provider : null,
|
||||||
'submission_date' => $request->submission_date,
|
'submission_date' => $request->submission_date,
|
||||||
|
'approved_at' => $request->approved_at,
|
||||||
|
'approved_final_log_at' => $request->approved_final_log_at,
|
||||||
'corporate_id_partner' => !empty($request->corporate_id_partner) ? $request->corporate_id_partner : [],
|
'corporate_id_partner' => !empty($request->corporate_id_partner) ? $request->corporate_id_partner : [],
|
||||||
'specialities_id' => $request->specialities_id,
|
'specialities_id' => $request->specialities_id,
|
||||||
'dppj' => $request->dppj
|
'dppj' => $request->dppj
|
||||||
@@ -264,12 +279,16 @@ class RequestLogController extends Controller
|
|||||||
'member_id' => 'required',
|
'member_id' => 'required',
|
||||||
'service_code' => 'required',
|
'service_code' => 'required',
|
||||||
'submission_date' => 'required',
|
'submission_date' => 'required',
|
||||||
|
'approved_at' => 'required',
|
||||||
|
'approved_final_log_at' => 'required',
|
||||||
'specialities_id' => 'required',
|
'specialities_id' => 'required',
|
||||||
'dppj' => 'required',
|
'dppj' => 'required',
|
||||||
], [
|
], [
|
||||||
'member_id.required' => trans('Validation.required',['attribute' => 'Member ID']),
|
'member_id.required' => trans('Validation.required',['attribute' => 'Member ID']),
|
||||||
'service_code.required' => trans('Validation.required',['attribute' => 'Service Code']),
|
'service_code.required' => trans('Validation.required',['attribute' => 'Service Code']),
|
||||||
'submission_date.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
'submission_date.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
||||||
|
'approved_at.required' => trans('Validation.required',['attribute' => 'Approved At Date']),
|
||||||
|
'approved_final_log_at.required' => trans('Validation.required',['attribute' => 'Approved Final Log At Date']),
|
||||||
'specialities_id.required' => trans('Validation.required',['attribute' => 'Specialities']),
|
'specialities_id.required' => trans('Validation.required',['attribute' => 'Specialities']),
|
||||||
'dppj.required' => trans('Validation.required',['attribute' => 'DPJP']),
|
'dppj.required' => trans('Validation.required',['attribute' => 'DPJP']),
|
||||||
]);
|
]);
|
||||||
@@ -280,6 +299,8 @@ class RequestLogController extends Controller
|
|||||||
'member_id' => 'required',
|
'member_id' => 'required',
|
||||||
'service_code' => 'required',
|
'service_code' => 'required',
|
||||||
'submission_date' => 'required',
|
'submission_date' => 'required',
|
||||||
|
'approved_at' => 'required',
|
||||||
|
'approved_final_log_at' => 'required',
|
||||||
'specialities_id' => 'required',
|
'specialities_id' => 'required',
|
||||||
'dppj' => 'required',
|
'dppj' => 'required',
|
||||||
], [
|
], [
|
||||||
@@ -287,6 +308,8 @@ class RequestLogController extends Controller
|
|||||||
'member_id.required' => trans('Validation.required',['attribute' => 'Member ID']),
|
'member_id.required' => trans('Validation.required',['attribute' => 'Member ID']),
|
||||||
'service_code.required' => trans('Validation.required',['attribute' => 'Service Code']),
|
'service_code.required' => trans('Validation.required',['attribute' => 'Service Code']),
|
||||||
'submission_date.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
'submission_date.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
||||||
|
'approved_at.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
||||||
|
'approved_final_log_at.required' => trans('Validation.required',['attribute' => 'Submission Date']),
|
||||||
'specialities_id.required' => trans('Validation.required',['attribute' => 'Specialities']),
|
'specialities_id.required' => trans('Validation.required',['attribute' => 'Specialities']),
|
||||||
'dppj.required' => trans('Validation.required',['attribute' => 'DPJP']),
|
'dppj.required' => trans('Validation.required',['attribute' => 'DPJP']),
|
||||||
]);
|
]);
|
||||||
@@ -369,6 +392,8 @@ class RequestLogController extends Controller
|
|||||||
'specialities_id' => $request->specialities_id,
|
'specialities_id' => $request->specialities_id,
|
||||||
'dppj' => $request->dppj,
|
'dppj' => $request->dppj,
|
||||||
'approved_at' => $request->approved_at ?? now(),
|
'approved_at' => $request->approved_at ?? now(),
|
||||||
|
'approved_final_log_at' => $request->approved_final_log_at ?? now(),
|
||||||
|
'log_type' => $request->type ?? 'reference'
|
||||||
];
|
];
|
||||||
|
|
||||||
// SIMPAN LOG
|
// SIMPAN LOG
|
||||||
|
|||||||
126
app/Console/Commands/SyncLogTypeFromTelemedicine.php
Normal file
126
app/Console/Commands/SyncLogTypeFromTelemedicine.php
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
||||||
|
class SyncLogTypeFromTelemedicine extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'sync:log-type {--dry-run : Run without updating database}';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Sync log_type from telemedicine prime_logs to request_logs table';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$isDryRun = $this->option('dry-run');
|
||||||
|
|
||||||
|
if ($isDryRun) {
|
||||||
|
$this->info('🔍 DRY RUN MODE - No database changes will be made');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info('Starting sync log_type from telemedicine...');
|
||||||
|
|
||||||
|
// Get telemedicine DB config
|
||||||
|
$telemedicineDb = config('database.connections.telemedicine');
|
||||||
|
|
||||||
|
if (!$telemedicineDb) {
|
||||||
|
$this->error('Telemedicine database connection not configured!');
|
||||||
|
return Command::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Query prime_logs from telemedicine with log_code
|
||||||
|
$primeLogs = DB::connection('telemedicine')
|
||||||
|
->table('prime_logs')
|
||||||
|
->whereNotNull('log_code')
|
||||||
|
->where('log_code', '!=', '')
|
||||||
|
->where('status', 'success')
|
||||||
|
->select('log_code', 'type')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
if ($primeLogs->isEmpty()) {
|
||||||
|
$this->warn('No prime_logs found with log_code');
|
||||||
|
return Command::SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info("Found {$primeLogs->count()} prime_logs records");
|
||||||
|
|
||||||
|
$updated = 0;
|
||||||
|
$skipped = 0;
|
||||||
|
$notFound = 0;
|
||||||
|
|
||||||
|
$bar = $this->output->createProgressBar($primeLogs->count());
|
||||||
|
$bar->start();
|
||||||
|
|
||||||
|
foreach ($primeLogs as $primeLog) {
|
||||||
|
// Find matching request_log by code
|
||||||
|
$requestLog = DB::table('request_logs')
|
||||||
|
->where('code', $primeLog->log_code)
|
||||||
|
->whereNull('deleted_at')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (!$requestLog) {
|
||||||
|
$notFound++;
|
||||||
|
$bar->advance();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip if log_type already set correctly
|
||||||
|
if ($requestLog->log_type === $primeLog->type) {
|
||||||
|
$skipped++;
|
||||||
|
$bar->advance();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$isDryRun) {
|
||||||
|
// Update log_type
|
||||||
|
DB::table('request_logs')
|
||||||
|
->where('id', $requestLog->id)
|
||||||
|
->update([
|
||||||
|
'log_type' => $primeLog->type,
|
||||||
|
'updated_at' => now()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$updated++;
|
||||||
|
$bar->advance();
|
||||||
|
}
|
||||||
|
|
||||||
|
$bar->finish();
|
||||||
|
$this->newLine(2);
|
||||||
|
|
||||||
|
// Summary
|
||||||
|
$this->info('✅ Sync completed!');
|
||||||
|
$this->table(
|
||||||
|
['Status', 'Count'],
|
||||||
|
[
|
||||||
|
['Updated', $updated],
|
||||||
|
['Skipped (already correct)', $skipped],
|
||||||
|
['Not found in request_logs', $notFound],
|
||||||
|
['Total processed', $primeLogs->count()],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($isDryRun) {
|
||||||
|
$this->warn('⚠️ This was a DRY RUN. Run without --dry-run to apply changes.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return Command::SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -57,6 +57,7 @@ class RequestLog extends Model
|
|||||||
'type_of_member',
|
'type_of_member',
|
||||||
'nominal',
|
'nominal',
|
||||||
'approval_nominal_by',
|
'approval_nominal_by',
|
||||||
|
'log_type',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
|
|||||||
@@ -83,6 +83,19 @@ return [
|
|||||||
]) : [],
|
]) : [],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'telemedicine' => [
|
||||||
|
'driver' => 'mysql',
|
||||||
|
'host' => env('TELEMEDICINE_DB_HOST', '127.0.0.1'),
|
||||||
|
'port' => env('TELEMEDICINE_DB_PORT', '3306'),
|
||||||
|
'database' => env('TELEMEDICINE_DB_DATABASE', 'forge'),
|
||||||
|
'username' => env('TELEMEDICINE_DB_USERNAME', 'forge'),
|
||||||
|
'password' => env('TELEMEDICINE_DB_PASSWORD', ''),
|
||||||
|
'charset' => 'utf8mb4',
|
||||||
|
'collation' => 'utf8mb4_unicode_ci',
|
||||||
|
'prefix' => '',
|
||||||
|
'strict' => false,
|
||||||
|
],
|
||||||
|
|
||||||
'pgsql' => [
|
'pgsql' => [
|
||||||
'driver' => 'pgsql',
|
'driver' => 'pgsql',
|
||||||
'url' => env('DATABASE_URL'),
|
'url' => env('DATABASE_URL'),
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ return new class extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('notifications', function (Blueprint $table) {
|
Schema::table('notifications', function (Blueprint $table) {
|
||||||
$table->text('data')->after('notifiable_id')->nullable();
|
$table->text('data')->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ return new class extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('drugs', function (Blueprint $table) {
|
Schema::table('drugs', function (Blueprint $table) {
|
||||||
$table->string('unit')->nullable()->after('generic_name');
|
// $table->string('unit')->nullable()->after('generic_name');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
if(!Schema::hasColumn('request_logs', 'log_type')) {
|
||||||
|
Schema::table('request_logs', function (Blueprint $table) {
|
||||||
|
$table->enum('log_type', ['reference', 'prescription', 'consultation'])->after('dppj')->nullable()->comment('Type of LOG: reference, prescription, or consultation');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
if(Schema::hasColumn('request_logs', 'log_type')) {
|
||||||
|
Schema::table('request_logs', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('log_type');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -73,7 +73,7 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
if (formData.type_of_member == "" && requestLog?.corporate_id == 5) { // corporate vale
|
if (formData.type_of_member == "" && requestLog?.view_type_member) { // corporate vale
|
||||||
setError(true);
|
setError(true);
|
||||||
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
||||||
}
|
}
|
||||||
@@ -121,10 +121,12 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
|||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Member Of Type</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Member Of Type</Typography>
|
||||||
</Stack>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
||||||
@@ -189,24 +191,26 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member*</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Select
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
||||||
fullWidth
|
<Select
|
||||||
value={formData.type_of_member}
|
fullWidth
|
||||||
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
value={formData.type_of_member}
|
||||||
variant="outlined"
|
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
||||||
displayEmpty
|
variant="outlined"
|
||||||
required
|
displayEmpty
|
||||||
error={error}
|
required
|
||||||
>
|
error={error}
|
||||||
<MenuItem value="" disabled>
|
>
|
||||||
Type Member
|
<MenuItem value="" disabled>
|
||||||
</MenuItem>
|
Type Member
|
||||||
<MenuItem value="OMT">OMT</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
<MenuItem value="OMT">OMT</MenuItem>
|
||||||
</Select>
|
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
||||||
</Stack>
|
</Select>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
|
|||||||
@@ -28,7 +28,10 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
catatan: requestLog?.catatan,
|
catatan: requestLog?.catatan,
|
||||||
icdCodes: requestLog?.diagnosis,
|
icdCodes: requestLog?.diagnosis,
|
||||||
reason: requestLog?.reason,
|
reason: requestLog?.reason,
|
||||||
type_of_member: requestLog?.type_of_member
|
type_of_member: requestLog?.type_of_member,
|
||||||
|
organization_id: requestLog?.organization_id || 0,
|
||||||
|
edit: true
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
@@ -61,7 +64,11 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
icdCodes: requestLog?.diagnosis|| [],
|
icdCodes: requestLog?.diagnosis|| [],
|
||||||
reason: requestLog?.reason|| '',
|
reason: requestLog?.reason|| '',
|
||||||
type_of_member: requestLog?.type_of_member|| '',
|
type_of_member: requestLog?.type_of_member|| '',
|
||||||
|
organization_id: requestLog?.organization_id || 0,
|
||||||
|
edit: true
|
||||||
|
|
||||||
});
|
});
|
||||||
|
setIdProvider(requestLog?.organization_id || 0);
|
||||||
}, [requestLog]);
|
}, [requestLog]);
|
||||||
|
|
||||||
|
|
||||||
@@ -96,7 +103,7 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
|
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
if (formData.type_of_member == "" && requestLog?.corporate_id == 5) {
|
if (formData.type_of_member == "" && requestLog?.view_type_member) {
|
||||||
setError(true);
|
setError(true);
|
||||||
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
||||||
}
|
}
|
||||||
@@ -142,6 +149,9 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
icdCodes: requestLog?.diagnosis ?? [],
|
icdCodes: requestLog?.diagnosis ?? [],
|
||||||
reason: requestLog?.reason ?? '',
|
reason: requestLog?.reason ?? '',
|
||||||
type_of_member: requestLog?.type_of_member ?? '',
|
type_of_member: requestLog?.type_of_member ?? '',
|
||||||
|
organization_id: requestLog?.organization_id || 0,
|
||||||
|
edit: true
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const [isReasonSelected, setIsReasonSelected] = useState(true);
|
const [isReasonSelected, setIsReasonSelected] = useState(true);
|
||||||
@@ -156,11 +166,33 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
{ value: 'endorsement', label: 'Endorsement' },
|
{ value: 'endorsement', label: 'Endorsement' },
|
||||||
{ value: 'renewal', label: 'Renewal' },
|
{ value: 'renewal', label: 'Renewal' },
|
||||||
{ value: 'wrong_setting', label: 'Wrong Setting' },
|
{ value: 'wrong_setting', label: 'Wrong Setting' },
|
||||||
|
{ value: 'approval', label: 'Approval' },
|
||||||
// Add more options as needed
|
// Add more options as needed
|
||||||
];
|
];
|
||||||
|
|
||||||
// console.log(formData.type_of_member)
|
// console.log(formData.type_of_member)
|
||||||
|
|
||||||
|
const [providers, setProviders] = useState([]);
|
||||||
|
const [idProvider, setIdProvider] = useState(0);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
axios
|
||||||
|
.get('/organizations')
|
||||||
|
.then((res) => {
|
||||||
|
setProviders(res.data.data || []);
|
||||||
|
})
|
||||||
|
.catch((err) => console.error(err));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
if (requestLog?.organization_id) {
|
||||||
|
console.log(requestLog?.organization_id);
|
||||||
|
setIdProvider(requestLog.organization_id);
|
||||||
|
console.log(idProvider);
|
||||||
|
}
|
||||||
|
}, [requestLog]);
|
||||||
|
|
||||||
const getContent = () => (
|
const getContent = () => (
|
||||||
<Stack spacing={1} marginTop={2}>
|
<Stack spacing={1} marginTop={2}>
|
||||||
<Typography variant="subtitle2">Are you sure to edit this final log ?</Typography>
|
<Typography variant="subtitle2">Are you sure to edit this final log ?</Typography>
|
||||||
@@ -193,6 +225,26 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card sx={{padding:2, marginTop:2}} >
|
<Card sx={{padding:2, marginTop:2}} >
|
||||||
|
<Stack direction="row" spacing={2} sx={marginBottom2}>
|
||||||
|
<Typography variant="subtitle2" sx={style1} gutterBottom>
|
||||||
|
Provider
|
||||||
|
</Typography>
|
||||||
|
|
||||||
|
<Autocomplete
|
||||||
|
options={providers}
|
||||||
|
getOptionLabel={(option) => option.name?.trim() || '-'}
|
||||||
|
value={providers.find((item) => item.id == idProvider) || null}
|
||||||
|
onChange={(event, newValue) => {
|
||||||
|
const id = newValue?.id || 0;
|
||||||
|
setIdProvider(id);
|
||||||
|
handleChange('organization_id', id);
|
||||||
|
}}
|
||||||
|
renderInput={(params) => (
|
||||||
|
<TextField {...params} label="Provider" fullWidth />
|
||||||
|
)}
|
||||||
|
fullWidth
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Invoice Provider</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Invoice Provider</Typography>
|
||||||
<TextField
|
<TextField
|
||||||
@@ -213,24 +265,26 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
onChange={(e) => handleChange('billing_no', e.target.value)}
|
onChange={(e) => handleChange('billing_no', e.target.value)}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member*</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Select
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
||||||
fullWidth
|
<Select
|
||||||
value={formData.type_of_member}
|
fullWidth
|
||||||
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
value={formData.type_of_member}
|
||||||
variant="outlined"
|
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
||||||
displayEmpty
|
variant="outlined"
|
||||||
required
|
displayEmpty
|
||||||
error={error}
|
required
|
||||||
>
|
error={error}
|
||||||
<MenuItem value="" disabled>
|
>
|
||||||
Type Member
|
<MenuItem value="" disabled>
|
||||||
</MenuItem>
|
Type Member
|
||||||
<MenuItem value="OMT">OMT</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
<MenuItem value="OMT">OMT</MenuItem>
|
||||||
</Select>
|
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
||||||
</Stack>
|
</Select>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Discharge Date</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Discharge Date</Typography>
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ import { LoadingButton } from '@mui/lab';
|
|||||||
import { makeFormData } from '@/utils/jsonToFormData';
|
import { makeFormData } from '@/utils/jsonToFormData';
|
||||||
import TextField from '@mui/material/TextField';
|
import TextField from '@mui/material/TextField';
|
||||||
import { fPostFormat } from '@/utils/formatTime';
|
import { fPostFormat } from '@/utils/formatTime';
|
||||||
|
import { parse } from 'date-fns';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -86,32 +88,29 @@ import { format } from 'date-fns';
|
|||||||
|
|
||||||
export default function Detail() {
|
export default function Detail() {
|
||||||
//dari hospital portal
|
//dari hospital portal
|
||||||
const [dischargeDate, setDischargeDate] = useState<string>(format(new Date(), "yyyy MMM d HH:mm:ss"));
|
// const [dischargeDate, setDischargeDate] = useState<string>(format(new Date(), "yyyy MMM d HH:mm:ss"));
|
||||||
const [serviceOptions, setServiceOptions] = useState([
|
const [dischargeDate, setDischargeDate] = useState<Date | null>(null)
|
||||||
{ value: '-', label: '-' }
|
|
||||||
]);
|
|
||||||
const [specialisOptions, setSpecialisOptions] = useState([
|
|
||||||
{ value: '-', label: '-' }
|
|
||||||
]);
|
|
||||||
useEffect(() => {
|
|
||||||
axios.get('service-member/'+1)
|
|
||||||
.then((response) => {
|
|
||||||
setServiceOptions(response.data);
|
|
||||||
}).catch((error) => {
|
|
||||||
console.error('Error fetching ICD options:', error);
|
|
||||||
});
|
|
||||||
|
|
||||||
axios.get('specialis')
|
|
||||||
.then((response) => {
|
|
||||||
setSpecialisOptions(response.data);
|
|
||||||
}).catch((error) => {
|
|
||||||
console.error('Error fetching ICD options:', error);
|
|
||||||
});
|
|
||||||
|
|
||||||
}, []);
|
// const [serviceOptions, setServiceOptions] = useState([
|
||||||
|
// { value: '-', label: '-' }
|
||||||
|
// ]);
|
||||||
|
// const [specialisOptions, setSpecialisOptions] = useState([
|
||||||
|
// { value: '-', label: '-' }
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
const [serviceOptions, setServiceOptions] = useState<
|
||||||
|
{ value: string; label: string }[]
|
||||||
|
>([])
|
||||||
|
|
||||||
|
const [specialisOptions, setSpecialisOptions] = useState<
|
||||||
|
{ value: number; label: string }[]
|
||||||
|
>([])
|
||||||
const [serviceCode, setServiceCode] = useState<string>("");
|
const [serviceCode, setServiceCode] = useState<string>("");
|
||||||
const [idSpecialities, setIdSpecialities] = useState("");
|
const [idSpecialities, setIdSpecialities] = useState<number | null>(null)
|
||||||
|
|
||||||
const [inputDppj, setInputDppj] = useState("");
|
const [inputDppj, setInputDppj] = useState("");
|
||||||
|
const [requestLog, setRequestLog] = useState<DetailFinalLogType>();
|
||||||
function submitRequestFinalLog() {
|
function submitRequestFinalLog() {
|
||||||
if(dischargeDate == '')
|
if(dischargeDate == '')
|
||||||
{
|
{
|
||||||
@@ -127,7 +126,7 @@ function submitRequestFinalLog() {
|
|||||||
//cek dpjp
|
//cek dpjp
|
||||||
if(!inputDppj)
|
if(!inputDppj)
|
||||||
{
|
{
|
||||||
enqueueSnackbar('DPPJ', { variant: 'warning' });
|
enqueueSnackbar('DPJP', { variant: 'warning' });
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
setSubmitLoading(true);
|
setSubmitLoading(true);
|
||||||
@@ -136,10 +135,11 @@ function submitRequestFinalLog() {
|
|||||||
// result_files: fileHasilPenunjangs,
|
// result_files: fileHasilPenunjangs,
|
||||||
// diagnosa_files: fileDiagnosas,
|
// diagnosa_files: fileDiagnosas,
|
||||||
// kondisi_files: fileKondisis,
|
// kondisi_files: fileKondisis,
|
||||||
|
request_logs_id: requestLog?.id,
|
||||||
discharge_date: fPostFormat(dischargeDate, 'yyyy-MM-dd HH:mm:ss'),
|
discharge_date: fPostFormat(dischargeDate, 'yyyy-MM-dd HH:mm:ss'),
|
||||||
service_code: serviceCode,
|
service_code: serviceCode,
|
||||||
spescialis_id: idSpecialities,
|
spescialis_id: idSpecialities,
|
||||||
dppj: inputDppj,
|
dppj: inputDppj
|
||||||
});
|
});
|
||||||
axios
|
axios
|
||||||
.post('/request-final-log', formData)
|
.post('/request-final-log', formData)
|
||||||
@@ -163,7 +163,7 @@ function submitRequestFinalLog() {
|
|||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { themeStretch } = useSettings();
|
const { themeStretch } = useSettings();
|
||||||
const [requestLog, setRequestLog] = useState<DetailFinalLogType>();
|
|
||||||
const [isReversal, setIsReversal] = useState(false);
|
const [isReversal, setIsReversal] = useState(false);
|
||||||
const [submitLoading, setSubmitLoading] = useState(false);
|
const [submitLoading, setSubmitLoading] = useState(false);
|
||||||
|
|
||||||
@@ -199,6 +199,24 @@ function submitRequestFinalLog() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!requestLog?.id_member) return
|
||||||
|
axios.get('service-member/'+ (requestLog?.id_member ?? null))
|
||||||
|
.then((response) => {
|
||||||
|
setServiceOptions(response.data);
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('Error fetching ICD options:', error);
|
||||||
|
});
|
||||||
|
|
||||||
|
axios.get('specialis')
|
||||||
|
.then((response) => {
|
||||||
|
setSpecialisOptions(response.data);
|
||||||
|
}).catch((error) => {
|
||||||
|
console.error('Error fetching ICD options:', error);
|
||||||
|
});
|
||||||
|
|
||||||
|
}, [requestLog?.id_member]);
|
||||||
|
|
||||||
const updateApproval = async () => {
|
const updateApproval = async () => {
|
||||||
setSubmitLoading(true);
|
setSubmitLoading(true);
|
||||||
axios
|
axios
|
||||||
@@ -335,6 +353,40 @@ function submitRequestFinalLog() {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (requestLog?.discharge_date) {
|
||||||
|
setDischargeDate(
|
||||||
|
parse(
|
||||||
|
requestLog.discharge_date,
|
||||||
|
'yyyy-MM-dd HH:mm:ss',
|
||||||
|
new Date()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}, [requestLog?.discharge_date])
|
||||||
|
useEffect(() => {
|
||||||
|
if (!requestLog) return
|
||||||
|
setServiceCode(requestLog.service_code ?? '')
|
||||||
|
setIdSpecialities(requestLog.specialitiesID ?? null)
|
||||||
|
setInputDppj(requestLog.dppj ?? '')
|
||||||
|
}, [requestLog])
|
||||||
|
const selectedService = useMemo(
|
||||||
|
() =>
|
||||||
|
serviceOptions.find(
|
||||||
|
(o) => String(o.value) === String(serviceCode)
|
||||||
|
) || null,
|
||||||
|
[serviceOptions, serviceCode]
|
||||||
|
)
|
||||||
|
console.log(serviceOptions);
|
||||||
|
console.log(serviceCode);
|
||||||
|
const selectedSpecialis = useMemo(
|
||||||
|
() =>
|
||||||
|
specialisOptions.find(
|
||||||
|
(o) => Number(o.value) === Number(idSpecialities)
|
||||||
|
) || null,
|
||||||
|
[specialisOptions, idSpecialities]
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page title='Detail'>
|
<Page title='Detail'>
|
||||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||||
@@ -352,7 +404,7 @@ function submitRequestFinalLog() {
|
|||||||
Detail
|
Detail
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
{requestLog?.status_final_log != 'requested' ? (
|
{requestLog?.status_final_log != 'approved' ? (
|
||||||
<Grid item xs={6} sx={{ display: 'flex', placeContent: 'end' }}>
|
<Grid item xs={6} sx={{ display: 'flex', placeContent: 'end' }}>
|
||||||
<MoreMenu
|
<MoreMenu
|
||||||
actions={
|
actions={
|
||||||
@@ -385,10 +437,12 @@ function submitRequestFinalLog() {
|
|||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
||||||
</Stack>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
||||||
@@ -440,7 +494,7 @@ function submitRequestFinalLog() {
|
|||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.specialities_id ? requestLog?.specialities_id : '-'}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.specialities_id ? requestLog?.specialities_id : '-'}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>DPPJ</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>DPJP</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.dppj ? requestLog?.dppj : '-'}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.dppj ? requestLog?.dppj : '-'}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
@@ -529,7 +583,7 @@ function submitRequestFinalLog() {
|
|||||||
{/* Kolom Service Type */}
|
{/* Kolom Service Type */}
|
||||||
<Stack spacing={2} sx={{ flex: 1 }}>
|
<Stack spacing={2} sx={{ flex: 1 }}>
|
||||||
<Typography variant="subtitle1">Tipe Service </Typography>
|
<Typography variant="subtitle1">Tipe Service </Typography>
|
||||||
<Autocomplete
|
{/* <Autocomplete
|
||||||
id="service_type"
|
id="service_type"
|
||||||
options={serviceOptions}
|
options={serviceOptions}
|
||||||
getOptionLabel={(option) => option.label || ""}
|
getOptionLabel={(option) => option.label || ""}
|
||||||
@@ -540,7 +594,17 @@ function submitRequestFinalLog() {
|
|||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField {...params} label='Tipe Service' fullWidth />
|
<TextField {...params} label='Tipe Service' fullWidth />
|
||||||
)}
|
)}
|
||||||
/>
|
/> */}
|
||||||
|
<Autocomplete
|
||||||
|
options={serviceOptions}
|
||||||
|
value={selectedService}
|
||||||
|
getOptionLabel={(o) => o.label}
|
||||||
|
isOptionEqualToValue={(o, v) => o.value === v.value}
|
||||||
|
onChange={(_, v) => setServiceCode(v?.value ?? '')}
|
||||||
|
renderInput={(params) => (
|
||||||
|
<TextField {...params} label="Tipe Service" fullWidth />
|
||||||
|
)}
|
||||||
|
/>
|
||||||
<FormHelperText style={{ color: "red" }}></FormHelperText>
|
<FormHelperText style={{ color: "red" }}></FormHelperText>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -549,7 +613,7 @@ function submitRequestFinalLog() {
|
|||||||
<Stack direction="row" spacing={2}>
|
<Stack direction="row" spacing={2}>
|
||||||
<Stack spacing={2} sx={{ width: '100%' }}>
|
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||||
<Typography variant='subtitle1'>Spesialis </Typography>
|
<Typography variant='subtitle1'>Spesialis </Typography>
|
||||||
<Autocomplete
|
{/* <Autocomplete
|
||||||
id='specialities'
|
id='specialities'
|
||||||
options={specialisOptions}
|
options={specialisOptions}
|
||||||
getOptionLabel={(option) => option.label || ''}
|
getOptionLabel={(option) => option.label || ''}
|
||||||
@@ -560,6 +624,16 @@ function submitRequestFinalLog() {
|
|||||||
renderInput={(params) => (
|
renderInput={(params) => (
|
||||||
<TextField {...params} label="Spesialis" fullWidth />
|
<TextField {...params} label="Spesialis" fullWidth />
|
||||||
)}
|
)}
|
||||||
|
/> */}
|
||||||
|
<Autocomplete
|
||||||
|
options={specialisOptions}
|
||||||
|
value={selectedSpecialis}
|
||||||
|
getOptionLabel={(o) => o.label}
|
||||||
|
isOptionEqualToValue={(o, v) => o.value === v.value}
|
||||||
|
onChange={(_, v) => setIdSpecialities(v?.value ?? null)}
|
||||||
|
renderInput={(params) => (
|
||||||
|
<TextField {...params} label="Spesialis" fullWidth />
|
||||||
|
)}
|
||||||
/>
|
/>
|
||||||
<FormHelperText style={{ color: 'red' }}></FormHelperText>
|
<FormHelperText style={{ color: 'red' }}></FormHelperText>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -567,12 +641,12 @@ function submitRequestFinalLog() {
|
|||||||
|
|
||||||
<Stack direction="row" spacing={2}>
|
<Stack direction="row" spacing={2}>
|
||||||
<Stack spacing={2} sx={{ width: '100%' }}>
|
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||||
<Typography variant='subtitle1'>DPPJ </Typography>
|
<Typography variant='subtitle1'>DPJP </Typography>
|
||||||
<TextField
|
<TextField
|
||||||
id='dppj'
|
id='dppj'
|
||||||
variant='outlined'
|
variant='outlined'
|
||||||
value={inputDppj}
|
value={inputDppj}
|
||||||
placeholder="DPPJ"
|
placeholder="DPJP"
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setInputDppj(event.target.value);
|
setInputDppj(event.target.value);
|
||||||
}}
|
}}
|
||||||
@@ -1203,7 +1277,7 @@ function submitRequestFinalLog() {
|
|||||||
|
|
||||||
{requestLog?.status_final_log == 'requested' ? (
|
{requestLog?.status_final_log == 'requested' ? (
|
||||||
<Grid item xs={12} md={12}>
|
<Grid item xs={12} md={12}>
|
||||||
<Stack direction="row" padding={4} sx={{ justifyContent: 'space-between' }}>
|
<Stack direction="row" padding={4} spacing={2} sx={{ justifyContent: 'flex-end' }}>
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ export type DetailFinalLogType = {
|
|||||||
id : number,
|
id : number,
|
||||||
code : string,
|
code : string,
|
||||||
member_id : string,
|
member_id : string,
|
||||||
|
view_type_member : any,
|
||||||
|
organization_id : any,
|
||||||
|
id_member : string,
|
||||||
|
service_code : string,
|
||||||
|
specialitiesID : any,
|
||||||
|
dppj : any,
|
||||||
invoice_no : string,
|
invoice_no : string,
|
||||||
billing_no : string,
|
billing_no : string,
|
||||||
provider : string,
|
provider : string,
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
|||||||
|
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
if (formData.type_of_member == "" && requestLog?.corporate_id == 5) {
|
if (formData.type_of_member == "" && requestLog?.view_type_member) {
|
||||||
setError(true);
|
setError(true);
|
||||||
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
||||||
} else {
|
} else {
|
||||||
@@ -132,10 +132,12 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
|||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type of Member</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Type of Member</Typography>
|
||||||
</Stack>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
||||||
@@ -206,24 +208,26 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
|||||||
onChange={(e) => handleChange('penempatan_kamar', e.target.value)}
|
onChange={(e) => handleChange('penempatan_kamar', e.target.value)}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member*</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Select
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
||||||
fullWidth
|
<Select
|
||||||
value={formData.type_of_member}
|
fullWidth
|
||||||
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
value={formData.type_of_member}
|
||||||
variant="outlined"
|
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
||||||
displayEmpty
|
variant="outlined"
|
||||||
required
|
displayEmpty
|
||||||
error={error}
|
required
|
||||||
>
|
error={error}
|
||||||
<MenuItem value="" disabled>
|
>
|
||||||
Type Member
|
<MenuItem value="" disabled>
|
||||||
</MenuItem>
|
Type Member
|
||||||
<MenuItem value="OMT">OMT</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
<MenuItem value="OMT">OMT</MenuItem>
|
||||||
</Select>
|
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
||||||
</Stack>
|
</Select>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export default function DialogEditInformation({requestLog, setOpenDialog, openDi
|
|||||||
|
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
if (formData.type_of_member == "" && requestLog?.corporate_id == 5) {
|
if (formData.type_of_member == "" && requestLog?.view_type_member) {
|
||||||
setError(true);
|
setError(true);
|
||||||
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
||||||
} else if (isReasonSelected && formData.reason !== '') {
|
} else if (isReasonSelected && formData.reason !== '') {
|
||||||
@@ -201,24 +201,26 @@ export default function DialogEditInformation({requestLog, setOpenDialog, openDi
|
|||||||
onChange={(e) => handleChange('penempatan_kamar', e.target.value)}
|
onChange={(e) => handleChange('penempatan_kamar', e.target.value)}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member*</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Select
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
||||||
fullWidth
|
<Select
|
||||||
value={formData.type_of_member}
|
fullWidth
|
||||||
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
value={formData.type_of_member}
|
||||||
variant="outlined"
|
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
||||||
displayEmpty
|
variant="outlined"
|
||||||
required
|
displayEmpty
|
||||||
error={error}
|
required
|
||||||
>
|
error={error}
|
||||||
<MenuItem value="" disabled>
|
>
|
||||||
Type Member
|
<MenuItem value="" disabled>
|
||||||
</MenuItem>
|
Type Member
|
||||||
<MenuItem value="OMT">OMT</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
<MenuItem value="OMT">OMT</MenuItem>
|
||||||
</Select>
|
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
||||||
</Stack>
|
</Select>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Reason*</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Reason*</Typography>
|
||||||
<Autocomplete
|
<Autocomplete
|
||||||
|
|||||||
@@ -116,10 +116,12 @@ export default function Detail() {
|
|||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
||||||
</Stack>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
||||||
@@ -162,7 +164,7 @@ export default function Detail() {
|
|||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.specialities_id ? requestLog?.specialities_id : '-'}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.specialities_id ? requestLog?.specialities_id : '-'}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>DPPJ</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>DPJP</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.dppj ? requestLog?.dppj : '-'}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.dppj ? requestLog?.dppj : '-'}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Card>
|
</Card>
|
||||||
@@ -192,7 +194,7 @@ export default function Detail() {
|
|||||||
</Grid>
|
</Grid>
|
||||||
{requestLog?.status == 'requested' || requestLog?.status == 'canceled' || requestLog?.status == 'waiting_billing' ? (
|
{requestLog?.status == 'requested' || requestLog?.status == 'canceled' || requestLog?.status == 'waiting_billing' ? (
|
||||||
<Grid item xs={12} md={12}>
|
<Grid item xs={12} md={12}>
|
||||||
<Stack direction="row" padding={4} sx={{ justifyContent: 'space-between' }}>
|
<Stack direction="row" padding={4} spacing={2} sx={{ justifyContent: 'flex-end' }}>
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export type file = {
|
|||||||
export type DetailRequestLogType = {
|
export type DetailRequestLogType = {
|
||||||
id : number,
|
id : number,
|
||||||
code : string,
|
code : string,
|
||||||
|
view_type_member : any,
|
||||||
member_id : string,
|
member_id : string,
|
||||||
policy_number : string,
|
policy_number : string,
|
||||||
name : string,
|
name : string,
|
||||||
|
|||||||
@@ -142,7 +142,9 @@
|
|||||||
"txtDPPJ": "DPJP",
|
"txtDPPJ": "DPJP",
|
||||||
"txtSpecialist": "Specialist",
|
"txtSpecialist": "Specialist",
|
||||||
"txtWarningDPPJ": "Please input DPJP",
|
"txtWarningDPPJ": "Please input DPJP",
|
||||||
"txtWarningSpecialist": "Please select Specialist"
|
"txtWarningSpecialist": "Please select Specialist",
|
||||||
|
"txtLogType": "LOG Type",
|
||||||
|
"txtStatusFinalLog": "Final LOG Status"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,5 +142,7 @@
|
|||||||
"txtDPPJ": "DPJP",
|
"txtDPPJ": "DPJP",
|
||||||
"txtSpecialist": "Spesialis",
|
"txtSpecialist": "Spesialis",
|
||||||
"txtWarningDPPJ": "Mohon isi DPJP",
|
"txtWarningDPPJ": "Mohon isi DPJP",
|
||||||
"txtWarningSpecialist": "Mohon pilih Spesialis"
|
"txtWarningSpecialist": "Mohon pilih Spesialis",
|
||||||
|
"txtLogType": "Tipe LOG",
|
||||||
|
"txtStatusFinalLog": "Status Final LOG"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
if (formData.type_of_member == "" && requestLog?.corporate_id == 5) { // corporate vale
|
if (formData.type_of_member == "" && requestLog?.view_type_member) { // corporate vale
|
||||||
setError(true);
|
setError(true);
|
||||||
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
||||||
}
|
}
|
||||||
@@ -121,10 +121,12 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
|||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
{requestLog?.view_type_member ? (
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Member Of Type</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Member Of Type</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
):('')}
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
||||||
@@ -189,24 +191,26 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member*</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Select
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
||||||
fullWidth
|
<Select
|
||||||
value={formData.type_of_member}
|
fullWidth
|
||||||
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
value={formData.type_of_member}
|
||||||
variant="outlined"
|
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
||||||
displayEmpty
|
variant="outlined"
|
||||||
required
|
displayEmpty
|
||||||
error={error}
|
required
|
||||||
>
|
error={error}
|
||||||
<MenuItem value="" disabled>
|
>
|
||||||
Type Member
|
<MenuItem value="" disabled>
|
||||||
</MenuItem>
|
Type Member
|
||||||
<MenuItem value="OMT">OMT</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
<MenuItem value="OMT">OMT</MenuItem>
|
||||||
</Select>
|
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
||||||
</Stack>
|
</Select>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ export default function DialogEditBenefit({id, data, setOpenDialog, openDialog,
|
|||||||
const amountApproved = parseFloat(watch('amount_approved'));
|
const amountApproved = parseFloat(watch('amount_approved'));
|
||||||
const amountNotApproved = parseFloat(watch('amount_not_approved'));
|
const amountNotApproved = parseFloat(watch('amount_not_approved'));
|
||||||
const excessPaid = parseFloat(watch('excess_paid'));
|
const excessPaid = parseFloat(watch('excess_paid'));
|
||||||
|
|
||||||
// Hitung total baru
|
// Hitung total baru
|
||||||
const totalAmountIncurred = total.totalAmountIncurred - data?.amount_incurred + amountIncurred;
|
const totalAmountIncurred = total.totalAmountIncurred - data?.amount_incurred + amountIncurred;
|
||||||
const totalAmountApproved = total.totalAmountApproved - data?.amount_approved + amountApproved;
|
const totalAmountApproved = total.totalAmountApproved - data?.amount_approved + amountApproved;
|
||||||
@@ -203,7 +202,6 @@ export default function DialogEditBenefit({id, data, setOpenDialog, openDialog,
|
|||||||
<Typography variant="subtitle1" sx={{ fontWeight: 'bold'}}>
|
<Typography variant="subtitle1" sx={{ fontWeight: 'bold'}}>
|
||||||
{data?.benefit?.description}
|
{data?.benefit?.description}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={2}>
|
<Grid item xs={2}>
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
icdCodes: requestLog?.diagnosis,
|
icdCodes: requestLog?.diagnosis,
|
||||||
reason: requestLog?.reason,
|
reason: requestLog?.reason,
|
||||||
type_of_member: requestLog?.type_of_member,
|
type_of_member: requestLog?.type_of_member,
|
||||||
|
organization_id: requestLog?.organization_id || 0,
|
||||||
status: 'requested',
|
status: 'requested',
|
||||||
|
edit: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
@@ -62,8 +64,11 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
icdCodes: requestLog?.diagnosis|| [],
|
icdCodes: requestLog?.diagnosis|| [],
|
||||||
reason: requestLog?.reason|| '',
|
reason: requestLog?.reason|| '',
|
||||||
type_of_member: requestLog?.type_of_member|| '',
|
type_of_member: requestLog?.type_of_member|| '',
|
||||||
|
organization_id: requestLog?.organization_id || 0,
|
||||||
status: 'requested',
|
status: 'requested',
|
||||||
|
edit: true
|
||||||
});
|
});
|
||||||
|
setIdProvider(requestLog?.organization_id || 0); // ✅ sekalian sync UI
|
||||||
}, [requestLog]);
|
}, [requestLog]);
|
||||||
|
|
||||||
|
|
||||||
@@ -98,7 +103,7 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
|
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
if (formData.type_of_member == "" && requestLog?.corporate_id == 5) {
|
if (formData.type_of_member == "" && requestLog?.view_type_member) {
|
||||||
setError(true);
|
setError(true);
|
||||||
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
alert('Silakan pilih Type Of Member sebelum mengirimkan data.');
|
||||||
}
|
}
|
||||||
@@ -109,7 +114,9 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
enqueueSnackbar('Request Final LOG Success', { variant: 'success' });
|
enqueueSnackbar('Request Final LOG Success', { variant: 'success' });
|
||||||
setOpenDialog(false);
|
setOpenDialog(false);
|
||||||
navigate('/detail-request-final-log/' + requestLog?.id)
|
navigate('/detail-request-final-log/' + requestLog?.id)
|
||||||
window.location.reload()
|
setTimeout(() => {
|
||||||
|
window.location.reload();
|
||||||
|
}, 1000); // 1000 ms = 1 detik
|
||||||
})
|
})
|
||||||
.catch(({ response }) => {
|
.catch(({ response }) => {
|
||||||
enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
|
enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' });
|
||||||
@@ -144,7 +151,9 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
icdCodes: requestLog?.diagnosis ?? [],
|
icdCodes: requestLog?.diagnosis ?? [],
|
||||||
reason: requestLog?.reason ?? '',
|
reason: requestLog?.reason ?? '',
|
||||||
type_of_member: requestLog?.type_of_member ?? '',
|
type_of_member: requestLog?.type_of_member ?? '',
|
||||||
status: 'requested'
|
organization_id: requestLog?.organization_id || 0,
|
||||||
|
status: 'requested',
|
||||||
|
edit: true
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const [isReasonSelected, setIsReasonSelected] = useState(true);
|
const [isReasonSelected, setIsReasonSelected] = useState(true);
|
||||||
@@ -159,9 +168,28 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
{ value: 'endorsement', label: 'Endorsement' },
|
{ value: 'endorsement', label: 'Endorsement' },
|
||||||
{ value: 'renewal', label: 'Renewal' },
|
{ value: 'renewal', label: 'Renewal' },
|
||||||
{ value: 'wrong_setting', label: 'Wrong Setting' },
|
{ value: 'wrong_setting', label: 'Wrong Setting' },
|
||||||
|
{ value: 'approval', label: 'Approval' },
|
||||||
// Add more options as needed
|
// Add more options as needed
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const [providers, setProviders] = useState([]);
|
||||||
|
const [idProvider, setIdProvider] = useState(0);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
axios
|
||||||
|
.get('/organizations')
|
||||||
|
.then((res) => {
|
||||||
|
setProviders(res.data.data || []);
|
||||||
|
})
|
||||||
|
.catch((err) => console.error(err));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (requestLog?.organization_id) {
|
||||||
|
setIdProvider(requestLog.organization_id);
|
||||||
|
}
|
||||||
|
}, [requestLog]);
|
||||||
|
|
||||||
// console.log(formData.type_of_member)
|
// console.log(formData.type_of_member)
|
||||||
|
|
||||||
const getContent = () => (
|
const getContent = () => (
|
||||||
@@ -196,6 +224,26 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card sx={{padding:2, marginTop:2}} >
|
<Card sx={{padding:2, marginTop:2}} >
|
||||||
|
<Stack direction="row" spacing={2} sx={marginBottom2}>
|
||||||
|
<Typography variant="subtitle2" sx={style1} gutterBottom>
|
||||||
|
Provider
|
||||||
|
</Typography>
|
||||||
|
|
||||||
|
<Autocomplete
|
||||||
|
options={providers}
|
||||||
|
getOptionLabel={(option) => option.name?.trim() || '-'}
|
||||||
|
value={providers.find((item) => item.id == idProvider) || null}
|
||||||
|
onChange={(event, newValue) => {
|
||||||
|
const id = newValue?.id || 0;
|
||||||
|
setIdProvider(id);
|
||||||
|
handleChange('organization_id', id);
|
||||||
|
}}
|
||||||
|
renderInput={(params) => (
|
||||||
|
<TextField {...params} label="Provider" fullWidth />
|
||||||
|
)}
|
||||||
|
fullWidth
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Invoice Provider</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Invoice Provider</Typography>
|
||||||
<TextField
|
<TextField
|
||||||
@@ -216,24 +264,26 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
|||||||
onChange={(e) => handleChange('billing_no', e.target.value)}
|
onChange={(e) => handleChange('billing_no', e.target.value)}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member*</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Select
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
||||||
fullWidth
|
<Select
|
||||||
value={formData.type_of_member}
|
fullWidth
|
||||||
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
value={formData.type_of_member}
|
||||||
variant="outlined"
|
onChange={(e) => handleChange('type_of_member', e.target.value)}
|
||||||
displayEmpty
|
variant="outlined"
|
||||||
required
|
displayEmpty
|
||||||
error={error}
|
required
|
||||||
>
|
error={error}
|
||||||
<MenuItem value="" disabled>
|
>
|
||||||
Type Member
|
<MenuItem value="" disabled>
|
||||||
</MenuItem>
|
Type Member
|
||||||
<MenuItem value="OMT">OMT</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
<MenuItem value="OMT">OMT</MenuItem>
|
||||||
</Select>
|
<MenuItem value="Non OMT">Non OMT</MenuItem>
|
||||||
</Stack>
|
</Select>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Discharge Date</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Discharge Date</Typography>
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@@ -296,10 +296,10 @@ export default function DetailRequestFinalLog() {
|
|||||||
>([])
|
>([])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!requestLog?.id && !Log_id) return
|
if (!requestLog?.id_member) return
|
||||||
|
|
||||||
axios
|
axios
|
||||||
.get('service-member/' + (requestLog?.id ?? Log_id))
|
.get('service-member/' + (requestLog?.id_member ?? null))
|
||||||
.then((res) => setServiceOptions(res.data))
|
.then((res) => setServiceOptions(res.data))
|
||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ export default function DetailRequestFinalLog() {
|
|||||||
.get('specialis')
|
.get('specialis')
|
||||||
.then((res) => setSpecialisOptions(res.data))
|
.then((res) => setSpecialisOptions(res.data))
|
||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
}, [requestLog?.id, Log_id])
|
}, [requestLog?.id_member])
|
||||||
|
|
||||||
|
|
||||||
const [serviceCode, setServiceCode] = useState<string>('')
|
const [serviceCode, setServiceCode] = useState<string>('')
|
||||||
@@ -356,7 +356,7 @@ export default function DetailRequestFinalLog() {
|
|||||||
}
|
}
|
||||||
setSubmitLoading(true);
|
setSubmitLoading(true);
|
||||||
const formData = makeFormData({
|
const formData = makeFormData({
|
||||||
request_logs_id: Log_id,
|
request_logs_id: requestLog?.id,
|
||||||
// result_files: fileHasilPenunjangs,
|
// result_files: fileHasilPenunjangs,
|
||||||
// diagnosa_files: fileDiagnosas,
|
// diagnosa_files: fileDiagnosas,
|
||||||
// kondisi_files: fileKondisis,
|
// kondisi_files: fileKondisis,
|
||||||
@@ -364,6 +364,7 @@ export default function DetailRequestFinalLog() {
|
|||||||
service_code: serviceCode,
|
service_code: serviceCode,
|
||||||
spescialis_id: idSpecialities,
|
spescialis_id: idSpecialities,
|
||||||
dppj: inputDppj,
|
dppj: inputDppj,
|
||||||
|
edit: true
|
||||||
});
|
});
|
||||||
axios
|
axios
|
||||||
.post('/request-final-log', formData)
|
.post('/request-final-log', formData)
|
||||||
@@ -424,7 +425,7 @@ export default function DetailRequestFinalLog() {
|
|||||||
Detail
|
Detail
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
{requestLog?.status_final_log != 'requested' ? (
|
{requestLog?.status_final_log != 'approved' ? (
|
||||||
<Grid item xs={6} sx={{ display: 'flex', placeContent: 'end' }}>
|
<Grid item xs={6} sx={{ display: 'flex', placeContent: 'end' }}>
|
||||||
<MoreMenu
|
<MoreMenu
|
||||||
actions={
|
actions={
|
||||||
@@ -457,10 +458,13 @@ export default function DetailRequestFinalLog() {
|
|||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Member ID</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.member_id}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
{requestLog?.view_type_member ? (
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Type Of Member</Typography>
|
||||||
</Stack>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.type_of_member}</Typography>
|
||||||
|
</Stack>
|
||||||
|
):('')}
|
||||||
|
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Policy Number</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.policy_number}</Typography>
|
||||||
@@ -512,7 +516,7 @@ export default function DetailRequestFinalLog() {
|
|||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.specialities_id ? requestLog?.specialities_id : '-'}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.specialities_id ? requestLog?.specialities_id : '-'}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>DPPJ</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>DPJP</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.dppj ? requestLog?.dppj : '-'}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.dppj ? requestLog?.dppj : '-'}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
@@ -639,7 +643,7 @@ export default function DetailRequestFinalLog() {
|
|||||||
|
|
||||||
<Stack direction="row" spacing={2}>
|
<Stack direction="row" spacing={2}>
|
||||||
<Stack spacing={2} sx={{ width: '100%' }}>
|
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||||
<Typography variant='subtitle1'>DPPJ </Typography>
|
<Typography variant='subtitle1'>DPJP </Typography>
|
||||||
<TextField
|
<TextField
|
||||||
id='dppj'
|
id='dppj'
|
||||||
variant='outlined'
|
variant='outlined'
|
||||||
@@ -893,7 +897,14 @@ export default function DetailRequestFinalLog() {
|
|||||||
!isReversal ? (
|
!isReversal ? (
|
||||||
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
||||||
if (!requestLog?.discharge_date || !requestLog?.service_code || !requestLog?.specialitiesID || !requestLog?.dppj) {
|
if (!requestLog?.discharge_date || !requestLog?.service_code || !requestLog?.specialitiesID || !requestLog?.dppj) {
|
||||||
alert('Lengkapi Tanggal Keluar, Service Code, Specialities, dan DPPJ terlebih dahulu, lalu simpan');
|
alert(
|
||||||
|
'Lengkapi:\n\n' +
|
||||||
|
'- Tanggal Keluar\n' +
|
||||||
|
'- Service Code\n' +
|
||||||
|
'- Specialities\n' +
|
||||||
|
'- DPPJ\n\n' +
|
||||||
|
'Terlebih dahulu, lalu simpan'
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setDialogBenefit(true);
|
setDialogBenefit(true);
|
||||||
@@ -1307,8 +1318,15 @@ export default function DetailRequestFinalLog() {
|
|||||||
!(requestLog?.files?.length > 0)
|
!(requestLog?.files?.length > 0)
|
||||||
) {
|
) {
|
||||||
alert(
|
alert(
|
||||||
'Lengkapi Tanggal Keluar, Service Code, Specialities, DPPJ, isi benefit, dan upload files terlebih dahulu, lalu simpan'
|
'Lengkapi:\n\n' +
|
||||||
);
|
'- Tanggal Keluar\n' +
|
||||||
|
'- Service Code\n' +
|
||||||
|
'- Specialities\n' +
|
||||||
|
'- DPJP\n' +
|
||||||
|
'- Isi Benefit\n' +
|
||||||
|
'- Upload Files\n\n' +
|
||||||
|
'Terlebih dahulu, lalu simpan'
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1316,7 +1334,7 @@ export default function DetailRequestFinalLog() {
|
|||||||
setOpenDialogSubmit(true);
|
setOpenDialogSubmit(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Request Final LOG
|
{requestLog?.status_final_log == 'requested' ? 'Update' : 'Request Final LOG'}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -1330,7 +1348,6 @@ export default function DetailRequestFinalLog() {
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Grid>
|
</Grid>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Container>
|
</Container>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ export type DetailFinalLogType = {
|
|||||||
id : number,
|
id : number,
|
||||||
code : string,
|
code : string,
|
||||||
member_id : string,
|
member_id : string,
|
||||||
|
view_type_member : any,
|
||||||
|
organization_id : any,
|
||||||
|
id_member : string,
|
||||||
|
service_code : string,
|
||||||
|
specialitiesID : any,
|
||||||
|
dppj : any,
|
||||||
invoice_no : string,
|
invoice_no : string,
|
||||||
billing_no : string,
|
billing_no : string,
|
||||||
provider : string,
|
provider : string,
|
||||||
|
|||||||
@@ -344,6 +344,12 @@ export default function TableListFinalLog() {
|
|||||||
label: localeData.txtServiceType,
|
label: localeData.txtServiceType,
|
||||||
isSort: true,
|
isSort: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'log_type',
|
||||||
|
align: 'center',
|
||||||
|
label: 'LOG Type',
|
||||||
|
isSort: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'discharge_date',
|
id: 'discharge_date',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@@ -447,6 +453,24 @@ export default function TableListFinalLog() {
|
|||||||
Pending
|
Pending
|
||||||
</Label>
|
</Label>
|
||||||
),
|
),
|
||||||
|
log_type:
|
||||||
|
obj.log_type === 'final' ? (
|
||||||
|
<Label color='info'>
|
||||||
|
Final
|
||||||
|
</Label>
|
||||||
|
) : obj.log_type === 'prescription' ? (
|
||||||
|
<Label color='warning'>
|
||||||
|
Prescription
|
||||||
|
</Label>
|
||||||
|
) : obj.log_type === 'reference' ? (
|
||||||
|
<Label color='secondary'>
|
||||||
|
Reference
|
||||||
|
</Label>
|
||||||
|
) : (
|
||||||
|
<Label color='default'>
|
||||||
|
-
|
||||||
|
</Label>
|
||||||
|
),
|
||||||
submission_date:
|
submission_date:
|
||||||
<Label>
|
<Label>
|
||||||
{obj.submission_date ? fDateTime(obj.submission_date) : ''}
|
{obj.submission_date ? fDateTime(obj.submission_date) : ''}
|
||||||
@@ -466,6 +490,27 @@ export default function TableListFinalLog() {
|
|||||||
<Iconify icon="eva:eye-fill" />
|
<Iconify icon="eva:eye-fill" />
|
||||||
View
|
View
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
{obj.status !== 'approved' ? (
|
||||||
|
<MenuItem
|
||||||
|
onClick={() =>
|
||||||
|
navigate('/detail-request-final-log/'+obj.id, {
|
||||||
|
state: {
|
||||||
|
Log_id: obj.id,
|
||||||
|
full_name: obj.full_name,
|
||||||
|
no_polis: obj.no_polis,
|
||||||
|
submission_date: obj.submission_date,
|
||||||
|
service_code: obj.service_code,
|
||||||
|
member_id: obj.member_id,
|
||||||
|
specialities_id: obj.specialities_id,
|
||||||
|
dppj: obj.dppj,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Iconify icon="fa:file-text" />
|
||||||
|
Edit
|
||||||
|
</MenuItem>
|
||||||
|
):''}
|
||||||
{obj.status === 'approved' ? (
|
{obj.status === 'approved' ? (
|
||||||
<MenuItem onClick={() => handleDownloadLog(obj.id, obj.service_code, obj.no_polis, obj.full_name, obj.provider, obj.approved_final_log_at)}>
|
<MenuItem onClick={() => handleDownloadLog(obj.id, obj.service_code, obj.no_polis, obj.full_name, obj.provider, obj.approved_final_log_at)}>
|
||||||
<Iconify icon="eva:download-fill" />
|
<Iconify icon="eva:download-fill" />
|
||||||
|
|||||||
@@ -294,6 +294,12 @@ export default function TableList() {
|
|||||||
label: localeData.txtRequestCode,
|
label: localeData.txtRequestCode,
|
||||||
isSort: true,
|
isSort: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'log_type',
|
||||||
|
align: 'left',
|
||||||
|
label: localeData.txtLogType,
|
||||||
|
isSort: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'provider',
|
id: 'provider',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@@ -318,6 +324,12 @@ export default function TableList() {
|
|||||||
label: localeData.txtStatus,
|
label: localeData.txtStatus,
|
||||||
isSort: true,
|
isSort: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'status_final_log',
|
||||||
|
align: 'center',
|
||||||
|
label: localeData.txtStatusFinalLog,
|
||||||
|
isSort: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'action',
|
id: 'action',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
@@ -399,6 +411,34 @@ export default function TableList() {
|
|||||||
...obj,
|
...obj,
|
||||||
provider:obj.provider,
|
provider:obj.provider,
|
||||||
full_name:formatTitleCase(obj.full_name),
|
full_name:formatTitleCase(obj.full_name),
|
||||||
|
log_type:
|
||||||
|
obj.log_type === 'reference' ? (
|
||||||
|
<Label color='info'>
|
||||||
|
Rujukan
|
||||||
|
</Label>
|
||||||
|
) : obj.log_type === 'prescription' ? (
|
||||||
|
<Label color='warning'>
|
||||||
|
Resep
|
||||||
|
</Label>
|
||||||
|
) : obj.log_type === 'consultation' ? (
|
||||||
|
<Label color='primary'>
|
||||||
|
Konsultasi
|
||||||
|
</Label>
|
||||||
|
) : (
|
||||||
|
<Label color='default'>
|
||||||
|
-
|
||||||
|
</Label>
|
||||||
|
),
|
||||||
|
status_final_log:
|
||||||
|
obj.final_log === 1 ? (
|
||||||
|
<Label color='primary'>
|
||||||
|
Request
|
||||||
|
</Label>
|
||||||
|
) : (
|
||||||
|
<Label color='error'>
|
||||||
|
Belum Dibuat
|
||||||
|
</Label>
|
||||||
|
),
|
||||||
status:
|
status:
|
||||||
obj.status === 'requested' ? (
|
obj.status === 'requested' ? (
|
||||||
<Label color='primary'>
|
<Label color='primary'>
|
||||||
|
|||||||
@@ -253,10 +253,10 @@
|
|||||||
<td>{{ $dataMember->code_plan }}</td>
|
<td>{{ $dataMember->code_plan }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="hot-line-<?php echo now()->timestamp; ?>">
|
<!-- <div class="hot-line-<?php echo now()->timestamp; ?>">
|
||||||
<b>Call Center LinkSehat : 08114123962</b>
|
<b>Call Center LinkSehat : 08114123962</b>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="txt-tindakan-<?php echo now()->timestamp; ?>">
|
<div class="txt-tindakan-<?php echo now()->timestamp; ?>" style="margin-top: 5px;">
|
||||||
LinkSehat bertindak mewakili perusahaan asuransi/penanggung untuk mengeluarkan Surat Jaminan Akhir untuk peserta dibawah ini :
|
LinkSehat bertindak mewakili perusahaan asuransi/penanggung untuk mengeluarkan Surat Jaminan Akhir untuk peserta dibawah ini :
|
||||||
</div>
|
</div>
|
||||||
<div class="container2-<?php echo now()->timestamp; ?>">
|
<div class="container2-<?php echo now()->timestamp; ?>">
|
||||||
|
|||||||
@@ -270,12 +270,9 @@
|
|||||||
echo '<img style="width: 65px; height: 48px;" src="' . $imgSrc . '">';
|
echo '<img style="width: 65px; height: 48px;" src="' . $imgSrc . '">';
|
||||||
}
|
}
|
||||||
@endphp -->
|
@endphp -->
|
||||||
@php
|
@php
|
||||||
if(!empty($dataMember->code_perusahaan) == 'VALEIND' && $dataRequestLog->submission_date <= '2025-05-12') {
|
if(!empty($ttdImage)) {
|
||||||
$imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(public_path('images/ttd_dr_vale.png')));
|
$imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents($ttdImage));
|
||||||
echo '<img style="width: 65px; height: 48px;" src="' . $imgSrc . '">';
|
|
||||||
} else if(!empty($dataMember->code_perusahaan) == 'VALEIND'){
|
|
||||||
$imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(public_path('images/ttd_dr_irma_2.png')));
|
|
||||||
echo '<img style="width: 65px; height: 48px;" src="' . $imgSrc . '">';
|
echo '<img style="width: 65px; height: 48px;" src="' . $imgSrc . '">';
|
||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
|
|||||||
@@ -260,10 +260,10 @@
|
|||||||
<td>{{ $dataMember->code_plan }}</td>
|
<td>{{ $dataMember->code_plan }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="hot-line-<?php echo now()->timestamp; ?>">
|
<!-- <div class="hot-line-<?php echo now()->timestamp; ?>">
|
||||||
<b>Call Center LinkSehat : 08114123962</b>
|
<b>Call Center LinkSehat : 08114123962</b>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="txt-tindakan-<?php echo now()->timestamp; ?>">
|
<div class="txt-tindakan-<?php echo now()->timestamp; ?>" style="margin-top: 5px;">
|
||||||
LinkSehat bertindak mewakili perusahaan asuransi/penanggung untuk mengeluarkan Surat Jaminan Awal untuk peserta dibawah ini :
|
LinkSehat bertindak mewakili perusahaan asuransi/penanggung untuk mengeluarkan Surat Jaminan Awal untuk peserta dibawah ini :
|
||||||
</div>
|
</div>
|
||||||
<div class="container2-<?php echo now()->timestamp; ?>">
|
<div class="container2-<?php echo now()->timestamp; ?>">
|
||||||
@@ -390,7 +390,7 @@
|
|||||||
<b>Keterangan:</b> {{ !empty($dataRequestLog->keterangan) ? $dataRequestLog->keterangan : ''}}
|
<b>Keterangan:</b> {{ !empty($dataRequestLog->keterangan) ? $dataRequestLog->keterangan : ''}}
|
||||||
</div>
|
</div>
|
||||||
<div class="txt-pernyataan-<?php echo now()->timestamp; ?>">
|
<div class="txt-pernyataan-<?php echo now()->timestamp; ?>">
|
||||||
Mohon konfirmasi ke LinkSehat (Alarm Center Makassar) jika ada rujukan pasien ke spesialis lain.<br/>
|
Mohon konfirmasi ke Primayan Medicare jika ada rujukan pasien ke spesialis lain.<br/>
|
||||||
Surat Jaminan ini dinyatakan berlaku apabila disertai surat jaminan akhir dengan nominal yang tertera pada akhir perawatan.
|
Surat Jaminan ini dinyatakan berlaku apabila disertai surat jaminan akhir dengan nominal yang tertera pada akhir perawatan.
|
||||||
</div>
|
</div>
|
||||||
<div class="title-container-page-<?php echo now()->timestamp; ?>">
|
<div class="title-container-page-<?php echo now()->timestamp; ?>">
|
||||||
|
|||||||
Reference in New Issue
Block a user