|
|
@@ -156,8 +156,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor |
|
|
|
// 没有血压数据时增量值为0 |
|
|
|
int systolicInc; |
|
|
|
int diastolicInc; |
|
|
|
int systolicAvg; |
|
|
|
int diastolicAvg; |
|
|
|
decimal systolicAvg; |
|
|
|
decimal diastolicAvg; |
|
|
|
|
|
|
|
// 最后一次下发值 |
|
|
|
int lastPushSystolicInc = 0; |
|
|
@@ -195,8 +195,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor |
|
|
|
//systolicAvg = (int)(hmBpParser?.AverageAfterRemovingOneMinMaxRef(i => i.SystolicValue, SafeType.SafeInt(systolicRefValue!)))!; |
|
|
|
//diastolicAvg = (int)(hmBpParser?.AverageAfterRemovingOneMinMaxRef(i => i.DiastolicValue, SafeType.SafeInt(diastolicRefValue!)))!; |
|
|
|
var avgs = _serviceTDengine.AverageAfterRemovingOneMinMaxRef(SafeType.SafeInt(systolicRefValue!), hmBpParser!); |
|
|
|
systolicAvg = (int)avgs[0]; |
|
|
|
diastolicAvg = (int)avgs[1]; |
|
|
|
systolicAvg = avgs[0]; |
|
|
|
diastolicAvg = avgs[1]; |
|
|
|
// 平均值为0,说明数据不足,不能计算增量值 |
|
|
|
// 数据不足等同进行初始化,只下发标定值,增量值为0;remarks恢复到未校准状态,需要基于第一个测量值生成增量值。 |
|
|
|
if (systolicAvg.Equals(0)) |
|
|
@@ -229,8 +229,8 @@ namespace HealthMonitor.WebApi.Controllers.HealthMonitor |
|
|
|
systolicInc = currentSystolicInc + lastPushSystolicInc; |
|
|
|
diastolicInc = currentDiastolicInc + lastPushDiastolicInc; |
|
|
|
_logger.LogInformation($"{imei}--{nameof(Put)}--计算增量值" + |
|
|
|
$"\n systolicInc:{systolicInc}-- currentSystolicInc:{currentSystolicInc} -- lastPushSystolicInc:{lastPushSystolicInc}" + |
|
|
|
$"\n diastolicInc:{diastolicInc} --currentDiastolicInc:{currentDiastolicInc} -- lastPushDiastolicInc:{lastPushDiastolicInc}"); |
|
|
|
$"\n {imei}-- systolicAvg:{systolicAvg}--systolicInc:{systolicInc}-- currentSystolicInc:{currentSystolicInc} -- lastPushSystolicInc:{lastPushSystolicInc}" + |
|
|
|
$"\n {imei}-- diastolicAvg:{diastolicAvg}--diastolicInc:{diastolicInc} --currentDiastolicInc:{currentDiastolicInc} -- lastPushDiastolicInc:{lastPushDiastolicInc}"); |
|
|
|
_logger.LogInformation($"{imei},手工校准,发给设备的绝对增量值=(上次绝对增量值+新数据的增量值)"); |
|
|
|
return await IotSetBloodPressCalibrationConfigResponseAsync(imei, systolicRefValue, diastolicRefValue, systolicInc, diastolicInc, systolicAvg, diastolicAvg, systolicAvgOffset, diastolicAvgOffset, startTime, endTime).ConfigureAwait(false); |
|
|
|
} |
|
|
|