mirror of
https://gitee.com/republicline/rax-remote-v2.git
synced 2025-08-24 04:04:57 +08:00
fixed: 修正生命体征这部分的返回json内容,便于处理
This commit is contained in:
parent
39341f6c20
commit
9b2daf8452
1
pom.xml
1
pom.xml
|
@ -98,7 +98,6 @@
|
||||||
<module>upms</module>
|
<module>upms</module>
|
||||||
<!-- 通用模块 -->
|
<!-- 通用模块 -->
|
||||||
<module>common</module>
|
<module>common</module>
|
||||||
|
|
||||||
<module>daily-plan</module>
|
<module>daily-plan</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
|
import org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService;
|
||||||
import org.springframework.web.socket.*;
|
import org.springframework.web.socket.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
@ -26,7 +27,7 @@ public class AddMedicineHandler implements WebSocketHandler {
|
||||||
private OAuth2AuthorizationService authorizationService;
|
private OAuth2AuthorizationService authorizationService;
|
||||||
|
|
||||||
// 发送心跳任务的定时任务容器
|
// 发送心跳任务的定时任务容器
|
||||||
private Map<String, ScheduledExecutorService> timerTaskMap = new ConcurrentHashMap();
|
private Map<String, ScheduledExecutorService> timerTaskMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AIMedicineTimer aiMedicineTimer;
|
private AIMedicineTimer aiMedicineTimer;
|
||||||
|
@ -38,6 +39,7 @@ public class AddMedicineHandler implements WebSocketHandler {
|
||||||
startHeartbeat(session);
|
startHeartbeat(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
|
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
|
||||||
// String decode = URLDecoder.decode(session.getUri().getQuery());
|
// String decode = URLDecoder.decode(session.getUri().getQuery());
|
||||||
|
@ -61,6 +63,20 @@ public class AddMedicineHandler implements WebSocketHandler {
|
||||||
aiMedicineTimer.initWeb(databaseName, session);
|
aiMedicineTimer.initWeb(databaseName, session);
|
||||||
vitalSignTimerWS.initWeb(databaseName, session);
|
vitalSignTimerWS.initWeb(databaseName, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理网页端接收到消息后的相应内容
|
||||||
|
if ("webResponseConnection".equals(msgType)) {
|
||||||
|
String webConnectionFlag = jsonObject.getString("webConnectionFlag");
|
||||||
|
// 给unity端发送网页端拒绝连接
|
||||||
|
aiMedicineTimer.sendConnectionResponseToUnity(patientName,idNum,date,databaseName, webConnectionFlag);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理web端请求或断开连接
|
||||||
|
if ("webRequestConnection".equals(msgType)) {
|
||||||
|
String webRequestFlag = jsonObject.getString("webConnectionFlag");
|
||||||
|
aiMedicineTimer.sendWebRequestConnectionMsg(patientName,idNum,date,databaseName, webRequestFlag);
|
||||||
|
}
|
||||||
|
|
||||||
if (aiMedicineTimer.getUnitySession(databaseName) != null) {
|
if (aiMedicineTimer.getUnitySession(databaseName) != null) {
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("msg", "unity端已登录");
|
result.put("msg", "unity端已登录");
|
||||||
|
@ -84,28 +100,26 @@ public class AddMedicineHandler implements WebSocketHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理网页端接收到消息后的相应内容
|
|
||||||
if ("webResponseConnection".equals(msgType)) {
|
|
||||||
String webConnectionFlag = jsonObject.getString("webConnectionFlag");
|
|
||||||
// 给unity端发送网页端拒绝连接
|
|
||||||
aiMedicineTimer.sendConnectionResponseToUnity(patientName,idNum,date,databaseName, webConnectionFlag);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理web端请求或断开连接
|
|
||||||
if ("webRequestConnection".equals(msgType)) {
|
|
||||||
String webRequestFlag = jsonObject.getString("webConnectionFlag");
|
|
||||||
aiMedicineTimer.sendWebRequestConnectionMsg(patientName,idNum,date,databaseName, webRequestFlag);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理发送给药相关
|
// 处理发送给药相关
|
||||||
if ("addMedicine".equals(msgType) && aiMedicineTimer.getWebSession(databaseName) != null && aiMedicineTimer.getUnitySession(databaseName) != null
|
if ("addMedicine".equals(msgType) && aiMedicineTimer.getWebSession(databaseName) != null && aiMedicineTimer.getUnitySession(databaseName) != null
|
||||||
&& aiMedicineTimer.isReady(databaseName)) {
|
&& aiMedicineTimer.isReady(databaseName)) {
|
||||||
// todo 注意修改
|
// todo 注意修改
|
||||||
// flag 1 代表人工给药, 0代表AI给药
|
// flag 0 代表人工给药, 1代表AI给药
|
||||||
vitalSignTimerWS.changeWSAIFlag(databaseName, "admin", session, jsonObject.getString("flag"),
|
vitalSignTimerWS.changeWSAIFlag(databaseName, "admin", session, jsonObject.getString("flag"),
|
||||||
jsonObject.getString("medicine"), jsonObject.getString("value"));
|
jsonObject.getString("medicine"), jsonObject.getString("value"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 展示网页端延迟信息
|
||||||
|
if ("ping".equals(msgType)) {
|
||||||
|
Long timeStamp = jsonObject.getLong("msg");
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("msgType", "pong");
|
||||||
|
// 当前时间戳
|
||||||
|
result.put("msg", new Date().getTime() - timeStamp);
|
||||||
|
session.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +158,7 @@ public class AddMedicineHandler implements WebSocketHandler {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
stopHeartbeat(session);
|
stopHeartbeat(session);
|
||||||
}
|
}
|
||||||
}, 0, 10, TimeUnit.SECONDS);
|
}, 0, 30, TimeUnit.SECONDS);
|
||||||
timerTaskMap.put(session.getId(), heartbeatExecutor);
|
timerTaskMap.put(session.getId(), heartbeatExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,11 @@ import com.rax.vital.timer.AIMedicineTimer;
|
||||||
import com.rax.vital.timer.VitalSignTimerWS;
|
import com.rax.vital.timer.VitalSignTimerWS;
|
||||||
import com.rax.vital.util.DatabaseNameUtil;
|
import com.rax.vital.util.DatabaseNameUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.joda.time.LocalDateTime;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.socket.*;
|
import org.springframework.web.socket.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
@ -82,12 +84,12 @@ public class MachineFeedbackHandler implements WebSocketHandler {
|
||||||
|
|
||||||
if (aiMedicineTimer.getWebSession(databaseName) != null) {
|
if (aiMedicineTimer.getWebSession(databaseName) != null) {
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("msg", "网站端已登录");
|
result.put("msg", "网页端已登录");
|
||||||
result.put("msgType", "msg");
|
result.put("msgType", "msg");
|
||||||
session.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
session.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
||||||
} else {
|
} else {
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("msg", "网站端未登录");
|
result.put("msg", "网页端未登录");
|
||||||
result.put("msgType", "msg");
|
result.put("msgType", "msg");
|
||||||
session.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
session.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
||||||
}
|
}
|
||||||
|
@ -108,6 +110,28 @@ public class MachineFeedbackHandler implements WebSocketHandler {
|
||||||
&& aiMedicineTimer.isReady(databaseName)) {
|
&& aiMedicineTimer.isReady(databaseName)) {
|
||||||
vitalSignTimerWS.sendMachineFlag(databaseName, code, session);
|
vitalSignTimerWS.sendMachineFlag(databaseName, code, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 展示unity端延迟信息
|
||||||
|
if ("ping".equals(msgType)) {
|
||||||
|
Long timeStamp = jsonObject.getLong("msg");
|
||||||
|
JSONObject result = new JSONObject();
|
||||||
|
result.put("msgType", "pong");
|
||||||
|
// 当前时间戳
|
||||||
|
result.put("msg", new Date().getTime() - timeStamp);
|
||||||
|
session.sendMessage(new TextMessage(result.toJSONString().getBytes()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// unity收到给药信息后回复把此消息推送给web
|
||||||
|
if ("getMedicine".equals(msgType)) {
|
||||||
|
JSONObject getMedicineMsg = new JSONObject();
|
||||||
|
getMedicineMsg.put("msgType", "getMedicine");
|
||||||
|
getMedicineMsg.put("patientName", patientName);
|
||||||
|
getMedicineMsg.put("idNum", idNum);
|
||||||
|
getMedicineMsg.put("date", date);
|
||||||
|
getMedicineMsg.put(jsonObject.getString("medicine"), jsonObject.getString("value"));
|
||||||
|
WebSocketSession webSession = aiMedicineTimer.getWebSession(databaseName);
|
||||||
|
webSession.sendMessage(new TextMessage(getMedicineMsg.toJSONString().getBytes()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -147,7 +171,7 @@ public class MachineFeedbackHandler implements WebSocketHandler {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
stopHeartbeat(session);
|
stopHeartbeat(session);
|
||||||
}
|
}
|
||||||
}, 0, 10, TimeUnit.SECONDS);
|
}, 0, 30, TimeUnit.SECONDS);
|
||||||
timerTaskMap.put(session.getId(), heartbeatExecutor);
|
timerTaskMap.put(session.getId(), heartbeatExecutor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,9 +46,7 @@ public class MedicineHandler implements WebSocketHandler {
|
||||||
String patientName = jsonObject.getString("patientName");
|
String patientName = jsonObject.getString("patientName");
|
||||||
String idNum = jsonObject.getString("idNum");
|
String idNum = jsonObject.getString("idNum");
|
||||||
String date = jsonObject.getString("date");
|
String date = jsonObject.getString("date");
|
||||||
System.out.println("medicineHandler-jsonObject = " + jsonObject.toJSONString());
|
|
||||||
String databaseName = DatabaseNameUtil.encrypt(patientName) + "_" + DatabaseNameUtil.encrypt(idNum) + "_" + date;
|
String databaseName = DatabaseNameUtil.encrypt(patientName) + "_" + DatabaseNameUtil.encrypt(idNum) + "_" + date;
|
||||||
System.out.println("medicineHandler-databaseName = " + databaseName);
|
|
||||||
vitalSignTimerWS.createAndSendWSMessageMongo(databaseName, "admin", session);
|
vitalSignTimerWS.createAndSendWSMessageMongo(databaseName, "admin", session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,30 +66,31 @@ public class MedicineController {
|
||||||
vitalSignTimer.createAndSendMessageMongo(databaseName, username, simpSessionId);
|
vitalSignTimer.createAndSendMessageMongo(databaseName, username, simpSessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@MessageMapping("/changeAIFlag")
|
// @MessageMapping("/changeAIFlag")
|
||||||
public void changeAIFlag(MessageHeaders messageHeaders, String body) {
|
// public void changeAIFlag(MessageHeaders messageHeaders, String body) {
|
||||||
LinkedMultiValueMap nativeHeaders = (LinkedMultiValueMap) messageHeaders.get("nativeHeaders");
|
// LinkedMultiValueMap nativeHeaders = (LinkedMultiValueMap) messageHeaders.get("nativeHeaders");
|
||||||
ArrayList tokenList = (ArrayList) nativeHeaders.get("token");
|
// ArrayList tokenList = (ArrayList) nativeHeaders.get("token");
|
||||||
String token = (String) tokenList.get(0);
|
// String token = (String) tokenList.get(0);
|
||||||
OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
// OAuth2Authorization authorization = authorizationService.findByToken(token, OAuth2TokenType.ACCESS_TOKEN);
|
||||||
|
//
|
||||||
String username = authorization.getPrincipalName();
|
// String username = authorization.getPrincipalName();
|
||||||
String simpSessionId = messageHeaders.get("simpSessionId", String.class);
|
// String simpSessionId = messageHeaders.get("simpSessionId", String.class);
|
||||||
|
//
|
||||||
JSONObject params = JSONObject.parseObject(body);
|
// JSONObject params = JSONObject.parseObject(body);
|
||||||
// 病人名
|
// // 病人名
|
||||||
String patientName = params.getString("patientName");
|
// String patientName = params.getString("patientName");
|
||||||
// 病人身份证
|
// // 病人身份证
|
||||||
String idNum = params.getString("idNum");
|
// String idNum = params.getString("idNum");
|
||||||
// yyyyMMdd
|
// // yyyyMMdd
|
||||||
String date = params.getString("date");
|
// String date = params.getString("date");
|
||||||
String databaseName = DatabaseNameUtil.encrypt(patientName) + "_" + DatabaseNameUtil.encrypt(idNum) + "_" + date;
|
// String databaseName = DatabaseNameUtil.encrypt(patientName) + "_" + DatabaseNameUtil.encrypt(idNum) + "_" + date;
|
||||||
vitalSignTimer.changeAIFlag(databaseName, username, simpSessionId, params.getString("flag"),
|
// vitalSignTimer.changeAIFlag(databaseName, username, simpSessionId, params.getString("flag"),
|
||||||
params.getString("medicine"), params.getString("value"));
|
// params.getString("medicine"), params.getString("value"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
@PostMapping("/getPatientInfo")
|
@PostMapping("/getPatientInfo")
|
||||||
public R getPatientInfo(String patientName, String idNum, String date) {
|
public R getPatientInfo(String patientName, String idNum, String date) {
|
||||||
|
// todo : 存疑
|
||||||
String databaseName = DatabaseNameUtil.encrypt(patientName) + "_" + DatabaseNameUtil.encrypt(idNum) + "_" + date;
|
String databaseName = DatabaseNameUtil.encrypt(patientName) + "_" + DatabaseNameUtil.encrypt(idNum) + "_" + date;
|
||||||
return vitalSignsService.getPatientInfo(databaseName);
|
return vitalSignsService.getPatientInfo(databaseName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,10 @@ public interface AIMedicineService {
|
||||||
List<Map> getAIMedicine(Connection connection);
|
List<Map> getAIMedicine(Connection connection);
|
||||||
|
|
||||||
void changeAIFlagMedicine(MongoTemplate template, String flag, String medicine, String value);
|
void changeAIFlagMedicine(MongoTemplate template, String flag, String medicine, String value);
|
||||||
|
|
||||||
|
// 获取累计用药量
|
||||||
|
List getCountMedicine(MongoTemplate template);
|
||||||
|
|
||||||
|
// 获取ai给药信息
|
||||||
|
List getAiMedicine(MongoTemplate template);
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,4 +164,38 @@ public class AIMedicineServiceImpl implements AIMedicineService {
|
||||||
template.insert(medicineObj, "doctormedicinetable");
|
template.insert(medicineObj, "doctormedicinetable");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List getCountMedicine(MongoTemplate template) {
|
||||||
|
Query query = new Query();
|
||||||
|
query.limit(1);
|
||||||
|
query.with(Sort.by(Sort.Order.desc("Time")));
|
||||||
|
List<Map> aiMedicines = template.find(query, Map.class, "fktable");
|
||||||
|
if (!aiMedicines.isEmpty()) {
|
||||||
|
Map medicine = new HashMap();
|
||||||
|
for (Map map : aiMedicines) {
|
||||||
|
medicine.put("丙泊酚sum", map.get("cumu_1"));
|
||||||
|
medicine.put("舒芬太尼sum", map.get("cumu_2"));
|
||||||
|
medicine.put("瑞芬太尼sum", map.get("cumu_3"));
|
||||||
|
medicine.put("顺阿曲库胺sum", map.get("cumu_4"));
|
||||||
|
medicine.put("尼卡地平sum", map.get("cumu_5"));
|
||||||
|
medicine.put("艾司洛尔sum", map.get("cumu_6"));
|
||||||
|
medicine.put("麻黄素sum", map.get("cumu_7"));
|
||||||
|
medicine.put("阿托品sum", map.get("cumu_8"));
|
||||||
|
medicine.put("Time", map.get("Time"));
|
||||||
|
}
|
||||||
|
aiMedicines.remove(0);
|
||||||
|
aiMedicines.add(medicine);
|
||||||
|
}
|
||||||
|
return aiMedicines;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List getAiMedicine(MongoTemplate template) {
|
||||||
|
Query query = new Query();
|
||||||
|
query.limit(1);
|
||||||
|
query.with(Sort.by(Sort.Order.desc("Time")));
|
||||||
|
List<Map> aimedicinetable = template.find(query, Map.class, "aimedicinetable");
|
||||||
|
return aimedicinetable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,13 +37,16 @@ public class FlagServiceImpl implements FlagService {
|
||||||
Map flagMap = new HashMap();
|
Map flagMap = new HashMap();
|
||||||
Query query = new Query();
|
Query query = new Query();
|
||||||
query.limit(1);
|
query.limit(1);
|
||||||
query.with(Sort.by(Sort.Order.desc("_id")));
|
query.with(Sort.by(Sort.Order.desc("Time")));
|
||||||
List<Map> linkTable = template.find(query, Map.class, "linktable");
|
List<Map> linkTable = template.find(query, Map.class, "linktable");
|
||||||
flagMap.put("linktable", linkTable);
|
System.out.println("linkTable = " + linkTable);
|
||||||
|
flagMap.put("linkFlag", linkTable.get(0).get("Flag"));
|
||||||
List<Map> aiFlagTable = template.find(query, Map.class, "aiflagtable");
|
List<Map> aiFlagTable = template.find(query, Map.class, "aiflagtable");
|
||||||
flagMap.put("aiflagtable", aiFlagTable);
|
System.out.println("aiFlagTable = " + aiFlagTable);
|
||||||
|
flagMap.put("aiFlag", aiFlagTable.get(0).get("Flag"));
|
||||||
List<Map> endFlagTable = template.find(query, Map.class, "endflagtable");
|
List<Map> endFlagTable = template.find(query, Map.class, "endflagtable");
|
||||||
flagMap.put("endflagtable", endFlagTable);
|
System.out.println("endFlagTable = " + endFlagTable);
|
||||||
|
flagMap.put("endFlag", endFlagTable.get(0).get("Flag"));
|
||||||
return flagMap;
|
return flagMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +60,6 @@ public class FlagServiceImpl implements FlagService {
|
||||||
@Override
|
@Override
|
||||||
public Map getFlag(MongoTemplate template) {
|
public Map getFlag(MongoTemplate template) {
|
||||||
Map allFlag = new HashMap();
|
Map allFlag = new HashMap();
|
||||||
|
|
||||||
Query query1 = new Query();
|
Query query1 = new Query();
|
||||||
query1.limit(1);
|
query1.limit(1);
|
||||||
query1.with(Sort.by(Sort.Order.desc("_id")));
|
query1.with(Sort.by(Sort.Order.desc("_id")));
|
||||||
|
|
|
@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.bson.BsonRegularExpression;
|
import org.bson.BsonRegularExpression;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||||
|
import org.springframework.data.domain.ScrollPosition;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.data.mongodb.SpringDataMongoDB;
|
import org.springframework.data.mongodb.SpringDataMongoDB;
|
||||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class AIMedicineTimer {
|
||||||
// 网页端拒绝连接
|
// 网页端拒绝连接
|
||||||
setWebStatus(databaseName, false);
|
setWebStatus(databaseName, false);
|
||||||
unityMsg = new JSONObject();
|
unityMsg = new JSONObject();
|
||||||
unityMsg.put("msgType", "connection refused");
|
unityMsg.put("msgType", "webResponseConnection");
|
||||||
unityMsg.put("webConnectionFlag", "0");
|
unityMsg.put("webConnectionFlag", "0");
|
||||||
unityMsg.put("patientName", patientName);
|
unityMsg.put("patientName", patientName);
|
||||||
unityMsg.put("idNum", idNum);
|
unityMsg.put("idNum", idNum);
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class VitalSignTimerWS {
|
||||||
dataSourceMap.put(sessionId, dataSource);
|
dataSourceMap.put(sessionId, dataSource);
|
||||||
dataSource.open();
|
dataSource.open();
|
||||||
}
|
}
|
||||||
|
System.out.println("mongoDBName = " + database);
|
||||||
CustomDataSource finalMongoDBSource = dataSource;
|
CustomDataSource finalMongoDBSource = dataSource;
|
||||||
TimerTask timerTask = new TimerTask() {
|
TimerTask timerTask = new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -107,19 +107,38 @@ public class VitalSignTimerWS {
|
||||||
|
|
||||||
MongoTemplate template = finalMongoDBSource.getConnection();
|
MongoTemplate template = finalMongoDBSource.getConnection();
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
// 生命体征信息
|
||||||
List vitalSignsList = vitalSignsService.getVitalSignsList(template);
|
List vitalSignsList = vitalSignsService.getVitalSignsList(template);
|
||||||
jsonObject.put("vitalSignsList", vitalSignsList);
|
jsonObject.put("vitalSignsList", vitalSignsList);
|
||||||
List aiMedicineList = aiMedicineService.getAIMedicine(template);
|
|
||||||
jsonObject.put("aiMedicineList", aiMedicineList);
|
// // 诱导期给药信息
|
||||||
// List docMedicineList = doctorMedicineService.getDocMedicine(template);
|
// List revulsionList = revulsionService.getRevulsionServiceList(template);
|
||||||
// jsonObject.put("docMedicineList", docMedicineList);
|
// jsonObject.put("revulsionList", revulsionList);
|
||||||
List revulsionList = revulsionService.getRevulsionServiceList(template);
|
// 标记信息
|
||||||
jsonObject.put("revulsionList", revulsionList);
|
|
||||||
Map flags = flagService.getFlags(template);
|
Map flags = flagService.getFlags(template);
|
||||||
|
// flag
|
||||||
|
// aiFlag 1代表AI给药 0代表医生给药
|
||||||
|
// reFlag 1代表维持期 0代表诱导期
|
||||||
|
// endFlag 1代表手术进行 0代表手术结束
|
||||||
|
// linkFlag 1泵异常 0正常
|
||||||
jsonObject.put("flags", flags);
|
jsonObject.put("flags", flags);
|
||||||
|
if (flags.get("aiFlag")!= null && flags.get("aiFlag").equals("1")){
|
||||||
|
// ai给药信息
|
||||||
|
List aiMedicineList = aiMedicineService.getAiMedicine(template);
|
||||||
|
jsonObject.put("medicineRate", aiMedicineList);
|
||||||
|
}else if (flags.get("aiFlag")!= null && flags.get("aiFlag").equals("0")){
|
||||||
|
// 医生给药信息
|
||||||
|
List docMedicineList = doctorMedicineService.getDocMedicine(template);
|
||||||
|
jsonObject.put("medicineRate", docMedicineList);
|
||||||
|
}
|
||||||
|
// 总的药量信息
|
||||||
|
List countMedicineList = aiMedicineService.getCountMedicine(template);
|
||||||
|
jsonObject.put("countMedicine", countMedicineList);
|
||||||
jsonObject.put("msgType", "msg");
|
jsonObject.put("msgType", "msg");
|
||||||
|
|
||||||
|
// 如果是人工给药展示人工给药的内容
|
||||||
WebSocketMessage message = new TextMessage(jsonObject.toJSONString().getBytes());
|
WebSocketMessage message = new TextMessage(jsonObject.toJSONString().getBytes());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
session.sendMessage(message);
|
session.sendMessage(message);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -261,7 +280,7 @@ public class VitalSignTimerWS {
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void setMachineSessionMap(WebSocketSession session) {
|
public synchronized void setMachineSessionMap(WebSocketSession session) {
|
||||||
// machineSessionMap.put(session.getId(), session);
|
machineSessionMap.put(session.getId(), session);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeMachineSessionMap(WebSocketSession session) {
|
public void removeMachineSessionMap(WebSocketSession session) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: prod
|
||||||
application:
|
application:
|
||||||
name: ${project.artifactId}
|
name: ${project.artifactId}
|
||||||
# 定时任务属性配置
|
# 定时任务属性配置
|
||||||
|
|
Loading…
Reference in New Issue
Block a user