Commit f92d1460 by huangjy

feat: 睡眠分析报告过滤呼吸心率是0和255

parent 90de48d8
......@@ -164,6 +164,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
DeviceInfoContentBreathe.Properties breatheProperties;
Integer bodymove;
int reportSize = deviceInfoContentBreathes.size();
// 记录总呼吸率和总心率
int maxBr = 0;
int minBr = 0;
......@@ -182,6 +183,7 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
boolean isMoveBed = true;
boolean awakeMinuteActionFlag = true; // 清醒每分钟体动是否满足要求
int noPersonCount = 0; // 无人跳过计数
int sleepDeepMinuteCount = 0; // 深睡每分钟体动和翻身次数
int sleepModerateAMinuteCount = 0; // 中度睡每分钟体动和翻身次数
for (DeviceInfoContentBreathe infoContentBreathe : deviceInfoContentBreathes) {
......@@ -191,6 +193,21 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
int br = breatheProperties.getBr();
int hr = breatheProperties.getHr();
Integer hasPerson = breatheProperties.getPerson(); // 0无人,1有人
if (breatheProperties.getPerson() == 0) {
noPersonCount++;
continue;
}
// 0和255直接跳过
if (breatheProperties.getHr() == 255 || breatheProperties.getHr() == 0 ) {
noPersonCount++;
continue;
}
if (breatheProperties.getBr() == 255 || breatheProperties.getBr() == 0) {
noPersonCount++;
continue;
}
if (bodymove > actionThreshold) {
bodymoveCount++;
}
......@@ -234,12 +251,15 @@ public class PlatElderSleepServiceImpl extends ServiceImpl<PlatElderSleepMapper,
hrBrCount++;
}
}
if (reportSize == noPersonCount) {
continue;
}
analysisVO.setTotalBr(totalBr);
analysisVO.setAvgBr(totalBr / 60);
analysisVO.setAvgBr(totalBr / reportSize);
analysisVO.setTotalHr(totalHr);
analysisVO.setAvgHr(totalHr / 60);
analysisVO.setAvgHr(totalHr / reportSize);
analysisVO.setMaxBr(maxBr);
analysisVO.setMinBr(minBr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment