Kaynağa Gözat

fix 镇痛不足自动消失

A17404李放 3 yıl önce
ebeveyn
işleme
049ae10b08

+ 2 - 3
nb-system/src/main/java/com/nb/bus/entity/BusInfusionHistoryEntity.java

@@ -31,10 +31,10 @@ import java.util.Date;
 @ApiModel(value="设备输注历史信息记录", description="设备的classification标识每改变一次,就算一次新的输注记录")
 public class BusInfusionHistoryEntity extends CommonDeviceParam<String,String> {
 
-    @ApiModelProperty(value = "从阿里云接收到的消息id")
+    @ApiModelProperty(value = "当引起镇痛不足时,从阿里云接收到的消息id")
     @JsonIgnore
     @TableField(updateStrategy = FieldStrategy.NEVER)
-    private String msgId;
+    private String analPoorMsgId;
 
     @ApiModelProperty(value = "公共-此次输注过程中到此为止的总追加量")
     private BigDecimal totalAppendDose;
@@ -92,7 +92,6 @@ public class BusInfusionHistoryEntity extends CommonDeviceParam<String,String> {
         entity.setStartTime(running.getStartTime());
         entity.setPatientId(running.getPatientId());
         entity.setLastUploadTime(running.getUploadTime());
-        entity.setMsgId(running.getMsgId());
 //        if(DeviceStatusEnum.Shutdown.equals(running.getRunState())){
 //            entity.setFinished(true);
 //        }

+ 2 - 1
nb-system/src/main/java/com/nb/bus/hospital/config/HospitalFunctionAnalConfigHandler.java

@@ -136,6 +136,7 @@ public class HospitalFunctionAnalConfigHandler extends AbstractHospitalConfigHan
             if(subCount>=analConfig.getInsufficientCount()){
                 log.info("消息【{}】,设备【{}】由引起镇痛不足--实时判定",source.getMsgId(),source.getDeviceId());
                 source.setWarnAnalgesicPoor(true);
+
                 //镇痛消失延迟队列
                 RDelayedQueue<AbstractMsgId> noneAnalDelayedQueue = redissonUtil.getDelayedQueue("none-" + getId(), e -> {
                     if(e instanceof NoneAnalEntity){
@@ -188,7 +189,7 @@ public class HospitalFunctionAnalConfigHandler extends AbstractHospitalConfigHan
             infusionHistoryService.update(new UpdateWrapper<BusInfusionHistoryEntity>().lambda()
                     .eq(BusInfusionHistoryEntity::getId,infusionHistory.getId())
                     .eq(BusInfusionHistoryEntity::getWarnAnalgesicPoor,true)
-                    .eq(BusInfusionHistoryEntity::getMsgId,noneAnal.getIotMsgId())
+                    .eq(BusInfusionHistoryEntity::getAnalPoorMsgId,noneAnal.getIotMsgId())
                     .set(BusInfusionHistoryEntity::getWarnAnalgesicPoor,false));
             deviceRegistry.getOperator(deviceId).setAlarmOrWarn(null);
             //发布推送

+ 4 - 0
nb-system/src/main/java/com/nb/bus/websocket/listener/DeviceInfoListener.java

@@ -476,6 +476,10 @@ public class DeviceInfoListener {
                 .handleDeviceMessage(device);
         //实时处理,镇痛不足
         infusionHistory.setWarnAnalgesicPoor(device.getWarnAnalgesicPoor());
+        if (Boolean.TRUE.equals(infusionHistory.getWarnAnalgesicPoor())) {
+            //引起镇痛不足的消息id
+            infusionHistory.setAnalPoorMsgId(device.getMsgId());
+        }
         //实时处理,低输注
         infusionHistory.setWarnFlow(device.getWarnFlow());
     }