feature: In-App Simulation Runner (Backend)
This commit is contained in:
@@ -25,6 +25,7 @@ public class PatientConfiguration : IEntityTypeConfiguration<Patient>
|
||||
.HasColumnName("name_search_token")
|
||||
.HasMaxLength(64);
|
||||
builder.Property(p => p.CreatedAt).HasColumnName("created_at").HasDefaultValueSql("NOW()");
|
||||
builder.Property(p => p.IsSimulated).HasColumnName("is_simulated").HasDefaultValue(false);
|
||||
|
||||
// MRN uses exact-match unique index — MRN lookups are always equality checks,
|
||||
// never LIKE/ILIKE. A B-tree unique index satisfies O(log n) point lookup.
|
||||
@@ -33,5 +34,9 @@ public class PatientConfiguration : IEntityTypeConfiguration<Patient>
|
||||
// at this scale (pg_trgm GIN would be warranted at >500k patients).
|
||||
builder.HasIndex(p => p.Mrn).IsUnique();
|
||||
builder.HasIndex(p => p.NameSearchToken);
|
||||
// Filtered index keeps Phase 38 simulated-patient purge cheap.
|
||||
builder.HasIndex(p => p.IsSimulated)
|
||||
.HasDatabaseName("IX_Patients_IsSimulated")
|
||||
.HasFilter("is_simulated = true");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user