feature: Clinical Data Model Expansion & Observation Vocabulary

This commit is contained in:
voltsrage
2026-06-18 15:00:42 +08:00
parent 3b4c5c524b
commit 7d630fbbd9
33 changed files with 2636 additions and 36 deletions
@@ -7,7 +7,8 @@ using Minio.DataModel.Args;
using Parquet;
using StackExchange.Redis;
public class DataLakePhase9Tests : IClassFixture<ApiFixture>
[Collection("Integration")]
public class DataLakePhase9Tests
{
private readonly ApiFixture _fixture;
private readonly HttpClient _http;
@@ -208,7 +209,6 @@ public class DataLakePhase9Tests : IClassFixture<ApiFixture>
await EnsureThresholdAsync(db, "HEART_RATE", "Heart Rate", "bpm", 30, 50, 100, 150);
await EnsureThresholdAsync(db, "POTASSIUM_MEQ_L", "Serum Potassium", "mEq/L", 2.5m, 3.5m, 5.0m, 6.5m);
await EnsureThresholdAsync(db, "TEMP_C", "Temperature", "°C", 34m, 36m, 37.8m, 40m);
await db.SaveChangesAsync();
var redis = scope.ServiceProvider.GetRequiredService<IConnectionMultiplexer>();
var cache = redis.GetDatabase(1);
@@ -245,5 +245,15 @@ public class DataLakePhase9Tests : IClassFixture<ApiFixture>
CriticalHigh = criticalHigh,
CreatedAt = DateTimeOffset.UtcNow
});
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateException ex) when (
ex.InnerException is Npgsql.PostgresException { SqlState: "23505" })
{
// Another test inserted the same observation code concurrently.
}
}
}