From d215493859d6b9a779f0698dea324eb5992d00b7 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Tue, 25 Apr 2023 20:51:07 +0800 Subject: [PATCH] 1 --- app/Controller/UserDoctorController.php | 16 ++++++++++++++++ app/Request/UserDoctorRequest.php | 3 +++ app/Services/CaService.php | 7 ++++++- config/routes.php | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/Controller/UserDoctorController.php b/app/Controller/UserDoctorController.php index 8128829..1b0d895 100644 --- a/app/Controller/UserDoctorController.php +++ b/app/Controller/UserDoctorController.php @@ -301,6 +301,22 @@ class UserDoctorController extends AbstractController return $this->response->json($data); } + /** + * 检测是否可以开具处方 + * @return ResponseInterface + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + public function checkOpenPrescription(): ResponseInterface + { + $request = $this->container->get(UserDoctorRequest::class); + $request->scene('getPrescriptionInfo')->validateResolved(); + + $UserDoctorService = new UserDoctorService(); + $data = $UserDoctorService->getPrescriptionInfo(); + return $this->response->json($data); + } + /** * 获取医生名片 * @return ResponseInterface diff --git a/app/Request/UserDoctorRequest.php b/app/Request/UserDoctorRequest.php index 767f92b..236818c 100644 --- a/app/Request/UserDoctorRequest.php +++ b/app/Request/UserDoctorRequest.php @@ -57,6 +57,9 @@ class UserDoctorRequest extends FormRequest 'getPrescriptionInfo' => [ // 获取处方详情 'order_inquiry_id', ], + 'checkOpenPrescription' => [ // 检测是否可以开具处方 + 'order_inquiry_id', + ], 'putPrescription' => [ // 修改处方 'order_prescription_id', 'prescription_icd',// 诊断疾病 diff --git a/app/Services/CaService.php b/app/Services/CaService.php index 27b9b60..c8056fa 100644 --- a/app/Services/CaService.php +++ b/app/Services/CaService.php @@ -130,17 +130,23 @@ class CaService extends BaseService return; } + dump(111); $this->icd_name = ""; $icd_name = array_column($order_prescription_icd->toArray(), 'icd_name'); + dump($icd_name); if (!empty($icd_name)) { if (count($icd_name) > 1) { + dump(22222); $this->icd_name = implode(';', $icd_name); } else { + dump(333); $this->icd_name = $icd_name[0]; } } }); + dump($this->icd_name); + // 获取处方关联商品数据 co(function () use ($wg,$channel,$order_prescription_id) { defer(function() use ($wg) { @@ -197,7 +203,6 @@ class CaService extends BaseService $params['order_inquiry_id'] = $order_inquiry_id; $order_inquiry_case = OrderInquiryCase::getOne($params); if (empty($order_inquiry_case)) { - dump(111); $channel->push('处方病例数据错误'); return; } diff --git a/config/routes.php b/config/routes.php index 7a2391b..1162318 100644 --- a/config/routes.php +++ b/config/routes.php @@ -161,7 +161,7 @@ Router::addGroup('/doctor', function () { Router::post('', [UserDoctorController::class, 'addPrescription']); // 检测是否可以开具处方 - Router::get('/check', [UserDoctorController::class, 'addPrescription']); + Router::get('/check', [UserDoctorController::class, 'checkOpenPrescription']); }); // 常用语