feature: Site & Gateway Registry + Clinical Sync Contracts
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user