Browse Source

调整

datasub12_fetal_heart_rate
H Vs 5 months ago
parent
commit
3ec188c78e
1 changed files with 53 additions and 22 deletions
  1. +53
    -22
      HealthMonitor.WebApi/Worker.cs

+ 53
- 22
HealthMonitor.WebApi/Worker.cs View File

@@ -541,54 +541,78 @@ namespace HealthMonitor.WebApi
if (true) if (true)
{ {
var step = await _personCacheMgr.GetStepPeriodicityAsync(imeiDel); var step = await _personCacheMgr.GetStepPeriodicityAsync(imeiDel);
if (DateTime.Now.Hour - ((DateTime)step?.LastUpdate!).Hour <= 2)
if (step != null)
{ {
if (step.Steps > 1500) fetalMovementStepVar = 1;
if (DateTime.Now.Hour - ((DateTime)step?.LastUpdate!).Hour <= 2)
{
if (step.Steps > 1500) fetalMovementStepVar = 1;
}
else
{
_logger.LogWarning($"{imeiDel} 周期步数 时间无效");
}
} }
else else
{ {
_logger.LogWarning($"{imeiDel} 周期步数 时间无效");
_logger.LogWarning($"{imeiDel} 周期步数无数据");
} }

} }


// 体温 // 体温
if (true) if (true)
{ {
var temp = await _personCacheMgr.GetTemperaturePeriodicityAsync(imeiDel); var temp = await _personCacheMgr.GetTemperaturePeriodicityAsync(imeiDel);
if (DateTime.Now.Hour - ((DateTime)temp?.LastUpdate!).Hour <= 2)
if (temp != null)
{ {
// 中烧
if (temp.Temperature>=37.3M&& temp.Temperature<= 38.5M)
if (DateTime.Now.Hour - ((DateTime)temp?.LastUpdate!).Hour <= 2)
{ {
fetalMovementTempVar = -1;
// 中烧
if (temp.Temperature >= 37.3M && temp.Temperature <= 38.5M)
{
fetalMovementTempVar = -1;
}
// 高烧
if (temp.Temperature >= 38.6M)
{
fetalMovementTempVar = -2;
}
} }
// 高烧
if (temp.Temperature >= 38.6M)
else
{ {
fetalMovementTempVar = -2;
_logger.LogWarning($"{imeiDel} 周期体温 时间无效");
} }
} }
else else
{ {
_logger.LogWarning($"{imeiDel} 周期体温 时间无效");
_logger.LogWarning($"{imeiDel} 周期体温无数据");
} }
} }


// 血压 // 血压
if (true) if (true)
{ {
var bp = await _personCacheMgr.GetBloodPressPeriodicityAsync(imeiDel); var bp = await _personCacheMgr.GetBloodPressPeriodicityAsync(imeiDel);
if (DateTime.Now.Hour - ((DateTime)bp?.LastUpdate!).Hour <= 2)
if (bp != null)
{ {
if (bp.SystolicValue>160)
if (DateTime.Now.Hour - ((DateTime)bp?.LastUpdate!).Hour <= 2)
{
if (bp.SystolicValue > 160)
{
fetalMovementBpVar = 1;
}
}
else
{ {
fetalMovementBpVar = 1;
_logger.LogWarning($"{imeiDel} 周期血压 时间无效");
} }
} }
else else
{ {
_logger.LogWarning($"{imeiDel} 周期血压 时间无效");
_logger.LogWarning($"{imeiDel} 周期血压无数据");
} }
} }
// 心理 // 心理
if (true) if (true)
@@ -626,16 +650,23 @@ namespace HealthMonitor.WebApi
} }
}; };
var psych = await _hisPsychResultApiClient.GetFirstAsync(psychResultParam, imeiDel[^2..], null, new RequestHeader { RequestId = Guid.NewGuid().ToString("D") }); var psych = await _hisPsychResultApiClient.GetFirstAsync(psychResultParam, imeiDel[^2..], null, new RequestHeader { RequestId = Guid.NewGuid().ToString("D") });

if (psych?.StressScore == 2)
if (psych != null)
{ {
fetalMovementPpVar = 1;
}
if (psych?.StressScore == 2)
{
fetalMovementPpVar = 1;
}


if (psych?.StressScore == 3)
if (psych?.StressScore == 3)
{
fetalMovementPpVar = 2;
}
}
else
{ {
fetalMovementPpVar = 2;
_logger.LogWarning($"{imeiDel} 周期心理压力无数据");
} }
} }


#endregion #endregion
@@ -1089,7 +1120,7 @@ namespace HealthMonitor.WebApi
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogInformation($"{nameof(WatchEvents)},出错: |{ex.Message}|{ex.StackTrace}");
_logger.LogError($"{nameof(WatchEvents)},出错: |{ex.Message}|{ex.StackTrace}");
} }






Loading…
Cancel
Save