|
|
@@ -96,7 +96,7 @@ public class DeviceInfoListener implements IIotMsgHandler {
|
|
|
long startTime = System.currentTimeMillis();
|
|
|
DeviceOperator deviceOperator = deviceRegistry.getOperator(deviceId);
|
|
|
//对设备数据的一些参数进行初始化设置
|
|
|
- init(device,deviceOperator);
|
|
|
+ init(device);
|
|
|
|
|
|
//缓存操作
|
|
|
List<Supplier<?>> cacheOperation=new ArrayList<>();
|
|
|
@@ -204,16 +204,10 @@ public class DeviceInfoListener implements IIotMsgHandler {
|
|
|
&&FlowStatusEnum.None==device.getWarnFlow()
|
|
|
&& Boolean.FALSE.equals(device.isNewInfusion())){
|
|
|
BigDecimal lastContinueDose = deviceOperator.getContinueDose();
|
|
|
- boolean flowLimit = deviceOperator.isFlowLimit();
|
|
|
- if(lastContinueDose==null){
|
|
|
- device.setWarnFlow(flowLimit?FlowStatusEnum.Limited:FlowStatusEnum.None);
|
|
|
- if(log.isDebugEnabled()){
|
|
|
- log.warn("设备【{}】流速在缓存中不存在",device.getContinueDose());
|
|
|
- }
|
|
|
- }else {
|
|
|
+ if(lastContinueDose!=null){
|
|
|
if(CompareUtil.compare(device.getContinueDose(),lastContinueDose)>0){
|
|
|
log.info("消息【{}】,设备【{}】,当前流速【{}】,上一状态流速【{}】,加档",device.getMsgId(),device.getDeviceId(),device.getContinueDose(),lastContinueDose);
|
|
|
- device.setWarnFlow(flowLimit?FlowStatusEnum.Limited:FlowStatusEnum.Up);
|
|
|
+ device.setWarnFlow(FlowStatusEnum.Up);
|
|
|
}else if(CompareUtil.compare(device.getContinueDose(),lastContinueDose)<0){
|
|
|
log.info("消息【{}】,设备【{}】,当前流速【{}】,上一状态流速【{}】,减档",device.getMsgId(),device.getDeviceId(),device.getContinueDose(),lastContinueDose);
|
|
|
device.setWarnFlow(FlowStatusEnum.Down);
|
|
|
@@ -224,8 +218,7 @@ public class DeviceInfoListener implements IIotMsgHandler {
|
|
|
}
|
|
|
cacheOperation.add(()->{
|
|
|
deviceOperator.setContinueDose(device.getContinueDose());
|
|
|
- if(FlowStatusEnum.Down.equals(device.getWarnFlow())
|
|
|
- ||(device.isNewInfusion()&&!FlowStatusEnum.Limited.equals(device.getWarnFlow()))){
|
|
|
+ if(FlowStatusEnum.Down.equals(device.getWarnFlow())){
|
|
|
//减档或者非加档受限的新输注
|
|
|
deviceOperator.setFlowLimit(false);
|
|
|
}else if(FlowStatusEnum.Limited.equals(device.getWarnFlow())){
|
|
|
@@ -241,23 +234,16 @@ public class DeviceInfoListener implements IIotMsgHandler {
|
|
|
return null;
|
|
|
});
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- private void init(BusDeviceRunningEntity device,DeviceOperator deviceOperator ) {
|
|
|
- if(DeviceTypeEnum.intelligent.equals(device.getType())
|
|
|
- &&device.getFlowUpLimit().compareTo(device.getContinueDose())>=0
|
|
|
- &&!FlowStatusEnum.None.equals(device.getWarnFlow())){
|
|
|
- device.setWarnFlow(FlowStatusEnum.Limited);
|
|
|
- }
|
|
|
-// if(device.getWarnFlow()!=null&&FlowStatusEnum.None.equals(device.getWarnFlow())){
|
|
|
-// device.setWarnFlow(null);
|
|
|
-// }
|
|
|
if(device.getWarnFlow()!=null&&FlowStatusEnum.Limited.equals(device.getWarnFlow())){
|
|
|
//加档受限,进行标识
|
|
|
device.setFlowRestricted(true);
|
|
|
}else {
|
|
|
device.setFlowRestricted(false);
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ private void init(BusDeviceRunningEntity device) {
|
|
|
//默认格式化住院号=设备上传住院号
|
|
|
device.setFormatPatientCode(device.getPatientCode());
|
|
|
device.setMonitorType(true);
|