Skip to content

Commit 56c76cb

Browse files
committed
some fixups
Signed-off-by: Neil South <[email protected]>
1 parent 634a484 commit 56c76cb

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

src/Api/Hl7ApplicationConfigEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
namespace Monai.Deploy.InformaticsGateway.Api
2828
{
29-
public class Hl7ApplicationConfigEntity : MongoDBEntityBase
29+
public sealed class Hl7ApplicationConfigEntity : MongoDBEntityBase
3030
{
3131
/// <summary>
3232
/// Gets or sets the name of a Hl7 application entity.

src/InformaticsGateway/Services/Common/InputHL7DataPlugInEngine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public async Task<Tuple<Message, FileStorageMetadata>> ExecutePlugInsAsync(Messa
5555
foreach (var plugin in _plugsins)
5656
{
5757
var nm = plugin.ToString();
58-
if (configItem is not null && configItem.PlugInAssemblies.Any(a => a.StartsWith(plugin.ToString()!)))
58+
if (configItem is not null && configItem.PlugInAssemblies.Exists(a => a.StartsWith(plugin.ToString()!)))
5959
{
6060
_logger.ExecutingInputDataPlugIn(plugin.Name);
6161
(hl7File, fileMetadata) = await plugin.ExecuteAsync(hl7File, fileMetadata).ConfigureAwait(false);

src/InformaticsGateway/Services/Export/ExportServiceBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ public async Task StopAsync(CancellationToken cancellationToken)
138138
await Task.Delay(250).ConfigureAwait(false);
139139
#pragma warning restore CA2016 // Forward the 'CancellationToken' parameter to methods
140140
_cancellationTokenSource.Dispose();
141-
return;
142141
}
143142

144143
private void SetupPolling()

src/InformaticsGateway/Services/HealthLevel7/MllpExtract.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ public async Task<Message> ExtractInfo(Hl7FileStorageMetadata meta, Message mess
105105
switch (type)
106106
{
107107
case DataLinkType.PatientId:
108-
return await _externalAppDetailsRepository.GetByPatientIdOutboundAsync(tagId, new CancellationToken()).ConfigureAwait(false); ;
108+
return await _externalAppDetailsRepository.GetByPatientIdOutboundAsync(tagId, new CancellationToken()).ConfigureAwait(false);
109109
case DataLinkType.StudyInstanceUid:
110-
return await _externalAppDetailsRepository.GetByStudyIdOutboundAsync(tagId, new CancellationToken()).ConfigureAwait(false); ;
110+
return await _externalAppDetailsRepository.GetByStudyIdOutboundAsync(tagId, new CancellationToken()).ConfigureAwait(false);
111111
default:
112112
break;
113113
}

src/InformaticsGateway/Services/HealthLevel7/MllpService.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ internal sealed class MllpService : IMllpService, IHostedService, IDisposable, I
6262
private readonly IMllpExtract _mIIpExtract;
6363
private readonly IInputHL7DataPlugInEngine _inputHL7DataPlugInEngine;
6464
private readonly IHl7ApplicationConfigRepository _hl7ApplicationConfigRepository;
65-
private DateTime _lastConfigRead = new(2000, 1, 1);
65+
private DateTime _lastConfigRead = new DateTime(2000, 1, 1);
6666

6767
public int ActiveConnections
6868
{
@@ -218,12 +218,11 @@ private async Task ConfigurePlugInEngine()
218218
if (configs is not null && configs.Any() && configs.Max(c => c.LastModified) > _lastConfigRead)
219219
{
220220
var pluginAssemblies = new List<string>();
221-
foreach (var config in configs.Where(p => p.PlugInAssemblies is not null && p.PlugInAssemblies.Count > 0))
221+
foreach (var config in configs.Where(p => p.PlugInAssemblies?.Count > 0))
222222
{
223223
try
224224
{
225-
var addMe = config.PlugInAssemblies.Where(p => pluginAssemblies.Any(a => a == p) is false);
226-
pluginAssemblies.AddRange(config.PlugInAssemblies.Where(p => pluginAssemblies.Any(a => a == p) is false));
225+
pluginAssemblies.AddRange(config.PlugInAssemblies.Where(p => pluginAssemblies.Contains(p) is false));
227226
}
228227
catch (Exception ex)
229228
{

0 commit comments

Comments
 (0)