Clinical Sync Batch Engine: first commit

This commit is contained in:
voltsrage
2026-06-23 03:02:30 +08:00
parent 90b8baa2a1
commit c9994b1ba2
60 changed files with 3547 additions and 31 deletions
@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
public static class GatewayRegistrySeeder
{
public static readonly Guid DemoSiteId =
Guid.Parse("11111111-1111-1111-1111-111111111111");
public static readonly Guid DemoGatewayId =
Guid.Parse("22222222-2222-2222-2222-222222222222");
public static async Task SeedAsync(AppDbContext db)
{
if (await db.ClinicalSites.AnyAsync()) return;
var site = new ClinicalSite("SITE-DEMO", "Demo General Hospital", "123 Main St");
db.Entry(site).Property(nameof(ClinicalSite.Id)).CurrentValue = DemoSiteId;
db.ClinicalSites.Add(site);
var gateway = new WardGateway(DemoSiteId, "GW-ICU-3B", "ICU");
db.Entry(gateway).Property(nameof(WardGateway.Id)).CurrentValue = DemoGatewayId;
db.WardGateways.Add(gateway);
await db.SaveChangesAsync();
}
}