Pārlūkot izejas kodu

调整

datasub12_fetal_heart_rate_0
H Vs pirms 3 mēnešiem
vecāks
revīzija
f86e3e0ada
1 mainītis faili ar 18 papildinājumiem un 0 dzēšanām
  1. +18
    -0
      HealthMonitor.WebApi/Worker.cs

+ 18
- 0
HealthMonitor.WebApi/Worker.cs Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt