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
+13 -2
View File
@@ -9,6 +9,7 @@ using FluentValidation;
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Mvc;
using System.Reflection;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens;
using Microsoft.AspNetCore.Authorization;
@@ -46,7 +47,9 @@ try
ValidAudience = jwtOptions.Audience,
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtOptions.SigningKey))
};
});
})
.AddScheme<AuthenticationSchemeOptions, GatewayApiKeyAuthenticationHandler>(
GatewayApiKeyAuthenticationHandler.SchemeName, null);
builder.Services.AddSingleton<IAuthorizationPolicyProvider, PermissionPolicyProvider>();
builder.Services.AddSingleton<IAuthorizationHandler, PermissionAuthorizationHandler>();
@@ -126,6 +129,9 @@ try
.GetSection(DashboardOptions.Section)
.Get<DashboardOptions>() ?? new DashboardOptions();
builder.Services.Configure<ClinicalSyncOptions>(
builder.Configuration.GetSection(ClinicalSyncOptions.Section));
builder.Services.Configure<FhirOptions>(
builder.Configuration.GetSection(FhirOptions.Section));
@@ -140,6 +146,8 @@ try
builder.Services.Configure<PhiEncryptionOptions>(
builder.Configuration.GetSection(PhiEncryptionOptions.Section));
builder.Services.Configure<ClinicalSyncOptions>(builder.Configuration.GetSection(ClinicalSyncOptions.Section));
builder.Services.AddCors(options =>
{
options.AddPolicy("Dashboard", policy =>
@@ -191,12 +199,14 @@ try
builder.Services.AddScoped<ICurrentUserService, CurrentUserService>();
builder.Services.AddScoped<IAuthService, AuthService>();
builder.Services.AddScoped<IAuditService, AuditService>();
builder.Services.AddScoped<IClinicalSyncService, ClinicalSyncService>();
builder.Services.AddScoped<ClinicalSyncBatchProcessor>();
builder.Services.AddSingleton<IPhiEncryptionService, PhiEncryptionService>();
builder.Services.AddScoped<IPhiAccessLogService, PhiAccessLogService>();
builder.Services.AddHostedService<ThresholdCacheLoader>();
builder.Services.AddHostedService<KafkaTopicProvisioner>();
builder.Services.AddHostedService<OutboxRelayService>();
builder.Services.AddHostedService<ClinicalSyncBatchConsumer>();
builder.Services.AddHostedService<ElasticIndexProvisioner>();
builder.Services.AddHostedService<EsIndexerService>();
builder.Services.AddHostedService<SepsisEngineService>();
@@ -303,6 +313,7 @@ try
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
var redis = scope.ServiceProvider.GetRequiredService<IConnectionMultiplexer>();
await DataSeeder.SeedAsync(db, redis);
await GatewayRegistrySeeder.SeedAsync(db);
await UserSeeder.SeedAsync(db);
}