香洲二院小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mini_xzey/app/Http/Resources/Outpatient/Pending/PendingListsResource.php

42 lines
1.4 KiB

<?php
declare(strict_types = 1);
namespace App\Http\Resources\Outpatient\Pending;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class PendingListsResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request = null): array
{
$lists = [];
foreach ($this->resource['response'] as $v) {
$lists[] = [
'category' => $v['visitType'],
'visit_date' => date('Y-m-d', strtotime($v['visitDate'])),
'diagnosis' => $v['outpatientDiagnosis'],
'dept_id' => $v['treatmentDepartment'],
'dept_name' => $v['departmentName'],
'reg_id' => $v['regId'],
'prescription_id' => $v['prescriptionId'],
'total_prescription_amount' => (float) $v['prescriptionAmount'],
'single_prescription_amount' => (float) $v['singleAmount'],
'doctor_name' => $v['doctorName'],
'remark' => $v['remarks'],
'is_self_pay' => $v['isexpense'],
'prescription_number' => $v['nrescriptionNumber'],
'exec_address' => $v['takeMedicine'] ?: '',
'visit_no' => $v['visitNumber'],
];
}
return $lists;
}
}