feature: RBAC + Clinical Audit Logging
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
public enum AuditAction
|
||||
{
|
||||
ThresholdCreated,
|
||||
ThresholdUpdated,
|
||||
AlertAcknowledged,
|
||||
AlertResolved,
|
||||
EncounterStatusChanged,
|
||||
PatientRegistered,
|
||||
SuppressionWindowSet,
|
||||
UserLogin
|
||||
}
|
||||
|
||||
public static class AuditActionExtensions
|
||||
{
|
||||
public static string ToDbString(this AuditAction a) => a switch
|
||||
{
|
||||
AuditAction.ThresholdCreated => "THRESHOLD_CREATED",
|
||||
AuditAction.ThresholdUpdated => "THRESHOLD_UPDATED",
|
||||
AuditAction.AlertAcknowledged => "ALERT_ACKNOWLEDGED",
|
||||
AuditAction.AlertResolved => "ALERT_RESOLVED",
|
||||
AuditAction.EncounterStatusChanged => "ENCOUNTER_STATUS_CHANGED",
|
||||
AuditAction.PatientRegistered => "PATIENT_REGISTERED",
|
||||
AuditAction.SuppressionWindowSet => "SUPPRESSION_WINDOW_SET",
|
||||
AuditAction.UserLogin => "USER_LOGIN",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(a))
|
||||
};
|
||||
|
||||
public static AuditAction FromDbString(string v) => v switch
|
||||
{
|
||||
"THRESHOLD_CREATED" => AuditAction.ThresholdCreated,
|
||||
"THRESHOLD_UPDATED" => AuditAction.ThresholdUpdated,
|
||||
"ALERT_ACKNOWLEDGED" => AuditAction.AlertAcknowledged,
|
||||
"ALERT_RESOLVED" => AuditAction.AlertResolved,
|
||||
"ENCOUNTER_STATUS_CHANGED" => AuditAction.EncounterStatusChanged,
|
||||
"PATIENT_REGISTERED" => AuditAction.PatientRegistered,
|
||||
"SUPPRESSION_WINDOW_SET" => AuditAction.SuppressionWindowSet,
|
||||
"USER_LOGIN" => AuditAction.UserLogin,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(v))
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user