his_client = app('HisHttpService'); } /** * 获取科室列表 * @param string $date * @return array * @throws GeneralException */ public function getDeptLists(string $date): array { $response = $this->his_client->getDepType('', '','01', $date); if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') { throw new GeneralException($response['ERRORMSG'] ?? '暂无科室排班!', Response::HTTP_SERVICE_UNAVAILABLE); } return $response; } /** * 获取医生列表 * @param string $date 日期 * @param string $dept_id 科室ID * @return array * @throws GeneralException */ public function getDoctorLists(string $date, string $dept_id): array { $type = $date === date('Y-m-d') ? '3' : '1'; $response = $this->his_client->getDoctorLists($dept_id, $type, '', $date); if (!isset($response['RESULTCODE']) || $response['RESULTCODE'] !== '0') { throw new GeneralException($response['ERRORMSG'] ?? '该科室暂无医生排班!', Response::HTTP_SERVICE_UNAVAILABLE); } return $response; } }