Add remain services and fixes

This commit is contained in:
voltsrage
2026-06-18 23:33:39 +08:00
parent 4b46c09f90
commit e2d40331b7
9 changed files with 291 additions and 40 deletions
@@ -87,8 +87,7 @@ public class QsofaDetectorTests : IAsyncLifetime
alert.PatientId.Should().Be(_patientId);
alert.Details.Should().Contain("qSOFA score 2/3");
var outbox = await db.OutboxEvents.SingleAsync();
outbox.Topic.Should().Be("alert.generated");
var outbox = await db.OutboxEvents.SingleAsync(e => e.Topic == "alert.generated");
outbox.PartitionKey.Should().Be(_encounterId.ToString());
}
@@ -141,7 +140,7 @@ public class QsofaDetectorTests : IAsyncLifetime
var alertCount = await db.ClinicalAlerts.CountAsync();
alertCount.Should().Be(1, "WHERE NOT EXISTS prevents duplicate QSOFA_WARNING while one is open");
var outboxCount = await db.OutboxEvents.CountAsync();
var outboxCount = await db.OutboxEvents.CountAsync(e => e.Topic == "alert.generated");
outboxCount.Should().Be(1, "outbox event must be written exactly once");
}