Files
voltsrage 24f45851e9
CI / frontend (push) Canceled after 0s
CI / backend (push) Canceled after 8m32s
feature: In-App Simulation Runner (Backend)
2026-08-06 01:52:53 +08:00

26 lines
961 B
C#

using VigilCare.Simulation;
public class ApiPoller : IApiPoller
{
private readonly VigilCareApiClient _client;
private readonly HashSet<Guid> _seenAlertIds = new();
public ApiPoller(VigilCareApiClient client) => _client = client;
public async Task PollAndDisplayAsync(Guid encounterId, string simTime)
{
var news2 = await _client.GetCurrentNews2Async(encounterId);
var gcs = await _client.GetCurrentGcsAsync(encounterId);
var sofa = await _client.GetCurrentSofaAsync(encounterId);
var qsofa = await _client.GetCurrentQsofaAsync(encounterId);
var allAlerts = await _client.GetAlertsAsync(encounterId);
var newAlerts = allAlerts.Where(a => _seenAlertIds.Add(a.Id)).ToList();
var bundle = await _client.GetSepsisBundleAsync(encounterId);
var result = new PollResult(news2, gcs, sofa, qsofa, newAlerts, bundle);
SimulatorConsole.PollResults(simTime, result);
}
}