public enum EncounterStatus { Scheduled, Active, Discharged, Cancelled }

public static class EncounterStatusExtensions
{
    public static string ToDbString(this EncounterStatus s) => s switch
    {
        EncounterStatus.Scheduled  => "SCHEDULED",
        EncounterStatus.Active     => "ACTIVE",
        EncounterStatus.Discharged => "DISCHARGED",
        EncounterStatus.Cancelled  => "CANCELLED",
        _ => throw new ArgumentOutOfRangeException(nameof(s))
    };

    public static EncounterStatus FromDbString(string v) => v switch
    {
        "SCHEDULED"  => EncounterStatus.Scheduled,
        "ACTIVE"     => EncounterStatus.Active,
        "DISCHARGED" => EncounterStatus.Discharged,
        "CANCELLED"  => EncounterStatus.Cancelled,
        _ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown encounter status: '{v}'")
    };
}