| | |
| | | import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.devrent.DevRentDO; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.call.CallMapper; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.appointment.AppointmentMapper; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.devrent.DevRentMapper; |
| | | import cn.lihu.jh.module.ecg.enums.DevRentStateEnum; |
| | | import cn.lihu.jh.module.system.api.oauth2.OAuth2TokenApi; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.cxf.common.util.CollectionUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | import cn.lihu.jh.framework.common.util.object.BeanUtils; |
| | | import cn.lihu.jh.module.ecg.dal.mysql.queue.QueueMapper; |
| | | |
| | | import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*; |
| | | import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.lihu.jh.framework.common.pojo.CommonResult.error; |
| | |
| | | private RoomMapper roomMapper; |
| | | |
| | | @Resource |
| | | private CallMapper callMapper; |
| | | private AppointmentMapper appointmentMapper; |
| | | |
| | | @Resource |
| | | private DevRentMapper devRentMapper; |
| | |
| | | |
| | | @Override |
| | | public ErrorCode startBedOpen(Long roomId, String roomName, String bedNo) { |
| | | Future<ErrorCode> future = singleThreadExecutor.submit( new BedOpenCallable(queueServiceTxFunctions, roomId, roomName, bedNo)); |
| | | Future<ErrorCode> future = singleThreadExecutor.submit(new BedOpenCallable(queueServiceTxFunctions, roomId, roomName, bedNo)); |
| | | |
| | | try { |
| | | ErrorCode ret = future.get(); |
| | |
| | | |
| | | @Override |
| | | public ErrorCode startBedClose(Long roomId, String bedNo) { |
| | | Future<ErrorCode> future = singleThreadExecutor.submit( new BedCloseCallable(queueServiceTxFunctions, roomId, bedNo)); |
| | | Future<ErrorCode> future = singleThreadExecutor.submit(new BedCloseCallable(queueServiceTxFunctions, roomId, bedNo)); |
| | | |
| | | try { |
| | | ErrorCode ret = future.get(); |
| | |
| | | |
| | | @Override |
| | | public ErrorCode startBedDoctorPause(Long roomId, String bedNo, Long docId, String docName) { |
| | | Future<ErrorCode> future = singleThreadExecutor.submit( |
| | | new BedDoctorPauseCallable(queueServiceTxFunctions, roomId, bedNo, docId, docName) |
| | | ); |
| | | Future<ErrorCode> future = singleThreadExecutor.submit(new BedDoctorPauseCallable(queueServiceTxFunctions, roomId, bedNo, docId, docName)); |
| | | |
| | | try { |
| | | ErrorCode ret = future.get(); |
| | |
| | | |
| | | @Override |
| | | public ErrorCode startBedDoctorResume(Long roomId, String bedNo, Long docId, String docName) { |
| | | Future<ErrorCode> future = singleThreadExecutor.submit( |
| | | new BedDoctorResumeCallable(queueServiceTxFunctions, roomId, bedNo, docId, docName) |
| | | ); |
| | | Future<ErrorCode> future = singleThreadExecutor.submit(new BedDoctorResumeCallable(queueServiceTxFunctions, roomId, bedNo, docId, docName)); |
| | | |
| | | try { |
| | | ErrorCode ret = future.get(); |
| | |
| | | |
| | | @Override |
| | | public ErrorCode startBedDoctorOn(Long roomId, String bedNo, Long docId, String docName) { |
| | | Future<ErrorCode> future = singleThreadExecutor.submit( |
| | | new BedDoctorOnCallable(queueServiceTxFunctions, roomId, bedNo, docId, docName) |
| | | ); |
| | | Future<ErrorCode> future = singleThreadExecutor.submit(new BedDoctorOnCallable(queueServiceTxFunctions, roomId, bedNo, docId, docName)); |
| | | |
| | | try { |
| | | ErrorCode ret = future.get(); |
| | |
| | | |
| | | @Override |
| | | public ErrorCode startBedDoctorOff(Long roomId, String bedNo, Long docId, String docName) { |
| | | Future<ErrorCode> future = singleThreadExecutor.submit( |
| | | new BedDoctorOffCallable(queueServiceTxFunctions, roomId, bedNo, docId, docName) |
| | | ); |
| | | Future<ErrorCode> future = singleThreadExecutor.submit(new BedDoctorOffCallable(queueServiceTxFunctions, roomId, bedNo, docId, docName)); |
| | | |
| | | try { |
| | | ErrorCode ret = future.get(); |
| | |
| | | |
| | | @Override |
| | | public ErrorCode startNextPatient(Long roomId, String bedNo) { |
| | | Future<ErrorCode> future = singleThreadExecutor.submit( |
| | | new BedDoctorNextPatientCallable(queueServiceTxFunctions, roomId, bedNo) |
| | | ); |
| | | Future<ErrorCode> future = singleThreadExecutor.submit(new BedDoctorNextPatientCallable(queueServiceTxFunctions, roomId, bedNo)); |
| | | |
| | | try { |
| | | ErrorCode ret = future.get(); |
| | |
| | | |
| | | @Override |
| | | public ErrorCode startNextInstallPatient(Long roomId, String bedNo) { |
| | | Future<ErrorCode> future = singleThreadExecutor.submit( |
| | | new BedDoctorNextInstallPatientCallable(queueServiceTxFunctions, roomId, bedNo) |
| | | ); |
| | | Future<ErrorCode> future = singleThreadExecutor.submit(new BedDoctorNextInstallPatientCallable(queueServiceTxFunctions, roomId, bedNo)); |
| | | |
| | | try { |
| | | ErrorCode ret = future.get(); |
| | |
| | | |
| | | @Override |
| | | public void startHurryUpOneBed(Long roomId, String bedNo) { |
| | | singleThreadExecutor.execute( () -> { |
| | | singleThreadExecutor.execute(() -> { |
| | | queueServiceTxFunctions.hurryupOneBed(roomId, bedNo); |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void startHurryUpOneCheckType(Integer checkType) { |
| | | singleThreadExecutor.execute( () -> { |
| | | queueServiceTxFunctions.hurryupOneCheckType( checkType ); |
| | | singleThreadExecutor.execute(() -> { |
| | | queueServiceTxFunctions.hurryupOneCheckType(checkType); |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void startBedReload() { |
| | | singleThreadExecutor.execute( () -> { |
| | | singleThreadExecutor.execute(() -> { |
| | | queueServiceTxFunctions.bedReload(); |
| | | queueServiceTxFunctions.hurryupAllBed(); |
| | | queueServiceTxFunctions.monitorInfo(); |
| | |
| | | |
| | | @Override |
| | | public void startResetRoom(Boolean needCloseBed) { |
| | | singleThreadExecutor.execute( () -> { |
| | | singleThreadExecutor.execute(() -> { |
| | | queueServiceTxFunctions.resetRoom(needCloseBed); |
| | | queueServiceTxFunctions.bedReload(); |
| | | queueServiceTxFunctions.monitorInfo(); |
| | |
| | | |
| | | @Override |
| | | public PageResult<QueueDO> getqueuePage(QueuePageReqVO pageReqVO) { |
| | | return queueMapper.selectPage(pageReqVO); |
| | | PageResult<QueueDO> queueDOPageResult = queueMapper.selectPage(pageReqVO); |
| | | queueDOPageResult.getList().forEach(queueDO -> { |
| | | queueDO.setTolerance(appointmentMapper.getByApplyNo(queueDO.getApplyNo()).getTolerance()); |
| | | }); |
| | | return queueDOPageResult; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 预约确认后的排队 |
| | | * |
| | | * @param queueSaveReqVO |
| | | */ |
| | | @Override |
| | |
| | | queueSaveReqVO.setStatus(QueueStatusEnum.WAITING.getStatus()); |
| | | |
| | | // 处理 检查项目.亲和性 逻辑 |
| | | CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem( queueSaveReqVO.getBookCheckType() ); |
| | | if ( checkTypeDO.getAffinityCheckTypes().length > 0) { |
| | | CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem(queueSaveReqVO.getBookCheckType()); |
| | | if (checkTypeDO.getAffinityCheckTypes().length > 0) { |
| | | procAffinityWhenQueue(/*IN,OUT*/queueSaveReqVO, checkTypeDO.getAffinityCheckTypes()); |
| | | } |
| | | |
| | |
| | | queueMapper.insert(queue); |
| | | |
| | | DevRentDO devRent = BeanUtils.toBean(queueSaveReqVO, DevRentDO.class); |
| | | devRent.setApplyNo( queueSaveReqVO.getApplyNo() ); |
| | | devRent.setEpisodeId( queueSaveReqVO.getEpisodeId() ); |
| | | devRent.setState( DevRentStateEnum.FREE.getState() ); |
| | | devRent.setPatDetails( queueSaveReqVO.getPatDetails() ); |
| | | devRent.setCheckType( queueSaveReqVO.getBookCheckType() ); |
| | | devRent.setApplyNo(queueSaveReqVO.getApplyNo()); |
| | | devRent.setEpisodeId(queueSaveReqVO.getEpisodeId()); |
| | | devRent.setState(DevRentStateEnum.FREE.getState()); |
| | | devRent.setPatDetails(queueSaveReqVO.getPatDetails()); |
| | | devRent.setCheckType(queueSaveReqVO.getBookCheckType()); |
| | | devRentMapper.insert(devRent); |
| | | |
| | | startHurryUpOneCheckType( queue.getBookCheckType() ); |
| | | startHurryUpOneCheckType(queue.getBookCheckType()); |
| | | } |
| | | |
| | | @Override |
| | | public List<QueueDO> selectBookSeqNumByAppointIdList(List<Long> appointIdList) { |
| | | return queueMapper.selectBookSeqNumByAppointIdList( appointIdList ); |
| | | return queueMapper.selectBookSeqNumByAppointIdList(appointIdList); |
| | | } |
| | | |
| | | // 常规检查 叫号 |
| | |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus()); |
| | | Integer num = queueMapper.bedQueueStatisticByStatus(roomId, bedNo, queueStatusList); |
| | | if ( num != null && num > 0) |
| | | return; |
| | | if (num != null && num > 0) return; |
| | | |
| | | startNextPatient(roomId, bedNo); |
| | | } |
| | |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.ONSTAGE.getStatus()); |
| | | Integer num = queueMapper.bedQueueStatisticByStatus(roomId, bedNo, queueStatusList); |
| | | if ( num != null && num > 0) |
| | | return; |
| | | if (num != null && num > 0) return; |
| | | |
| | | startNextPatient(roomId, bedNo); |
| | | } |
| | |
| | | List<Integer> queueStatusList = new ArrayList<>(); |
| | | queueStatusList.add(QueueStatusEnum.INSTALLING.getStatus()); |
| | | Integer num = queueMapper.bedQueueStatisticByStatus(roomId, bedNo, queueStatusList); |
| | | if ( num != null && num > 0) |
| | | return; |
| | | if (num != null && num > 0) return; |
| | | |
| | | startNextInstallPatient(roomId, bedNo); |
| | | } |
| | |
| | | @Override |
| | | public void passWaitingPatient(String patId, Integer bookCheckType) { |
| | | // 从 DB 把 排队中的人 设置为 过号-排队中 |
| | | Integer ret = queueMapper.updatePatientQueueStatus(patId, bookCheckType, |
| | | QueueStatusEnum.WAITING.getStatus(), QueueStatusEnum.PASSED_WAITING.getStatus()); |
| | | Integer ret = queueMapper.updatePatientQueueStatus(patId, bookCheckType, QueueStatusEnum.WAITING.getStatus(), QueueStatusEnum.PASSED_WAITING.getStatus()); |
| | | } |
| | | |
| | | public void passNextPatient(Long roomId, String bedNo) { |
| | | // 从 DB 把 就诊中的人 设置为过号 |
| | | Integer ret = queueMapper.updateBedQueueStatus(roomId, bedNo, |
| | | QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.PASSED.getStatus()); |
| | | Integer ret = queueMapper.updateBedQueueStatus(roomId, bedNo, QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.PASSED.getStatus()); |
| | | |
| | | startNextPatient(roomId, bedNo); |
| | | } |
| | |
| | | @Override |
| | | public void passInstallNextPatient(Long roomId, String bedNo) { |
| | | // 从 DB 把 [安装中]的人 设置为 [过号-安装] |
| | | Integer ret = queueMapper.updateBedQueueStatus(roomId, bedNo, |
| | | QueueStatusEnum.INSTALLING.getStatus(), QueueStatusEnum.PASSED_INSTALL.getStatus()); |
| | | Integer ret = queueMapper.updateBedQueueStatus(roomId, bedNo, QueueStatusEnum.INSTALLING.getStatus(), QueueStatusEnum.PASSED_INSTALL.getStatus()); |
| | | |
| | | startNextPatient(roomId, bedNo); |
| | | } |
| | | |
| | | public List<QueueDO> getBedQueueByStatus(Long roomId, String bedNo, List<Integer> statusList) { |
| | | List<QueueDO> queueDOList = queueMapper.getBedQueueByStatus(roomId, bedNo, statusList); |
| | | if (!CollectionUtils.isEmpty(queueDOList)) { |
| | | queueDOList.forEach(queueDO -> { |
| | | queueDO.setTolerance(appointmentMapper.getByApplyNo(queueDO.getApplyNo()).getTolerance()); |
| | | }); |
| | | } |
| | | return queueDOList; |
| | | } |
| | | |
| | | @Override |
| | | |
| | | public List<QueueDO> getRoomQueueByStatus(Long roomId, List<Integer> statusList) { |
| | | List<QueueDO> queueDOList = queueMapper.getRoomQueueByStatus(roomId, statusList); |
| | | if (!CollectionUtils.isEmpty(queueDOList)) { |
| | | queueDOList.forEach(queueDO -> { |
| | | queueDO.setTolerance(appointmentMapper.getByApplyNo(queueDO.getApplyNo()).getTolerance()); |
| | | }); |
| | | } |
| | | return queueDOList; |
| | | } |
| | | |
| | |
| | | }); |
| | | |
| | | // 装机界面:统计 该诊室 [已领用] 的数量, 因为安装工位看不到 [已领用] 患者,所以无法根据装机工位来统计,只能按诊室统计 |
| | | patientStatisticVO.setReceivedNum( 0 ); |
| | | patientStatisticVO.setReceivedNum(0); |
| | | List<BedQueueStatisticDO> roomQueueStatisticDOList = queueMapper.roomQueueStatistic(roomId); |
| | | roomQueueStatisticDOList.forEach(item -> { |
| | | if (QueueStatusEnum.RECEIVED.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setReceivedNum( patientStatisticVO.getReceivedNum() + item.getTotalInStatus() ); |
| | | patientStatisticVO.setReceivedNum(patientStatisticVO.getReceivedNum() + item.getTotalInStatus()); |
| | | } |
| | | }); |
| | | |
| | |
| | | @Override |
| | | public Integer recallPassWaitingPatient(String patId, Integer bookCheckType) { |
| | | // 从 DB 把 过号-排队中的人 设置为 排队中 |
| | | Integer ret = queueMapper.updatePatientQueueStatus(patId, bookCheckType, |
| | | QueueStatusEnum.PASSED_WAITING.getStatus(), QueueStatusEnum.WAITING.getStatus()); |
| | | Integer ret = queueMapper.updatePatientQueueStatus(patId, bookCheckType, QueueStatusEnum.PASSED_WAITING.getStatus(), QueueStatusEnum.WAITING.getStatus()); |
| | | |
| | | return ret; |
| | | } |
| | |
| | | }); |
| | | |
| | | // 领用界面:统计 该诊室 [已领用] 的数量, 因为安装时患者归属工位从领用工位变更到安装工位,所以无法根据领用工位来统计,只能按诊室统计 |
| | | patientStatisticVO.setReceivedNum( 0 ); |
| | | patientStatisticVO.setReceivedNum(0); |
| | | List<BedQueueStatisticDO> roomQueueStatisticDOList = queueMapper.roomQueueStatistic(roomId); |
| | | roomQueueStatisticDOList.forEach(item -> { |
| | | if (QueueStatusEnum.RECEIVED.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setReceivedNum( patientStatisticVO.getReceivedNum() + item.getTotalInStatus() ); |
| | | patientStatisticVO.setReceivedNum(patientStatisticVO.getReceivedNum() + item.getTotalInStatus()); |
| | | } else if (QueueStatusEnum.INSTALLING.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setReceivedNum( patientStatisticVO.getReceivedNum() + item.getTotalInStatus() ); |
| | | patientStatisticVO.setReceivedNum(patientStatisticVO.getReceivedNum() + item.getTotalInStatus()); |
| | | } else if (QueueStatusEnum.FINISH.getStatus() == item.getStatus()) { |
| | | patientStatisticVO.setReceivedNum(patientStatisticVO.getReceivedNum() + item.getTotalInStatus() ); |
| | | patientStatisticVO.setReceivedNum(patientStatisticVO.getReceivedNum() + item.getTotalInStatus()); |
| | | } |
| | | }); |
| | | |
| | |
| | | } |
| | | |
| | | public void initCheckType() { |
| | | queueServiceTxFunctions.initCheckType( ); |
| | | queueServiceTxFunctions.initCheckType(); |
| | | } |
| | | |
| | | public void startBiz() { |
| | | if (1 == queueServiceTxFunctions.getOpeningFlag()) |
| | | return; |
| | | if (1 == queueServiceTxFunctions.getOpeningFlag()) return; |
| | | |
| | | queueServiceTxFunctions.setOpeningFlag(1); |
| | | startBedReload(); |
| | |
| | | |
| | | @Override |
| | | public Integer recallPatient(Long roomId, String bedNo, String patId, Integer checkType) { |
| | | Integer updateNum = queueMapper.recallPassedPatient(roomId, bedNo, patId, checkType, |
| | | QueueStatusEnum.PASSED.getStatus(), QueueStatusEnum.RECALLED.getStatus()); |
| | | Integer updateNum = queueMapper.recallPassedPatient(roomId, bedNo, patId, checkType, QueueStatusEnum.PASSED.getStatus(), QueueStatusEnum.RECALLED.getStatus()); |
| | | |
| | | // 检查项目.亲和性 不需要在这里处理 |
| | | // 会在 HurryUpOnBed 里面处理 检查项目.亲和性 |
| | |
| | | |
| | | @Override |
| | | public Integer recallInstallPatient(Long roomId, String bedNo, String patId, Integer checkType, Long roomId_operator, String bedNo_operator) { |
| | | Integer updateNum = queueMapper.recallPassedInstallPatient(roomId, bedNo_operator, patId, checkType, |
| | | QueueStatusEnum.PASSED_INSTALL.getStatus(), QueueStatusEnum.RECALLED_INSTALL.getStatus()); |
| | | Integer updateNum = queueMapper.recallPassedInstallPatient(roomId, bedNo_operator, patId, checkType, QueueStatusEnum.PASSED_INSTALL.getStatus(), QueueStatusEnum.RECALLED_INSTALL.getStatus()); |
| | | |
| | | // 检查项目.亲和性 处理 |
| | | if (null != updateNum && 1 == updateNum) { |
| | | CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem( checkType ); |
| | | if ( checkTypeDO.getAffinityCheckTypes().length > 0) { |
| | | CheckTypeDO checkTypeDO = queueServiceTxFunctions.getCheckTypeItem(checkType); |
| | | if (checkTypeDO.getAffinityCheckTypes().length > 0) { |
| | | procAffinityWhenInstallRecall(patId, checkTypeDO.getAffinityCheckTypes(), roomId_operator, bedNo_operator); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 加急 |
| | | * |
| | | * @param patId |
| | | * @param jumped |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取 指定工位 【检查|领用】相关的患者 |
| | | * |
| | | * @param roomId |
| | | * @param bedNo |
| | | * @return |
| | |
| | | affinityWaitingList.add(item); |
| | | } |
| | | } |
| | | affinityWaitingList.forEach( affinityWaitingItem -> { |
| | | for (int i = queueDOList.size()-1; i >= 0; i--) { |
| | | if ( affinityWaitingItem.getSeqNum() == queueDOList.get(i).getSeqNum() ) { |
| | | affinityWaitingList.forEach(affinityWaitingItem -> { |
| | | for (int i = queueDOList.size() - 1; i >= 0; i--) { |
| | | if (affinityWaitingItem.getSeqNum() == queueDOList.get(i).getSeqNum()) { |
| | | queueDOList.add(i + 1, affinityWaitingItem); |
| | | break; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取 指定工位 【安装】相关的患者 |
| | | * |
| | | * @param roomId |
| | | * @param bedNo |
| | | * @return |
| | |
| | | |
| | | queueStatusList.clear(); |
| | | queueStatusList.add(QueueStatusEnum.INSTALLING.getStatus()); |
| | | queueDOList.addAll(0, getBedQueueByStatus(roomId, bedNo, queueStatusList) ); // 当前工位的 |
| | | queueDOList.addAll(0, getBedQueueByStatus(roomId, bedNo, queueStatusList)); // 当前工位的 |
| | | |
| | | //把 [亲和的] 挪到主项后面 |
| | | List<QueueDO> affinityReceivedList = new ArrayList<>(); |
| | |
| | | affinityReceivedList.add(item); |
| | | } |
| | | } |
| | | affinityReceivedList.forEach( affinityReceivedItem -> { |
| | | for (int i = queueDOList.size()-1; i >= 0; i--) { |
| | | if ( affinityReceivedItem.getSeqNum() == queueDOList.get(i).getSeqNum() ) { |
| | | affinityReceivedList.forEach(affinityReceivedItem -> { |
| | | for (int i = queueDOList.size() - 1; i >= 0; i--) { |
| | | if (affinityReceivedItem.getSeqNum() == queueDOList.get(i).getSeqNum()) { |
| | | queueDOList.add(i + 1, affinityReceivedItem); |
| | | break; |
| | | } |
| | |
| | | } |
| | | |
| | | private RoomDO getRoomDO(Long roomId, String bedNo) { |
| | | RoomDO roomDO = mapRoomBed.get( Utils.formatRoomBed(roomId, bedNo) ); |
| | | if ( null == roomDO) |
| | | roomDO = roomMapper.getRoom(roomId, bedNo); |
| | | RoomDO roomDO = mapRoomBed.get(Utils.formatRoomBed(roomId, bedNo)); |
| | | if (null == roomDO) roomDO = roomMapper.getRoom(roomId, bedNo); |
| | | |
| | | return roomDO; |
| | | } |
| | |
| | | * 装机召回,是抢占式的,会改变装机工位 |
| | | */ |
| | | private void procAffinityWhenInstallRecall(String patId, Integer[] affinityCheckTypes, Long roomId_operator, String bedNo_operator) { |
| | | List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatus( |
| | | patId, affinityCheckTypes, QueueStatusEnum.AFFINITY_INSTALL.getStatus()); |
| | | List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatus(patId, affinityCheckTypes, QueueStatusEnum.AFFINITY_INSTALL.getStatus()); |
| | | for (int i = 0; i < affinityItems.size(); i++) { |
| | | QueueDO queueItem = affinityItems.get(i); |
| | | queueItem.setRoomId( roomId_operator ); |
| | | queueItem.setBedNo( bedNo_operator ); |
| | | queueItem.setRoomId(roomId_operator); |
| | | queueItem.setBedNo(bedNo_operator); |
| | | //queueItem.setSeqNum( preemptQueueItem.getSeqNum() ); // 装机时 内部序号不变 故不需更新 |
| | | queueMapper.updateById(queueItem); |
| | | } |
| | |
| | | */ |
| | | private void procAffinityWhenQueue(/*IN, OUT*/QueueSaveReqVO queueSaveReqVO, Integer[] affinityCheckTypes) { |
| | | // 如果存在 [候诊中] [就诊中] [过号] [已召回] 能被依附的检查项,则依附到其中一个 |
| | | List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatusList( |
| | | queueSaveReqVO.getPatId(), affinityCheckTypes, |
| | | List.of(QueueStatusEnum.READY.getStatus(), QueueStatusEnum.ONSTAGE.getStatus(), |
| | | QueueStatusEnum.PASSED.getStatus(), QueueStatusEnum.RECALLED.getStatus())); |
| | | List<QueueDO> affinityItems = queueMapper.getCurPatGivenCheckTypesAndStatusList(queueSaveReqVO.getPatId(), affinityCheckTypes, List.of(QueueStatusEnum.READY.getStatus(), QueueStatusEnum.ONSTAGE.getStatus(), QueueStatusEnum.PASSED.getStatus(), QueueStatusEnum.RECALLED.getStatus())); |
| | | if (!affinityItems.isEmpty()) { |
| | | QueueDO queueItem = affinityItems.get(0); |
| | | queueSaveReqVO.setStatus(QueueStatusEnum.AFFINITY.getStatus()); // [亲和-排队] 状态 |
| | | queueSaveReqVO.setAffinityItem( 1 ); |
| | | queueSaveReqVO.setAffinityItem(1); |
| | | queueSaveReqVO.setRoomId(queueItem.getRoomId()); |
| | | queueSaveReqVO.setRoomName(queueItem.getRoomName()); |
| | | queueSaveReqVO.setBedNo(queueItem.getBedNo()); |