71 lines
2.4 KiB
PHP
71 lines
2.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace app\adminapi\validate\tcm;
|
|
|
|
use app\common\validate\BaseValidate;
|
|
|
|
class PrescriptionValidate extends BaseValidate
|
|
{
|
|
protected $rule = [
|
|
'id' => 'require',
|
|
'diagnosis_id' => 'number',
|
|
'appointment_id' => 'number',
|
|
'dosage_bag_count' => 'integer|between:1,5',
|
|
'patient_name' => 'require',
|
|
'clinical_diagnosis' => 'require',
|
|
'herbs' => 'require|array',
|
|
'action' => 'require|in:approve,reject',
|
|
'remark' => 'max:500',
|
|
];
|
|
|
|
protected $message = [
|
|
'dosage_bag_count.integer' => '用量袋数必须为整数',
|
|
'dosage_bag_count.between' => '用量袋数必须在1到5袋之间',
|
|
'patient_name.require' => '患者姓名不能为空',
|
|
'clinical_diagnosis.require' => '临床诊断不能为空',
|
|
'herbs.require' => '请添加中药',
|
|
];
|
|
|
|
public function sceneAdd()
|
|
{
|
|
return $this->only([
|
|
'prescription_type', 'dosage_amount', 'dosage_unit', 'dosage_bag_count', 'need_decoction', 'bags_per_dose',
|
|
'patient_name', 'gender', 'age',
|
|
'visit_no', 'prescription_date', 'tongue', 'tongue_image', 'pulse',
|
|
'pulse_condition', 'clinical_diagnosis', 'herbs', 'dose_count', 'dose_unit',
|
|
'usage_days', 'times_per_day', 'usage_instruction', 'usage_time', 'usage_way', 'dietary_taboo',
|
|
'usage_notes', 'doctor_name', 'is_shared', 'visible_role_ids',
|
|
'diagnosis_id', 'appointment_id', 'audit_status',
|
|
]);
|
|
}
|
|
|
|
public function sceneEdit()
|
|
{
|
|
return $this->only([
|
|
'id', 'prescription_type', 'dosage_amount', 'dosage_unit', 'dosage_bag_count', 'need_decoction', 'bags_per_dose',
|
|
'patient_name', 'gender', 'age',
|
|
'visit_no', 'prescription_date', 'tongue', 'tongue_image', 'pulse',
|
|
'pulse_condition', 'clinical_diagnosis', 'herbs', 'dose_count', 'dose_unit',
|
|
'usage_days', 'times_per_day', 'usage_instruction', 'usage_time', 'usage_way', 'dietary_taboo',
|
|
'usage_notes', 'doctor_name', 'is_shared', 'visible_role_ids', 'diagnosis_id',
|
|
]);
|
|
}
|
|
|
|
public function sceneDelete()
|
|
{
|
|
return $this->only(['id']);
|
|
}
|
|
|
|
public function sceneDetail()
|
|
{
|
|
return $this->only(['id']);
|
|
}
|
|
|
|
public function sceneAudit()
|
|
{
|
|
return $this->only(['id', 'action', 'remark']);
|
|
}
|
|
}
|