diff --git a/app/Controller/PatientFamilyController.php b/app/Controller/PatientFamilyController.php index 49f73dc..ec83eb2 100644 --- a/app/Controller/PatientFamilyController.php +++ b/app/Controller/PatientFamilyController.php @@ -250,4 +250,15 @@ class PatientFamilyController extends AbstractController $data = $patientFamilyService->getFamilyCase(); return $this->response->json($data); } + + /** + * 检测家庭成员是否存在病情记录 + * @return ResponseInterface + */ + public function existFamilyPathography(): ResponseInterface + { + $patientFamilyService = new PatientFamilyService(); + $data = $patientFamilyService->existFamilyPathography(); + return $this->response->json($data); + } } \ No newline at end of file diff --git a/app/Controller/PatientPathographyController.php b/app/Controller/PatientPathographyController.php deleted file mode 100644 index d60c722..0000000 --- a/app/Controller/PatientPathographyController.php +++ /dev/null @@ -1,23 +0,0 @@ -existFamilyPathography(); - return $this->response->json($data); - } -} \ No newline at end of file diff --git a/app/Services/PatientFamilyService.php b/app/Services/PatientFamilyService.php index 29b0f2b..91abc4c 100644 --- a/app/Services/PatientFamilyService.php +++ b/app/Services/PatientFamilyService.php @@ -1043,4 +1043,29 @@ class PatientFamilyService extends BaseService return success($result); } + + /** + * 检测家庭成员是否存在病情记录 + * @return array + */ + public function existFamilyPathography(): array + { + $user_info = $this->request->getAttribute("userInfo") ?? []; + $family_id = $this->request->route('family_id'); + + $result = array(); + $result['is_exist'] = 0; + + // 获取病情记录 + $params = array(); + $params['user_id'] = $user_info['user_id']; + $params['patient_id'] = $user_info['client_user_id']; + $params['family_id'] = $family_id; + $patient_pathography = PatientPathography::getLastOne($params); + if (!empty($patient_pathography)){ + $result['is_exist'] = 1; + } + + return success($result); + } } \ No newline at end of file diff --git a/app/Services/PatientPathographyService.php b/app/Services/PatientPathographyService.php deleted file mode 100644 index 3afd002..0000000 --- a/app/Services/PatientPathographyService.php +++ /dev/null @@ -1,36 +0,0 @@ -request->getAttribute("userInfo") ?? []; - $family_id = $this->request->route('family_id'); - - $result = array(); - $result['is_exist'] = 0; - - // 获取病情记录 - $params = array(); - $params['user_id'] = $user_info['user_id']; - $params['patient_id'] = $user_info['client_user_id']; - $params['family_id'] = $family_id; - $patient_pathography = PatientPathography::getLastOne($params); - if (!empty($patient_pathography)){ - $result['is_exist'] = 1; - } - - return success($result); - } -} \ No newline at end of file diff --git a/config/routes.php b/config/routes.php index 2ee36e4..2d6553d 100644 --- a/config/routes.php +++ b/config/routes.php @@ -25,7 +25,6 @@ use App\Controller\PatientCenterController; use App\Controller\PatientDoctorController; use App\Controller\PatientFamilyController; use App\Controller\PatientOrderController; -use App\Controller\PatientPathographyController; use App\Controller\SafeController; use App\Controller\SystemController; use App\Controller\TestController; @@ -381,6 +380,15 @@ Router::addGroup('/patient', function () { // 获取家庭成员用药记录列表 Router::get('/record', [PatientFamilyController::class, 'getFamilyProductRecord']); }); + + // 病情记录 + Router::addGroup('/pathography', function () { + // 检测家庭成员是否存在病情记录 + Router::get('/exist/{family_id:\d+}', [PatientFamilyController::class, 'existFamilyPathography']); + +// // 获取家庭成员病情记录列表-分页 +// Router::get('/exist/{family_id:\d+}', [PatientPathographyController::class, 'existFamilyPathography']); + }); }); // 药品 @@ -487,11 +495,7 @@ Router::addGroup('/patient', function () { Router::get('/system/last', [MessageNoticeController::class, 'getPatientMessageServiceLast']); }); - // 病情记录 - Router::addGroup('/pathography', function () { - // 检测家庭成员是否存在病情记录 - Router::get('/exist/{family_id:\d+}', [PatientPathographyController::class, 'existFamilyPathography']); - }); + }); // 药师端api