Skip to content

Commit

Permalink
Merge pull request #241 from Project-MONAI/release/1.0.3
Browse files Browse the repository at this point in the history
Release/1.0.3
  • Loading branch information
neildsouth authored Oct 13, 2023
2 parents e6195b0 + 3d3800f commit 3adc5c4
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 15 deletions.
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;
}
}
1 change: 1 addition & 0 deletions src/Messaging/Common/ArtifactType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace Monai.Deploy.Messaging.Common
public enum ArtifactType
{
Unset, //Unset
Folder, // Folder
AR, //Autorefraction
ASMT, //Content Assessment Results
AU, //Audio
Expand Down
3 changes: 2 additions & 1 deletion src/Messaging/Common/ArtifactTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ namespace Monai.Deploy.Messaging.Common
{
public static class ArtifactTypes
{
private static readonly Dictionary<ArtifactType, string> ListOfModularity = new()
public static readonly Dictionary<ArtifactType, string> ListOfModularity = new()

Check warning on line 21 in src/Messaging/Common/ArtifactTypes.cs

View workflow job for this annotation

GitHub Actions / unit-test

Use an immutable collection or reduce the accessibility of the non-private readonly field 'ListOfModularity'.

Check warning on line 21 in src/Messaging/Common/ArtifactTypes.cs

View workflow job for this annotation

GitHub Actions / unit-test

Use an immutable collection or reduce the accessibility of the public static field 'ListOfModularity'.

Check warning on line 21 in src/Messaging/Common/ArtifactTypes.cs

View workflow job for this annotation

GitHub Actions / unit-test

Use an immutable collection or reduce the accessibility of the non-private readonly field 'ListOfModularity'.

Check warning on line 21 in src/Messaging/Common/ArtifactTypes.cs

View workflow job for this annotation

GitHub Actions / unit-test

Use an immutable collection or reduce the accessibility of the public static field 'ListOfModularity'.

Check warning on line 21 in src/Messaging/Common/ArtifactTypes.cs

View workflow job for this annotation

GitHub Actions / unit-test

Use an immutable collection or reduce the accessibility of the non-private readonly field 'ListOfModularity'.

Check warning on line 21 in src/Messaging/Common/ArtifactTypes.cs

View workflow job for this annotation

GitHub Actions / unit-test

Use an immutable collection or reduce the accessibility of the public static field 'ListOfModularity'.

Check warning on line 21 in src/Messaging/Common/ArtifactTypes.cs

View workflow job for this annotation

GitHub Actions / unit-test

Use an immutable collection or reduce the accessibility of the non-private readonly field 'ListOfModularity'.

Check warning on line 21 in src/Messaging/Common/ArtifactTypes.cs

View workflow job for this annotation

GitHub Actions / unit-test

Use an immutable collection or reduce the accessibility of the public static field 'ListOfModularity'.
{
{ ArtifactType.Unset, "Unset" },
{ ArtifactType.Folder, "Folders" },
{ ArtifactType.AR, "Autorefract" },
{ ArtifactType.ASMT, "Content Assessment Results" },
{ ArtifactType.AU, "Audio" },
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private EventingBasicConsumer CreateConsumer(Func<MessageReceivedEventArgs, Task
["@messageId"] = eventArgs.BasicProperties.MessageId,
["@applicationId"] = eventArgs.BasicProperties.AppId,
["@correlationId"] = eventArgs.BasicProperties.CorrelationId,
["@recievedTime"] = DateTime.UtcNow
["@receivedTime"] = DateTime.UtcNow
});
_logger.MessageReceivedFromQueue(queueDeclareResult.QueueName, eventArgs.RoutingKey);
Expand Down

0 comments on commit 3adc5c4

Please sign in to comment.