| | |
| | | package cn.lihu.jh.module.ecg.service.callingscreen; |
| | | |
| | | import cn.lihu.jh.framework.common.pojo.PageResult; |
| | | import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import cn.lihu.jh.module.ecg.Utils; |
| | | import cn.lihu.jh.module.ecg.controller.admin.checktype.vo.CheckTypePageReqVO; |
| | | import cn.lihu.jh.module.ecg.dal.dataobject.checktype.CheckTypeDO; |
| | |
| | | queueStatusList.add(QueueStatusEnum.PASSED_WAITING.getStatus()); |
| | | queueStatusList.add(QueueStatusEnum.AFFINITY.getStatus()); |
| | | List<QueueDO> queueDOList = queueMapper.getRoomQueueByStatus(roomId, queueStatusList); |
| | | |
| | | // 【共享候诊池】共享项目(如 100/1100/1000)准备中时不绑定诊室(room_id=0), |
| | | // 上面的按 room_id 查询查不到他们 → 1/2 诊室屏会"看不到准备中的病人"(2026-11-25 反馈)。 |
| | | // 这里按本诊室开展的共享项目把池中「准备中(20)」补进来,排在列表最前面。 |
| | | Integer[] sharedOfRoom = getSharedCheckTypesOfRoom(roomId); |
| | | if (sharedOfRoom.length > 0) { |
| | | List<QueueDO> poolList = queueMapper.selectSharedList(QueueStatusEnum.READY.getStatus(), sharedOfRoom); |
| | | if (null != poolList && !poolList.isEmpty()) { |
| | | queueDOList.addAll(0, poolList); |
| | | } |
| | | } |
| | | |
| | | // 需求1:回填患者信息(诊间屏-检查队列) |
| | | queueService.fillAppointmentInfo(queueDOList); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 本诊室开展的「共享候诊池」检查项目 = 本诊室任一工位的 check_types ∩ check_type.share_pool=1。 |
| | | * 用于把池中未绑定诊室的「准备中」患者补进诊间屏列表。 |
| | | */ |
| | | private Integer[] getSharedCheckTypesOfRoom(Long roomId) { |
| | | if (null == roomId) { |
| | | return new Integer[0]; |
| | | } |
| | | try { |
| | | List<CheckTypeDO> sharedList = checkTypeMapper.selectList( |
| | | new LambdaQueryWrapperX<CheckTypeDO>().eq(CheckTypeDO::getSharePool, true)); |
| | | if (null == sharedList || sharedList.isEmpty()) { |
| | | return new Integer[0]; |
| | | } |
| | | List<Integer> sharedValues = sharedList.stream().map(CheckTypeDO::getValue) |
| | | .filter(Objects::nonNull).toList(); |
| | | List<RoomDO> beds = roomMapper.selectList( |
| | | new LambdaQueryWrapperX<RoomDO>().eq(RoomDO::getRoomId, roomId)); |
| | | if (null == beds || beds.isEmpty() || null == beds.get(0).getCheckTypes()) { |
| | | return new Integer[0]; |
| | | } |
| | | return Arrays.stream(beds.get(0).getCheckTypes()).filter(sharedValues::contains) |
| | | .distinct().toArray(Integer[]::new); |
| | | } catch (Exception e) { |
| | | log.warn("[getSharedCheckTypesOfRoom] 读取诊室共享项目失败,按无共享项目处理. roomId={}", roomId, e); |
| | | return new Integer[0]; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 诊间屏 安装患者列表 |
| | | */ |
| | | @Override |