Bladeren bron

调整

datasub12_fetal_heart_rate_0
H Vs 3 maanden geleden
bovenliggende
commit
f86e3e0ada
1 gewijzigde bestanden met toevoegingen van 18 en 0 verwijderingen
  1. +18
    -0
      HealthMonitor.WebApi/Worker.cs

+ 18
- 0
HealthMonitor.WebApi/Worker.cs Bestand weergeven

@@ -283,6 +283,9 @@ namespace HealthMonitor.WebApi
// 告警下限阀值
var lowerAlarmThreshold = (int)watchConfig["lowerAlarmThreshold"]!;

// 高频心率采样间隔 highFreqSampleInterval = highFreqSampleInterval+5,增加5秒兼容(最小highFreqSampleInterval=60)
var highFreqSampleInterval = (int)watchConfig!["highFreqSampleInterval"]! >= 60 ? (int)watchConfig!["highFreqSampleInterval"]! + 5 : 60;

var commonPHR = await _serviceTDengine.GetLastAsync<PregnancyCommonHeartRateModel>(imeiDel);

// 最后一条孕妇心率
@@ -329,6 +332,21 @@ namespace HealthMonitor.WebApi
_logger.LogInformation($"{imeiDel} 平常心率数据是批量上报,需要计算每条心率对应的胎心数据");

#region 计算每条心率对应的胎心数据
//去除高频
PregnancyHeartRateModel? previousItem = null;
phr = phr.OrderByDescending(i => i.LastUpdate).ToList();
foreach (var item in phr)
{
if (previousItem != null)
{
var timeNextDiff = (previousItem!.LastUpdate - item.LastUpdate).TotalSeconds;
if (timeNextDiff <= highFreqSampleInterval)
{
phr.Remove(item);
}
}
previousItem = item;
};
var calFhrTasks = phr.Where(p => p.LastUpdate >= triggerHeartRate!.LastUpdate)
.Select( async p =>
{


Laden…
Annuleren
Opslaan