|
|
@@ -114,6 +114,18 @@ namespace HealthMonitor.Service.Resolver |
|
|
|
|
|
|
|
if (isFetalHeartEnable) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
var edoc = DateTimeUtil.ToDateTime(watchConfig!["EDOC"]!.ToString()); |
|
|
|
int pregnancyWeek = (DateTime.Now - edoc.AddDays(-280)).Days / 7; |
|
|
|
|
|
|
|
// 12-45周之间 |
|
|
|
if (pregnancyWeek < 12 && pregnancyWeek > 45) |
|
|
|
{ |
|
|
|
_logger.LogWarning($"{heartRate.Serialno} 孕周{pregnancyWeek},不在计算范围 12-45 周内,胎心胎动都不计算"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//_logger.LogInformation($"{heartRate.Serialno} 计算胎心胎动启动"); |
|
|
|
#region 定时下发触发器(定时建模) |
|
|
|
var key = $"health_monitor/schedule_push/pregnancy_heart_rate/imei/{heartRate.Serialno}"; |
|
|
@@ -171,10 +183,6 @@ namespace HealthMonitor.Service.Resolver |
|
|
|
var upperAlarmThreshold = (int)watchConfig["upperAlarmThreshold"]!; |
|
|
|
// 告警下限阀值 |
|
|
|
var lowerAlarmThreshold = (int)watchConfig["lowerAlarmThreshold"]!; |
|
|
|
// EDOC |
|
|
|
var edoc = DateTimeUtil.ToDateTime(watchConfig!["EDOC"]!.ToString()); |
|
|
|
// interval (分钟) 固定15分钟 |
|
|
|
var intervalFHR = 15;//int)watchConfig["interval"]!; |
|
|
|
|
|
|
|
var daysPhr = await _serviceTDengine.GetBySerialNoAsync<PregnancyHeartRateModel>(heartRate.Serialno, 7); |
|
|
|
var phr = daysPhr |
|
|
@@ -778,6 +786,10 @@ namespace HealthMonitor.Service.Resolver |
|
|
|
_logger.LogInformation($"{heartRate.Serialno} 记录不足30条,建模中"); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
@@ -1123,6 +1135,8 @@ namespace HealthMonitor.Service.Resolver |
|
|
|
_logger.LogInformation($"{heartRate.Serialno} 高频选择心率值:{selectedHrValue}"); |
|
|
|
|
|
|
|
var fetalHeartRate = await _serviceTDengine.GetFetalHeartRateAsync(heartRate.Serialno, selectedHrValue); |
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"{heartRate.Serialno} 高频状态计算,由高频心率 {selectedHrValue} 根据胎心算法转换的胎心值 {fetalHeartRate}"); |
|
|
|
#endregion |
|
|
|
|
|
|
|