Commit 2cfc1903 by lujunyi

药品搜索条件增加

parent 994d719e
......@@ -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);
......
......@@ -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);
});
// 行按钮控制
......
......@@ -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('该问诊人不存在');
......
......@@ -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('录入失败');
}
}
......@@ -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
}
......@@ -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();
}
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment