|
@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.test.context.jdbc.Sql;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.text.SimpleDateFormat;
|
|
@ -155,7 +156,7 @@ public class DeviceUploadService {
|
|
|
try{
|
|
|
String patientsql = "select group_concat(label) disease from wlyy_sign_patient_label_info where label_type = 3 and status=1 " +
|
|
|
"and (label = 1 or label = 2) and patient = '"+patientCode+"' GROUP BY patient";
|
|
|
|
|
|
System.out.println("patientsql==>"+ patientsql);
|
|
|
String patientdisease = jdbcTemplate.queryForObject(patientsql,String.class);
|
|
|
|
|
|
//连续5次体征值正常,则修改为非预警状态;连续5次异常,修改为预警状态-----START
|
|
@ -166,13 +167,14 @@ public class DeviceUploadService {
|
|
|
|
|
|
List<DevicePatientHealthIndex> bloodPressurepatientHealthIndices = patientHealthIndexDao.findByPatientAndTypeByPage(patientCode,2);
|
|
|
List<DevicePatientHealthIndex> bloodSuggurpatientHealthIndices = patientHealthIndexDao.findByPatientAndTypeByPage(patientCode,1);
|
|
|
|
|
|
System.out.println("bloodPressurepatientHealthIndices.size()==>"+bloodPressurepatientHealthIndices.size());
|
|
|
System.out.println("bloodSuggurpatientHealthIndices.size()==>"+bloodSuggurpatientHealthIndices.size());
|
|
|
if(!bloodPressurepatientHealthIndices.isEmpty()){
|
|
|
stdbloodPressureBbnormalCount = bloodPressurepatientHealthIndices.size();
|
|
|
stdbloodPressureBbnormalCount = bloodPressurepatientHealthIndices.size();//血压次数
|
|
|
}
|
|
|
|
|
|
if(!bloodSuggurpatientHealthIndices.isEmpty()){
|
|
|
stdbloodSuggurBbnormalCount = bloodSuggurpatientHealthIndices.size();
|
|
|
stdbloodSuggurBbnormalCount = bloodSuggurpatientHealthIndices.size();//血糖次数
|
|
|
}
|
|
|
|
|
|
for (DevicePatientHealthIndex index1 : bloodPressurepatientHealthIndices) {
|
|
@ -186,8 +188,12 @@ public class DeviceUploadService {
|
|
|
bloodSuggurBbnormalCount++;
|
|
|
}
|
|
|
}
|
|
|
System.out.println("血压异常次数-bloodPressureBbnormalCount数量==>"+bloodPressureBbnormalCount);
|
|
|
System.out.println("血糖异常次数-stdbloodSuggurBbnormalCount数量==>"+stdbloodSuggurBbnormalCount);
|
|
|
|
|
|
//连续3次异常,修改用户为预警状态
|
|
|
if( (bloodPressureBbnormalCount >=3 || bloodSuggurBbnormalCount >=3)){
|
|
|
System.out.println("连续3次异常,修改用户为预警状态");
|
|
|
patient.setStandardStatus(1);
|
|
|
// setTrackPatientByDoctor(patientCode);
|
|
|
}else{
|
|
@ -196,11 +202,15 @@ public class DeviceUploadService {
|
|
|
//计算血糖或者血压一周内的异常记录数量
|
|
|
int errorCount = patientHealthIndexDao.getCountByTimeAndStatus(start,end,1,patientCode);
|
|
|
if(errorCount >= 5){//超过5次,记为预警状态
|
|
|
System.out.println("计算血糖或者血压一周内的异常记录数量-->超过5次,记为预警状态");
|
|
|
patient.setStandardStatus(1);
|
|
|
// setTrackPatientByDoctor(patientCode);
|
|
|
}else {
|
|
|
System.out.println("计算血糖或者血压一周内的异常记录数量-->没有超过5次");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
System.out.println("patientdisease=>"+patientdisease+" stdbloodPressureBbnormalCount=>"+stdbloodPressureBbnormalCount+" bloodPressureBbnormalCount=>"+bloodPressureBbnormalCount);
|
|
|
//连续5次正常,修改用户为非预警状态
|
|
|
if(StringUtils.isNotBlank(patientdisease)){
|
|
|
if("1".equals(patientdisease)){
|