Browse Source

调整常规孕妇心率统计时间点

datasub12_fetal_heart_rate_0
H Vs 3 months ago
parent
commit
a6f02e8fd4
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      HealthMonitor.WebApi/Worker.cs

+ 6
- 2
HealthMonitor.WebApi/Worker.cs View File

@@ -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


Loading…
Cancel
Save