Files
zyt/server/app/adminapi/validate/doctor/AppointmentValidate.php
T

152 lines
3.6 KiB
PHP
Executable File

<?php
namespace app\adminapi\validate\doctor;
use app\common\validate\BaseValidate;
/**
* 医生预约验证器
* Class AppointmentValidate
* @package app\adminapi\validate\doctor
*/
class AppointmentValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
'patient_id' => 'require|integer',
'doctor_id' => 'require|integer',
'diagnosis_id' => 'require|integer',
'appointment_date' => 'require|date',
'appointment_time' => 'require',
'period' => 'in:morning,afternoon,all',
'appointment_type' => 'require|in:video,text,phone',
'status' => 'require|integer|between:1,4',
'remark' => 'max:500',
'channel_source' => 'require',
'channel_source_detail' => 'max:128',
'note_id' => 'require|integer',
'image_type' => 'require|in:tongue_images,report_files',
'image_path' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => '预约ID',
'patient_id' => '患者ID',
'doctor_id' => '医生ID',
'diagnosis_id' => '诊单ID',
'appointment_date' => '预约日期',
'appointment_time' => '预约时间',
'period' => '时段',
'appointment_type' => '预约类型',
'status' => '状态',
'remark' => '备注',
'assistant_id' => '医助',
'channel_source' => '渠道来源',
'channel_source_detail' => '渠道补充说明',
];
/**
* @notes 创建预约场景
* @return AppointmentValidate
*/
public function sceneCreate()
{
return $this->only(['patient_id', 'doctor_id', 'appointment_date', 'period', 'appointment_time', 'appointment_type', 'channel_source', 'channel_source_detail']);
}
/**
* @notes 取消预约场景
* @return AppointmentValidate
*/
public function sceneCancel()
{
return $this->only(['id']);
}
/**
* @notes 预约详情场景
* @return AppointmentValidate
*/
public function sceneDetail()
{
return $this->only(['id']);
}
/**
* @notes 可用时间段场景
* @return AppointmentValidate
*/
public function sceneAvailableSlots()
{
return $this->only(['doctor_id', 'appointment_date', 'period']);
}
/**
* @notes 完成预约场景
* @return AppointmentValidate
*/
public function sceneComplete()
{
return $this->only(['id']);
}
/**
* @notes 接诊台聚合详情场景
* @return AppointmentValidate
*/
public function sceneReception()
{
return $this->only(['id']);
}
/**
* @notes 通知接诊医助场景
* @return AppointmentValidate
*/
public function sceneNotifyAssistant()
{
return $this->only(['id']);
}
public function sceneAddDoctorNote()
{
return $this->only(['diagnosis_id']);
}
public function sceneDoctorNotes()
{
return $this->only(['diagnosis_id']);
}
public function sceneDeleteDoctorNoteImage()
{
return $this->only(['note_id', 'image_type', 'image_path']);
}
/**
* 后台挂号编辑(消费者处方-挂号列表等)
*/
public function sceneAdminEdit()
{
return $this->only([
'id',
'appointment_date',
'appointment_time',
'period',
'appointment_type',
'status',
'remark',
'channel_source',
'channel_source_detail',
]);
}
}