feature: RBAC + Clinical Audit Logging

This commit is contained in:
voltsrage
2026-06-21 15:46:55 +08:00
parent a43db52813
commit 5af6ab490e
83 changed files with 4281 additions and 70 deletions
@@ -90,7 +90,8 @@ public static class ScenarioReplayHelper
public static async Task<SofaScore> WaitForSofaScoreAsync(
IServiceProvider services,
Guid encounterId,
TimeSpan timeout)
TimeSpan timeout,
Func<SofaScore, bool>? predicate = null)
{
var deadline = DateTime.UtcNow + timeout;
while (DateTime.UtcNow < deadline)
@@ -101,7 +102,7 @@ public static class ScenarioReplayHelper
.Where(s => s.EncounterId == encounterId)
.OrderByDescending(s => s.CalculatedAt)
.FirstOrDefaultAsync();
if (sofa is not null)
if (sofa is not null && (predicate is null || predicate(sofa)))
return sofa;
await Task.Delay(500);
}