Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4b6cfc6d
authored
Dec 02, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加医师驳回
parent
e9bdc8d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
app/Api/Controllers/PrescriptionController.php
+29
-0
No files found.
app/Api/Controllers/PrescriptionController.php
View file @
4b6cfc6d
...
...
@@ -131,6 +131,9 @@ public function create(Request $request)
$prescription
->
user_id
=
$authInfo
->
id
;
// 获取当前用户ID
// 问诊人信息
$patient
=
PatientModel
::
find
(
$patient_id
);
if
(
!
$patient
)
{
return
$this
->
failed
(
'问诊人不存在,请选择正确的问诊人'
);
}
$prescription
->
patient_id
=
$patient_id
;
// 问诊人编号
$prescription
->
patient_name
=
$patient
->
name
;
// 问诊人姓名
$prescription
->
patient_age
=
getAgeByIdCard
(
$patient
->
id_card
);
// 问诊人年龄
...
...
@@ -394,4 +397,30 @@ public function invalid(Request $request)
return
$this
->
failed
(
'处方作废失败'
);
}
public
function
reject
(
Request
$request
)
{
$authInfo
=
auth
(
'api'
)
->
user
();
// 获取医师信息
$doctor
=
DoctorModel
::
where
(
'user_id'
,
$authInfo
->
id
)
->
first
();
if
(
!
$doctor
)
{
return
$this
->
failed
(
'你的账号可能在其他设备登录,请重新登录'
);
}
$prescription_id
=
$request
->
input
(
'prescription_id'
);
$prescription
=
PrescriptionModel
::
where
(
'id'
,
$prescription_id
)
->
where
(
'doctor_id'
,
$doctor
->
id
)
->
first
();
if
(
!
$prescription
)
{
return
$this
->
success
(
'处方单不存在!'
);
}
$reject_reason
=
$request
->
input
(
'reject_reason'
);
if
(
empty
(
$reject_reason
))
{
return
$this
->
failed
(
'请输入驳回原因'
);
}
$prescription
->
reject_status
=
PrescriptionModel
::
REJECT_STSATUS_TRUE
;
$prescription
->
reject_reason
=
$reject_reason
;
if
(
$prescription
->
save
())
{
return
$this
->
success
(
'驳回成功'
);
}
return
$this
->
failed
(
'处方作废失败'
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment