fix errors of Degraded Operations Visibility

This commit is contained in:
voltsrage
2026-06-24 00:46:27 +08:00
parent 4399996448
commit 2e80700bf0
7 changed files with 177 additions and 40 deletions
@@ -32,13 +32,14 @@ public class ClinicalRefactorEndToEndTests : IAsyncLifetime
public async Task SofaProgressionScenario_EndToEnd()
{
var scenario = ScenarioReplayHelper.Load("sepsis-sofa-progression-01.json");
var (_, encounterId) = await ScenarioReplayHelper.ReplayObservationsAsync(_client, scenario);
var (_, encounterId) = await ScenarioReplayHelper.ReplayObservationsAsync(
_client, scenario, _fixture.Services);
await ScenarioReplayHelper.WaitForAlertTypeAsync(
_fixture.Services, encounterId, AlertType.QsofaScreen, TimeSpan.FromSeconds(30));
_fixture.Services, encounterId, AlertType.QsofaScreen, TimeSpan.FromSeconds(60));
await ScenarioReplayHelper.WaitForAlertTypeAsync(
_fixture.Services, encounterId, AlertType.SofaSepsis, TimeSpan.FromSeconds(30));
_fixture.Services, encounterId, AlertType.SofaSepsis, TimeSpan.FromSeconds(60));
SepsisBundle? bundle = null;
var deadline = DateTime.UtcNow + TimeSpan.FromSeconds(10);
@@ -58,13 +59,14 @@ public class ClinicalRefactorEndToEndTests : IAsyncLifetime
public async Task GcsDeclineScenario_EndToEnd()
{
var scenario = ScenarioReplayHelper.Load("neurological-decline-gcs-01.json");
var (_, encounterId) = await ScenarioReplayHelper.ReplayObservationsAsync(_client, scenario);
var (_, encounterId) = await ScenarioReplayHelper.ReplayObservationsAsync(
_client, scenario, _fixture.Services);
await ScenarioReplayHelper.WaitForAlertTypeAsync(
_fixture.Services, encounterId, AlertType.GcsWarning, TimeSpan.FromSeconds(30));
_fixture.Services, encounterId, AlertType.GcsWarning, TimeSpan.FromSeconds(60));
await ScenarioReplayHelper.WaitForAlertTypeAsync(
_fixture.Services, encounterId, AlertType.GcsCritical, TimeSpan.FromSeconds(30));
_fixture.Services, encounterId, AlertType.GcsCritical, TimeSpan.FromSeconds(60));
await ScenarioReplayHelper.AssertNoAlertTypeAsync(
_fixture.Services, encounterId, AlertType.SofaSepsis, TimeSpan.FromSeconds(5));
@@ -77,11 +79,12 @@ public class ClinicalRefactorEndToEndTests : IAsyncLifetime
public async Task PartialSofaScenario_StalenessFlags()
{
var scenario = ScenarioReplayHelper.Load("sofa-partial-spo2-fallback-01.json");
var (_, encounterId) = await ScenarioReplayHelper.ReplayObservationsAsync(_client, scenario);
var (_, encounterId) = await ScenarioReplayHelper.ReplayObservationsAsync(
_client, scenario, _fixture.Services);
var jsonOpts = new JsonSerializerOptions { PropertyNameCaseInsensitive = true };
var sofa = await ScenarioReplayHelper.WaitForSofaScoreAsync(
_fixture.Services, encounterId, TimeSpan.FromSeconds(45),
_fixture.Services, encounterId, TimeSpan.FromSeconds(60),
s =>
{
if (string.IsNullOrEmpty(s.StalenessFlags)) return false;
@@ -113,10 +116,11 @@ public class ClinicalRefactorEndToEndTests : IAsyncLifetime
public async Task UtiSepsisScenario_NowUsesSofa()
{
var scenario = ScenarioReplayHelper.Load("uti-sepsis-elderly-01.json");
var (_, encounterId) = await ScenarioReplayHelper.ReplayObservationsAsync(_client, scenario);
var (_, encounterId) = await ScenarioReplayHelper.ReplayObservationsAsync(
_client, scenario, _fixture.Services);
await ScenarioReplayHelper.WaitForAlertTypeAsync(
_fixture.Services, encounterId, AlertType.SofaSepsis, TimeSpan.FromSeconds(45));
_fixture.Services, encounterId, AlertType.SofaSepsis, TimeSpan.FromSeconds(60));
await ScenarioReplayHelper.AssertNoAlertTypeAsync(
_fixture.Services, encounterId, AlertTypeExtensions.FromDbString("SEPSIS_WARNING"), TimeSpan.FromSeconds(5));