香洲二院小程序
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/PendingDetailsResource.php

58 lines
2.2 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 = [];
$this->resource = xmlArrayToListByKey($this->resource, 'ITEM');
foreach ($this->resource['ITEM'] as $v) {
$lists[] = [
'fee_date' => $v['FYRQ'],
'item_id' => $v['XMXH'],
'item_code' => $v['XMBH'],
'item_name' => $v['XMMC'],
'price' => (float) $v['JG'],
'quantity' => $v['MCYL'],
'total_price' => $v['JE'],
'package_name' => $v['ZTMC'],
'self_pay_ratio' => $v['ZFBL'],
'self_pay_fee' => (float) $v['ZFJE'],
'prescription_id' => $v['CFID'],
'unit' => $v['UNIT'],
'prescription_type' => $v['CFTYPE'],
'dept_id' => $v['BQDM'],
'dept_name' => $v['BQMC'],
'doctor_id' => $v['YSGH'],
'doctor_name' => $v['YSMC'],
// 冗余字段
'national_catalog_code' => $v['GJMLBM'] ?: '',
'single_dose' => $v['YCJL'] ?: '',
'frequency' => $v['YPYF'] ?: '',
'medication_days' => $v['YYTS'] ?: '',
'administration_route' => $v['GYTJ'] ?: '',
'hospital_approval_flag' => $v['HOSP_APPR_FLAG'] ?: '',
'chinese_medicine_usage' => $v['TCMDRUG_USED_WAY'] ?: '',
'external_inspection_flag' => $v['ETIP_FLAG'] ?: '',
'external_inspection_hospital_code' => $v['ETIP_HOSP_CODE'] ?: '',
'discharge_medication_flag' => $v['DSCG_TKDRUG_FLAG'] ?: '',
'maternity_fee_flag' => $v['MATN_FEE_FLAG'] ?: '',
'external_purchase_prescription_flag' => $v['RX_CIRC_FLAG'] ?: '',
];
}
return $lists;
}
}