feature: Site & Gateway Registry + Clinical Sync Contracts

This commit is contained in:
voltsrage
2026-06-23 04:31:15 +08:00
parent c9994b1ba2
commit efe5419da4
24 changed files with 547 additions and 19 deletions
@@ -40,10 +40,18 @@ public class ClinicalRefactorEndToEndTests : IAsyncLifetime
await ScenarioReplayHelper.WaitForAlertTypeAsync(
_fixture.Services, encounterId, AlertType.SofaSepsis, TimeSpan.FromSeconds(30));
using var scope = _fixture.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
var bundle = await db.SepsisBundles.SingleAsync(b => b.EncounterId == encounterId);
bundle.TriggeringAlertType.Should().Be("SOFA_SEPSIS");
SepsisBundle? bundle = null;
var deadline = DateTime.UtcNow + TimeSpan.FromSeconds(10);
while (DateTime.UtcNow < deadline)
{
using var scope = _fixture.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
bundle = await db.SepsisBundles.FirstOrDefaultAsync(b => b.EncounterId == encounterId);
if (bundle is not null) break;
await Task.Delay(500);
}
bundle.Should().NotBeNull("expected sepsis bundle for encounter after SOFA_SEPSIS alert");
bundle!.TriggeringAlertType.Should().Be("SOFA_SEPSIS");
}
[Fact]