From 04b8fcb2b9037705b4e449e83f0e6b4fda5ba3b9 Mon Sep 17 00:00:00 2001 From: H Vs Date: Tue, 22 Oct 2024 17:49:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=83=8E=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=E9=95=BF=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HealthMonitor.WebApi/Worker.cs | 43 ++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/HealthMonitor.WebApi/Worker.cs b/HealthMonitor.WebApi/Worker.cs index fd94186..cbe6b14 100644 --- a/HealthMonitor.WebApi/Worker.cs +++ b/HealthMonitor.WebApi/Worker.cs @@ -2761,9 +2761,15 @@ namespace HealthMonitor.WebApi .OrderBy(i => i.LastUpdate).ToList(); - if (filterPhr.Count < 2) + //if (filterPhr.Count < 2) + //{ + // _logger.LogWarning($"{heartRate.Serialno} 胎动统计数据少于2条,不统计,{string.Join('-', filterPhr.Select(i=>i.LastUpdate))}"); + // return; + //} + + if (filterPhr.Count < 1) { - _logger.LogWarning($"{heartRate.Serialno} 胎动统计数据少于2条,不统计,{string.Join('-', filterPhr.Select(i=>i.LastUpdate))}"); + _logger.LogWarning($"{heartRate.Serialno} 胎动统计数据少于1条,不统计,{string.Join('-', filterPhr.Select(i => i.LastUpdate))}"); return; } @@ -2823,7 +2829,7 @@ namespace HealthMonitor.WebApi var phrRange = segmentPhr.OrderByDescending(i => i.LastUpdate) .Select(i => i.LastUpdate) .ToList(); - if (phrRange.Count >= 2) + if (phrRange.Count >= 1) { // 读取胎心数据 GeneralParam param = new() @@ -2888,21 +2894,24 @@ namespace HealthMonitor.WebApi ; // var fetalMovementTimeVar = (fetalMovementMapValue * duringMins * 2) / 120; - var fetalMovementTimeVar = (fetalMovementMapValue * duringMins) / 60; + #region 取消使用时间长度比例 + //var fetalMovementTimeVar = (fetalMovementMapValue * duringMins) / 60; - if (duringMins < 59) - { - // 取12小时胎动总数最小值 - fetalMovementMapValue = fetalMovementMap - .Where(i => i.PregnancyPeriod![0] <= pregnancyWeeks && i.PregnancyPeriod[1] >= pregnancyWeeks) - .First() - .TwelveHourMovementRange[0]; - //取12小时胎动总数最小值的平均值 - fetalMovementTimeVar = fetalMovementMapValue / 12; - - _logger.LogWarning($"{heartRate.Serialno} 佩戴不足1小时,12小时胎动总数最小值{fetalMovementMapValue},平均值{fetalMovementTimeVar}"); - } + //if (duringMins < 59) + //{ + // // 取12小时胎动总数最小值 + // fetalMovementMapValue = fetalMovementMap + // .Where(i => i.PregnancyPeriod![0] <= pregnancyWeeks && i.PregnancyPeriod[1] >= pregnancyWeeks) + // .First() + // .TwelveHourMovementRange[0]; + // //取12小时胎动总数最小值的平均值 + // fetalMovementTimeVar = fetalMovementMapValue / 12; + + // _logger.LogWarning($"{heartRate.Serialno} 佩戴不足1小时,12小时胎动总数最小值{fetalMovementMapValue},平均值{fetalMovementTimeVar}"); + //} + #endregion + var fetalMovementTimeVar = (double)fetalMovementMapValue; #region 生理健康与胎动的关系 /// (步数)运动步数超过1500步则加1; @@ -3161,7 +3170,7 @@ namespace HealthMonitor.WebApi } else { - _logger.LogInformation($"{heartRate.Serialno} 胎动记录{isFetalMovementExisted},数据采样时间:{fetalMovementSampleTime}|{statStartTime.ToString("yyyy-MM-dd HH:mm:ss")}, 周期:{statStartTime}-{statEndTime} 不足两条,不能判断是否持续佩戴"); + _logger.LogInformation($"{heartRate.Serialno} 胎动记录{isFetalMovementExisted},数据采样时间:{fetalMovementSampleTime}|{statStartTime.ToString("yyyy-MM-dd HH:mm:ss")}, 周期:{statStartTime}-{statEndTime} 不足1条,不能判断是否持续佩戴"); } }