香洲二院小程序
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

51 lines
1.7 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
{
$this->resource = xmlArrayToListByKey($this->resource, 'ITEM');
$lists = [];
foreach ($this->resource['ITEM'] as $v) {
$lists[] = [
'category' => $v['JZLB'],
'visit_date' => $v['JZRQ'],
'diagnosis' => $v['CYZD'],
'dept_id' => $v['BQDM'],
'dept_name' => $v['BQMC'],
'reg_id' => $v['REGID'],
'prescription_id' => $v['CFID'],
'total_prescription_amount' => (float) $v['YLFYZE'],
'single_prescription_amount' => (float) $v['CFFYJE'] ?? 0,
'doctor_id' => $v['YSGH'],
'doctor_name' => $v['YSMC'],
'remark' => $v['BZ'],
'is_self_pay' => $v['ZFCF'],
'visit_no' => $v['JZXH'],
'prescription_number' => $v['CHHM'] ?: '',
'prescription_type' => $v['CFTYPE'] ?: '',
'exec_address' => $v['YFMC'] ?: '',
'medical_type' => $v['MED_TYPE'] ?: '',
'disease_code' => $v['DISE_CODG'] ?: '',
'disease_name' => $v['DISE_NAME'] ?: '',
'settlement_method' => $v['PSN_SETLWAY'] ?: '',
'out_of_area_flag' => $v['OUT_FLAG'] ?: ''
];
}
return $lists;
}
}