Skip to content

Commit 6d2cf96

Browse files
authored
Support new Workflow Request event data structure (#455)
* Support new Workflow Request event data structure. * Re-generate EF migration code * Update user guide and changelog * Update ObjectUploadService to call Upload once since it's already handled with Polly. --------- Signed-off-by: Victor Chang <[email protected]>
1 parent d619c62 commit 6d2cf96

File tree

102 files changed

+1145
-722
lines changed

Some content is hidden

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

102 files changed

+1145
-722
lines changed

.editorconfig

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 MONAI Consortium
1+
# Copyright 2022-2023 MONAI Consortium
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818
root = true
1919

2020
# Copyright File Header
21-
file_header_template = SPDX-FileCopyrightText: © [year file created] - [last year file modified], MONAI Consortium\nSPDX-License-Identifier: Apache License 2.0
21+
file_header_template = SPDX-FileCopyrightText: © [year file created] - [last year file modified], MONAI Consortium\nSPDX-License-Identifier: Apache License 2.0
2222
dotnet_diagnostic.IDE0073.severity = error
2323

2424
# Default settings:
@@ -309,3 +309,7 @@ max_line_length = 88
309309
[*.json]
310310
indent_size = 2
311311
insert_final_newline = ignore
312+
313+
314+
# Spelling
315+
spelling_error_severity = information

doc/dependency_decisions.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
:why: MIT (https://github.com/microsoft/vstest/raw/main/LICENSE)
315315
:versions:
316316
- 17.4.1
317-
- 17.6.3
317+
- 17.7.1
318318
:when: 2022-08-16 23:05:48.342748414 Z
319319
- - :approve
320320
- Microsoft.Data.Sqlite.Core
@@ -682,7 +682,7 @@
682682
:why: MIT (https://raw.githubusercontent.com/microsoft/vstest/main/LICENSE)
683683
:versions:
684684
- 17.4.1
685-
- 17.6.3
685+
- 17.7.1
686686
:when: 2022-09-01 23:06:13.008314524 Z
687687
- - :approve
688688
- Microsoft.NETCore.Platforms
@@ -733,15 +733,15 @@
733733
:why: MIT (https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE)
734734
:versions:
735735
- 17.4.1
736-
- 17.6.3
736+
- 17.7.1
737737
:when: 2022-08-16 23:06:16.175705981 Z
738738
- - :approve
739739
- Microsoft.TestPlatform.TestHost
740740
- :who: mocsharp
741741
:why: MIT (https://github.com/microsoft/vstest/raw/v17.4.0/LICENSE)
742742
:versions:
743743
- 17.4.1
744-
- 17.6.3
744+
- 17.7.1
745745
:when: 2022-08-16 23:06:17.671459450 Z
746746
- - :approve
747747
- Microsoft.Toolkit.HighPerformance
@@ -783,14 +783,14 @@
783783
- :who: neilsouth
784784
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
785785
:versions:
786-
- 0.1.25
786+
- 1.0.0
787787
:when: 2022-08-16 23:06:21.051573547 Z
788788
- - :approve
789789
- Monai.Deploy.Messaging.RabbitMQ
790790
- :who: neilsouth
791791
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
792792
:versions:
793-
- 0.1.25
793+
- 1.0.0
794794
:when: 2022-08-16 23:06:21.511789690 Z
795795
- - :approve
796796
- Monai.Deploy.Storage

docs/changelog.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
[GitHub Milestone 0.4.0](https://github.com/Project-MONAI/monai-deploy-informatics-gateway/milestone/5)
2323

2424
- gh-435 Fix CLI to read log dir path from NLog config file.
25-
- New Virtual Application Entity support for DICOMWeb STOW-RS APIs to enable dynamic endpoints.
25+
- gh-425 New Virtual Application Entity support for DICOMWeb STOW-RS APIs to enable dynamic endpoints.
26+
- gh-421 Integrate updated Workflow Request data structure to support multiple sources.
2627
- New data [plug-ins](./plug-ins/overview.md) feature to manipulate incoming outgoing data.
2728

2829

docs/compliance/third-party-licenses.md

+6-6
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.25</summary>
7307+
<summary>Monai.Deploy.Messaging 1.0.0</summary>
73087308

73097309
## Monai.Deploy.Messaging
73107310

7311-
- Version: 0.1.25
7311+
- Version: 1.0.0
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.25)
7314+
- Source: [NuGet](https://www.nuget.org/packages/Monai.Deploy.Messaging/1.0.0)
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.25</summary>
7535+
<summary>Monai.Deploy.Messaging.RabbitMQ 1.0.0</summary>
75367536

75377537
## Monai.Deploy.Messaging.RabbitMQ
75387538

7539-
- Version: 0.1.25
7539+
- Version: 1.0.0
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.25)
7542+
- Source: [NuGet](https://www.nuget.org/packages/Monai.Deploy.Messaging.RabbitMQ/1.0.0)
75437543
- License: [Apache-2.0](https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
75447544

75457545

docs/index.md

+20-35
Original file line numberDiff line numberDiff line change
@@ -27,51 +27,36 @@ MIG uses standard protocols like DICOM and FHIR. It stores studies and resources
2727
After inference completes, MIG receives notifications for exporting the results to the proper consumers, usually PACS or viewers for visualization, VNAs for storage, and EHRs (Electronic Healthcare Records).
2828

2929

30-
## Services
30+
A list of supported protocols and services are available on the [MONAI Deploy Informatics Gateway Services](./setup/services.md) page.
3131

32-
MIG contains the following standard protocols for communicating with medical devices:
3332

34-
* **DICOM SCP**: C-ECHO, C-STORE
35-
* **DICOM SCU**: C-STORE
36-
* **HL7 Server**: A HL7 MLLP listener.
37-
* **ACR DSI API**: [The American College of Radiology’s Data Science Institute API](https://www.acrdsi.org/-/media/DSI/Files/ACR-DSI-Model-API.pdf)
38-
* **DICOMweb client**: QIDO-RS, WADO-RS, STOW-RS
39-
* **FHIR client**: GET
33+
## Contributing
34+
For guidance on making a contribution, see the [contributing guidelines](https://github.com/Project-MONAI/monai-deploy/blob/main/CONTRIBUTING.md).
4035

41-
> [!Note]
42-
> The ACR DSI API uses the DICOMweb client and FHIR client.
36+
## Community
37+
To participate, please join the MONAI Deploy App SDK weekly meetings on the [calendar](https://calendar.google.com/calendar/u/0/[email protected]&ctz=America/New_York) and review the [meeting notes](https://docs.google.com/document/d/1nw7JX-1kVaHiK8wBteM96xAWE3dh5wRUeC691bGuFjk/edit?usp=sharing).
4338

44-
### DICOM SCP
39+
Join the conversation on Twitter [@ProjectMONAI](https://twitter.com/ProjectMONAI) or join our [Slack channel](https://forms.gle/QTxJq3hFictp31UM9).
4540

46-
The *DICOM SCP Service* accepts standard DICOM C-ECHO and C-STORE commands, which receive DICOM instances for processing. In addition, the Informatics Gateway groups received DICOM instances by the study or series based on the configuration. Once DICOM instances are grouped, they are assembled into a payload for the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager) to consume.
41+
Ask and answer questions over on [MONAI Deploy Informatics Gateway's GitHub Discussions tab](https://github.com/Project-MONAI/monai-deploy-informatics-gateway/discussions).
4742

48-
### DICOM SCU
43+
## License
4944

50-
The *DICOM SCU Service* enables users to export application-generated DICOM results to external DICOM devices. It subscribes to the `md.export.request.monaiscu` events generated by the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager) and then exports the data to user-configured DICOM destination(s).
45+
Copyright (c) MONAI Consortium. All rights reserved.
46+
Licensed under the [Apache-2.0](https://github.com/Project-MONAI/monai-deploy-informatics-gateway/blob/develop/LICENSE) license.
5147

52-
> [!Note]
53-
> DICOM instances are sent as-is; no codec conversion is done as part of the SCU process.
54-
> See the [DICOM Interface SCU](./compliance/dicom.md#dimse-services-scu) section for more information.
48+
This software uses the Microsoft .NET 6.0 library, and the use of this software is subject to the [Microsoft software license terms](https://dotnet.microsoft.com/en-us/dotnet_library_license.htm).
5549

56-
### DICOMWeb STOW-RS
50+
By downloading this software, you agree to the license terms & all licenses listed on the [third-party licenses](./compliance/third-party-licenses.md) page.
5751

58-
The *DICOMWeb STOW-RS Service* allows users to trigger a new workflow request by uploading a DICOM dataset. The entire DICOM dataset is assembled into a payload for the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager) to consume.
59-
It provides options to trigger a workflow with or without specifying a workflow ID/name. See the
60-
[DICOMWeb STOW-RS](./api/rest/dicomweb-stow.md) section for more information.
52+
## Links
6153

62-
### HL7 MLLP Server
54+
- Website: <https://monai.io>
55+
- API documentation: <https://docs.monai.io/projects/monai-deploy-informatics-gateway>
56+
- Code: <https://github.com/Project-MONAI/monai-deploy-informatics-gateway>
57+
- Project tracker: <https://github.com/Project-MONAI/monai-deploy-informatics-gateway/projects>
58+
- Issue tracker: <https://github.com/Project-MONAI/monai-deploy-informatics-gateway/issues>
59+
- Wiki: <https://github.com/Project-MONAI/monai-deploy-informatics-gateway/wiki>
60+
- Test status: <https://github.com/Project-MONAI/monai-deploy-informatics-gateway/actions>
6361

64-
The *HL7 MLLP Server* accepts Health Level 7 messages via the MLLP (Minimal Lower Layer Protocol). The received messages are validated and assembled into a payload for the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager) to consume.
6562

66-
### ACR DSI API
67-
68-
The ACR DSI API allows users to trigger inference requests via RESTful calls, utilizing DICOMweb and FHIR to
69-
retrieve data specified in the request. Upon data retrieval, the Informatics Gateway uploads the data to the
70-
shared storage and generates an `md.workflow.request` event, which notifies the
71-
[MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager) for processing.
72-
73-
### DICOMweb Export
74-
75-
A DICOMweb export agent can export any user-generated DICOM content to configured DICOM destinations. The agent
76-
subscribes to the `md.export.request.monaidicomweb` events generated by the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager)
77-
and then exports the data to user-configured DICOMweb destination(s).

docs/setup/services.md

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<!--
2+
~ Copyright 2021-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+
18+
# MONAI Deploy Informatics Gateway Services
19+
20+
MONAI Deploy Informatics Gateway supports the following standard protocols for communicating with medical devices:
21+
22+
* **DICOM SCP**: C-ECHO, C-STORE
23+
* **DICOM SCU**: C-STORE
24+
* **HL7 Server**: A HL7 MLLP listener.
25+
* **ACR DSI API**: [The American College of Radiology�s Data Science Institute API](https://www.acrdsi.org/-/media/DSI/Files/ACR-DSI-Model-API.pdf)
26+
* **DICOMweb client**: QIDO-RS, WADO-RS, STOW-RS
27+
* **FHIR Server**: POST
28+
* **FHIR client**: GET
29+
30+
> [!Note]
31+
> The ACR DSI API uses the DICOMweb client and FHIR client.
32+
33+
## DICOM SCP
34+
35+
The *DICOM SCP Service* accepts standard DICOM C-ECHO and C-STORE commands, which receive DICOM instances for processing. In addition, the Informatics Gateway groups received DICOM instances by the study or series based on the configuration. Once DICOM instances are grouped, they are assembled into a payload for the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager) to consume.
36+
37+
### Workflow Request
38+
39+
With a DICOM SCP triggered workflow request, the data trigger contains the following:
40+
41+
- `DataService`: `DataService.DIMSE`
42+
- `Source`: `<calling AE Title>`
43+
- `Destination`: `<called AE Title>`
44+
45+
## DICOM SCU
46+
47+
The *DICOM SCU Service* enables users to export application-generated DICOM results to external DICOM devices. It subscribes to the `md.export.request.monaiscu` events generated by the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager) and then exports the data to user-configured DICOM destination(s).
48+
49+
> [!Note]
50+
> DICOM instances are sent as-is; no codec conversion is done as part of the SCU process.
51+
> See the [DICOM Interface SCU](../compliance/dicom.md#dimse-services-scu) section for more information.
52+
53+
## DICOMWeb STOW-RS
54+
55+
The *DICOMWeb STOW-RS Service* allows users to trigger a new workflow request by uploading a DICOM dataset. The entire DICOM dataset is assembled into a payload for the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager) to consume.
56+
It provides options to trigger a workflow with or without specifying a workflow ID/name. See the
57+
[DICOMWeb STOW-RS](../api/rest/dicomweb-stow.md) section for more information.
58+
59+
### Workflow Request
60+
61+
With a DICOMWeb STOW-RS triggered workflow request, the data trigger contains the following:
62+
63+
- `DataService`: `DataService.DicomWeb`
64+
- `Source`: `<caller's IP address>`
65+
- `Destination`: `default` or `<name of Virtual AE Title>`
66+
67+
## HL7 MLLP Server
68+
69+
The *HL7 MLLP Server* accepts Health Level 7 messages via the MLLP (Minimal Lower Layer Protocol). The received messages are validated and assembled into a payload for the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager) to consume.
70+
71+
### Workflow Request
72+
73+
With an HL7 MLLP Server triggered workflow request, the data trigger contains the following:
74+
75+
- `DataService`: `DataService.HL7`
76+
- `Source`: `<caller's IP address>`
77+
- `Destination`: `<MIG's IP address>`
78+
79+
## ACR DSI API
80+
81+
The ACR DSI API allows users to trigger inference requests via RESTful calls, utilizing DICOMweb and FHIR to
82+
retrieve data specified in the request. Upon data retrieval, the Informatics Gateway uploads the data to the
83+
shared storage and generates an `md.workflow.request` event, which notifies the
84+
[MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager) for processing.
85+
See the [Inference API](../api/rest/inference.md) for more information.
86+
87+
### Workflow Request
88+
89+
With an ACR DSI API triggered workflow request, the data trigger contains the following:
90+
91+
- `DataService`: `DataService.ACR`
92+
- `Source`: `<transaction ID from the ACR request>`
93+
- `Destination`: `<MIG's IP address>`
94+
95+
## DICOMweb Export
96+
97+
A DICOMweb export agent can export any user-generated DICOM content to configured DICOM destinations. The agent
98+
subscribes to the `md.export.request.monaidicomweb` events generated by the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager)
99+
and then exports the data to user-configured DICOMweb destination(s).
100+
101+
## FHIR Server
102+
103+
The *FHIR Server* accepts FHIR resources as described in the [FHIR API](../api/rest/fhir.md) section. When data arrives at the service, each resource is packaged into a payload and a workflow request is
104+
sent to the [MONAI Deploy Workflow Manager](https://github.com/Project-MONAI/monai-deploy-workflow-manager).
105+
106+
107+
### Workflow Request
108+
109+
With an FHIR Server triggered workflow request, the data trigger contains the following:
110+
111+
- `DataService`: `DataService.FHIR`
112+
- `Source`: `<caller's IP address>`
113+
- `Destination`: `<MIG's IP address>`

docs/setup/toc.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
# [Setup](setup.md)
1818
# [Configuration](schema.md)
1919
# [CLI](cli.md)
20+
# [Services](services.md)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
~ Copyright 2021-2022 MONAI Consortium
2+
~ Copyright 2021-2023 MONAI Consortium
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
55
~ you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@
3131
<PackageReference Include="fo-dicom" Version="5.1.1" />
3232
<PackageReference Include="Macross.Json.Extensions" Version="3.0.0" />
3333
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="6.0.21" />
34-
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.25" />
34+
<PackageReference Include="Monai.Deploy.Messaging" Version="1.0.0" />
3535
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.18" />
3636
</ItemGroup>
3737

src/Api/Storage/DicomFileStorageMetadata.cs

+7-17
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System;
1818
using System.Text.Json.Serialization;
1919
using Ardalis.GuardClauses;
20+
using Monai.Deploy.Messaging.Events;
2021

2122
namespace Monai.Deploy.InformaticsGateway.Api.Storage
2223
{
@@ -31,21 +32,6 @@ public sealed record DicomFileStorageMetadata : FileStorageMetadata
3132
public static readonly string DicomContentType = "application/dicom";
3233
public static readonly string DicomJsonContentType = System.Net.Mime.MediaTypeNames.Application.Json;
3334

34-
/// <summary>
35-
/// The calling AE title of the DICOM instance.
36-
/// For ACR, this is the Transaction ID of the original request.
37-
/// Note: this value is same as <see cref="FileStorageMetadata.Source"/>
38-
/// </summary>
39-
[JsonIgnore]
40-
public string CallingAeTitle { get => Source; }
41-
42-
/// <summary>
43-
/// The MONAI AE Title that received the DICOM instance.
44-
/// For ACR request, this field is empty.
45-
/// </summary>
46-
[JsonPropertyName("calledAeTitle")]
47-
public string CalledAeTitle { get; set; } = default!;
48-
4935
/// <summary>
5036
/// Gets or set the Study Instance UID of the DICOM instance.
5137
/// </summary>
@@ -95,7 +81,7 @@ public sealed record DicomFileStorageMetadata : FileStorageMetadata
9581
[JsonConstructor]
9682
public DicomFileStorageMetadata() { }
9783

98-
public DicomFileStorageMetadata(string associationId, string identifier, string studyInstanceUid, string seriesInstanceUid, string sopInstanceUid)
84+
public DicomFileStorageMetadata(string associationId, string identifier, string studyInstanceUid, string seriesInstanceUid, string sopInstanceUid, DataService dataService, string callingAeTitle, string calledAeTitle)
9985
: base(associationId.ToString(), identifier)
10086
{
10187
Guard.Against.NullOrWhiteSpace(associationId, nameof(associationId));
@@ -120,6 +106,10 @@ public DicomFileStorageMetadata(string associationId, string identifier, string
120106
UploadPath = $"{File.UploadPath}{DicomJsonFileExtension}",
121107
ContentType = DicomJsonContentType,
122108
};
109+
110+
DataOrigin.DataService = dataService;
111+
DataOrigin.Source = callingAeTitle;
112+
DataOrigin.Destination = calledAeTitle;
123113
}
124114

125115
public override void SetFailed()
@@ -128,4 +118,4 @@ public override void SetFailed()
128118
JsonFile.SetFailed();
129119
}
130120
}
131-
}
121+
}

0 commit comments

Comments
 (0)