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.
42 lines
1.3 KiB
42 lines
1.3 KiB
<?php
|
|
declare(strict_types = 1);
|
|
|
|
namespace App\Http\Resources\Outpatient\Pending;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class PendingDetailsResource 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[] = [
|
|
'fee_date' => $v['feeDate'],
|
|
'item_id' => $v['itemNo'],
|
|
'item_code' => $v['projectNumber'],
|
|
'item_name' => $v['entryName'],
|
|
'price' => (float) $v['unitPrice'],
|
|
'quantity' => $v['quantity'],
|
|
'unit' => $v['company'],
|
|
'spec' => $v['projectSpecifications'],
|
|
'total_price' => $v['money'],
|
|
'prescription_id' => $v['prescriptionNumber'],
|
|
'prescription_type' => $v['prescriptionType'],
|
|
'dept_id' => $v['treatmentDepartment'],
|
|
'dept_name' => $v['departmentName'],
|
|
'doctor_id' => $v['doctorNumber'],
|
|
'doctor_name' => $v['doctorName'],
|
|
];
|
|
}
|
|
|
|
return $lists;
|
|
}
|
|
}
|
|
|