diff --git a/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs b/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs index c345d88..c60be5e 100644 --- a/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs +++ b/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs @@ -658,7 +658,21 @@ namespace HealthMonitor.Service.Resolver var fetalHeartRate = SafeType.SafeInt(phrValue * coefficient); // 胎心的最大值调整为220,超过都按该值220输出 - fetalHeartRate = fetalHeartRate>= 220 ? 220 : fetalHeartRate; + // fetalHeartRate = fetalHeartRate>= 220 ? 220 : fetalHeartRate; + + if (fetalHeartRate > 220) + { + fetalHeartRate = 220; + _logger.LogWarning($"{heartRate.Serialno} 大于220,按220输出,计算因子:孕妇心率 {heartRate.HeartRate},系数 {coefficient},周期 周期:{statStartTime.ToString("yyyy-MM-dd HH:mm:ss")}----{statEndTime.ToString("yyyy-MM-dd HH:mm:ss")}"); + } + + // 胎心的最小值调整为90,超过都按该值90 + if (fetalHeartRate < 90) + { + fetalHeartRate = 90; + _logger.LogWarning($"{heartRate.Serialno} 小于90,按90输出,计算因子:孕妇心率 {heartRate.HeartRate},系数 {coefficient},周期 周期:{statStartTime.ToString("yyyy-MM-dd HH:mm:ss")}----{statEndTime.ToString("yyyy-MM-dd HH:mm:ss")}"); + } + var isAbnormal = fetalHeartRate > upperAlarmThreshold ? 1 : (fetalHeartRate < lowerAlarmThreshold ? 2 : 0); var phrFreqstatus = await _deviceCacheMgr.GetPregnancyHeartRateFreqStatusAsync(heartRate.Serialno);