|
@@ -114,19 +114,22 @@ public class DeviceInfoListener implements IIotMsgHandler {
|
|
|
if(log.isDebugEnabled()){
|
|
if(log.isDebugEnabled()){
|
|
|
log.debug("消息【{}】,设备号【{}】处理输注参数成功,处理后结果为【{}】",device.getMsgId(),device.getDeviceId(),JSONUtil.toJsonStr(device));
|
|
log.debug("消息【{}】,设备号【{}】处理输注参数成功,处理后结果为【{}】",device.getMsgId(),device.getDeviceId(),JSONUtil.toJsonStr(device));
|
|
|
}
|
|
}
|
|
|
- //格式化病号
|
|
|
|
|
- formatPatientCode(device);
|
|
|
|
|
- if(log.isDebugEnabled()){
|
|
|
|
|
- log.debug("消息【{}】,设备号【{}】格式化病号,处理后结果为【{}】",device.getMsgId(),device.getDeviceId(),JSONUtil.toJsonStr(device));
|
|
|
|
|
- }
|
|
|
|
|
- //处理输注修改参数,处理病人信息
|
|
|
|
|
- handleInfusionModify(device,deviceOperator,cacheOperation);
|
|
|
|
|
- if(log.isDebugEnabled()){
|
|
|
|
|
- log.debug("消息【{}】,设备号【{}】处理输注修改参数、病人信息成功,处理后结果为【{}】",device.getMsgId(),device.getDeviceId(),JSONUtil.toJsonStr(device));
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- //根据功能配置进行最后的一些状态处理
|
|
|
|
|
- handleHospitalConfigLast(device,infusionHistory);
|
|
|
|
|
|
|
+ //测试数据不进行病人数据的计算
|
|
|
|
|
+ if(Boolean.FALSE.equals(infusionHistory.getTest())){
|
|
|
|
|
+ //格式化病号
|
|
|
|
|
+ formatPatientCode(device);
|
|
|
|
|
+ if(log.isDebugEnabled()){
|
|
|
|
|
+ log.debug("消息【{}】,设备号【{}】格式化病号,处理后结果为【{}】",device.getMsgId(),device.getDeviceId(),JSONUtil.toJsonStr(device));
|
|
|
|
|
+ }
|
|
|
|
|
+ //处理输注修改参数,处理病人信息
|
|
|
|
|
+ handleInfusionModify(device,deviceOperator,cacheOperation);
|
|
|
|
|
+ if(log.isDebugEnabled()){
|
|
|
|
|
+ log.debug("消息【{}】,设备号【{}】处理输注修改参数、病人信息成功,处理后结果为【{}】",device.getMsgId(),device.getDeviceId(),JSONUtil.toJsonStr(device));
|
|
|
|
|
+ }
|
|
|
|
|
+ //根据功能配置进行最后的一些状态处理
|
|
|
|
|
+ handleHospitalConfigLast(device,infusionHistory);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
//处理历史运行数据
|
|
//处理历史运行数据
|
|
|
BusDeviceHistoryEntity history=handleRunningHistory(device);
|
|
BusDeviceHistoryEntity history=handleRunningHistory(device);
|
|
@@ -159,26 +162,29 @@ public class DeviceInfoListener implements IIotMsgHandler {
|
|
|
cacheOperation.add(()->{
|
|
cacheOperation.add(()->{
|
|
|
deviceOperator.setUploadTime(device.getUploadTime());
|
|
deviceOperator.setUploadTime(device.getUploadTime());
|
|
|
wsPublishUtils.publishPatientMonitor(device.getPatientId(),device.getTenantId());
|
|
wsPublishUtils.publishPatientMonitor(device.getPatientId(),device.getTenantId());
|
|
|
- if (Boolean.TRUE.equals(device.isResetUndo())||Boolean.TRUE.equals(device.isInfusionModify())) {
|
|
|
|
|
- if (Boolean.TRUE.equals(device.isInfusionModify())) {
|
|
|
|
|
- wsPublishUtils.publishDeviceNone(device.getTenantId());
|
|
|
|
|
|
|
+ //非测试数据再进行处理
|
|
|
|
|
+ if(!Boolean.TRUE.equals(device.getTest())){
|
|
|
|
|
+ if (Boolean.TRUE.equals(device.isResetUndo())||Boolean.TRUE.equals(device.isInfusionModify())) {
|
|
|
|
|
+ if (Boolean.TRUE.equals(device.isInfusionModify())) {
|
|
|
|
|
+ wsPublishUtils.publishDeviceNone(device.getTenantId());
|
|
|
|
|
+ }
|
|
|
|
|
+ wsPublishUtils.publishDeviceRepeat(device.getTenantId());
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Boolean.TRUE.equals(device.isResetClinic())) {
|
|
|
|
|
+ wsPublishUtils.publishMonitorTotalCount(device.getTenantId());
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!device.isMaybeLowInfusion()){
|
|
|
|
|
+ deviceOperator.setNonLowInfusionTime(device.getUploadTime());
|
|
|
|
|
+ }
|
|
|
|
|
+ wsPublishUtils.publishMonitorStateCount(device.getTenantId());
|
|
|
|
|
+ if(device.isNewInfusion()){
|
|
|
|
|
+ CompletableFuture.runAsync(()->patientService.getPatientInfoFromHis(device.getTenantId(),device.getFormatPatientCode(),10,false)
|
|
|
|
|
+ ,executor)
|
|
|
|
|
+ .exceptionally(t->{
|
|
|
|
|
+ log.warn("新的输注产生后,拉取病号【{}】信息失败,失败原因:【{}】",device.getFormatPatientCode(), ExceptionUtil.getExceptionMsg(t));
|
|
|
|
|
+ return null;
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- wsPublishUtils.publishDeviceRepeat(device.getTenantId());
|
|
|
|
|
- }
|
|
|
|
|
- if (Boolean.TRUE.equals(device.isResetClinic())) {
|
|
|
|
|
- wsPublishUtils.publishMonitorTotalCount(device.getTenantId());
|
|
|
|
|
- }
|
|
|
|
|
- if(!device.isMaybeLowInfusion()){
|
|
|
|
|
- deviceOperator.setNonLowInfusionTime(device.getUploadTime());
|
|
|
|
|
- }
|
|
|
|
|
- wsPublishUtils.publishMonitorStateCount(device.getTenantId());
|
|
|
|
|
- if(device.isNewInfusion()){
|
|
|
|
|
- CompletableFuture.runAsync(()->patientService.getPatientInfoFromHis(device.getTenantId(),device.getFormatPatientCode(),10,false)
|
|
|
|
|
- ,executor)
|
|
|
|
|
- .exceptionally(t->{
|
|
|
|
|
- log.warn("新的输注产生后,拉取病号【{}】信息失败,失败原因:【{}】",device.getFormatPatientCode(), ExceptionUtil.getExceptionMsg(t));
|
|
|
|
|
- return null;
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
|
});
|
|
});
|