fix:
No SOFA trend chart or organ-system timeline No GCS trend chart or component history No qSOFA history view
This commit is contained in:
@@ -283,7 +283,7 @@ public class GapAnalysisFixTests : IAsyncLifetime
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
[Fact]
|
||||
public async Task QsofaHistory_ReturnsAlertRecords()
|
||||
public async Task QsofaHistory_ReturnsEvaluationRecords()
|
||||
{
|
||||
using var scope = _fixture.Services.CreateScope();
|
||||
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
@@ -304,20 +304,28 @@ public class GapAnalysisFixTests : IAsyncLifetime
|
||||
db.Patients.Add(patient);
|
||||
db.Encounters.Add(encounter);
|
||||
|
||||
db.ClinicalAlerts.Add(new ClinicalAlert
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
db.QsofaEvaluations.Add(new QsofaEvaluation
|
||||
{
|
||||
Id = Guid.NewGuid(), EncounterId = encounter.Id, PatientId = patient.Id,
|
||||
AlertType = AlertType.QsofaScreen, Severity = AlertSeverity.Warning,
|
||||
Details = "qSOFA >= 2", Status = AlertStatus.Open,
|
||||
TriggeredAt = DateTimeOffset.UtcNow.AddMinutes(-30)
|
||||
Id = Guid.NewGuid(),
|
||||
EncounterId = encounter.Id,
|
||||
PatientId = patient.Id,
|
||||
ActiveCriteria = 1,
|
||||
RespRate = 24m,
|
||||
EvaluatedAt = now.AddMinutes(-30),
|
||||
CreatedAt = now,
|
||||
});
|
||||
db.ClinicalAlerts.Add(new ClinicalAlert
|
||||
db.QsofaEvaluations.Add(new QsofaEvaluation
|
||||
{
|
||||
Id = Guid.NewGuid(), EncounterId = encounter.Id, PatientId = patient.Id,
|
||||
AlertType = AlertType.QsofaScreen, Severity = AlertSeverity.Warning,
|
||||
Details = "qSOFA >= 2", Status = AlertStatus.Resolved,
|
||||
TriggeredAt = DateTimeOffset.UtcNow.AddMinutes(-10),
|
||||
ResolvedAt = DateTimeOffset.UtcNow
|
||||
Id = Guid.NewGuid(),
|
||||
EncounterId = encounter.Id,
|
||||
PatientId = patient.Id,
|
||||
ActiveCriteria = 2,
|
||||
RespRate = 24m,
|
||||
SystolicBp = 95m,
|
||||
ScreenAlertFired = true,
|
||||
EvaluatedAt = now.AddMinutes(-10),
|
||||
CreatedAt = now,
|
||||
});
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
@@ -325,7 +333,12 @@ public class GapAnalysisFixTests : IAsyncLifetime
|
||||
$"/api/v1/encounters/{encounter.Id}/qsofa/history?limit=10");
|
||||
|
||||
var data = resp.GetProperty("data");
|
||||
data.GetProperty("items").GetArrayLength().Should().Be(2);
|
||||
var items = data.GetProperty("items");
|
||||
items.GetArrayLength().Should().Be(2);
|
||||
|
||||
var latest = items[0];
|
||||
latest.GetProperty("activeCriteria").GetInt32().Should().Be(2);
|
||||
latest.GetProperty("screenAlertFired").GetBoolean().Should().BeTrue();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user