begin: PHI Column Encryption
This commit is contained in:
@@ -21,6 +21,9 @@ public class PatientConfiguration : IEntityTypeConfiguration<Patient>
|
||||
builder.Property(p => p.Allergies).HasColumnName("allergies");
|
||||
builder.Property(p => p.EmergencyContactName).HasColumnName("emergency_contact_name").HasMaxLength(200);
|
||||
builder.Property(p => p.EmergencyContactPhone).HasColumnName("emergency_contact_phone").HasMaxLength(20);
|
||||
builder.Property(p => p.NameSearchToken)
|
||||
.HasColumnName("name_search_token")
|
||||
.HasMaxLength(64);
|
||||
builder.Property(p => p.CreatedAt).HasColumnName("created_at").HasDefaultValueSql("NOW()");
|
||||
|
||||
// MRN uses exact-match unique index — MRN lookups are always equality checks,
|
||||
@@ -29,5 +32,6 @@ public class PatientConfiguration : IEntityTypeConfiguration<Patient>
|
||||
// equality match — so no index here; full ILIKE is intentionally unindexed
|
||||
// at this scale (pg_trgm GIN would be warranted at >500k patients).
|
||||
builder.HasIndex(p => p.Mrn).IsUnique();
|
||||
builder.HasIndex(p => p.NameSearchToken);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user