diff --git a/Modules/Client/Http/Controllers/Api/CorporateMemberController.php b/Modules/Client/Http/Controllers/Api/CorporateMemberController.php index 17387a83..d9f40b8f 100644 --- a/Modules/Client/Http/Controllers/Api/CorporateMemberController.php +++ b/Modules/Client/Http/Controllers/Api/CorporateMemberController.php @@ -212,7 +212,8 @@ class CorporateMemberController extends Controller 'benefit' ], 'requestLogDailyMonitorings:id,request_log_id,created_at,subject,body_temperature,sistole,diastole,respiration_rate,analysis,lab_date,provider,examination' => [ - 'requestLogMedicalPlans:request_log_daily_monitoring_id,plan,type' + 'requestLogMedicalPlans:request_log_daily_monitoring_id,plan,type', + // 'document' ], 'service:code,name', 'files', diff --git a/Modules/Client/Transformers/AlarmCenter/DataServiceMonitoring.php b/Modules/Client/Transformers/AlarmCenter/DataServiceMonitoring.php index 15e8c74c..1feb3adb 100644 --- a/Modules/Client/Transformers/AlarmCenter/DataServiceMonitoring.php +++ b/Modules/Client/Transformers/AlarmCenter/DataServiceMonitoring.php @@ -5,6 +5,7 @@ namespace Modules\Client\Transformers\AlarmCenter; use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Support\Carbon; use App\Models\Icd; +use DB; class DataServiceMonitoring extends JsonResource { @@ -22,17 +23,22 @@ class DataServiceMonitoring extends JsonResource $filesFinalLogKondisi = []; if (count($this->files)>0){ foreach ($this->files as $key => $value) { - if($value->type == 'final-log-result'){ + /* + Sementara di buat satu dulu, jangan di hapus.. + karena suka labil client nya, tiba2 hide tiba2 munculin fitur :D + */ + + // if($value->type == 'final-log-result'){ array_push($filesFinalLogResult, $value); - }; + // }; - if($value->type == 'final-log-diagnosis'){ - array_push($filesFinalLogDiagnosis, $value); - } + // if($value->type == 'final-log-diagnosis'){ + // array_push($filesFinalLogDiagnosis, $value); + // } - if($value->type == 'final-log-kondisi'){ - array_push($filesFinalLogKondisi, $value); - } + // if($value->type == 'final-log-kondisi'){ + // array_push($filesFinalLogKondisi, $value); + // } } $files = [ @@ -77,7 +83,6 @@ class DataServiceMonitoring extends JsonResource } } } - return [ 'companyName' => $this->member->currentCorporate->name ?? null, 'serviceCode' => $this->service_code ?? null, @@ -111,6 +116,23 @@ class DataServiceMonitoring extends JsonResource ->map(function ($groupedItems) { return collect($groupedItems) ->map(function ($requestLogDailyMonitoring) { + $arr_document = []; + $document = DB::table('files') + ->where(['fileable_type' => 'App\Models\LaboratoriumResult', 'fileable_id' => $requestLogDailyMonitoring->id]) + ->whereIn('type', ['medical-action-letter', 'confirmation-medical-letter']) + ->get(); + if ($document){ + foreach($document as $d){ + $arr_document[]= [ + 'path' => env('APP_URL') . '/storage/lab_result/' . $d->original_name, + 'type' => $d->type, + 'original_name' => $d->original_name, + 'name' => $d->name, + ]; + } + } + + return [ 'time' => $requestLogDailyMonitoring->created_at->format('H:i') ?? null, 'status' => 'Done' ?? null, @@ -130,6 +152,7 @@ class DataServiceMonitoring extends JsonResource }) ->sortBy('type') ->all()) ?? null, + 'files' => $arr_document ]; }) ->sortByDesc(function ($item) { @@ -148,11 +171,27 @@ class DataServiceMonitoring extends JsonResource ->map(function ($groupedItems) { return collect($groupedItems) ->map(function ($requestLogDailyMonitoring) { + $arr_document = []; + $document = DB::table('files') + ->where(['fileable_type' => 'App\Models\LaboratoriumResult', 'fileable_id' => $requestLogDailyMonitoring->id]) + ->whereIn('type', ['laboratorium-result']) + ->get(); + if ($document){ + foreach($document as $d){ + $arr_document[]= [ + 'path' => env('APP_URL') . '/storage/lab_result/' . $d->original_name, + 'type' => $d->type, + 'original_name' => $d->original_name, + 'name' => $d->name, + ]; + } + } return [ 'code' => $requestLogDailyMonitoring->code, 'date' => Carbon::parse($requestLogDailyMonitoring->lab_date)->format('d M Y') ?? null, 'examination' => $requestLogDailyMonitoring->examination ?? null, 'location' => $requestLogDailyMonitoring->provider ?? null, + 'files' => $arr_document ]; }) ->sortByDesc(function ($item) { diff --git a/Modules/Internal/Services/RequestLogService.php b/Modules/Internal/Services/RequestLogService.php index b25d0483..5aab262f 100644 --- a/Modules/Internal/Services/RequestLogService.php +++ b/Modules/Internal/Services/RequestLogService.php @@ -33,6 +33,7 @@ class RequestLogService "Tgl Billing dari RS" => "approved_final_log_at", "Total Billing" => "total_billing", "Benefit Item" => "benefit_id", + "Amount Incurred" => "amount_incurred", "Amount Approval" => "amount_approval", "Amount Not Approval" => "amount_not_approval", "Total COB" => "total_cob", @@ -57,6 +58,7 @@ class RequestLogService "approved_final_log_at" => "Tgl Billing dari RS", "total_billing" => "Total Billing", "benefit_id" => "Benefit Item", + "amount_incurred" => "Amount Incurred", "amount_approval" => "Amount Approval", "amount_not_approval" => "Amount Not Approval", "total_cob" => "Total COB", @@ -80,6 +82,7 @@ class RequestLogService "Tgl Billing dari RS", "Total Billing", "Benefit Item", + "Amount Incurred", "Amount Approval", "Amount Not Approval", "Total COB", @@ -103,6 +106,7 @@ class RequestLogService "Tgl Billing dari RS", "Total Billing", "Benefit Item", + "Amount Incurred", "Amount Approval", "Amount Not Approval", "Total COB", @@ -297,7 +301,7 @@ class RequestLogService 'request_log_id' => $requestLog->id, 'benefit_id' => $benefit->id, // 'amount_incurred' => ($row['amount_approval'] ? $row['amount_approval'] : 0) + ($row['amount_not_approval'] ? $row['amount_not_approval'] : 0) , - 'amount_incurred' => $row['total_billing'] , + 'amount_incurred' => $row['amount_incurred'] , 'amount_approved' => $row['amount_approval'] ?? 0, 'amount_not_approved' => $row['amount_not_approval'] ?? 0, 'excess_paid' => $row['amount_not_approval'] ?? 0, diff --git a/frontend/client-portal/src/pages/AlarmCenter/ListMember.tsx b/frontend/client-portal/src/pages/AlarmCenter/ListMember.tsx index e95bf847..8324b208 100644 --- a/frontend/client-portal/src/pages/AlarmCenter/ListMember.tsx +++ b/frontend/client-portal/src/pages/AlarmCenter/ListMember.tsx @@ -175,6 +175,10 @@ export default function List() { View + {/* navigate('service-monitoring/' + obj.id)}> + + Document Member + */} } /> diff --git a/frontend/client-portal/src/pages/AlarmCenter/ServiceMonitoring.tsx b/frontend/client-portal/src/pages/AlarmCenter/ServiceMonitoring.tsx index eb057be4..fb1d915a 100644 --- a/frontend/client-portal/src/pages/AlarmCenter/ServiceMonitoring.tsx +++ b/frontend/client-portal/src/pages/AlarmCenter/ServiceMonitoring.tsx @@ -179,6 +179,12 @@ type ServiceMonitoringProps = { type: number; plan: string; }[]; + files: { + type: string; + name: string; + original_name: string; + path: string; + }[]; }> >; laboratoriumResults: Record< @@ -188,6 +194,12 @@ type ServiceMonitoringProps = { date: string; examination: string; location: string; + files: { + type: string; + name: string; + original_name: string; + path: string; + }[]; }> >; }; @@ -387,7 +399,7 @@ export default function ServiceMonitoring() { - + {/* {loading ? : 'Symptoms'} @@ -404,8 +416,8 @@ export default function ServiceMonitoring() { )} - - + */} + {/* {loading ? : 'Sign'} @@ -422,7 +434,7 @@ export default function ServiceMonitoring() { )} - + */} @@ -441,7 +453,7 @@ export default function ServiceMonitoring() { - + {/* {loading ? ( @@ -462,14 +474,14 @@ export default function ServiceMonitoring() { )} - + */} {loading ? ( ) : ( - 'Files Result' + 'Files Document' )} @@ -502,7 +514,7 @@ export default function ServiceMonitoring() { )} - + {/* {loading ? ( @@ -539,8 +551,8 @@ export default function ServiceMonitoring() { - )} - - + */} + {/* {loading ? ( @@ -548,8 +560,8 @@ export default function ServiceMonitoring() { 'Files Kondisi' )} - - + */} + {/* {loading ? ( ) : data && data.files && data.files.kondisi.length > 0 ? @@ -576,7 +588,7 @@ export default function ServiceMonitoring() { - )} - + */} @@ -833,338 +845,393 @@ export default function ServiceMonitoring() { */} - - {loading ? ( - - - - + {data?.serviceCode === 'IP' ? ( + + {loading ? ( + + + + + + + + + + + - - - - - - - - - ) : ( - - - - - - - - - - {data && data.dailyMonitorings ? ( - - {data && - data.dailyMonitorings && - Object.keys(data.dailyMonitorings).length > 0 && - Object.keys(data.dailyMonitorings).map((date, dateIndex) => ( - - - - - - - - {date ? date : '-'} - - {data.dailyMonitorings[date].map( - (dailyMonitoring, dailyMonitoringIndex) => ( - - + ) : ( + + + + + + + + + + {data && data.dailyMonitorings ? ( + + {data && + data.dailyMonitorings && + Object.keys(data.dailyMonitorings).length > 0 && + Object.keys(data.dailyMonitorings).map((date, dateIndex) => ( + + + + + + + + {date ? date : '-'} + + {data.dailyMonitorings[date].map( + (dailyMonitoring, dailyMonitoringIndex) => ( + - - - - - - - - Subject - - {dailyMonitoring.subject - ? dailyMonitoring.subject - : '-'} - - - - - - - Objektif - - - - - - - Body Temperature - + + + + + + + + + Subject + + {dailyMonitoring.subject + ? dailyMonitoring.subject + : '-'} + + + + + + + Objektif + + + + + + + Body Temperature + + + + + + + {dailyMonitoring.bodyTemperature + ? dailyMonitoring.bodyTemperature + : '-'} + + + + + + + + Sistole + + + + + + {dailyMonitoring.sistole + ? dailyMonitoring.sistole + : '-'} + + + + + + + + Diastole + + + + + + {dailyMonitoring.diastole + ? dailyMonitoring.diastole + : '-'} + + + + + + + + + Respiration Rate + + + + + + + {dailyMonitoring.respirationRate + ? dailyMonitoring.respirationRate + : '-'} + + + + + + + + Complaints + + + + + + {dailyMonitoring.complaints + ? dailyMonitoring.complaints + : '-'} + + + + + + + Analysis + + + + + + + {dailyMonitoring.analysis + ? dailyMonitoring.analysis + : '-'} + + + + + + + Medical Plan : + + + + + + {data.dailyMonitorings ? ( +
    + {dailyMonitoring.plans.length > 0 ? ( + dailyMonitoring.plans.map((plan, planIndex) => + plan.type === 1 ? ( +
  • {plan.plan}
  • + ) : null + ) + ) : ( +
  • No plans available
  • + )} +
+ ) : ( + '-' + )}
-
- - - - {dailyMonitoring.bodyTemperature - ? dailyMonitoring.bodyTemperature - : '-'} - + + +
+ + + Non Medikamentosa Plan : + + + + + + {data.dailyMonitorings ? ( +
    + {dailyMonitoring.plans.length > 0 ? ( + dailyMonitoring.plans.map((plan, planIndex) => + plan.type === 2 ? ( +
  • {plan.plan}
  • + ) : null + ) + ) : ( +
  • No plans available
  • + )} +
+ ) : ( + '-' + )}
-
-
- - - - Sistole - - - - - - {dailyMonitoring.sistole - ? dailyMonitoring.sistole - : '-'} - - - - - - - - Diastole - - - - - - {dailyMonitoring.diastole - ? dailyMonitoring.diastole - : '-'} - - - - - - - - - Respiration Rate - - - - - - - {dailyMonitoring.respirationRate - ? dailyMonitoring.respirationRate - : '-'} - - - - - - - - Complaints - - - - - - {dailyMonitoring.complaints - ? dailyMonitoring.complaints - : '-'} - - - - - - - Analysis - - - - - - - {dailyMonitoring.analysis - ? dailyMonitoring.analysis - : '-'} - - - - - - - Medical Plan : - - - - + + + + + + + File Document : + + + {data.dailyMonitorings ? (
    - {dailyMonitoring.plans.length > 0 ? ( - dailyMonitoring.plans.map((plan, planIndex) => - plan.type === 1 ? ( -
  • {plan.plan}
  • - ) : null + {dailyMonitoring.files.length > 0 ? ( + dailyMonitoring.files.map((file, fileIndex) => + ( +
  • + + {file.original_name} + +
  • + ) ) ) : ( -
  • No plans available
  • +
  • -
  • )}
) : ( - '-' + - )}
+
+
+
+
+ ) + )} +
+
+ ))} +
+ ) : ( + + No Data Found + + )} +
+
-
- - - - Non Medikamentosa Plan : - - - - - - {data.dailyMonitorings ? ( -
    - {dailyMonitoring.plans.length > 0 ? ( - dailyMonitoring.plans.map((plan, planIndex) => - plan.type === 2 ? ( -
  • {plan.plan}
  • - ) : null - ) + + + {data && + data.laboratoriumResults && + Object.keys(data.laboratoriumResults).length > 0 ? ( + Object.keys(data.laboratoriumResults).map((date, dateIndex) => ( + + + {date ? date : '-'} + {data.laboratoriumResults[date]?.map((laboratoriumResult, laboratoriumResultIndex) => ( + + + + + + Date + Examination + Location + + + + + + {laboratoriumResult.examination || '-'} + {laboratoriumResult.location || '-'} + + + + {data.dailyMonitorings ? ( +
      + {laboratoriumResult.files.length > 0 ? ( + laboratoriumResult.files.map((file, fileIndex) => + ( +
    • + + {file.original_name} + +
    • + ) + ) + ) : ( +
    • -
    • + )} +
    ) : ( -
  • No plans available
  • + - )} - - ) : ( - '-' - )} - - - - - - +
    +
    +
    +
    - ) - )} - - - ))} - - ) : ( - - No Data Found - - )} -
    -
    - - - - {data && - data.laboratoriumResults && - Object.keys(data.laboratoriumResults).length > 0 ? ( - Object.keys(data.laboratoriumResults).map((date, dateIndex) => ( - - - {date ? date : '-'} - {data.laboratoriumResults[date]?.map((laboratoriumResult, laboratoriumResultIndex) => ( - - - - - - Date - Examination - Location - - - - - - {laboratoriumResult.examination || '-'} - {laboratoriumResult.location || '-'} - {/* - handleDownloadClick(laboratoriumResult.file)}> - Download - - - } - /> */} - - -
    -
    - ))} -
    -
    - )) - ) : ( - - No Data Found - - )} -
    -
    - - )} - + ))} + + + )) + ) : ( + + No Data Found + + )} + + + + )} + + ) : null} );