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
c967854b
authored
Nov 19, 2024
by
赵增煜
Browse files
Options
Browse Files
Download
Plain Diff
合并异常
parents
8085c08b
3870e3e0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
12 deletions
+66
-12
app/Admin/Controllers/PharmacyConfigController.php
+6
-0
app/Admin/Controllers/PrescriptionController.php
+1
-0
app/Admin/Controllers/PrescriptionPrintController.php
+13
-1
app/Admin/Extensions/Form/PharmacyConfigForm.php
+10
-11
app/Api/Controllers/PrescriptionController.php
+7
-0
database/migrations/2024_11_19_155001_add_is_abnormal_to_prescription_table.php
+28
-0
database/seeders/AdminTablesSeeder.php
+0
-0
lang/zh_CN/prescription.php
+1
-0
No files found.
app/Admin/Controllers/PharmacyConfigController.php
View file @
c967854b
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
App\Admin\Controllers
;
namespace
App\Admin\Controllers
;
use
App\Admin\Extensions\Form\PharmacyConfigForm
;
use
App\Admin\Extensions\Form\PharmacyConfigForm
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Layout\Content
;
use
Dcat\Admin\Layout\Content
;
...
@@ -11,6 +12,11 @@ class PharmacyConfigController extends AdminController
...
@@ -11,6 +12,11 @@ class PharmacyConfigController extends AdminController
{
{
public
function
index
(
Content
$content
)
:
Content
public
function
index
(
Content
$content
)
:
Content
{
{
// 权限判断和数据过滤
if
(
!
Admin
::
user
()
->
isRole
(
'pharmacy'
))
{
admin_exit
(
Content
::
make
()
->
withError
(
trans
(
'admin.deny'
)));
}
return
$content
->
header
(
'药店配置'
)
return
$content
->
header
(
'药店配置'
)
->
description
(
''
)
->
description
(
''
)
->
body
(
new
PharmacyConfigForm
());
->
body
(
new
PharmacyConfigForm
());
...
...
app/Admin/Controllers/PrescriptionController.php
View file @
c967854b
...
@@ -53,6 +53,7 @@ protected function grid()
...
@@ -53,6 +53,7 @@ protected function grid()
// $grid->column('pharmacist_id');
// $grid->column('pharmacist_id');
// $grid->column('pharmacist_license_number');
// $grid->column('pharmacist_license_number');
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'is_abnormal'
)
->
using
([
0
=>
'否'
,
1
=>
'是'
]);
// $grid->column('updated_at')->sortable();
// $grid->column('updated_at')->sortable();
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
$grid
->
filter
(
function
(
Grid\Filter
$filter
)
{
...
...
app/Admin/Controllers/PrescriptionPrintController.php
View file @
c967854b
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
use
App\Models\PatientModel
;
use
App\Models\PatientModel
;
use
App\Models\PharmacyDrugModel
;
use
App\Models\PharmacyDrugModel
;
use
App\Models\PrescriptionModel
;
use
App\Models\PrescriptionModel
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Dcat\Admin\Layout\Content
;
use
Dcat\Admin\Layout\Content
;
use
Illuminate\Support\Facades\Storage
;
use
Illuminate\Support\Facades\Storage
;
...
@@ -16,6 +17,11 @@ class PrescriptionPrintController extends AdminController
...
@@ -16,6 +17,11 @@ class PrescriptionPrintController extends AdminController
// 处方打印首页,显示输入框,可以搜索处方
// 处方打印首页,显示输入框,可以搜索处方
public
function
index
(
Content
$content
)
:
Content
public
function
index
(
Content
$content
)
:
Content
{
{
// 权限判断和数据过滤
if
(
!
Admin
::
user
()
->
isRole
(
'pharmacy'
))
{
admin_exit
(
Content
::
make
()
->
withError
(
trans
(
'admin.deny'
)));
}
// 加载处方打印页面
// 加载处方打印页面
return
$content
->
header
(
'处方打印'
)
return
$content
->
header
(
'处方打印'
)
->
description
(
'根据处方编号搜索并打印处方'
)
->
description
(
'根据处方编号搜索并打印处方'
)
...
@@ -27,13 +33,19 @@ public function index(Content $content): Content
...
@@ -27,13 +33,19 @@ public function index(Content $content): Content
*/
*/
public
function
search
()
public
function
search
()
{
{
if
(
!
Admin
::
user
()
->
isRole
(
'pharmacy'
))
{
return
response
()
->
json
([
'status'
=>
false
,
'message'
=>
'您没有权限~'
,
]);
}
$prescriptionNo
=
request
(
'prescription_no'
);
$prescriptionNo
=
request
(
'prescription_no'
);
$isEseal
=
request
(
'is_eseal'
,
0
);
// 是否打印电子印章,实时生成
$isEseal
=
request
(
'is_eseal'
,
0
);
// 是否打印电子印章,实时生成
if
(
empty
(
$prescriptionNo
))
{
if
(
empty
(
$prescriptionNo
))
{
return
response
()
->
json
([
return
response
()
->
json
([
'status'
=>
false
,
'status'
=>
false
,
'message'
=>
'请输入处方编号'
,
'message'
=>
'请输入处方编号
~
'
,
]);
]);
}
}
...
...
app/Admin/Extensions/Form/PharmacyConfigForm.php
View file @
c967854b
...
@@ -2,22 +2,22 @@
...
@@ -2,22 +2,22 @@
namespace
App\Admin\Extensions\Form
;
namespace
App\Admin\Extensions\Form
;
use
App\Models\PharmacyModel
;
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Widgets\Form
;
use
Dcat\Admin\Widgets\Form
;
//
全局
设置
//
药店
设置
class
PharmacyConfigForm
extends
Form
class
PharmacyConfigForm
extends
Form
{
{
public
function
handle
(
array
$input
)
public
function
handle
(
array
$input
)
{
{
$data
=
[
$isAuto
=
$input
[
'is_auto'
]
==
1
?
1
:
0
;
'site_config'
=>
$input
,
$pharmacyId
=
Admin
::
user
()
->
pharmacy_id
;
];
PharmacyModel
::
where
(
'id'
,
$pharmacyId
)
->
update
([
'is_auto'
=>
$isAuto
]);
admin_setting
(
$data
);
return
$this
return
$this
->
response
()
->
response
()
->
location
(
'
site
-config'
)
->
location
(
'
pharmacy
-config'
)
->
success
(
'设置成功'
);
->
success
(
'设置成功'
);
}
}
...
@@ -26,10 +26,9 @@ public function handle(array $input)
...
@@ -26,10 +26,9 @@ public function handle(array $input)
*/
*/
public
function
form
()
public
function
form
()
{
{
$data
=
admin_setting
(
'site_config'
);
$pharmacyId
=
Admin
::
user
()
->
pharmacy_id
;
$data
=
json_decode
(
$data
,
true
);
$isAuto
=
PharmacyModel
::
where
(
'id'
,
$pharmacyId
)
->
value
(
'is_auto'
);
$this
->
switch
(
'is_auto'
,
'药店自动开方'
)
->
default
(
$isAuto
);
$this
->
switch
(
'prescription_auto'
,
'医师自动开方'
);
$this
->
disableResetButton
();
$this
->
disableResetButton
();
}
}
...
...
app/Api/Controllers/PrescriptionController.php
View file @
c967854b
...
@@ -120,12 +120,17 @@ public function create(Request $request)
...
@@ -120,12 +120,17 @@ public function create(Request $request)
$prescription
->
diagnosis_name
=
DiagnosiModel
::
find
(
$diagnosis_id
)
->
value
(
'name'
);
$prescription
->
diagnosis_name
=
DiagnosiModel
::
find
(
$diagnosis_id
)
->
value
(
'name'
);
// 问诊问题
// 问诊问题
$inquiry_info
=
[];
$inquiry_info
=
[];
$is_abnormal
=
0
;
// 是否异常处方单,只有一个问题回答是就是异常
foreach
(
$inquirys
as
$inquiry
)
{
foreach
(
$inquirys
as
$inquiry
)
{
$inquiry_info
[]
=
[
$inquiry_info
[]
=
[
'inquiry_id'
=>
$inquiry
[
'inquiry_id'
],
'inquiry_id'
=>
$inquiry
[
'inquiry_id'
],
'question'
=>
InquiryModel
::
find
(
$inquiry
[
'inquiry_id'
])
->
value
(
'question'
),
'question'
=>
InquiryModel
::
find
(
$inquiry
[
'inquiry_id'
])
->
value
(
'question'
),
'answer'
=>
$inquiry
[
'answer'
]
==
1
?
1
:
0
,
// [1 => '是', 0 => '否']
'answer'
=>
$inquiry
[
'answer'
]
==
1
?
1
:
0
,
// [1 => '是', 0 => '否']
];
];
// 检查是否有一个answer是1
if
(
$inquiry
[
'answer'
]
==
1
)
{
$is_abnormal
=
1
;
// 如果有一个answer是1,设置$is_abnormal为1
}
}
}
$prescription
->
inquiry_info
=
json_encode
(
$inquiry_info
);
$prescription
->
inquiry_info
=
json_encode
(
$inquiry_info
);
// 用药信息
// 用药信息
...
@@ -196,6 +201,8 @@ public function create(Request $request)
...
@@ -196,6 +201,8 @@ public function create(Request $request)
$prescription
->
updated_at
=
Carbon
::
now
()
->
subMinutes
(
15
);
$prescription
->
updated_at
=
Carbon
::
now
()
->
subMinutes
(
15
);
$prescription
->
prescription_at
=
$prescription_at
;
$prescription
->
prescription_at
=
$prescription_at
;
$prescription
->
review_at
=
$review_at
;
$prescription
->
review_at
=
$review_at
;
$prescription
->
is_abnormal
=
$is_abnormal
;
$prescription_number
=
0
;
$prescription_number
=
0
;
if
(
$prescription
->
save
())
{
if
(
$prescription
->
save
())
{
$prescription_number
=
$prescription
->
id
;
$prescription_number
=
$prescription
->
id
;
...
...
database/migrations/2024_11_19_155001_add_is_abnormal_to_prescription_table.php
0 → 100644
View file @
c967854b
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*/
public
function
up
()
:
void
{
Schema
::
table
(
'prescription'
,
function
(
Blueprint
$table
)
{
$table
->
boolean
(
'is_abnormal'
)
->
default
(
0
)
->
comment
(
'是否异常处方[0=否,1=是]'
);
});
}
/**
* Reverse the migrations.
*/
public
function
down
()
:
void
{
Schema
::
table
(
'prescription'
,
function
(
Blueprint
$table
)
{
//
});
}
};
database/seeders/AdminTablesSeeder.php
View file @
c967854b
This diff is collapsed.
Click to expand it.
lang/zh_CN/prescription.php
View file @
c967854b
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
'open_source'
=>
'开方来源'
,
'open_source'
=>
'开方来源'
,
'prescription_at'
=>
'开方时间'
,
'prescription_at'
=>
'开方时间'
,
'review_at'
=>
'审方时间'
,
'review_at'
=>
'审方时间'
,
'is_abnormal'
=>
'异常处方单'
,
],
],
'options'
=>
[
'options'
=>
[
],
],
...
...
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