feature: PHI Column Encryption + Access Logging

This commit is contained in:
voltsrage
2026-06-22 23:43:48 +08:00
parent 46db694820
commit 1824e4eef1
15 changed files with 1832 additions and 11 deletions
@@ -8,17 +8,20 @@ public class PhiAccessLogService : IPhiAccessLogService
private readonly ICurrentUserService _currentUser;
private readonly IHttpContextAccessor _http;
private readonly PhiEncryptionOptions _options;
private readonly ClinicalMetrics _metrics;
public PhiAccessLogService(
AppDbContext db,
ICurrentUserService currentUser,
IHttpContextAccessor http,
IOptions<PhiEncryptionOptions> options)
IOptions<PhiEncryptionOptions> options,
ClinicalMetrics metrics)
{
_db = db;
_currentUser = currentUser;
_http = http;
_options = options.Value;
_metrics = metrics;
}
public async Task LogViewAsync(Guid patientId, string resourcePath) =>
@@ -68,6 +71,8 @@ public class PhiAccessLogService : IPhiAccessLogService
});
await _db.SaveChangesAsync();
_metrics.PhiAccessLogsTotal.WithLabels(accessType.ToDbString()).Inc();
}
private static string HashQuery(string query)