From 0ee868e071e9f6ad145070382719f687dfc4314f Mon Sep 17 00:00:00 2001 From: Iqbal Date: Thu, 7 May 2026 13:23:48 +0700 Subject: [PATCH] fix: update log_type from final to consultation in final log table and sync command --- .../Commands/SyncLogTypeFromTelemedicine.php | 6 ++- .../sections/dashboard/TableListFinalLog.tsx | 38 +++++-------------- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/app/Console/Commands/SyncLogTypeFromTelemedicine.php b/app/Console/Commands/SyncLogTypeFromTelemedicine.php index f6d08fa8..c32cd6d9 100644 --- a/app/Console/Commands/SyncLogTypeFromTelemedicine.php +++ b/app/Console/Commands/SyncLogTypeFromTelemedicine.php @@ -81,8 +81,10 @@ class SyncLogTypeFromTelemedicine extends Command continue; } + $mappedType = $primeLog->type === 'final' ? 'consultation' : $primeLog->type; + // Skip if log_type already set correctly - if ($requestLog->log_type === $primeLog->type) { + if ($requestLog->log_type === $mappedType) { $skipped++; $bar->advance(); continue; @@ -93,7 +95,7 @@ class SyncLogTypeFromTelemedicine extends Command DB::table('request_logs') ->where('id', $requestLog->id) ->update([ - 'log_type' => $primeLog->type, + 'log_type' => $mappedType, 'updated_at' => now() ]); } diff --git a/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx b/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx index 65f8ad44..124c94dc 100644 --- a/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx +++ b/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx @@ -320,36 +320,18 @@ export default function TableListFinalLog() { label: localeData.txtRequestCode, isSort: true, }, + { + id: 'log_type', + align: 'center', + label: 'Tipe LOG', + isSort: true, + }, { id: 'provider', align: 'left', label: localeData.txtProvider, isSort: true, }, - { - id: 'full_name', - align: 'left', - label: localeData.txtName, - isSort: true, - }, - { - id: 'submission_date', - align: 'center', - label: localeData.txtSubmissionDate, - isSort: true, - }, - { - id: 'service_type', - align: 'center', - label: localeData.txtServiceType, - isSort: true, - }, - { - id: 'log_type', - align: 'center', - label: 'LOG Type', - isSort: true, - }, { id: 'discharge_date', align: 'center', @@ -454,17 +436,17 @@ export default function TableListFinalLog() { ), log_type: - obj.log_type === 'final' ? ( + obj.log_type === 'consultation' ? ( ) : obj.log_type === 'prescription' ? ( ) : obj.log_type === 'reference' ? ( ) : (