From 952f6fc63405bd3c0a576c98e4b4fb83a5f1e79f Mon Sep 17 00:00:00 2001 From: H Vs Date: Thu, 31 Oct 2024 10:04:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=AB=98=E9=A2=91=E6=97=B6?= =?UTF-8?q?=E9=95=BF=E4=B8=8D=E8=B6=B310=E5=88=86=E9=92=9F=EF=BC=8C?= =?UTF-8?q?=E9=83=BD=E4=B8=8D=E4=BA=A7=E7=94=9F=E5=91=8A=E8=AD=A6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resolver/PregnancyHeartRateResolver.cs | 25 ++++++++--------- HealthMonitor.WebApi/Worker.cs | 28 +++++++++---------- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs b/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs index e6af944..c5f7774 100644 --- a/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs +++ b/HealthMonitor.Service/Resolver/PregnancyHeartRateResolver.cs @@ -1268,6 +1268,7 @@ namespace HealthMonitor.Service.Resolver /// 3. 高频结束后的在highFreqSampleTimes>0 正常心率触发的高频心率处理(常态) /// 4. 高频结束后的时间倒序的正常心率触发的高频心率处理 /// 5. 高频结束后计算胎心数据,防止结束后与常规心理的胎心处理过长,定时器时长highFreqSampleInterval触发的高频心率处理 + /// 高频结束后超过9分钟且不在阈值内才告警 /// /// /// @@ -1316,7 +1317,7 @@ namespace HealthMonitor.Service.Resolver // fetalHeartRate = fetalHeartRate>= 220 ? 220 : fetalHeartRate; var phrFreqstatus = await _deviceCacheMgr.GetPregnancyHeartRateFreqStatusAsync(heartRate.Serialno); - + var isAbnormal = 0; #region 判断是否够highFreqSampleTimes,540s var ts = DateTimeUtil.GetTimeDifferenceInSeconds((DateTime)heartRate.LastUpdate!, phrFreqstatus!.LastUpdate); // 判断是否够highFreqSampleTimes,540s @@ -1327,19 +1328,21 @@ namespace HealthMonitor.Service.Resolver { if (fetalHeartRate > upperAlarmThreshold) { - _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,计算胎心值 {fetalHeartRate} 高于高频警告上限阀值{upperAlarmThreshold},最后胎心值{upperAlarmThreshold}"); + _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,计算胎心值 {fetalHeartRate} 高于高频警告上限阀值{upperAlarmThreshold},最后胎心值{upperAlarmThreshold},并且不告警"); fetalHeartRate = upperAlarmThreshold; + } else if (fetalHeartRate < lowerAlarmThreshold) { - _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,计算胎心值 {fetalHeartRate} 低于高频警告下限阀值 {lowerAlarmThreshold},最后胎心值{lowerAlarmThreshold}"); + _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,计算胎心值 {fetalHeartRate} 低于高频警告下限阀值 {lowerAlarmThreshold},最后胎心值{lowerAlarmThreshold},并且不告警"); fetalHeartRate = lowerAlarmThreshold; } else { - _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,在高频警告下限阀值 {lowerAlarmThreshold} 和 高频警告上限阀值:{upperAlarmThreshold}之间,最后胎心值{fetalHeartRate}"); + _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,在高频警告下限阀值 {lowerAlarmThreshold} 和 高频警告上限阀值:{upperAlarmThreshold}之间,最后胎心值{fetalHeartRate},并且不告警"); } + } // 超过highFreqSampleTimes,540s else @@ -1356,20 +1359,16 @@ namespace HealthMonitor.Service.Resolver 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")}"); } - + isAbnormal = fetalHeartRate > upperAlarmThreshold ? 1 : (fetalHeartRate < lowerAlarmThreshold ? 2 : 0); } #endregion - var isAbnormal = fetalHeartRate > upperAlarmThreshold ? 1 : (fetalHeartRate < lowerAlarmThreshold ? 2 : 0); - if (phrFreqstatus == null) isAbnormal = 0; - var statsusDesc = (phrFreqstatus == null) ? "常规" : "高频"; + + //if (phrFreqstatus == null) isAbnormal = 0; + //var statsusDesc = (phrFreqstatus == null) ? "常规" : "高频"; + var statsusDesc = "高频"; _logger.LogInformation($"{heartRate.Serialno} 在 {statsusDesc} 状态,生成胎心值:{fetalHeartRate},统计周期:{statStartTime.ToString("yyyy-MM-dd HH:mm:ss")}----{statEndTime.ToString("yyyy-MM-dd HH:mm:ss")}"); - //if (!isFreq) - //{ - // statStartTime = heartRate.LastUpdate; - // - //} // 保存到 数据服务 MySQL 数据库 HisGpsFetalHeartRate gpsFetalHeartRate = new() { diff --git a/HealthMonitor.WebApi/Worker.cs b/HealthMonitor.WebApi/Worker.cs index e56aee6..eb34af7 100644 --- a/HealthMonitor.WebApi/Worker.cs +++ b/HealthMonitor.WebApi/Worker.cs @@ -2095,7 +2095,8 @@ namespace HealthMonitor.WebApi /// 2. 高频结束后的highFreqSampleTimes=0的高频心率处理 /// 3. 高频结束后的在highFreqSampleTimes>0 正常心率触发的高频心率处理(常态) /// 4. 高频结束后的时间倒序的正常心率触发的高频心率处理 - /// * 5. 高频结束后计算胎心数据,防止结束后与常规心理的胎心处理过长,定时器时长highFreqSampleInterval触发的高频心率处理 + /// 5. 高频结束后计算胎心数据,防止结束后与常规心理的胎心处理过长,定时器时长highFreqSampleInterval触发的高频心率处理 + /// 高频结束后超过9分钟且不在阈值内才告警 /// /// /// @@ -2144,7 +2145,7 @@ namespace HealthMonitor.WebApi // fetalHeartRate = fetalHeartRate>= 220 ? 220 : fetalHeartRate; var phrFreqstatus = await _deviceCacheMgr.GetPregnancyHeartRateFreqStatusAsync(heartRate.Serialno); - + var isAbnormal = 0; #region 判断是否够highFreqSampleTimes,540s var ts = DateTimeUtil.GetTimeDifferenceInSeconds((DateTime)heartRate.LastUpdate!, phrFreqstatus!.LastUpdate); // 判断是否够highFreqSampleTimes,540s @@ -2155,19 +2156,21 @@ namespace HealthMonitor.WebApi { if (fetalHeartRate > upperAlarmThreshold) { - _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,计算胎心值 {fetalHeartRate} 高于高频警告上限阀值{upperAlarmThreshold},最后胎心值{upperAlarmThreshold}"); + _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,计算胎心值 {fetalHeartRate} 高于高频警告上限阀值{upperAlarmThreshold},最后胎心值{upperAlarmThreshold},并且不告警"); fetalHeartRate = upperAlarmThreshold; + } else if (fetalHeartRate < lowerAlarmThreshold) { - _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,计算胎心值 {fetalHeartRate} 低于高频警告下限阀值 {lowerAlarmThreshold},最后胎心值{lowerAlarmThreshold}"); + _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,计算胎心值 {fetalHeartRate} 低于高频警告下限阀值 {lowerAlarmThreshold},最后胎心值{lowerAlarmThreshold},并且不告警"); fetalHeartRate = lowerAlarmThreshold; } else { - _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,在高频警告下限阀值 {lowerAlarmThreshold} 和 高频警告上限阀值:{upperAlarmThreshold}之间,最后胎心值{fetalHeartRate}"); + _logger.LogWarning($"{heartRate.Serialno} 高频持续不足10分钟,在高频警告下限阀值 {lowerAlarmThreshold} 和 高频警告上限阀值:{upperAlarmThreshold}之间,最后胎心值{fetalHeartRate},并且不告警"); } + } // 超过highFreqSampleTimes,540s else @@ -2184,20 +2187,16 @@ namespace HealthMonitor.WebApi 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")}"); } - + isAbnormal = fetalHeartRate > upperAlarmThreshold ? 1 : (fetalHeartRate < lowerAlarmThreshold ? 2 : 0); } #endregion - var isAbnormal = fetalHeartRate > upperAlarmThreshold ? 1 : (fetalHeartRate < lowerAlarmThreshold ? 2 : 0); - if (phrFreqstatus == null) isAbnormal = 0; - var statsusDesc = (phrFreqstatus == null) ? "常规" : "高频"; + + //if (phrFreqstatus == null) isAbnormal = 0; + //var statsusDesc = (phrFreqstatus == null) ? "常规" : "高频"; + var statsusDesc = "高频"; _logger.LogInformation($"{heartRate.Serialno} 在 {statsusDesc} 状态,生成胎心值:{fetalHeartRate},统计周期:{statStartTime.ToString("yyyy-MM-dd HH:mm:ss")}----{statEndTime.ToString("yyyy-MM-dd HH:mm:ss")}"); - //if (!isFreq) - //{ - // statStartTime = heartRate.LastUpdate; - // - //} // 保存到 数据服务 MySQL 数据库 HisGpsFetalHeartRate gpsFetalHeartRate = new() { @@ -2322,7 +2321,6 @@ namespace HealthMonitor.WebApi } - /// /// 去除高频数据 ///