ソースを参照

调整胎心的最大值调整为220,超过都按该值220输出

datasub12_fetal_heart_rate
H Vs 3ヶ月前
コミット
1e8269c722
1個のファイルの変更38行の追加2行の削除
  1. +38
    -2
      HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs

+ 38
- 2
HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs ファイルの表示

@@ -236,7 +236,6 @@ namespace HealthMonitor.Service.Resolver
// 高频心率启动(在高频第二条才能判断)
if (timeDiffInSeconds <= highFreqSampleInterval)
{

var phrFreqstatus = await _deviceCacheMgr.GetPregnancyHeartRateFreqStatusAsync(heartRate.Serialno);
if (phrFreqstatus == null)
{
@@ -250,6 +249,7 @@ namespace HealthMonitor.Service.Resolver
await _deviceCacheMgr.SetPregnancyHeartRateFreqStatusAsync(heartRate.Serialno, freqFirstPhr);
_logger.LogInformation($"{heartRate.Serialno} 设置高频状态");
phrFreqstatus = await _deviceCacheMgr.GetPregnancyHeartRateFreqStatusAsync(heartRate.Serialno);
// 通过续租 延时计算高频心率的胎心
}

/// phr PregnancyHeartRate 连续连续正常次数个值都是正常(大于等于triggerHighFreqLow,少于等于triggerHighFreqHig),
@@ -642,7 +642,8 @@ namespace HealthMonitor.Service.Resolver
#endregion

var fetalHeartRate = SafeType.SafeInt(phrValue * coefficient);

// 胎心的最大值调整为220,超过都按该值220输出
fetalHeartRate = fetalHeartRate>= 220 ? 220 : fetalHeartRate;

var isAbnormal = fetalHeartRate > upperAlarmThreshold ? 1 : (fetalHeartRate < lowerAlarmThreshold ? 2 : 0);
var phrFreqstatus = await _deviceCacheMgr.GetPregnancyHeartRateFreqStatusAsync(heartRate.Serialno);
@@ -795,6 +796,7 @@ namespace HealthMonitor.Service.Resolver
/// 去除高频数据
/// </summary>
/// <param name="phr"></param>
/// <param name="highFreqSampleInterva"></param>
/// <returns></returns>
private static List<PregnancyHeartRateModel> GetNonFreqPregnancyHeartRate(List<PregnancyHeartRateModel> phr,int highFreqSampleInterval)
{
@@ -825,5 +827,39 @@ namespace HealthMonitor.Service.Resolver
}


/// <summary>
/// 获取高频数据
/// </summary>
/// <param name="phr"></param>
/// <param name="highFreqSampleInterval"></param>
/// <returns></returns>
private static List<PregnancyHeartRateModel> GetFreqPregnancyHeartRate(List<PregnancyHeartRateModel> phr, int highFreqSampleInterval)
{
phr = phr.OrderByDescending(i => i.LastUpdate).ToList();
var freqCollection = new List<PregnancyHeartRateModel>();
PregnancyHeartRateModel? previousItem = null;

foreach (var item in phr)
{
if (previousItem != null)
{
var timeNextDiff = (previousItem.LastUpdate - item.LastUpdate).TotalSeconds;
if (timeNextDiff <= highFreqSampleInterval)
{
freqCollection.Add(previousItem);
}
}
previousItem = item;
}

// 检查最后一条是否高频
if (previousItem != null && (phr.Last().LastUpdate - previousItem.LastUpdate).TotalSeconds <= highFreqSampleInterval)
{
freqCollection.Add(previousItem);
}

return freqCollection;
}

}
}

読み込み中…
キャンセル
保存