Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Shared/Shared/ValidationConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,24 @@ public static class ValidationConstants
/// </summary>
public static readonly string Mode = "mode";

/// <summary>
/// Key for the notifications.
/// </summary>
public static readonly string Notifications = "notifications";

public enum ModeValues
{
QA,
Research,
Clinical
}

public enum NotificationValues
{
True,
False
}

/// <summary>
/// Required arguments to run the clinical review task workflow args.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,16 @@ private void ValidateClinicalReviewRequiredFields(TaskObject[] tasks, TaskObject
return;
}

if (!currentTask.Args.ContainsKey(Notifications))
{
Errors.Add($"Task: '{currentTask.Id}' notifications must be specified.");
return;
}
else if (!Enum.TryParse(typeof(NotificationValues), currentTask.Args[Notifications], true, out var _))
{
Errors.Add($"Task: '{currentTask.Id}' notifications is incorrectly specified{Comma}please specify 'true' or 'false'");
}

var reviewedTask = tasks.First(t => t.Id.ToLower() == currentTask.Args[ReviewedTaskId].ToLower());

if (reviewedTask.Type.Equals(ArgoTaskType, StringComparison.OrdinalIgnoreCase) is false)
Expand Down
Loading