|
@@ -27,8 +27,10 @@ import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
|
|
|
|
+import java.util.Collections;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
|
+import java.util.Set;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author lifang
|
|
* @author lifang
|
|
@@ -47,6 +49,8 @@ public class RabbitMqListener {
|
|
|
private final IDeviceClient deviceClient;
|
|
private final IDeviceClient deviceClient;
|
|
|
private final IIotMsgHandler iotMsgHandler;
|
|
private final IIotMsgHandler iotMsgHandler;
|
|
|
private final IHospitalLogClient hospitalLogService;
|
|
private final IHospitalLogClient hospitalLogService;
|
|
|
|
|
+ private final IConMixClient conMixClient;
|
|
|
|
|
+ private final IConDoctorClient conDoctorClient;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 描述: 监听病人队列
|
|
* 描述: 监听病人队列
|
|
@@ -71,22 +75,6 @@ public class RabbitMqListener {
|
|
|
BusClinicEntity clinic= source.toClinic(patientId);
|
|
BusClinicEntity clinic= source.toClinic(patientId);
|
|
|
PatientMonitorDetailResult patientDetail = patientClient.lookPatientDetail(patientId);
|
|
PatientMonitorDetailResult patientDetail = patientClient.lookPatientDetail(patientId);
|
|
|
BusClinicEntity existClinic = patientDetail.getClinic();
|
|
BusClinicEntity existClinic = patientDetail.getClinic();
|
|
|
-// if(Boolean.TRUE.equals(clinic.getFinished())){
|
|
|
|
|
-// if(ObjectUtil.isNull(existClinic)||
|
|
|
|
|
-// ObjectUtil.isNull(existClinic.getUndoConfig())||
|
|
|
|
|
-// ObjectUtil.notEqual(clinic.getUndoConfig(),
|
|
|
|
|
-// existClinic.getUndoConfig())){
|
|
|
|
|
-// //避免重复撤泵,进行撤泵处理
|
|
|
|
|
-// clinicClient.finish(existClinic.getId(),existClinic.getTenantId(),clinic.getUndoConfig());
|
|
|
|
|
-// if (patientDetail.getInfusion()!=null) {
|
|
|
|
|
-// //刷新分包标识
|
|
|
|
|
-// deviceClient.refreshClassification(patientDetail.getInfusion().getDeviceId());
|
|
|
|
|
-// }
|
|
|
|
|
-// }else {
|
|
|
|
|
-// clinic.setFinished(null);
|
|
|
|
|
-// clinicClient.update(existClinic.getId(),clinic);
|
|
|
|
|
-// }
|
|
|
|
|
-// }else {
|
|
|
|
|
//当上一个临床状态为已结束时,对比临床信息是否发生改变,生成新的临床信息
|
|
//当上一个临床状态为已结束时,对比临床信息是否发生改变,生成新的临床信息
|
|
|
boolean sameClinic=false;
|
|
boolean sameClinic=false;
|
|
|
if(StrUtil.isNotEmpty(existClinic.getId())){
|
|
if(StrUtil.isNotEmpty(existClinic.getId())){
|
|
@@ -96,9 +84,11 @@ public class RabbitMqListener {
|
|
|
if(!sameClinic){
|
|
if(!sameClinic){
|
|
|
//为了避免网络延迟,开始时间往前推1个小时
|
|
//为了避免网络延迟,开始时间往前推1个小时
|
|
|
clinic.setStartTime(DateUtil.offsetHour(new Date(),0));
|
|
clinic.setStartTime(DateUtil.offsetHour(new Date(),0));
|
|
|
-
|
|
|
|
|
|
|
+ Set<BusClinicEntity> sources = Collections.singleton(clinic);
|
|
|
clinic=clinicClient.insertFromHis(clinic);
|
|
clinic=clinicClient.insertFromHis(clinic);
|
|
|
clinicClient.setCurrentClinicByHis(clinic,Boolean.TRUE.equals(existClinic.getFinished()));
|
|
clinicClient.setCurrentClinicByHis(clinic,Boolean.TRUE.equals(existClinic.getFinished()));
|
|
|
|
|
+ conMixClient.insertUniqueCon(sources,clinic.getTenantId());
|
|
|
|
|
+ conDoctorClient.insertUniqueDoctor(sources,clinic.getTenantId());
|
|
|
}else {
|
|
}else {
|
|
|
clinic.setStartTime(existClinic.getStartTime());
|
|
clinic.setStartTime(existClinic.getStartTime());
|
|
|
clinicClient.update(existClinic.getId(),clinic);
|
|
clinicClient.update(existClinic.getId(),clinic);
|