Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding fields from workflow request #237

Merged
merged 5 commits into from
Oct 13, 2023
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
7 changes: 7 additions & 0 deletions src/Messaging/Common/Artifact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ namespace Monai.Deploy.Messaging.Common
{
public class Artifact
{
/// <summary>
/// Type of the artifact
/// </summary>
public ArtifactType Type { get; set; } = ArtifactType.Unset;

/// <summary>
/// relative path from the bucket to the artifact
/// </summary>
public string Path { get; set; } = string.Empty;
}
}
72 changes: 62 additions & 10 deletions src/Messaging/Events/ArtifactsReceivedEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,83 @@ namespace Monai.Deploy.Messaging.Events
public class ArtifactsReceivedEvent : EventBase
{
/// <summary>
/// Gets or sets the workflow instanceID generated by the Workflow Manager.
/// Gets or sets the ID of the payload which is also used as the root path of the payload.
/// </summary>
[JsonProperty(PropertyName = "workflow_instance_id")]
[JsonPropertyName("workflow_instance_id")]
[JsonProperty(PropertyName = "payload_id")]
[JsonPropertyName("payload_id")]
[Required]
public string WorkflowInstanceId { get; set; } = default!;
public Guid PayloadId { get; set; }

/// <summary>
/// Gets or sets the export task ID generated by the Workflow Manager.
/// Gets or sets the associated workflows to be launched.
/// </summary>
[JsonProperty(PropertyName = "task_id")]
[JsonPropertyName("task_id")]
[JsonProperty(PropertyName = "workflows")]
[JsonPropertyName("workflows")]
public IEnumerable<string> Workflows { get; set; } = new List<string>();

/// <summary>
/// Gets or sets number of files in the payload.
/// </summary>
[JsonProperty(PropertyName = "file_count")]
[JsonPropertyName("file_count")]
[Required]
public string TaskId { get; set; } = default!;
public int FileCount { get; set; }

/// <summary>
/// Gets or set the correlation ID.
/// For DIMSE, the correlation ID is the UUID associated with the first DICOM association received.
/// For ACR, use the Transaction ID in the original request.
/// For an ACR inference request, the correlation ID is the Transaction ID in the original request.
/// </summary>
[JsonProperty(PropertyName = "correlation_id")]
[JsonPropertyName("correlation_id")]
[Required]
public string CorrelationId { get; set; } = default!;

/// <summary>
/// Gets or set the name of the bucket where the files in are stored.
/// </summary>
[JsonProperty(PropertyName = "bucket")]
[JsonPropertyName("bucket")]
[Required]
public string Bucket { get; set; } = default!;

/// <summary>
/// Gets or sets the service that received the original request.
/// </summary>
[JsonProperty(PropertyName = "trigger")]
[JsonPropertyName("trigger")]
public DataOrigin DataTrigger { get; set; } = default!;

/// <summary>
/// Gets or sets the data origins that were involved in triggering this workflow request.
/// </summary>
[JsonProperty(PropertyName = "data_origins")]
[JsonPropertyName("data_origins")]
public List<DataOrigin> DataOrigins { get; private set; } = new List<DataOrigin>();

/// <summary>
/// Gets or sets the time the data was received.
/// </summary>
[JsonProperty(PropertyName = "timestamp")]
[JsonPropertyName("timestamp")]
[Required]
public DateTime Timestamp { get; set; }

/// <summary>
/// Gets or sets the workflow instanceID generated by the Workflow Manager.
/// </summary>
[JsonProperty(PropertyName = "workflow_instance_id")]
[JsonPropertyName("workflow_instance_id")]
[Required]
public string? WorkflowInstanceId { get; set; } = default!;

/// <summary>
/// Gets or sets the export task ID generated by the Workflow Manager.
/// </summary>
[JsonProperty(PropertyName = "task_id")]
[JsonPropertyName("task_id")]
[Required]
public string? TaskId { get; set; } = default!;

/// <summary>
/// Gets or set the list of artifacts.
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions src/Messaging/Events/WorkflowRequestEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public class DataOrigin
[JsonPropertyName("destination")]
public string Destination { get; set; } = default!;

[JsonProperty(PropertyName = "fromExternalApp")]
[JsonPropertyName("fromExternalApp")]
public bool FromExternalApp { get; set; } = false;
[JsonProperty(PropertyName = "artifactType")]
[JsonPropertyName("artifactType")]
public ArtifactType ArtifactType { get; set; } = ArtifactType.Unset;

public override int GetHashCode()
{
Expand Down
Loading