public enum OrderType { Lab, Imaging, Medication, Procedure }

public static class OrderTypeExtensions
{
    public static string ToDbString(this OrderType t) => t switch
    {
        OrderType.Lab        => "LAB",
        OrderType.Imaging    => "IMAGING",
        OrderType.Medication => "MEDICATION",
        OrderType.Procedure  => "PROCEDURE",
        _ => throw new ArgumentOutOfRangeException(nameof(t))
    };

    public static OrderType FromDbString(string v) => v switch
    {
        "LAB"        => OrderType.Lab,
        "IMAGING"    => OrderType.Imaging,
        "MEDICATION" => OrderType.Medication,
        "PROCEDURE"  => OrderType.Procedure,
        _ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown order type: '{v}'")
    };
}
