fix issues with phase-32
This commit is contained in:
@@ -60,6 +60,17 @@ public class GcsDetector
|
||||
var classification = GcsCalculator.ClassifyGcs(total);
|
||||
var calculatedAt = DateTimeOffset.UtcNow;
|
||||
|
||||
using (var checkScope = _services.CreateScope())
|
||||
{
|
||||
var db = checkScope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
if (!await db.Encounters.AnyAsync(e => e.Id == encounterId, ct))
|
||||
{
|
||||
_logger.LogWarning(
|
||||
"Skipping GCS score for unknown encounter {EncounterId}", encounterId);
|
||||
return GcsResult.EncounterNotFound;
|
||||
}
|
||||
}
|
||||
|
||||
await PersistScoreAsync(
|
||||
encounterId, patientId, (int)eye, (int)verbal, (int)motor,
|
||||
total, classification, calculatedAt, ct);
|
||||
|
||||
Reference in New Issue
Block a user