fix issues with phase-32

This commit is contained in:
voltsrage
2026-06-23 00:16:39 +08:00
parent 1824e4eef1
commit 90b8baa2a1
12 changed files with 237 additions and 14 deletions
+11
View File
@@ -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);