Fix: FHIR bundle processing has no rollback on partial failure

This commit is contained in:
voltsrage
2026-06-21 17:01:16 +08:00
parent 3eb937ef98
commit a91d79f3cd
3 changed files with 22 additions and 13 deletions
@@ -113,9 +113,14 @@ public class OrderService : IOrderService
order.ResultedAt = DateTimeOffset.UtcNow;
order.ResultSummary = req.ResultSummary;
await using var tx = _db.Database.CurrentTransaction is null
? await _db.Database.BeginTransactionAsync()
: null;
await _db.SaveChangesAsync();
var bundleService = _serviceProvider.GetRequiredService<ISepsisBundleService>();
await bundleService.OnOrderResultedAsync(order.Id);
if (tx is not null) await tx.CommitAsync();
return order;
}
}