fix issues with phase-32
This commit is contained in:
@@ -103,6 +103,17 @@ public class News2Detector
|
||||
var hasSingleParamThree = paramScores.Any(s => s == 3);
|
||||
var riskLevel = News2Calculator.DetermineRiskLevel(totalScore, hasSingleParamThree);
|
||||
|
||||
using (var scope = _services.CreateScope())
|
||||
{
|
||||
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
if (!await db.Encounters.AnyAsync(e => e.Id == encounterId, ct))
|
||||
{
|
||||
_logger.LogWarning(
|
||||
"Skipping NEWS2 score for unknown encounter {EncounterId}", encounterId);
|
||||
return News2Result.EncounterNotFound;
|
||||
}
|
||||
}
|
||||
|
||||
await PersistScoreAsync(
|
||||
encounterId, patientId, totalScore, riskLevel,
|
||||
paramScores, hasSingleParamThree, ct);
|
||||
|
||||
Reference in New Issue
Block a user