|
|
@@ -201,8 +201,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor |
|
|
|
|
|
|
|
|
|
|
|
// 增量值=(标定值-平均值)* 0.25 |
|
|
|
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!; |
|
|
|
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!; |
|
|
|
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)Math.Round((systolicRefValue - systolicAvg) * systolicAvgOffset)!; |
|
|
|
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)Math.Round((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!; |
|
|
|
_logger.LogInformation(" A.2 没有下推记录,有测量记录,正常计算增量值 ,增量值将正常下发"); |
|
|
|
return await IotSetBloodPressCalibrationConfigResponseAsync(imei, systolicRefValue, diastolicRefValue, systolicInc, diastolicInc).ConfigureAwait(false); |
|
|
|
} |
|
|
@@ -254,8 +254,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor |
|
|
|
//var systolicAvgOffset = avgOffset; |
|
|
|
//var diastolicAvgOffset = avgOffset; |
|
|
|
// 增量值=(标定值-平均值)* 0.25 |
|
|
|
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!; |
|
|
|
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!; |
|
|
|
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)Math.Round((systolicRefValue - systolicAvg) * systolicAvgOffset)!; |
|
|
|
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)Math.Round((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!; |
|
|
|
_logger.LogInformation("B.1.2 设备已经被重新设置, 从重置的ts 到 now 有测量数据 ,增量值将正常下发"); |
|
|
|
return await IotSetBloodPressCalibrationConfigResponseAsync(imei, systolicRefValue, diastolicRefValue, systolicInc, diastolicInc).ConfigureAwait(false); |
|
|
|
} |
|
|
@@ -288,8 +288,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor |
|
|
|
//systolicInc = systolicAvg.Equals(0M) ? 0 : (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!; |
|
|
|
//diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!; |
|
|
|
|
|
|
|
systolicInc = (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!; |
|
|
|
diastolicInc = (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!; |
|
|
|
systolicInc = (int)Math.Round((systolicRefValue - systolicAvg) * systolicAvgOffset)!; |
|
|
|
diastolicInc = (int)Math.Round((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!; |
|
|
|
|
|
|
|
// B.2.1 数据异常,将按最后一次测量值的offeset下发 |
|
|
|
if (systolicAvg.Equals(0) || diastolicAvg.Equals(0)) |
|
|
@@ -318,8 +318,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor |
|
|
|
{ |
|
|
|
|
|
|
|
// 增量值=(标定值-平均值)* 0.25 |
|
|
|
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)((systolicRefValue - systolicAvg) * systolicAvgOffset)!; |
|
|
|
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!; |
|
|
|
systolicInc = systolicAvg.Equals(0M) ? 0 : (int)Math.Round((systolicRefValue - systolicAvg) * systolicAvgOffset)!; |
|
|
|
diastolicInc = diastolicAvg.Equals(0M) ? 0 : (int)Math.Round((diastolicRefValue - diastolicAvg) * diastolicAvgOffset)!; |
|
|
|
_logger.LogInformation("B.2.2 曾经下推过断言有测量记录,数据正常,按正常计算 ,增量值将正常下发"); |
|
|
|
return await IotSetBloodPressCalibrationConfigResponseAsync(imei, systolicRefValue, diastolicRefValue, systolicInc, diastolicInc).ConfigureAwait(false); |
|
|
|
} |
|
|
|