From 8a562938efd4e527b3e250da42d2c01220bc0b62 Mon Sep 17 00:00:00 2001 From: H Vs Date: Thu, 22 Aug 2024 10:23:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E6=95=B0=E6=9E=81=E5=80=BC=EF=BC=8C?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=80=BC=E4=B8=8D=E8=83=BD=E5=B0=91=E4=BA=8E?= =?UTF-8?q?60=EF=BC=8C=E6=9C=80=E5=A4=A7=E5=80=BC=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=B0=91=E4=BA=8E100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Biz/db/TDengineService.cs | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/HealthMonitor.Service/Biz/db/TDengineService.cs b/HealthMonitor.Service/Biz/db/TDengineService.cs index 84db3c6..81cb78e 100644 --- a/HealthMonitor.Service/Biz/db/TDengineService.cs +++ b/HealthMonitor.Service/Biz/db/TDengineService.cs @@ -1151,6 +1151,23 @@ namespace HealthMonitor.Service.Biz.db float statMaxValueFprCoefficient = 0f; float statMinValueFprCoefficient = 0f; float StatModeAvgFprCoefficient = 0f; + + // 如果最大值与最小值在60~100范围内,都按个固定值下发高频阈值。 + var maxValue = closestToModeData.Max(); + var minValue = closestToModeData.Min(); + + //if ((maxValue >= 60 && maxValue <= 100) && (minValue >= 60 && minValue <= 100)) + //{ + // minValue = 60; + // maxValue = 100; + //} + // 最小值不能少于60 + minValue = minValue < 60 ? 60 : minValue; + + // 最大值不能少于100 + maxValue= maxValue < 100 ? 100 : maxValue; + + // 20-45周之间 if (pregnancyWeek >= 12 && pregnancyWeek <= 45) { @@ -1164,20 +1181,15 @@ namespace HealthMonitor.Service.Biz.db if (map != null) { - statMaxValueFprCoefficient = (float)Math.Round((decimal)map.FetalHeartRateRange![1] / closestToModeData.Max(), 3); - statMinValueFprCoefficient = (float)Math.Round((decimal)map.FetalHeartRateRange[0] / closestToModeData.Min(), 3); + //statMaxValueFprCoefficient = (float)Math.Round((decimal)map.FetalHeartRateRange![1] / closestToModeData.Max(), 3); + //statMinValueFprCoefficient = (float)Math.Round((decimal)map.FetalHeartRateRange[0] / closestToModeData.Min(), 3); + + statMaxValueFprCoefficient = (float)Math.Round((decimal)map.FetalHeartRateRange![1] / maxValue, 3); + statMinValueFprCoefficient = (float)Math.Round((decimal)map.FetalHeartRateRange[0] / minValue, 3); StatModeAvgFprCoefficient = (float)Math.Round((decimal)map.FetalHeartRateAverage / mode, 3); } } - // 如果最大值与最小值在60~100范围内,都按个固定值下发高频阈值。 - var maxValue = closestToModeData.Max(); - var minValue = closestToModeData.Min(); - - if ((maxValue >= 60 && maxValue <= 100) && (minValue >= 60 && minValue <= 100)) - { - minValue = 60; - maxValue = 100; - } + return new PregnancyCommonHeartRateModel() {