修改新增家庭成员接口
This commit is contained in:
parent
08192db50d
commit
c32bdd4b9c
@ -19,7 +19,7 @@ class PatientFamilyRequest extends FormRequest
|
||||
|
||||
protected array $scenes = [
|
||||
'addFamily' => [ // 新增家庭成员
|
||||
// 'relation',
|
||||
'relation',
|
||||
'is_default',
|
||||
'card_name',
|
||||
'mobile',
|
||||
@ -33,7 +33,7 @@ class PatientFamilyRequest extends FormRequest
|
||||
'marital_status',
|
||||
],
|
||||
'editFamily' => [ // 修改家庭成员
|
||||
// 'relation',
|
||||
'relation',
|
||||
'is_default',
|
||||
'card_name',
|
||||
'type',
|
||||
@ -107,22 +107,20 @@ class PatientFamilyRequest extends FormRequest
|
||||
'type' => ['required',Rule::in(['1', '2', '3', '4'])],
|
||||
'id_number' => "required",
|
||||
'mobile' => ['sometimes','regex:/^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/'],
|
||||
'relation' => ['sometimes',Rule::in(['1', '2', '3', '4', '5', '6'])],
|
||||
'relation' => ['sometimes',Rule::in([1,2,3,4,5,6,null])],
|
||||
'city_id' => 'required_with:province_id',
|
||||
'province_id' => 'required_with:city_id',
|
||||
'is_default' => ['sometimes',Rule::in(['0', '1'])],
|
||||
'is_default' => ['sometimes',Rule::in([0,1,null])],
|
||||
'height' => ['sometimes','numeric'], // 身高
|
||||
'weight' => ['sometimes','numeric'], // 体重
|
||||
'marital_status' => ['sometimes',Rule::in([0,1,2,null])], // 婚姻状况(0:未婚 1:已婚 2:离异 null:未选择)
|
||||
'is_allergy_history' => ['sometimes','numeric','min:0','max:1'],
|
||||
'is_family_history' => ['sometimes','numeric','min:0','max:1'],
|
||||
// 'is_pregnant' => ['sometimes','numeric','min:0','max:1'],
|
||||
'is_operation' => ['sometimes','numeric','min:0','max:1'],
|
||||
'drink_wine_status' => ['sometimes','numeric','min:1','max:5'],
|
||||
'smoke_status' => ['sometimes','numeric','min:1','max:5'],
|
||||
'chemical_compound_status' => ['sometimes','numeric','min:1','max:4'],
|
||||
'is_allergy_history' => ['sometimes',Rule::in([0,1,null])],
|
||||
'is_family_history' => ['sometimes',Rule::in([0,1,null])],
|
||||
'is_operation' => ['sometimes',Rule::in([0,1,null])],
|
||||
'drink_wine_status' => ['sometimes',Rule::in([1,2,3,4,5,null])],
|
||||
'smoke_status' => ['sometimes','numeric',Rule::in([1,2,3,4,5,null])],
|
||||
'chemical_compound_status' => ['sometimes',Rule::in([1,2,3,4,null])],
|
||||
'family_id' => "required",
|
||||
// 'disease_class_id' => "required",
|
||||
'diagnosis_date' => ['sometimes','date'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -178,9 +178,12 @@ class PatientFamilyService extends BaseService
|
||||
// 新增 患者家庭成员信息表-基本信息(patient_family)
|
||||
$data = array();
|
||||
$data['patient_id'] = $user_info['client_user_id'];
|
||||
if (!empty($request_params['relation'])){
|
||||
$data['relation'] = $request_params['relation'];
|
||||
if (isset($request_params['relation'])){
|
||||
if ($request_params['relation'] != null){
|
||||
$data['relation'] = $request_params['relation'];
|
||||
}
|
||||
}
|
||||
|
||||
$data['status'] = 1;
|
||||
$data['is_default'] = empty($request_params['is_default']) ? 0 : 1;
|
||||
$data['card_name'] = $request_params['card_name'];
|
||||
@ -218,7 +221,6 @@ class PatientFamilyService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!empty($request_params['nation_id'])){
|
||||
$data['nation_id'] = $request_params['nation_id'];
|
||||
$data['nation_name'] = $nation['nation_name'];
|
||||
@ -417,7 +419,6 @@ class PatientFamilyService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 职业
|
||||
if (!empty($request_params['job_id'])){
|
||||
if ($patient_family['job_id'] != $request_params['job_id']){
|
||||
@ -450,11 +451,13 @@ class PatientFamilyService extends BaseService
|
||||
|
||||
$data = array();
|
||||
if (isset($request_params['relation'])) {
|
||||
$data['relation'] = $request_params['relation'];
|
||||
if ($request_params['relation'] != $patient_family['relation']){
|
||||
$data['relation'] = $request_params['relation'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($request_params['is_default'])) {
|
||||
if ($request_params['is_default'] != ""){
|
||||
if ($request_params['is_default'] != $patient_family['is_default']){
|
||||
$data['is_default'] = $request_params['is_default'];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user