|
|
@@ -152,8 +152,8 @@ namespace HealthMonitor.Service.Resolver |
|
|
|
#endregion |
|
|
|
//_logger.LogInformation($"{heartRate.Serialno} 触发定时建模"); |
|
|
|
|
|
|
|
// 高频心率采样间隔 highFreqSampleInterval = highFreqSampleInterval+5,增加5秒兼容(最小highFreqSampleInterval=60) |
|
|
|
var highFreqSampleInterval = (int)watchConfig!["highFreqSampleInterval"]! >= 60 ? (int)watchConfig!["highFreqSampleInterval"]! + 5 : 60; |
|
|
|
// 高频心率采样间隔 highFreqSampleInterval = highFreqSampleInterval 最小highFreqSampleInterval=60) |
|
|
|
var highFreqSampleInterval = (int)watchConfig!["highFreqSampleInterval"]! >= 60 ? (int)watchConfig!["highFreqSampleInterval"]!:60; |
|
|
|
// 触发高频监测的心率上限值 |
|
|
|
var triggerHighFreqHigh = (int)watchConfig["triggerHighFreqHigh"]!; |
|
|
|
// 触发高频监测的心率下限值 |
|
|
@@ -179,8 +179,8 @@ namespace HealthMonitor.Service.Resolver |
|
|
|
var phr = daysPhr |
|
|
|
.Where(p => p.LastUpdate <= heartRate.LastUpdate) |
|
|
|
.ToList(); |
|
|
|
|
|
|
|
if (phr.Count >= 30) |
|
|
|
var nonFreqPhr = GetNonFreqPregnancyHeartRate(phr, highFreqSampleInterval); |
|
|
|
if (nonFreqPhr.Count >= 30) |
|
|
|
{ |
|
|
|
#region 定时计算胎动数据触发器两小时间隔开始 |
|
|
|
var fetalMovementKey = $"health_monitor/schedule_push/cal_fetal_movement/imei/{heartRate.Serialno}"; |
|
|
@@ -791,5 +791,39 @@ namespace HealthMonitor.Service.Resolver |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 去除高频数据 |
|
|
|
/// </summary> |
|
|
|
/// <param name="phr"></param> |
|
|
|
/// <returns></returns> |
|
|
|
private static List<PregnancyHeartRateModel> GetNonFreqPregnancyHeartRate(List<PregnancyHeartRateModel> phr,int highFreqSampleInterval) |
|
|
|
{ |
|
|
|
phr = phr.OrderByDescending(i => i.LastUpdate).ToList(); |
|
|
|
var result = new List<PregnancyHeartRateModel>(); |
|
|
|
PregnancyHeartRateModel? previousItem = null; |
|
|
|
|
|
|
|
foreach (var item in phr) |
|
|
|
{ |
|
|
|
if (previousItem != null) |
|
|
|
{ |
|
|
|
var timeNextDiff =(previousItem!.LastUpdate - item.LastUpdate).TotalSeconds; |
|
|
|
if (timeNextDiff > highFreqSampleInterval) |
|
|
|
{ |
|
|
|
result.Add(previousItem); |
|
|
|
} |
|
|
|
} |
|
|
|
previousItem = item; |
|
|
|
} |
|
|
|
|
|
|
|
// 添加上一个 |
|
|
|
if (previousItem != null) |
|
|
|
{ |
|
|
|
result.Add(previousItem); |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |