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
4 changes: 2 additions & 2 deletions src/TaskManager/TaskManager/appsettings.Local.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@
"scuAgentName": "monaiscu"
},
"argoCallback": {
"argoRabbitOverrideEnabled": false,
"argoRabbitOverrideEndpoint": "localhost"
"argoRabbitOverrideEnabled": true,
"argoRabbitOverrideEndpoint": "rabbit-monai"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/WorkflowManager/Logging/Logging/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static partial class Log
[LoggerMessage(EventId = 23, Level = LogLevel.Error, Message = "The task {taskId} metadata store update failed. Payload: {payloadId} - Metadata: {metadata}")]
public static partial void TaskMetaDataUpdateFailed(this ILogger logger, string payloadId, string taskId, Dictionary<string, object> metadata);

[LoggerMessage(EventId = 24, Level = LogLevel.Debug, Message = "No files to export for task {taskId} within workflow instance {workflowInstanceId}.")]
[LoggerMessage(EventId = 24, Level = LogLevel.Error, Message = "No files to export for task {taskId} within workflow instance {workflowInstanceId}.")]
public static partial void ExportFilesNotFound(this ILogger logger, string taskId, string workflowInstanceId);

[LoggerMessage(EventId = 25, Level = LogLevel.Error, Message = "Failed to get dicom tag {keyId} in bucket {bucketId}. Payload: {payloadId}")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,6 @@ private async Task HandleDicomExportAsync(WorkflowRevision workflow, WorkflowIns

var artifactValues = GetDicomExports(workflow, workflowInstance, task, exportList);

if (artifactValues.Any() is false)
{
await HandleTaskDestinations(workflowInstance, workflow, task, correlationId);

return;
}

var files = new List<VirtualFileInfo>();
foreach (var artifact in artifactValues)
{
Expand All @@ -365,15 +358,29 @@ private async Task HandleDicomExportAsync(WorkflowRevision workflow, WorkflowIns
workflowInstance.BucketId,
artifact,
true);
if (objects.IsNullOrEmpty() is false)

var dcmFiles = objects?.Where(o => o.FilePath.EndsWith(".dcm"))?.ToList();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes, users may not use .dcm extension.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change also removes the ability to export HL7/FHIR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know what other file extensions we will support?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we only support exporting to the dicom scu endpoint. So when we extend the export to other endpoints we can update supported filetypes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to support DICOM, FHIR, and HL7 but no guarantee what file extensions users will use. Therefore, I think we must document the usage, e.g., without .dcm we will not export their DICOM files.


if (dcmFiles?.IsNullOrEmpty() is false)
{
files.AddRange(objects.ToList());
files.AddRange(dcmFiles.ToList());
}
}
}

artifactValues = files.Select(f => f.FilePath).ToArray();

if (artifactValues.IsNullOrEmpty())
{
_logger.ExportFilesNotFound(task.TaskId, workflowInstance.Id);

await UpdateWorkflowInstanceStatus(workflowInstance, task.TaskId, TaskExecutionStatus.Failed);

await CompleteTask(task, workflowInstance, correlationId, TaskExecutionStatus.Failed);

return;
}

await DispatchDicomExport(workflowInstance, task, exportList, artifactValues, correlationId);
}

Expand All @@ -399,8 +406,6 @@ private string[] GetDicomExports(WorkflowRevision workflow, WorkflowInstance wor

if (!task.InputArtifacts.Any())
{
_logger.ExportFilesNotFound(task.TaskId, workflowInstance.Id);

return Array.Empty<string>();
}

Expand Down