|
@ -102,6 +102,7 @@ public class AsyncService extends BaseService{
|
|
|
|
|
|
int type = data.getType();
|
|
|
String msgContent = "";
|
|
|
String msgContentTemp = "";
|
|
|
//血糖校验
|
|
|
if (type == 1) {
|
|
|
// 血糖记录,查询患者血糖预警值
|
|
@ -130,7 +131,7 @@ public class AsyncService extends BaseService{
|
|
|
// 餐后
|
|
|
if (index % 2 == 0) {
|
|
|
if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter )) {
|
|
|
// msgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L),请处理";
|
|
|
msgContentTemp += patient.getName() + "血糖异常(" + value1 + "mmol/L),请处理";
|
|
|
if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==1){
|
|
|
msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏高</span>";
|
|
|
}else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==2){
|
|
@ -143,7 +144,7 @@ public class AsyncService extends BaseService{
|
|
|
}
|
|
|
} else { //餐前
|
|
|
if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueBefore, minValueBefore)) {
|
|
|
// msgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L),请处理";
|
|
|
msgContentTemp += patient.getName() + "血糖异常(" + value1 + "mmol/L),请处理";
|
|
|
if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==1){
|
|
|
msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏高</span>";
|
|
|
}else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==2){
|
|
@ -182,7 +183,7 @@ public class AsyncService extends BaseService{
|
|
|
}
|
|
|
// 收缩压/舒张压校验
|
|
|
if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY) || !checkHealthIndex(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY)) {
|
|
|
// msgContent = patient.getName() + "血压异常(舒张压 " + value2 + "mmHg、收缩压 " + value1 + "mmHg),请处理";
|
|
|
msgContentTemp = patient.getName() + "血压异常(舒张压 " + value2 + "mmHg、收缩压 " + value1 + "mmHg),请处理";
|
|
|
if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY)==1||checkHealthIndexDetail(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY)==1){
|
|
|
msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血压偏高</span>";
|
|
|
}else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY)==2||checkHealthIndexDetail(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY)==2){
|
|
@ -197,7 +198,7 @@ public class AsyncService extends BaseService{
|
|
|
|
|
|
//超标则发送消息
|
|
|
if (msgContent != null && msgContent.length() > 0) {
|
|
|
sendMessage(msgContent, patient, data);
|
|
|
sendMessage(msgContent, patient, data,msgContentTemp);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
@ -230,7 +231,7 @@ public class AsyncService extends BaseService{
|
|
|
/**
|
|
|
* 推送信息
|
|
|
*/
|
|
|
private void sendMessage(String content, Patient patient, PatientHealthIndex model) {
|
|
|
private void sendMessage(String content, Patient patient, PatientHealthIndex model,String contentTemp) {
|
|
|
logger.info("======start sendMessage======");
|
|
|
String patientCode = patient.getCode();
|
|
|
String patientName = patient.getName();
|
|
@ -241,25 +242,16 @@ public class AsyncService extends BaseService{
|
|
|
logger.info("签约对象--全科医生code===="+signFamily.getDoctor());
|
|
|
String healthDoctorFamily = "";
|
|
|
String doctorFamily = "";
|
|
|
String doctorName = "";
|
|
|
String doctorOpenID = "";
|
|
|
if (signFamily != null) {
|
|
|
healthDoctorFamily = signFamily.getDoctorHealth();
|
|
|
doctorFamily = signFamily.getDoctor();
|
|
|
logger.info("全科医生code======"+doctorFamily);
|
|
|
if (StringUtils.isNotEmpty(healthDoctorFamily)) {
|
|
|
// 添加到消息接收人列表
|
|
|
receivers.add(healthDoctorFamily);
|
|
|
Doctor doctor = doctorDao.findByCode(healthDoctorFamily);
|
|
|
doctorName = doctor.getName();
|
|
|
doctorOpenID = doctor.getOpenid();
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(doctorFamily)){
|
|
|
// 添加到消息接收人列表
|
|
|
receivers.add(doctorFamily);
|
|
|
Doctor doctor = doctorDao.findByCode(signFamily.getDoctor());
|
|
|
doctorName = doctor.getName();
|
|
|
doctorOpenID = doctor.getOpenid();
|
|
|
}
|
|
|
}
|
|
|
// 查询病人三师签约中的健康管理师
|
|
@ -312,7 +304,7 @@ public class AsyncService extends BaseService{
|
|
|
json.put("receiver", receiver);
|
|
|
json.put("type", MessageType.MESSAGE_TYPE_DOCTOR_HEALTH_INDEX.D_HI_01.name());
|
|
|
json.put("title", MessageType.MESSAGE_TYPE_DOCTOR_HEALTH_INDEX.体征指标.name());
|
|
|
json.put("msg", content);
|
|
|
json.put("msg", contentTemp);
|
|
|
json.put("data", "");
|
|
|
array.add(json);
|
|
|
}
|
|
@ -326,15 +318,17 @@ public class AsyncService extends BaseService{
|
|
|
}
|
|
|
if(messageService.getMessageNoticeSettingByMessageType(receiver,"1", MessageNoticeSetting.MessageTypeEnum.healthSignSwitch.getValue())){
|
|
|
// 新增发送医生助手模板消息 v1.4.0 by wujunjie
|
|
|
if (StringUtils.isNotEmpty(doctorOpenID)) {
|
|
|
Doctor doctor = doctorDao.findByCode(receiver);
|
|
|
if (doctor!=null && StringUtils.isNotEmpty(doctor.getOpenid())) {
|
|
|
List<Message> messagesList = messageDao.findUnreadHealthIndex(patientCode, receiver);
|
|
|
if (messagesList != null && messagesList.size()>0){
|
|
|
logger.info("发送医生助手------start");
|
|
|
String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
params.add(new BasicNameValuePair("type", "3"));
|
|
|
params.add(new BasicNameValuePair("openId", doctorOpenID));
|
|
|
params.add(new BasicNameValuePair("openId", doctor.getOpenid()));
|
|
|
params.add(new BasicNameValuePair("url", targetUrl));
|
|
|
params.add(new BasicNameValuePair("first", doctorName + "医生,您的签约居民" + patientName +
|
|
|
params.add(new BasicNameValuePair("first", doctor.getName() + "医生,您的签约居民" + patientName +
|
|
|
"有" + messagesList.size() + "条未读的体征异常消息"));
|
|
|
params.add(new BasicNameValuePair("remark", "请进入手机APP查看"));
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
|
|
@ -342,7 +336,8 @@ public class AsyncService extends BaseService{
|
|
|
String keywords = date + "," + patientName;
|
|
|
params.add(new BasicNameValuePair("keywords", keywords));
|
|
|
|
|
|
httpClientUtil.post(url, params, "UTF-8");
|
|
|
String result = httpClientUtil.post(url, params, "UTF-8");
|
|
|
logger.info("医生助手推送结果========"+result);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -378,7 +373,7 @@ public class AsyncService extends BaseService{
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 预警
|
|
|
* 预警.
|
|
|
* @param patientCode
|
|
|
* @param patient
|
|
|
*/
|