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
2cfc1903
authored
Dec 04, 2024
by
lujunyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
药品搜索条件增加
parent
994d719e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
21 deletions
+31
-21
app/Admin/Controllers/DrugController.php
+4
-0
app/Admin/Renderable/DrugTable.php
+8
-0
app/Api/Controllers/PatientController.php
+11
-11
app/Api/Controllers/PrescriptionController.php
+3
-2
app/Api/Controllers/UnitController.php
+2
-4
app/Console/Commands/TestCommand.php
+3
-4
No files found.
app/Admin/Controllers/DrugController.php
View file @
2cfc1903
...
...
@@ -76,6 +76,10 @@ protected function grid()
$filter
->
like
(
'code'
)
->
width
(
3
);
$filter
->
like
(
'factory'
)
->
width
(
3
);
$filter
->
like
(
'standard_code'
)
->
width
(
3
);
$filter
->
in
(
'drug_type'
)
->
checkbox
(
DrugModel
::
DRUG_TYPE_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_foreign'
)
->
checkbox
(
DrugModel
::
FOREIGN_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_rx'
)
->
checkbox
(
DrugModel
::
RX_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_si'
)
->
checkbox
(
DrugModel
::
SI_MAP
)
->
width
(
3
);
});
$grid
->
setActionClass
(
Grid\Displayers\Actions
::
class
);
...
...
app/Admin/Renderable/DrugTable.php
View file @
2cfc1903
...
...
@@ -36,6 +36,14 @@ public function grid(): Grid
$filter
->
like
(
'name'
,
'药品名称'
)
->
width
(
3
);
$filter
->
like
(
'code'
,
'简码'
)
->
width
(
3
);
$filter
->
like
(
'factory'
,
'生产厂家'
)
->
width
(
3
);
$filter
->
like
(
'name'
)
->
width
(
3
);
$filter
->
like
(
'code'
)
->
width
(
3
);
$filter
->
like
(
'factory'
)
->
width
(
3
);
$filter
->
like
(
'standard_code'
)
->
width
(
3
);
$filter
->
in
(
'drug_type'
)
->
checkbox
(
DrugModel
::
DRUG_TYPE_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_foreign'
)
->
checkbox
(
DrugModel
::
FOREIGN_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_rx'
)
->
checkbox
(
DrugModel
::
RX_MAP
)
->
width
(
3
);
$filter
->
in
(
'is_si'
)
->
checkbox
(
DrugModel
::
SI_MAP
)
->
width
(
3
);
});
// 行按钮控制
...
...
app/Api/Controllers/PatientController.php
View file @
2cfc1903
...
...
@@ -67,25 +67,25 @@ public function add(Request $request)
$idValidator
=
new
IdValidator
();
// if (! $idValidator->isValid($data['id_card'])) {
// if( !in_array(strlen($data['id_card']),[15,18])){
if
(
strlen
(
$data
[
'id_card'
])
!=
18
)
{
#
身份证非必填项
#
return $this->failed('身份证格式错误');
if
(
strlen
(
$data
[
'id_card'
])
!=
18
)
{
//
身份证非必填项
//
return $this->failed('身份证格式错误');
}
if
(
is_int
(
$data
[
'age'
])
||
$data
[
'age'
]
<=
0
)
{
return
$this
->
failed
(
'年龄格式错误'
);
}
}
if
(
!
array_key_exists
(
$data
[
'gender'
],
PatientModel
::
SEX_MAP
)
)
{
if
(
!
array_key_exists
(
$data
[
'gender'
],
PatientModel
::
SEX_MAP
))
{
return
$this
->
failed
(
'性别错误'
);
}
$mobile
=
$data
[
'mobile'
];
$verificationCode
=
cache
()
->
get
(
"sms_verification_code_
{
$mobile
}
"
);
$code
=
$data
[
'code'
];
if
(
$verificationCode
!=
$code
)
{
return
$this
->
failed
(
'验证码错误'
);
}
#
$idCardInfo = Util::getIdCardInfo($data['id_card']);
//
$idCardInfo = Util::getIdCardInfo($data['id_card']);
$patient
->
name
=
$data
[
'name'
];
$patient
->
id_card
=
$data
[
'id_card'
];
$patient
->
mobile
=
$mobile
;
...
...
@@ -113,18 +113,18 @@ public function update(Request $request)
$idValidator
=
new
IdValidator
();
// if (! $idValidator->isValid($id_card)) {
if
(
strlen
(
$id_card
)
!=
18
)
{
#
return $this->failed('身份证格式错误');
//
return $this->failed('身份证格式错误');
}
if
(
is_int
(
$age
)
||
$age
<=
0
)
{
return
$this
->
failed
(
'年龄格式错误'
);
}
}
if
(
!
array_key_exists
(
$gender
,
PatientModel
::
SEX_MAP
)
)
{
if
(
!
array_key_exists
(
$gender
,
PatientModel
::
SEX_MAP
))
{
return
$this
->
failed
(
'性别错误'
);
}
#
$idCardInfo = Util::getIdCardInfo($id_card);
//
$idCardInfo = Util::getIdCardInfo($id_card);
$data
=
PatientModel
::
find
(
$id
);
if
(
!
$data
)
{
return
$this
->
failed
(
'该问诊人不存在'
);
...
...
app/Api/Controllers/PrescriptionController.php
View file @
2cfc1903
...
...
@@ -476,16 +476,17 @@ public function enter(Request $request)
'num'
=>
$drug
[
'num'
],
// 中药为药师录入数量
];
}
#
$prescription->doses = $request->input('doses'); // 剂量
//
$prescription->doses = $request->input('doses'); // 剂量
$prescription
->
drug_info
=
$drug_info
;
}
else
{
return
$this
->
failed
(
'暂不支持该类型处方单录入'
);
}
$prescription
->
status
=
PrescriptionModel
::
PRESCRIPTION_STATUS_PENDING
;
if
(
$prescription
->
save
()
)
{
if
(
$prescription
->
save
())
{
return
$this
->
success
(
'录入成功'
);
}
return
$this
->
failed
(
'录入失败'
);
}
}
app/Api/Controllers/UnitController.php
View file @
2cfc1903
...
...
@@ -3,8 +3,6 @@
namespace
App\Api\Controllers
;
use
App\Http\Controllers\BaseApiController
;
use
App\Models\DosageModel
;
use
App\Models\PharmacyModel
;
use
App\Models\DrugUnitModel
;
use
Illuminate\Http\Request
;
...
...
@@ -20,6 +18,7 @@ public function test()
public
function
unitList
(
Request
$request
)
{
$units
=
DrugUnitModel
::
query
()
->
get
()
->
toArray
();
return
$this
->
success
(
$units
);
}
}
\ No newline at end of file
}
app/Console/Commands/TestCommand.php
View file @
2cfc1903
...
...
@@ -6,7 +6,6 @@
use
App\Models\PatientModel
;
use
App\Models\PrescriptionModel
;
use
Illuminate\Console\Command
;
use
App\Common\Util
;
class
TestCommand
extends
Command
{
...
...
@@ -41,12 +40,12 @@ public function handle()
// }
// 刷新存量问诊人年龄
$patients
=
PatientModel
::
query
()
->
whereNotNull
(
'id_card'
)
->
where
(
'age'
,
0
)
->
get
();
if
(
$patients
->
count
()
>
0
)
{
$patients
=
PatientModel
::
query
()
->
whereNotNull
(
'id_card'
)
->
where
(
'age'
,
0
)
->
get
();
if
(
$patients
->
count
()
>
0
)
{
foreach
(
$patients
as
$patient
)
{
$patient
->
age
=
getAgeByIdCard
(
$patient
->
id_card
);
$patient
->
save
();
}
}
}
}
}
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