public enum ClinicalSyncBatchStatus { Received, Processing, Applied, Conflict, Rejected }

public static class ClinicalSyncBatchStatusExtensions
{
    public static string ToDbString(this ClinicalSyncBatchStatus s) => s switch
    {
        ClinicalSyncBatchStatus.Received   => "RECEIVED",
        ClinicalSyncBatchStatus.Processing => "PROCESSING",
        ClinicalSyncBatchStatus.Applied    => "APPLIED",
        ClinicalSyncBatchStatus.Conflict   => "CONFLICT",
        ClinicalSyncBatchStatus.Rejected   => "REJECTED",
        _ => throw new ArgumentOutOfRangeException(nameof(s))
    };

    public static ClinicalSyncBatchStatus FromDbString(string v) => v switch
    {
        "RECEIVED"   => ClinicalSyncBatchStatus.Received,
        "PROCESSING" => ClinicalSyncBatchStatus.Processing,
        "APPLIED"    => ClinicalSyncBatchStatus.Applied,
        "CONFLICT"   => ClinicalSyncBatchStatus.Conflict,
        "REJECTED"   => ClinicalSyncBatchStatus.Rejected,
        _ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown sync batch status: '{v}'")
    };
}