93 lines
3.4 KiB
PHP
93 lines
3.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models\YiiModels;
|
|
|
|
use App\Models\Extend\SoftDeletesInt;
|
|
|
|
/**
|
|
* App\Models\YiiModels\Prescription
|
|
*
|
|
* @property int $id
|
|
* @property int $store_id 门店id
|
|
* @property string $prescription_no 处方编号
|
|
* @property int $register_id 挂号订单id
|
|
* @property int $su_id su_id
|
|
* @property int $user_id 用户id
|
|
* @property int $up_id 就诊人id
|
|
* @property int $status 状态 0待审核,1已通过,2未通过
|
|
* @property int|null $valid_hours
|
|
* @property int $is_online 1线上 0线下
|
|
* @property int|null $is_dispense
|
|
* @property array|null $content 处方快照
|
|
* @property int $prescription_type 1中药处方 2西药处方 3颗粒药处方
|
|
* @property int $category 类别 1自费2医保
|
|
* @property string $doctor_order 医嘱
|
|
* @property string|null $clinical_diagnose 临床诊断
|
|
* @property string|null $doctor_sign 医生签名
|
|
* @property int|null $pharmacist_id
|
|
* @property int|null $pharmacist_view_time
|
|
* @property int $first_view 初审药师id
|
|
* @property string|null $first_sign 初审药师签名
|
|
* @property int $first_time 初审时间
|
|
* @property int $again_view 复审药师id
|
|
* @property string|null $again_sign 复审药师签名
|
|
* @property int $again_time 复审时间
|
|
* @property int $type 类型 1普通方 2常用方
|
|
* @property string $cr_ids 中药药方ids
|
|
* @property string $gr_ids 颗粒药药方ids
|
|
* @property string $wr_ids 西药药方ids
|
|
* @property int $order_type 订单类型1处方2医技
|
|
* @property string $total_pay_price
|
|
* @property int $is_pay 是否支付0否1是
|
|
* @property int $pay_time 支付时间
|
|
* @property int $pay_type 支付类型 1微信2支付宝3银行卡4其他
|
|
* @property int $cancel_status 取消状态0否1是
|
|
* @property int $cancel_time 取消时间
|
|
* @property string $cancel_remark 取消备注(未支付超时取消,主动取消,拒绝取消)
|
|
* @property int $refund_status 退款状态
|
|
* @property int $refund_time
|
|
* @property int $auto_expire_time
|
|
* @property \Illuminate\Support\Carbon $created_at
|
|
* @property \Illuminate\Support\Carbon $updated_at
|
|
* @property int $is_deleted
|
|
* @property-read string $created_at_format 创建时间的格式化
|
|
* @property-read string $prescription_type_string 处方类型
|
|
* @property-read string $status_string 状态名称
|
|
* @property-read string $updated_at_format 更新时间的格式化
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\Prescription newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\Prescription newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\YiiModels\Prescription query()
|
|
* @mixin \Eloquent
|
|
*/
|
|
class Prescription extends YiiBaseModel
|
|
{
|
|
use SoftDeletesInt;
|
|
|
|
protected $casts = [
|
|
'content' => 'array',
|
|
];
|
|
|
|
const DELETED_AT = 'is_deleted';
|
|
|
|
// 处方类型
|
|
const CHINESE_MEDICINES_DECOCTION_PIECE = 1;
|
|
const WESTERN_ZHONG_CHENG_MEDICINE = 2;
|
|
const DISPENSING_GRANULES = 3;
|
|
const PRESCRIPTION_TYPE = [
|
|
self::CHINESE_MEDICINES_DECOCTION_PIECE => '中药饮片',
|
|
self::WESTERN_ZHONG_CHENG_MEDICINE => '西(中成)药',
|
|
self::DISPENSING_GRANULES => '配方颗粒',
|
|
];
|
|
|
|
/**
|
|
* prescription_type_string
|
|
*
|
|
* @comment 处方类型
|
|
* @return string
|
|
*/
|
|
public function getPrescriptionTypeStringAttribute(): string
|
|
{
|
|
return self::PRESCRIPTION_TYPE[$this->prescription_type] ?? '';
|
|
}
|
|
}
|