| | |
| | | import cn.lihu.jh.module.ecg.service.queuesequence.QueueSequenceService; |
| | | import cn.lihu.jh.module.ecg.webservice.WebServiceClient; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.dao.DuplicateKeyException; |
| | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | |
| | | |
| | | @Override |
| | | public PageResult<AppointmentDO> getAppointmentPage(AppointmentPageReqVO pageReqVO) { |
| | | //1. 先根据patId去查 |
| | | PageResult<AppointmentDO> result = appointmentMapper.selectPage(pageReqVO); |
| | | log.info("--------------PATID result的值为:{}", result); |
| | | if (!result.getList().isEmpty()) { |
| | | return result; |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(pageReqVO.getPatId())) { |
| | | // 2. 用 applyNo 查询 |
| | | pageReqVO.setApplyNo(pageReqVO.getPatId()); |
| | | pageReqVO.setPatId(null); |
| | | log.info("------------------ApplyNo pageReqVO的值为:{}", pageReqVO); |
| | | result = appointmentMapper.selectPage(pageReqVO); |
| | | if (!result.getList().isEmpty()) { |
| | | return result; |
| | | } |
| | | |
| | | // 3. 用 episodeId 查询 |
| | | pageReqVO.setEpisodeId(pageReqVO.getApplyNo()); |
| | | pageReqVO.setPatId(null); |
| | | pageReqVO.setApplyNo(null); |
| | | log.info("-----------EpisodeId pageReqVO的值为:{}", pageReqVO); |
| | | } |
| | | return appointmentMapper.selectPage(pageReqVO); |
| | | } |
| | | |
| | |
| | | String status = Optional.ofNullable(dataMap.get("controlActProcess")).map(controlActProcess -> (Map<String, Object>) controlActProcess).map(controlActProcess -> (Map<String, Object>) controlActProcess.get("subject")).map(subject -> (Map<String, Object>) subject.get("placerGroup")).map(placerGroup -> (Map<String, Object>) placerGroup.get("component2")).map(component2 -> (Map<String, Object>) component2.get("observationRequest")).map(observationRequest -> (Map<String, Object>) observationRequest.get("component1")).map(component1 -> (Map<String, Object>) component1.get("processStep")).map(processStep -> (Map<String, Object>) processStep.get("code")).map(code -> (String) code.get("code")).orElseThrow(() -> exception(APPOINTMENT_CREATE_FAIL)); |
| | | |
| | | existingAppointment.setStatus(status); |
| | | if ("3".equals(status)) { |
| | | existingAppointment.setRegisterDate(new Date()); |
| | | } |
| | | // 将AppointmentDO转换为AppointmentSaveReqVO并更新 |
| | | AppointmentSaveReqVO updateReqVO = BeanUtils.toBean(existingAppointment, AppointmentSaveReqVO.class); |
| | | updateAppointment(updateReqVO); |