Skip to content

Commit d54788e

Browse files
authored
gh-419 Implement data output plug-in engine and integration with SCU/DICOMWeb export services (#428)
* Update Ardalis.GuardClauses * Update coverlet.collector * Update Docker.DotNet * Update xunit * Update NLog * Update MongoDB * Update Polly * Update Monai.Deploy libraries * Update Microsoft .NET 6 libraries * Update fo-dicom * Remove fo-dicom logging support and use .NET logging * Implement OutputDataPluginEngine for export service (SCU, DICOMWeb) * Add WorkflowInstanceId and TaskId properties for plugins to use * Fix package hash * Fix JSON property name of TaskId * Update Moq, NLog, NLog.Web.AspNetCore and dependencie decisions * Update dependency decisions: Devlooped.SponsorLink * Fix comments Signed-off-by: Victor Chang <[email protected]>
1 parent 8cfece2 commit d54788e

File tree

55 files changed

+966
-446
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+966
-446
lines changed

doc/dependency_decisions.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -795,14 +795,14 @@
795795
- :who: neilsouth
796796
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
797797
:versions:
798-
- 0.1.23
798+
- 0.1.24
799799
:when: 2022-08-16 23:06:21.051573547 Z
800800
- - :approve
801801
- Monai.Deploy.Messaging.RabbitMQ
802802
- :who: neilsouth
803803
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
804804
:versions:
805-
- 0.1.23
805+
- 0.1.24
806806
:when: 2022-08-16 23:06:21.511789690 Z
807807
- - :approve
808808
- Monai.Deploy.Storage
@@ -838,7 +838,7 @@
838838
:why: BSD 3-Clause License ( https://raw.githubusercontent.com/moq/moq4/main/License.txt)
839839
:versions:
840840
- 4.18.1
841-
- 4.18.4
841+
- 4.20.1
842842
:when: 2022-08-16 23:06:23.359197359 Z
843843
- - :approve
844844
- NETStandard.Library
@@ -897,7 +897,7 @@
897897
- :who: mocsharp
898898
:why: Apache-2.0 (https://github.com/rabbitmq/rabbitmq-dotnet-client/raw/main/LICENSE-APACHE2)
899899
:versions:
900-
- 6.4.0
900+
- 6.5.0
901901
:when: 2022-08-16 23:06:28.818109746 Z
902902
- - :approve
903903
- SQLitePCLRaw.bundle_e_sqlite3
@@ -1299,6 +1299,7 @@
12991299
:why: MIT (https://github.com/dotnet/corefx/raw/master/LICENSE.TXT)
13001300
:versions:
13011301
- 4.5.4
1302+
- 4.5.5
13021303
:when: 2022-08-16 23:06:55.672403035 Z
13031304
- - :approve
13041305
- System.Net.Http
@@ -1694,6 +1695,7 @@
16941695
:why: MIT (https://github.com/dotnet/runtime/raw/main/LICENSE.TXT)
16951696
:versions:
16961697
- 6.0.0
1698+
- 7.0.0
16971699
:when: 2022-08-16 23:07:22.653576384 Z
16981700
- - :approve
16991701
- System.Threading.Overlapped
@@ -2295,21 +2297,21 @@
22952297
- :who: mocsharp
22962298
:why: BSD 3-Clause License (https://github.com/NLog/NLog/raw/dev/LICENSE.txt)
22972299
:versions:
2298-
- 5.2.2
2300+
- 5.2.3
22992301
:when: 2022-10-12 03:14:06.538744982 Z
23002302
- - :approve
23012303
- NLog.Extensions.Logging
23022304
- :who: mocsharp
23032305
:why: BSD 2-Clause Simplified License (https://github.com/NLog/NLog.Extensions.Logging/raw/master/LICENSE)
23042306
:versions:
2305-
- 5.3.2
2307+
- 5.3.3
23062308
:when: 2022-10-12 03:14:06.964203977 Z
23072309
- - :approve
23082310
- NLog.Web.AspNetCore
23092311
- :who: mocsharp
23102312
:why: BSD 3-Clause License (https://github.com/NLog/NLog.Web/raw/master/LICENSE)
23112313
:versions:
2312-
- 5.3.2
2314+
- 5.3.3
23132315
:when: 2022-10-12 03:14:07.396706995 Z
23142316
- - :approve
23152317
- fo-dicom.NLog
@@ -2458,5 +2460,15 @@
24582460
:versions:
24592461
- 1.1.1
24602462
:when: 2023-08-04 0:02:30.206982078 Z
2463+
- - :approve
2464+
- Devlooped.SponsorLink
2465+
- :who: mocsharp
2466+
:why: MIT (https://licenses.nuget.org/MIT)
2467+
:versions:
2468+
- 1.0.0
2469+
:when: 2023-08-08 0:08:05.206982078 Z
2470+
2471+
2472+
24612473

24622474

docs/compliance/third-party-licenses.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7304,14 +7304,14 @@ Apache License
73047304

73057305

73067306
<details>
7307-
<summary>Monai.Deploy.Messaging 0.1.21</summary>
7307+
<summary>Monai.Deploy.Messaging 0.1.24</summary>
73087308

73097309
## Monai.Deploy.Messaging
73107310

7311-
- Version: 0.1.21
7311+
- Version: 0.1.24
73127312
- Authors: MONAI Consortium
73137313
- Project URL: https://github.com/Project-MONAI/monai-deploy-messaging
7314-
- Source: [NuGet](https://www.nuget.org/packages/Monai.Deploy.Messaging/0.1.21)
7314+
- Source: [NuGet](https://www.nuget.org/packages/Monai.Deploy.Messaging/0.1.24)
73157315
- License: [Apache-2.0](https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
73167316

73177317

@@ -7532,14 +7532,14 @@ By downloading this software, you agree to the license terms & all licenses list
75327532

75337533

75347534
<details>
7535-
<summary>Monai.Deploy.Messaging.RabbitMQ 0.1.21</summary>
7535+
<summary>Monai.Deploy.Messaging.RabbitMQ 0.1.24</summary>
75367536

75377537
## Monai.Deploy.Messaging.RabbitMQ
75387538

7539-
- Version: 0.1.21
7539+
- Version: 0.1.24
75407540
- Authors: MONAI Consortium
75417541
- Project URL: https://github.com/Project-MONAI/monai-deploy-messaging
7542-
- Source: [NuGet](https://www.nuget.org/packages/Monai.Deploy.Messaging.RabbitMQ/0.1.21)
7542+
- Source: [NuGet](https://www.nuget.org/packages/Monai.Deploy.Messaging.RabbitMQ/0.1.24)
75437543
- License: [Apache-2.0](https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
75447544

75457545

@@ -8847,14 +8847,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88478847

88488848

88498849
<details>
8850-
<summary>Moq 4.18.4</summary>
8850+
<summary>Moq 4.20.1</summary>
88518851

88528852
## Moq
88538853

8854-
- Version: 4.18.4
8854+
- Version: 4.20.1
88558855
- Authors: Daniel Cazzulino, kzu
88568856
- Project URL: https://github.com/moq/moq4
8857-
- Source: [NuGet](https://www.nuget.org/packages/Moq/4.18.4)
8857+
- Source: [NuGet](https://www.nuget.org/packages/Moq/4.20.1)
88588858
- License: [BSD 3-Clause License]( https://raw.githubusercontent.com/moq/moq4/main/License.txt)
88598859

88608860

@@ -9182,14 +9182,14 @@ THE POSSIBILITY OF SUCH DAMAGE.
91829182

91839183

91849184
<details>
9185-
<summary>NLog.Extensions.Logging 5.2.2</summary>
9185+
<summary>NLog.Extensions.Logging 5.2.3</summary>
91869186

91879187
## NLog.Extensions.Logging
91889188

9189-
- Version: 5.2.2
9189+
- Version: 5.2.3
91909190
- Authors: Microsoft,Julian Verdurmen
91919191
- Project URL: https://github.com/NLog/NLog.Extensions.Logging
9192-
- Source: [NuGet](https://www.nuget.org/packages/NLog.Extensions.Logging/5.2.2)
9192+
- Source: [NuGet](https://www.nuget.org/packages/NLog.Extensions.Logging/5.2.3)
91939193
- License: [BSD 2-Clause Simplified License](https://github.com/NLog/NLog.Extensions.Logging/raw/master/LICENSE)
91949194

91959195

@@ -9223,14 +9223,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
92239223

92249224

92259225
<details>
9226-
<summary>NLog.Web.AspNetCore 5.2.2</summary>
9226+
<summary>NLog.Web.AspNetCore 5.2.3</summary>
92279227

92289228
## NLog.Web.AspNetCore
92299229

9230-
- Version: 5.2.2
9230+
- Version: 5.2.3
92319231
- Authors: Julian Verdurmen
92329232
- Project URL: https://github.com/NLog/NLog.Web
9233-
- Source: [NuGet](https://www.nuget.org/packages/NLog.Web.AspNetCore/5.2.2)
9233+
- Source: [NuGet](https://www.nuget.org/packages/NLog.Web.AspNetCore/5.2.3)
92349234
- License: [BSD 3-Clause License](https://github.com/NLog/NLog.Web/raw/master/LICENSE)
92359235

92369236

@@ -9571,14 +9571,14 @@ C# is a registered trademark of Microsoft ®.
95719571

95729572

95739573
<details>
9574-
<summary>RabbitMQ.Client 6.4.0</summary>
9574+
<summary>RabbitMQ.Client 6.5.0</summary>
95759575

95769576
## RabbitMQ.Client
95779577

9578-
- Version: 6.4.0
9578+
- Version: 6.5.0
95799579
- Authors: VMware
95809580
- Project URL: https://www.rabbitmq.com/dotnet.html
9581-
- Source: [NuGet](https://www.nuget.org/packages/RabbitMQ.Client/6.4.0)
9581+
- Source: [NuGet](https://www.nuget.org/packages/RabbitMQ.Client/6.5.0)
95829582
- License: [Apache-2.0](https://github.com/rabbitmq/rabbitmq-dotnet-client/raw/main/LICENSE-APACHE2)
95839583

95849584

@@ -17176,15 +17176,15 @@ SOFTWARE.
1717617176

1717717177

1717817178
<details>
17179-
<summary>System.Memory 4.5.4</summary>
17179+
<summary>System.Memory 4.5.5</summary>
1718017180

1718117181
## System.Memory
1718217182

17183-
- Version: 4.5.4
17183+
- Version: 4.5.5
1718417184
- Authors: Microsoft
1718517185
- Owners: microsoft,dotnetframework
1718617186
- Project URL: https://dot.net/
17187-
- Source: [NuGet](https://www.nuget.org/packages/System.Memory/4.5.4)
17187+
- Source: [NuGet](https://www.nuget.org/packages/System.Memory/4.5.5)
1718817188
- License: [MIT](https://github.com/dotnet/corefx/raw/master/LICENSE.TXT)
1718917189

1719017190

@@ -26326,14 +26326,14 @@ SOFTWARE.
2632626326

2632726327

2632826328
<details>
26329-
<summary>System.Threading.Channels 6.0.0</summary>
26329+
<summary>System.Threading.Channels 7.0.0</summary>
2633026330

2633126331
## System.Threading.Channels
2633226332

26333-
- Version: 6.0.0
26333+
- Version: 7.0.0
2633426334
- Authors: Microsoft
2633526335
- Project URL: https://dot.net/
26336-
- Source: [NuGet](https://www.nuget.org/packages/System.Threading.Channels/6.0.0)
26336+
- Source: [NuGet](https://www.nuget.org/packages/System.Threading.Channels/7.0.0)
2633726337
- License: [MIT](https://github.com/dotnet/runtime/raw/main/LICENSE.TXT)
2633826338

2633926339

src/InformaticsGateway/Services/Export/ExportRequestDataMessage.cs renamed to src/Api/ExportRequestDataMessage.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,29 @@
1919
using Ardalis.GuardClauses;
2020
using Monai.Deploy.Messaging.Events;
2121

22-
namespace Monai.Deploy.InformaticsGateway.Services.Export
22+
namespace Monai.Deploy.InformaticsGateway.Api
2323
{
2424
public class ExportRequestDataMessage
2525
{
2626
private readonly ExportRequestEvent _exportRequest;
2727

28-
public byte[] FileContent { get; private set; }
28+
public byte[] FileContent { get; private set; } = default!;
2929
public bool IsFailed { get; private set; }
3030
public IList<string> Messages { get; init; }
3131
public FileExportStatus ExportStatus { get; private set; }
3232
public string Filename { get; }
3333

34+
/// <summary>
35+
/// Optional list of data output plug-in type names to be executed by the <see cref="IOutputDataPluginEngine"/>.
36+
/// </summary>
37+
public List<string> PluginAssemblies
38+
{
39+
get
40+
{
41+
return _exportRequest.PluginAssemblies;
42+
}
43+
}
44+
3445
public string ExportTaskId
3546
{
3647
get { return _exportRequest.ExportTaskId; }
@@ -46,6 +57,7 @@ public string[] Destinations
4657
get { return _exportRequest.Destinations; }
4758
}
4859

60+
4961
public ExportRequestDataMessage(ExportRequestEvent exportRequest, string filename)
5062
{
5163
IsFailed = false;

src/Api/IInputDataPluginEngine.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ namespace Monai.Deploy.InformaticsGateway.Api
2626
/// a list of plug-ins based on <see cref="IInputDataPlugin"/>.
2727
/// Rules:
2828
/// <list type="bullet">
29-
/// <item>A list of plug-ins can be included with each export request, and each plug-in is executed in the order stored, processing one file at a time, enabling piping of the data before each file is exported.</item>
30-
/// <item>Plugins MUST be lightweight and not hinder the export process</item>
31-
/// <item>Plugins SHALL not accumulate files in memory or storage for bulk processing</item>
29+
/// <item>SCP: A list of plug-ins can be configured with each AET, and each plug-in is executed in the order stored, enabling piping of the incoming data before each file is uploaded to the storage service.</item>
30+
/// <item>Incoming data is processed one file at a time and SHALL not wait for the entire study to arrive.</item>
31+
/// <item>Plugins MUST be lightweight and not hinder the upload process.</item>
32+
/// <item>Plugins SHALL not accumulate files in memory or storage for bulk processing.</item>
3233
/// </list>
3334
/// </summary>
3435
public interface IInputDataPluginEngine

src/Api/IOutputDataPlugin.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2023 MONAI Consortium
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
using System.Threading.Tasks;
18+
using FellowOakDicom;
19+
20+
namespace Monai.Deploy.InformaticsGateway.Api
21+
{
22+
/// <summary>
23+
/// <c>IOutputDataPlugin</c> enables lightweight data processing over incoming data received from supported data ingestion
24+
/// services.
25+
/// Refer to <see cref="IOutputDataPluginEngine" /> for additional details.
26+
/// </summary>
27+
public interface IOutputDataPlugin
28+
{
29+
Task<(DicomFile dicomFile, ExportRequestDataMessage exportRequestDataMessage)> Execute(DicomFile dicomFile, ExportRequestDataMessage exportRequestDataMessage);
30+
}
31+
}

src/Api/IOutputDataPluginEngine.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright 2023 MONAI Consortium
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
using System.Collections.Generic;
18+
using System.Threading.Tasks;
19+
20+
namespace Monai.Deploy.InformaticsGateway.Api
21+
{
22+
/// <summary>
23+
/// <c>IOutputDataPluginEngine</c> processes each file before exporting to its destination
24+
/// through a list of plug-ins based on <see cref="IOutputDataPlugin"/>.
25+
/// Rules:
26+
/// <list type="bullet">
27+
/// <item>A list of plug-ins can be included with each export request, and each plug-in is executed in the order stored, processing one file at a time, enabling piping of the data before each file is exported.</item>
28+
/// <item>Plugins MUST be lightweight and not hinder the export process.</item>
29+
/// <item>Plugins SHALL not accumulate files in memory or storage for bulk processing.</item>
30+
/// </list>
31+
/// </summary>
32+
public interface IOutputDataPluginEngine
33+
{
34+
void Configure(IReadOnlyList<string> pluginAssemblies);
35+
36+
Task<ExportRequestDataMessage> ExecutePlugins(ExportRequestDataMessage exportRequestDataMessage);
37+
}
38+
}

src/Api/Monai.Deploy.InformaticsGateway.Api.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<ItemGroup>
3131
<PackageReference Include="Macross.Json.Extensions" Version="3.0.0" />
3232
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="6.0.20" />
33-
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.23" />
33+
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.24" />
3434
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.16" />
3535
</ItemGroup>
3636

src/Api/Storage/FileStorageMetadata.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ public abstract record FileStorageMetadata
8181
[JsonPropertyName("dateReceived")]
8282
public DateTime DateReceived { get; init; } = default!;
8383

84+
/// <summary>
85+
/// Gets or sets the workflow instance ID for the workflow manager to resume a workflow.
86+
/// </summary>
87+
/// <value></value>
88+
[JsonPropertyName("WorkflowInstanceId")]
89+
public string? WorkflowInstanceId { get; set; }
90+
91+
/// <summary>
92+
/// Gets or sets the task ID for the workflow manager to resume a workflow.
93+
/// </summary>
94+
/// <value></value>
95+
[JsonPropertyName("taskId")]
96+
public string? TaskId { get; set; }
97+
8498
/// <summary>
8599
/// DO NOT USE
86100
/// This constructor is intended for JSON serializer.

0 commit comments

Comments
 (0)