Skip to content

Commit 85d7d94

Browse files
authored
Input/output data plug-in engine (#423)
Signed-off-by: Victor Chang <[email protected]>
1 parent 90b31a6 commit 85d7d94

File tree

7 files changed

+93
-46
lines changed

7 files changed

+93
-46
lines changed

guidelines/diagrams/mig-export.png

54.3 KB
Loading

guidelines/diagrams/mig-export.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ title Export Results
66

77
participantgroup #00CC66 Informatics\nGateway
88
participant "SCU Export Watcher" as EW
9+
participant "Data Export Plugin Engine" as DEPE
910
participant "SCU Export" as SCU
1011
participant "FHIR Export" as FHIR
1112
participant "DICOMweb Export" as DICOMWEB
@@ -36,6 +37,16 @@ PS->EW: Notify new export task event
3637
activate EW
3738

3839
EW->DISK: Load results
40+
EW->DEPE: Execute plugins (DicomFile, ExportRequestEventDetails)
41+
activate DEPE
42+
loop plugin in plugins
43+
DEPE->DEPE: execute plugin
44+
activate DEPE
45+
DEPE<<--DEPE: return DicomFile
46+
deactivate DEPE
47+
end
48+
EW<--DEPE: return DicomFile
49+
deactivate DEPE
3950

4051
alt case DICOM
4152
EW->SCU: Queue DICOM export task
@@ -62,6 +73,3 @@ EA->DB: Update task state
6273
EW<--EA: Response
6374
deactivate EA
6475
deactivate EW
65-
66-
67-

guidelines/diagrams/mig-scp.png

67.6 KB
Loading

guidelines/diagrams/mig-scp.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ fontawesome f0f8 "Hospital\nDICOM Devices" as DICOM
88

99
participantgroup #00CC66 Informatics\nGateway
1010
participant "DICOM SCP" as SCP
11+
participant "Input Data Plugin Engine" as IDPE
1112
participant "Payload Assembler Service" as PA
1213
participant "Payload Notification Service" as PN
1314
participant "Object Upload Service" as OUS
@@ -45,6 +46,17 @@ SCP->DB: Query for \nconfigured\nsources
4546
SCP<--DB: Response
4647
SCP->SCP: Validate
4748
SCP->SCP: Extract DICOM headers
49+
SCP->IDPE: Execute Plugins (DicomFile, DicomFileStorageMetadata)
50+
activate IDPE
51+
loop plugin in plugins
52+
IDPE->IDPE: execute plugin
53+
activate IDPE
54+
IDPE<<--IDPE: return DicomFileStorageMetadata
55+
deactivate IDPE
56+
end
57+
SCP<<--IDPE: return DicomFileStorageMetadata
58+
deactivate IDPE
59+
4860
SCP->OUS: Queue for upload
4961
activate OUS
5062
OUS->DISK: Upload to temporary bucket path
@@ -67,4 +79,4 @@ deactivate PA
6779
PN->DISK: Move files associated with the payload to payload directory
6880
PN->PS: Publish new workflow request
6981
PN<--PS: Response
70-
end
82+
end

guidelines/diagrams/mig.png

12.2 KB
Loading

guidelines/srs.md renamed to guidelines/mig-sadd.md

Lines changed: 49 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ MIG Storage SCP service can be configured to accept all incoming association req
139139
| Save to disk | Sliding: 250ms - 1000ms | 3 |
140140
| Notify MWM | Sliding: 250ms - 1000ms | 3 |
141141

142+
142143
---
143144

144145
### DICOM SCU Service
@@ -279,6 +280,18 @@ The following APIs are supported to interact with the ACR-DSI API:
279280

280281
---
281282

283+
#### DICOMWeb STOW-RS API
284+
285+
[DICOMWeb STOW-RS API](../docs/api/rest/dicomweb-stow.md)
286+
287+
---
288+
289+
#### FHIR API
290+
291+
[FHIR API](../docs/api/rest/fhir.md)
292+
293+
---
294+
282295
### Health API
283296

284297
[Health API](../docs/api/rest/health.md)
@@ -291,6 +304,37 @@ The following APIs are supported to interact with the ACR-DSI API:
291304

292305
---
293306

307+
### Data Plug-in Engines
308+
309+
[REQ-FNC-06] MIG Data Plug-in Engines provide a plug-in architecture to enable customization of zero or more plug-ins
310+
to be executed on the inbound and outbound data pipelines.
311+
312+
#### Inbound Data Plug-in Engine
313+
314+
When data arrives at one of the supported data-receiving services, the MIG passes the raw data through the plug-in engine to enable data manipulation.
315+
316+
- For DICOM DIMSE, a list of plug-ins may be configured for each AE Title
317+
- For DICOMWeb STOW-RS, a list of plug-ins may be configured for each virtual AE Title and a single list for the default API endpoint
318+
- For the ACR Inference API, a single list of plug-ins may be defined
319+
- For FHIR, a single list of plug-ins may be defined
320+
- For HL7, a single list of plug-ins may be defined
321+
- Each plug-in is executed in the order that it is saved in the list
322+
- If any plug-in in the configured list fails, the data is dropped and may return an error to the sender, depending on the design of the receiving service.
323+
- Plug-ins MUST be lightweight and not hinder the upload process
324+
- Plug-ins SHALL not accumulate files in memory or storage for bulk processing
325+
326+
327+
#### Outbound Data Plug-in Engine
328+
329+
When the export service receives an export request and downloads the files included in the request, the export data pipeline passes each file through the plug-in engine for data manipulation.
330+
331+
- A list of plug-ins can be included with each export request
332+
- Each plug-in is executed in the order that it is saved in the list
333+
- Plug-ins MUST be lightweight and not hinder the export process
334+
- Plug-ins SHALL not accumulate files in memory or storage for bulk processing
335+
-
336+
---
337+
294338
### Storage & Subsystems
295339

296340
#### Data Storage
@@ -327,54 +371,18 @@ Each event is associated with a specific type and is serialized to JSON before s
327371

328372
- Workflow Request event
329373
- Routing Key: `md.workflow.request`
330-
- Class name: `WorkflowRequestMessage`
331-
332-
| Property | Type | Description |
333-
| ------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
334-
| Bucket | string | Name of the bucket/directory name, which can be used to locate the payload on the shared storage. |
335-
| PayloadId | string (UUID) | A UUID generated by Informatics Gateway for internal use. |
336-
| Workflows | string[] | Workflows associated with the payload, if any. |
337-
| FileCount | int | Number of files in the payload. |
338-
| CorrelationId | string | For DIMSE, the correlation ID is the UUID associated with the first DICOM association received. For an ACR inference request, the correlation ID is the Transaction ID in the original request. |
339-
| CallingAeTitle | string | For DIMSE, the sender/calling AE Title of the DICOM dataset. For ACR requests, this is the transaction ID. |
340-
| CalledAeTitle | string | For DIMSE, the receiving AE Title of the DICOM dataset. For ACR requests, this field is empty. |
341-
| Timestamp | DateTime | Date & time in, UTC, when the payload was created. |
342-
| Payload | BlockStorageInfo[] | List of files in the payload . |
343-
344-
- Definition of *BlockStorageInfo*:
345-
346-
| Property | Type | Description |
347-
| -------- | ------ | ------------------------------------------------------------------------------------------ |
348-
| Path | string | Path to the file located relatively to the root of the bucket. |
349-
| Metadata | string | Path to the metadata file located relatively to the root of the bucket. *See notes below.* |
350-
351-
Notes:
352-
For DICOM files, the metadata file contains the serialized representation of a [DICOM JSON Model](https://dicom.nema.org/dicom/2013/output/chtml/part18/sect_F.2.html).
353-
The serialized file may or may not contain any binary blob depending on user's configuration as defined in [DicomConfiguration](../src/Configuration/DicomConfiguration.cs).
374+
- Class name: [WorkflowRequestEvent](https://github.com/Project-MONAI/monai-deploy-messaging/blob/develop/src/Messaging/Events/WorkflowRequestEvent.cs)
354375

355376
- Export Complete event
356377
- Routing Key: `md.export.complete`
357-
- Class name: `ExportCompleteMessage`
358-
359-
| Property | Type | Description |
360-
| ------------ | ------------- | ------------------------------------------------------------- |
361-
| WorkflowId | string (UUID) | A UUID generated by the Workflow Manager. |
362-
| ExportTaskId | string (UUID) | A UUID generated by the Workflow Manager for the export task. |
363-
| Status | string (enum) | Success (0), Failure (1), PartialFailure(2), Unknown(3) |
364-
| Message | string | Optional for error messages. |
378+
- Class name: [ExportCompleteEvent](https://github.com/Project-MONAI/monai-deploy-messaging/blob/develop/src/Messaging/Events/ExportCompleteEvent.cs)
365379

366380
##### Subscribed Events
367381

368382
- Export task event
369383
- Routing Key: `md.export.request.[agent name]`
370384
- DIMSE SCU Export Service: `md.export.request.monaiscu`
371385
- DICOMweb Export Service: `md.export.request.monaidicomweb`
372-
- Class name: `ExportRequestMessage`
373-
374-
| Property | Type | Description |
375-
| ------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
376-
| WorkflowId | string (UUID) | A UUID generated by the Workflow Manager. |
377-
| ExportTaskId | string (UUID) | A UUID generated by the Workflow Manager for the export task. |
378-
| Files | string[] | A list of files to be exported. |
379-
| Destination | string | Export destination. For DICOM C-STORE, a named DICOM destination. For ACR request, use the Transaction ID in the original request. |
380-
| CorrelationId | string | For DIMSE, the correlation ID is the UUID associated with the first DICOM association received. For an ACR inference request, use the Transaction ID in the original request. |
386+
- FHIR: TBD
387+
- HL7: TBD
388+
- Class name: [ExportRequestEvent](https://github.com/Project-MONAI/monai-deploy-messaging/blob/develop/src/Messaging/Events/ExportRequestEvent.cs)

guidelines/mig-drd.md renamed to guidelines/mig-srs.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,4 +484,23 @@ Setup notification service, make one of the dependencies unavailable, and expect
484484

485485
#### Target Release
486486

487-
MONAI Deploy Informatics Gateway R2
487+
TBD
488+
489+
### [REQ-FNC-06] MIG SHALL allow minimum data manipulation of incoming and outgoing data while data is in memory
490+
491+
#### Background
492+
493+
Accessing and managing large-scale medical data between storage devices or services has posed significant bottlenecks
494+
in medical systems. This requirement aims to address these challenges by enabling users to effortlessly manipulate data
495+
as it flows into the Informatics Gateway and just before it is saved to a designated storage service. Moreover, it
496+
empowers users to perform data manipulation at the moment the Informatics Gateway exports the data, ensuring a seamless
497+
and efficient data processing experience.
498+
499+
#### Verification Strategy
500+
501+
Configure suported inbound and export services with one or moreplug-ins and ensure the plug-ins are called in the automated testing.
502+
503+
#### Target Release
504+
505+
MONAI Deploy Informatics Gateway R4
506+

0 commit comments

Comments
 (0)