|
@@ -3,8 +3,11 @@ package com.diagbot.facade;
|
|
|
import com.diagbot.dto.GetTopPatientInfoDTO;
|
|
|
import com.diagbot.dto.PatientInfoDTO;
|
|
|
import com.diagbot.entity.PatientInfo;
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.PatientInfoServiceImpl;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.vo.GetTopPatientInfoVO;
|
|
|
import com.diagbot.vo.PatientInfoVO;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -42,6 +45,18 @@ public class PatientInfoFacade extends PatientInfoServiceImpl {
|
|
|
*/
|
|
|
public GetTopPatientInfoDTO getTopPatientInfo(@RequestBody GetTopPatientInfoVO getTopPatientInfoVO) {
|
|
|
GetTopPatientInfoDTO getTopPatientInfoDTO = baseMapper.getTopPatientInfo(getTopPatientInfoVO);
|
|
|
+ if (getTopPatientInfoDTO == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR, "获取医院信息失败");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(getTopPatientInfoDTO.getHospitalDeptCode())) {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR, "获取科室信息失败");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(getTopPatientInfoDTO.getDoctorCode())) {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR, "获取医生信息失败");
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(getTopPatientInfoDTO.getPatientCode())) {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR, "获取患者信息失败");
|
|
|
+ }
|
|
|
getTopPatientInfoDTO.setSystemTime(DateUtil.now());
|
|
|
getTopPatientInfoDTO.setRecordId(getTopPatientInfoVO.getRecordId());
|
|
|
getTopPatientInfoDTO.setPatientAge(DateUtil.yearCompare(getTopPatientInfoDTO.getBirthday(), DateUtil.now()));
|