Skip to content

Commit

Permalink
Merge pull request #235 from Project-MONAI/release/1.0.2
Browse files Browse the repository at this point in the history
Release/1.0.2
  • Loading branch information
neildsouth authored Oct 11, 2023
2 parents 0877434 + 14dd26d commit e6195b0
Show file tree
Hide file tree
Showing 15 changed files with 436 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,5 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

*/.idea/*
5 changes: 3 additions & 2 deletions src/Messaging/API/IMessageBrokerSubscriberService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public interface IMessageBrokerSubscriberService : IDisposable
string Name { get; }

/// <summary>
/// Subscribe to a message topic & queue and executes <c>messageReceivedCallback</c> asynchronously for every message that is received.
/// Subscribe to a message topic and queue and executes <c>messageReceivedCallback</c> asynchronously for every message that is received.

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / unit-test

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / unit-test

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / analyze (csharp)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / analyze (csharp)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / analyze (csharp)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / analyze (csharp)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / unit-test

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'

Check warning on line 36 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / unit-test

XML comment has badly formed XML -- 'Expected an end tag for element 'summary'.'
/// Either provide a topic, a queue or both.
/// A queue is generated if the name of the queue is not provided.
/// </summary>

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / unit-test

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / unit-test

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / analyze (csharp)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / analyze (csharp)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / analyze (csharp)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / analyze (csharp)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / unit-test

XML comment has badly formed XML -- 'End tag was not expected at this location.'

Check warning on line 39 in src/Messaging/API/IMessageBrokerSubscriberService.cs

View workflow job for this annotation

GitHub Actions / unit-test

XML comment has badly formed XML -- 'End tag was not expected at this location.'
Expand All @@ -43,7 +44,7 @@ public interface IMessageBrokerSubscriberService : IDisposable
void SubscribeAsync(string topic, string queue, Func<MessageReceivedEventArgs, Task> messageReceivedCallback, ushort prefetchCount = 0);

/// <summary>
/// Subscribe to a message topic & queue and executes <c>messageReceivedCallback</c> asynchronously for every message that is received.
/// Subscribe to a message topic and queue and executes <c>messageReceivedCallback</c> asynchronously for every message that is received.
/// Either provide a topic, a queue or both.
/// A queue is generated if the name of the queue is not provided.
/// </summary>
Expand Down
24 changes: 24 additions & 0 deletions src/Messaging/Common/Artifact.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2022-2023 MONAI Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace Monai.Deploy.Messaging.Common
{
public class Artifact
{
public ArtifactType Type { get; set; } = ArtifactType.Unset;
public string Path { get; set; } = string.Empty;
}
}
85 changes: 85 additions & 0 deletions src/Messaging/Common/ArtifactType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright 2022-2023 MONAI Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace Monai.Deploy.Messaging.Common
{
public enum ArtifactType
{
Unset, //Unset
AR, //Autorefraction
ASMT, //Content Assessment Results
AU, //Audio
BDUS, //Bone Densitometry (ultrasound)
BI, //Biomagnetic imaging
BMD, //Bone Densitometry (X-Ray)
CR, //Computed Radiography
CT, //Computed Tomography
DG, //Diaphanography
DOC, //Document
DX, //Digital Radiography
ECG, //Electrocardiography
EPS, //Cardiac Electrophysiology
ES, //Endoscopy
FID, //Fiducials
GM, //General Microscopy
HC, //Hard Copy
HD, //Hemodynamic Waveform
IO, //Intra-Oral Radiography
IOL, //Intraocular Lens Data
IVOCT, //Intravascular Optical Coherence Tomography
IVUS, //Intravascular Ultrasound
KER, //Keratometry
KO, //Key Object Selection
LEN, //Lensometry
LS, //Laser surface scan
MG, //Mammography
MR, //Magnetic Resonance
NM, //Nuclear Medicine
OAM, //Ophthalmic Axial Measurements
OCT, //Optical Coherence Tomography (non-Ophthalmic)
OP, //Ophthalmic Photography
OPM, //Ophthalmic Mapping
OPT, //Ophthalmic Tomography
OPV, //Ophthalmic Visual Field
OSS, //Optical Surface Scan
OT, //Other
PLAN, //Plan
PR, //Presentation State
PT, //Positron emission tomography (PET)
PX, //Panoramic X-Ray
REG, //Registration
RESP, //Respiratory Waveform
RF, //Radio Fluoroscopy
RG, //Radiographic imaging (conventional film/screen)
RTDOSE, //Radiotherapy Dose
RTIMAGE, //Radiotherapy Image
RTPLAN, //Radiotherapy Plan
RTRECORD, //RT Treatment Record
RTSTRUCT, //Radiotherapy Structure Set
RWV, //Real World Value Map
SEG, //Segmentation
SM, //Slide Microscopy
SMR, //Stereometric Relationship
SR, //SR Document
SRF, //Subjective Refraction
STAIN, //Automated Slide Stainer
TG, //Thermography
US, //Ultrasound
VA, //Visual Acuity
XA, //X-Ray Angiography
XC, //External-camera Photography
};
}
95 changes: 95 additions & 0 deletions src/Messaging/Common/ArtifactTypes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*
* Copyright 2022-2023 MONAI Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace Monai.Deploy.Messaging.Common
{
public static class ArtifactTypes
{
private static readonly Dictionary<ArtifactType, string> ListOfModularity = new()
{
{ ArtifactType.Unset, "Unset" },
{ ArtifactType.AR, "Autorefract" },
{ ArtifactType.ASMT, "Content Assessment Results" },
{ ArtifactType.AU, "Audio" },
{ ArtifactType.BDUS, "Bone Densitometry (ultrasound)" },
{ ArtifactType.BI, "Biomagnetic imaging" },
{ ArtifactType.BMD, "Bone Densitometry (X-Ray)" },
{ ArtifactType.CR, "Computed Radiography" },
{ ArtifactType.CT, "Computed Tomography" },
{ ArtifactType.DG, "Diaphanography" },
{ ArtifactType.DOC, "Document" },
{ ArtifactType.DX, "Digital Radiography" },
{ ArtifactType.ECG, "Electrocardiography" },
{ ArtifactType.EPS, "Cardiac Electrophysiology" },
{ ArtifactType.ES, "Endoscopy" },
{ ArtifactType.FID, "Fiducials" },
{ ArtifactType.GM, "General Microscopy" },
{ ArtifactType.HC, "Hard Copy" },
{ ArtifactType.HD, "Hemodynamic Waveform" },
{ ArtifactType.IO, "Intra-Oral Radiography" },
{ ArtifactType.IOL, "Intraocular Lens Data" },
{ ArtifactType.IVOCT, "Intravascular Optical Coherence Tomography" },
{ ArtifactType.IVUS, "Intravascular Ultrasound" },
{ ArtifactType.KER, "Keratometry" },
{ ArtifactType.KO, "Key Object Selection" },
{ ArtifactType.LEN, "Lensometry" },
{ ArtifactType.LS, "Laser surface scan" },
{ ArtifactType.MG, "Mammography" },
{ ArtifactType.MR, "Magnetic Resonance" },
{ ArtifactType.NM, "Nuclear Medicine" },
{ ArtifactType.OAM, "Ophthalmic Axial Measurements" },
{ ArtifactType.OCT, "Optical Coherence Tomography (non-Ophthalmic)" },
{ ArtifactType.OP, "Ophthalmic Photography" },
{ ArtifactType.OPM, "Ophthalmic Mapping" },
{ ArtifactType.OPT, "Ophthalmic Tomography" },
{ ArtifactType.OPV, "Ophthalmic Visual Field" },
{ ArtifactType.OSS, "Optical Surface Scan" },
{ ArtifactType.OT, "Other" },
{ ArtifactType.PLAN, "Plan" },
{ ArtifactType.PR, "Presentation State" },
{ ArtifactType.PT, "Positron emission tomography (PET)" },
{ ArtifactType.PX, "Panoramic X-Ray" },
{ ArtifactType.REG, "Registration" },
{ ArtifactType.RESP, "Respiratory Waveform" },
{ ArtifactType.RF, "Radio Fluoroscopy" },
{ ArtifactType.RG, "Radiographic imaging (conventional film/screen)" },
{ ArtifactType.RTDOSE, "Radiotherapy Dose" },
{ ArtifactType.RTIMAGE, "Radiotherapy Image" },
{ ArtifactType.RTPLAN, "Radiotherapy Plan" },
{ ArtifactType.RTRECORD, "RT Treatment Record" },
{ ArtifactType.RTSTRUCT, "Radiotherapy Structure Set" },
{ ArtifactType.RWV, "Real World Value Map" },
{ ArtifactType.SEG, "Segmentation" },
{ ArtifactType.SM, "Slide Microscopy" },
{ ArtifactType.SMR, "Stereometric Relationship" },
{ ArtifactType.SR, "SR Document" },
{ ArtifactType.SRF, "Subjective Refraction" },
{ ArtifactType.STAIN, "Automated Slide Stainer" },
{ ArtifactType.TG, "Thermography" },
{ ArtifactType.US, "Ultrasound" },
{ ArtifactType.VA, "Visual Acuity" },
{ ArtifactType.XA, "X-Ray Angiography" },
{ ArtifactType.XC, "External-camera Photography" },
};

public static bool Validate(string artifactType)
{
return ListOfModularity.Any(x =>
Enum.TryParse<ArtifactType>(artifactType, out var artifact)
&& x.Key == artifact);
}
}
}
4 changes: 2 additions & 2 deletions src/Messaging/Configuration/MessageBrokerServiceConfiguration.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public class MessageBrokerServiceConfiguration

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

/// <summary>
/// Gets or sets the a fully qualified type name of the message subscriber service.
/// The spcified type must implement <typeparam name="Monai.Deploy.InformaticsGateway.Api.MessageBroker.IMessageBrokerSubscriberService">IMessageBrokerSubscriberService</typeparam> interface.
/// The spcified type must implement <see cref="Monai.Deploy.Messaging.API.IMessageBrokerSubscriberService">IMessageBrokerSubscriberService</see> interface.
/// The default message subscriber service configured is RabbitMQ.
/// </summary>
[ConfigurationKeyName("subscriberServiceAssemblyName")]
Expand Down
60 changes: 60 additions & 0 deletions src/Messaging/Events/ArtifactsReceivedEvent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright 2022-2023 MONAI Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using Monai.Deploy.Messaging.Common;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace Monai.Deploy.Messaging.Events
{
public class ArtifactsReceivedEvent : EventBase
{
/// <summary>
/// Gets or sets the workflow instanceID generated by the Workflow Manager.
/// </summary>
[JsonProperty(PropertyName = "workflow_instance_id")]
[JsonPropertyName("workflow_instance_id")]
[Required]
public string WorkflowInstanceId { get; set; } = default!;

/// <summary>
/// Gets or sets the export task ID generated by the Workflow Manager.
/// </summary>
[JsonProperty(PropertyName = "task_id")]
[JsonPropertyName("task_id")]
[Required]
public string TaskId { get; set; } = default!;

/// <summary>
/// Gets or set the correlation ID.
/// For DIMSE, the correlation ID is the UUID associated with the first DICOM association received.
/// For ACR, use the Transaction ID in the original request.
/// </summary>
[JsonProperty(PropertyName = "correlation_id")]
[JsonPropertyName("correlation_id")]
[Required]
public string CorrelationId { get; set; } = default!;

/// <summary>
/// Gets or set the list of artifacts.
/// </summary>
[JsonProperty(PropertyName = "artifacts")]
[JsonPropertyName("artifacts")]
[Required]
public List<Artifact> Artifacts { get; set; } = new List<Artifact>();
}
}
15 changes: 10 additions & 5 deletions src/Messaging/Events/WorkflowRequestEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public class DataOrigin
[JsonPropertyName("destination")]
public string Destination { get; set; } = default!;

[JsonProperty(PropertyName = "fromExternalApp")]
[JsonPropertyName("fromExternalApp")]
public bool FromExternalApp { get; set; } = false;


public override int GetHashCode()
{
return HashCode.Combine(Source, Destination, DataService);
Expand All @@ -67,7 +72,7 @@ public override bool Equals(object? obj)
DataService.Equals(dataOrigin.DataService);
}
}

public enum DataService
{
/// <summary>
Expand All @@ -79,22 +84,22 @@ public enum DataService
/// Data received via DIMSE services
/// </summary>
DIMSE,

/// <summary>
/// Data received via DICOMWeb services
/// </summary>
DicomWeb,

/// <summary>
/// Data received via FHIR services
/// </summary>
FHIR,

/// <summary>
/// Data received via HL7 services
/// </summary>
HL7,

/// <summary>
/// Data received via ACR API call
/// </summary>
Expand Down
Loading

0 comments on commit e6195b0

Please sign in to comment.