Skip to content

Commit e6195b0

Browse files
authored
Merge pull request #235 from Project-MONAI/release/1.0.2
Release/1.0.2
2 parents 0877434 + 14dd26d commit e6195b0

15 files changed

+436
-13
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,3 +350,5 @@ MigrationBackup/
350350

351351
# Ionide (cross platform F# VS Code tools) working folder
352352
.ionide/
353+
354+
*/.idea/*

src/Messaging/API/IMessageBrokerSubscriberService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public interface IMessageBrokerSubscriberService : IDisposable
3232
string Name { get; }
3333

3434
/// <summary>
35-
/// Subscribe to a message topic & queue and executes <c>messageReceivedCallback</c> asynchronously for every message that is received.
35+
/// Subscribe to a message topic and queue and executes <c>messageReceivedCallback</c> asynchronously for every message that is received.
36+
3637
/// Either provide a topic, a queue or both.
3738
/// A queue is generated if the name of the queue is not provided.
3839
/// </summary>
@@ -43,7 +44,7 @@ public interface IMessageBrokerSubscriberService : IDisposable
4344
void SubscribeAsync(string topic, string queue, Func<MessageReceivedEventArgs, Task> messageReceivedCallback, ushort prefetchCount = 0);
4445

4546
/// <summary>
46-
/// Subscribe to a message topic & queue and executes <c>messageReceivedCallback</c> asynchronously for every message that is received.
47+
/// Subscribe to a message topic and queue and executes <c>messageReceivedCallback</c> asynchronously for every message that is received.
4748
/// Either provide a topic, a queue or both.
4849
/// A queue is generated if the name of the queue is not provided.
4950
/// </summary>

src/Messaging/Common/Artifact.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright 2022-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+
namespace Monai.Deploy.Messaging.Common
18+
{
19+
public class Artifact
20+
{
21+
public ArtifactType Type { get; set; } = ArtifactType.Unset;
22+
public string Path { get; set; } = string.Empty;
23+
}
24+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright 2022-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+
namespace Monai.Deploy.Messaging.Common
18+
{
19+
public enum ArtifactType
20+
{
21+
Unset, //Unset
22+
AR, //Autorefraction
23+
ASMT, //Content Assessment Results
24+
AU, //Audio
25+
BDUS, //Bone Densitometry (ultrasound)
26+
BI, //Biomagnetic imaging
27+
BMD, //Bone Densitometry (X-Ray)
28+
CR, //Computed Radiography
29+
CT, //Computed Tomography
30+
DG, //Diaphanography
31+
DOC, //Document
32+
DX, //Digital Radiography
33+
ECG, //Electrocardiography
34+
EPS, //Cardiac Electrophysiology
35+
ES, //Endoscopy
36+
FID, //Fiducials
37+
GM, //General Microscopy
38+
HC, //Hard Copy
39+
HD, //Hemodynamic Waveform
40+
IO, //Intra-Oral Radiography
41+
IOL, //Intraocular Lens Data
42+
IVOCT, //Intravascular Optical Coherence Tomography
43+
IVUS, //Intravascular Ultrasound
44+
KER, //Keratometry
45+
KO, //Key Object Selection
46+
LEN, //Lensometry
47+
LS, //Laser surface scan
48+
MG, //Mammography
49+
MR, //Magnetic Resonance
50+
NM, //Nuclear Medicine
51+
OAM, //Ophthalmic Axial Measurements
52+
OCT, //Optical Coherence Tomography (non-Ophthalmic)
53+
OP, //Ophthalmic Photography
54+
OPM, //Ophthalmic Mapping
55+
OPT, //Ophthalmic Tomography
56+
OPV, //Ophthalmic Visual Field
57+
OSS, //Optical Surface Scan
58+
OT, //Other
59+
PLAN, //Plan
60+
PR, //Presentation State
61+
PT, //Positron emission tomography (PET)
62+
PX, //Panoramic X-Ray
63+
REG, //Registration
64+
RESP, //Respiratory Waveform
65+
RF, //Radio Fluoroscopy
66+
RG, //Radiographic imaging (conventional film/screen)
67+
RTDOSE, //Radiotherapy Dose
68+
RTIMAGE, //Radiotherapy Image
69+
RTPLAN, //Radiotherapy Plan
70+
RTRECORD, //RT Treatment Record
71+
RTSTRUCT, //Radiotherapy Structure Set
72+
RWV, //Real World Value Map
73+
SEG, //Segmentation
74+
SM, //Slide Microscopy
75+
SMR, //Stereometric Relationship
76+
SR, //SR Document
77+
SRF, //Subjective Refraction
78+
STAIN, //Automated Slide Stainer
79+
TG, //Thermography
80+
US, //Ultrasound
81+
VA, //Visual Acuity
82+
XA, //X-Ray Angiography
83+
XC, //External-camera Photography
84+
};
85+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* Copyright 2022-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+
namespace Monai.Deploy.Messaging.Common
18+
{
19+
public static class ArtifactTypes
20+
{
21+
private static readonly Dictionary<ArtifactType, string> ListOfModularity = new()
22+
{
23+
{ ArtifactType.Unset, "Unset" },
24+
{ ArtifactType.AR, "Autorefract" },
25+
{ ArtifactType.ASMT, "Content Assessment Results" },
26+
{ ArtifactType.AU, "Audio" },
27+
{ ArtifactType.BDUS, "Bone Densitometry (ultrasound)" },
28+
{ ArtifactType.BI, "Biomagnetic imaging" },
29+
{ ArtifactType.BMD, "Bone Densitometry (X-Ray)" },
30+
{ ArtifactType.CR, "Computed Radiography" },
31+
{ ArtifactType.CT, "Computed Tomography" },
32+
{ ArtifactType.DG, "Diaphanography" },
33+
{ ArtifactType.DOC, "Document" },
34+
{ ArtifactType.DX, "Digital Radiography" },
35+
{ ArtifactType.ECG, "Electrocardiography" },
36+
{ ArtifactType.EPS, "Cardiac Electrophysiology" },
37+
{ ArtifactType.ES, "Endoscopy" },
38+
{ ArtifactType.FID, "Fiducials" },
39+
{ ArtifactType.GM, "General Microscopy" },
40+
{ ArtifactType.HC, "Hard Copy" },
41+
{ ArtifactType.HD, "Hemodynamic Waveform" },
42+
{ ArtifactType.IO, "Intra-Oral Radiography" },
43+
{ ArtifactType.IOL, "Intraocular Lens Data" },
44+
{ ArtifactType.IVOCT, "Intravascular Optical Coherence Tomography" },
45+
{ ArtifactType.IVUS, "Intravascular Ultrasound" },
46+
{ ArtifactType.KER, "Keratometry" },
47+
{ ArtifactType.KO, "Key Object Selection" },
48+
{ ArtifactType.LEN, "Lensometry" },
49+
{ ArtifactType.LS, "Laser surface scan" },
50+
{ ArtifactType.MG, "Mammography" },
51+
{ ArtifactType.MR, "Magnetic Resonance" },
52+
{ ArtifactType.NM, "Nuclear Medicine" },
53+
{ ArtifactType.OAM, "Ophthalmic Axial Measurements" },
54+
{ ArtifactType.OCT, "Optical Coherence Tomography (non-Ophthalmic)" },
55+
{ ArtifactType.OP, "Ophthalmic Photography" },
56+
{ ArtifactType.OPM, "Ophthalmic Mapping" },
57+
{ ArtifactType.OPT, "Ophthalmic Tomography" },
58+
{ ArtifactType.OPV, "Ophthalmic Visual Field" },
59+
{ ArtifactType.OSS, "Optical Surface Scan" },
60+
{ ArtifactType.OT, "Other" },
61+
{ ArtifactType.PLAN, "Plan" },
62+
{ ArtifactType.PR, "Presentation State" },
63+
{ ArtifactType.PT, "Positron emission tomography (PET)" },
64+
{ ArtifactType.PX, "Panoramic X-Ray" },
65+
{ ArtifactType.REG, "Registration" },
66+
{ ArtifactType.RESP, "Respiratory Waveform" },
67+
{ ArtifactType.RF, "Radio Fluoroscopy" },
68+
{ ArtifactType.RG, "Radiographic imaging (conventional film/screen)" },
69+
{ ArtifactType.RTDOSE, "Radiotherapy Dose" },
70+
{ ArtifactType.RTIMAGE, "Radiotherapy Image" },
71+
{ ArtifactType.RTPLAN, "Radiotherapy Plan" },
72+
{ ArtifactType.RTRECORD, "RT Treatment Record" },
73+
{ ArtifactType.RTSTRUCT, "Radiotherapy Structure Set" },
74+
{ ArtifactType.RWV, "Real World Value Map" },
75+
{ ArtifactType.SEG, "Segmentation" },
76+
{ ArtifactType.SM, "Slide Microscopy" },
77+
{ ArtifactType.SMR, "Stereometric Relationship" },
78+
{ ArtifactType.SR, "SR Document" },
79+
{ ArtifactType.SRF, "Subjective Refraction" },
80+
{ ArtifactType.STAIN, "Automated Slide Stainer" },
81+
{ ArtifactType.TG, "Thermography" },
82+
{ ArtifactType.US, "Ultrasound" },
83+
{ ArtifactType.VA, "Visual Acuity" },
84+
{ ArtifactType.XA, "X-Ray Angiography" },
85+
{ ArtifactType.XC, "External-camera Photography" },
86+
};
87+
88+
public static bool Validate(string artifactType)
89+
{
90+
return ListOfModularity.Any(x =>
91+
Enum.TryParse<ArtifactType>(artifactType, out var artifact)
92+
&& x.Key == artifact);
93+
}
94+
}
95+
}

src/Messaging/Configuration/MessageBrokerServiceConfiguration.cs

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ public class MessageBrokerServiceConfiguration
2525

2626
/// <summary>
2727
/// Gets or sets the a fully qualified type name of the message publisher service.
28-
/// The spcified type must implement <typeparam name="Monai.Deploy.InformaticsGateway.Api.MessageBroker.IMessageBrokerPublisherService">IMessageBrokerPublisherService</typeparam> interface.
28+
/// The spcified type must implement <see cref="Monai.Deploy.Messaging.API.IMessageBrokerPublisherService">IMessageBrokerPublisherService</see> interface.
2929
/// The default message publisher service configured is RabbitMQ.
3030
/// </summary>
3131
[ConfigurationKeyName("publisherServiceAssemblyName")]
3232
public string PublisherServiceAssemblyName { get; set; } = DefaultPublisherAssemblyName;
3333

3434
/// <summary>
3535
/// Gets or sets the a fully qualified type name of the message subscriber service.
36-
/// The spcified type must implement <typeparam name="Monai.Deploy.InformaticsGateway.Api.MessageBroker.IMessageBrokerSubscriberService">IMessageBrokerSubscriberService</typeparam> interface.
36+
/// The spcified type must implement <see cref="Monai.Deploy.Messaging.API.IMessageBrokerSubscriberService">IMessageBrokerSubscriberService</see> interface.
3737
/// The default message subscriber service configured is RabbitMQ.
3838
/// </summary>
3939
[ConfigurationKeyName("subscriberServiceAssemblyName")]
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright 2022-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 Monai.Deploy.Messaging.Common;
18+
using Newtonsoft.Json;
19+
using System.ComponentModel.DataAnnotations;
20+
using System.Text.Json.Serialization;
21+
22+
namespace Monai.Deploy.Messaging.Events
23+
{
24+
public class ArtifactsReceivedEvent : EventBase
25+
{
26+
/// <summary>
27+
/// Gets or sets the workflow instanceID generated by the Workflow Manager.
28+
/// </summary>
29+
[JsonProperty(PropertyName = "workflow_instance_id")]
30+
[JsonPropertyName("workflow_instance_id")]
31+
[Required]
32+
public string WorkflowInstanceId { get; set; } = default!;
33+
34+
/// <summary>
35+
/// Gets or sets the export task ID generated by the Workflow Manager.
36+
/// </summary>
37+
[JsonProperty(PropertyName = "task_id")]
38+
[JsonPropertyName("task_id")]
39+
[Required]
40+
public string TaskId { get; set; } = default!;
41+
42+
/// <summary>
43+
/// Gets or set the correlation ID.
44+
/// For DIMSE, the correlation ID is the UUID associated with the first DICOM association received.
45+
/// For ACR, use the Transaction ID in the original request.
46+
/// </summary>
47+
[JsonProperty(PropertyName = "correlation_id")]
48+
[JsonPropertyName("correlation_id")]
49+
[Required]
50+
public string CorrelationId { get; set; } = default!;
51+
52+
/// <summary>
53+
/// Gets or set the list of artifacts.
54+
/// </summary>
55+
[JsonProperty(PropertyName = "artifacts")]
56+
[JsonPropertyName("artifacts")]
57+
[Required]
58+
public List<Artifact> Artifacts { get; set; } = new List<Artifact>();
59+
}
60+
}

src/Messaging/Events/WorkflowRequestEvent.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ public class DataOrigin
5454
[JsonPropertyName("destination")]
5555
public string Destination { get; set; } = default!;
5656

57+
[JsonProperty(PropertyName = "fromExternalApp")]
58+
[JsonPropertyName("fromExternalApp")]
59+
public bool FromExternalApp { get; set; } = false;
60+
61+
5762
public override int GetHashCode()
5863
{
5964
return HashCode.Combine(Source, Destination, DataService);
@@ -67,7 +72,7 @@ public override bool Equals(object? obj)
6772
DataService.Equals(dataOrigin.DataService);
6873
}
6974
}
70-
75+
7176
public enum DataService
7277
{
7378
/// <summary>
@@ -79,22 +84,22 @@ public enum DataService
7984
/// Data received via DIMSE services
8085
/// </summary>
8186
DIMSE,
82-
87+
8388
/// <summary>
8489
/// Data received via DICOMWeb services
8590
/// </summary>
8691
DicomWeb,
87-
92+
8893
/// <summary>
8994
/// Data received via FHIR services
9095
/// </summary>
9196
FHIR,
92-
97+
9398
/// <summary>
9499
/// Data received via HL7 services
95100
/// </summary>
96101
HL7,
97-
102+
98103
/// <summary>
99104
/// Data received via ACR API call
100105
/// </summary>

0 commit comments

Comments
 (0)