|
|
@@ -1003,6 +1003,10 @@ namespace HealthMonitor.WebApi |
|
|
|
// 获取当前时间 |
|
|
|
DateTime nowInterval = (DateTime)heartRate.LastUpdate!; |
|
|
|
|
|
|
|
if (nowInterval.Second > 0) |
|
|
|
{ |
|
|
|
nowInterval = nowInterval.AddMinutes(1); |
|
|
|
} |
|
|
|
// 计算last_update到上一间隔的分钟数 |
|
|
|
int minutesToSubtract = nowInterval.Minute % intervalFHR; |
|
|
|
|
|
|
@@ -1031,14 +1035,14 @@ namespace HealthMonitor.WebApi |
|
|
|
|
|
|
|
var normalPhrStatEndTime = nextInterval; |
|
|
|
|
|
|
|
_logger.LogInformation($"{heartRate.Serialno} 计算胎心数据, 周期:{normalPhrStatStartTime}-{normalPhrStatEndTime} "); |
|
|
|
_logger.LogInformation($" {heartRate.MessageId} -- {heartRate.Serialno} 计算胎心数据, 周期:{normalPhrStatStartTime}-{normalPhrStatEndTime} "); |
|
|
|
var filteredPhr = daysPhr |
|
|
|
// 使用 last_update 下一刻 |
|
|
|
.Where(i => i.LastUpdate <= normalPhrStatEndTime && i.LastUpdate >= normalPhrStatStartTime) |
|
|
|
.ToList(); |
|
|
|
if (filteredPhr.Count == 0) |
|
|
|
{ |
|
|
|
_logger.LogWarning($"{heartRate.Serialno} 周期:{normalPhrStatStartTime}-{normalPhrStatEndTime} 孕妇心率数据不足,{filteredPhr.Count}条记录"); |
|
|
|
_logger.LogWarning($"{heartRate.MessageId} -- {heartRate.Serialno} 周期:{normalPhrStatStartTime}-{normalPhrStatEndTime} 孕妇心率数据不足,{filteredPhr.Count}条记录"); |
|
|
|
return; |
|
|
|
} |
|
|
|
var phrValue = filteredPhr.Count == 1 |
|
|
|