Skip to content

Merge changes from 0.3.6 into develop #294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions src/Api/Rest/InferenceRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public InputConnectionDetails? Application
{
get
{
return InputResources.FirstOrDefault(predicate => predicate.Interface == InputInterfaceType.Algorithm)?.ConnectionDetails;
return InputResources?.FirstOrDefault(predicate => predicate.Interface == InputInterfaceType.Algorithm)?.ConnectionDetails;
}
}

Expand Down Expand Up @@ -232,13 +232,13 @@ private void ValidateOUtputResources(List<string> errors)
{
Guard.Against.Null(errors);

if (InputMetadata.Inputs.IsNullOrEmpty())
if (InputMetadata is not null && InputMetadata.Inputs.IsNullOrEmpty())
{
errors.Add("Request has no `inputMetadata` defined. At least one `inputs` or `inputMetadata` required.");
}
else
else if (InputMetadata!.Inputs is not null)
{
foreach (var inputDetails in InputMetadata.Inputs)
foreach (var inputDetails in InputMetadata!.Inputs)
{
CheckInputMetadataDetails(inputDetails, errors);
}
Expand All @@ -249,7 +249,7 @@ private void ValidateInputMetadata(List<string> errors)
{
Guard.Against.Null(errors);

foreach (var output in OutputResources)
foreach (var output in OutputResources ?? Enumerable.Empty<RequestOutputDataResource>())
{
if (output.Interface == InputInterfaceType.DicomWeb)
{
Expand All @@ -267,12 +267,12 @@ private void ValidateInputResources(List<string> errors)
Guard.Against.Null(errors);

if (InputResources.IsNullOrEmpty() ||
!InputResources.Any(predicate => predicate.Interface != InputInterfaceType.Algorithm))
!InputResources!.Any(predicate => predicate.Interface != InputInterfaceType.Algorithm))
{
errors.Add("No 'inputResources' specified.");
}

foreach (var input in InputResources)
foreach (var input in InputResources ?? Enumerable.Empty<RequestInputDataResource>())
{
if (input.Interface == InputInterfaceType.DicomWeb)
{
Expand Down Expand Up @@ -326,7 +326,7 @@ private static void CheckInputMetadataWithTypeFhirResource(InferenceRequestDetai
{
errors.Add("Request type is set to `FHIR_RESOURCE` but no FHIR `resources` defined.");
}
else
else if (details.Resources is not null)
{
errors.AddRange(details.Resources.Where(resource => string.IsNullOrWhiteSpace(resource.Type)).Select(resource => "A FHIR resource type cannot be empty."));
}
Expand All @@ -341,7 +341,7 @@ private static void CheckInputMetadataWithTypDicomUid(InferenceRequestDetails de
{
errors.Add("Request type is set to `DICOM_UID` but no `studies` defined.");
}
else
else if (details.Studies is not null)
{
foreach (var study in details.Studies)
{
Expand All @@ -358,39 +358,40 @@ private static void CheckInputMetadataWithTypDicomUid(InferenceRequestDetails de

private static void CheckInputMetadataWithTypeDicomSeries(List<string> errors, RequestedStudy study)
{
foreach (var series in study.Series)
foreach (var series in study.Series ?? Enumerable.Empty<RequestedSeries>())
{
if (string.IsNullOrWhiteSpace(series.SeriesInstanceUid))
{
errors.Add("`SeriesInstanceUID` cannot be empty.");
}

if (series.Instances is null) continue;

errors.AddRange(
series.Instances
.Where(
instance => instance.SopInstanceUid.IsNullOrEmpty() ||
instance.SopInstanceUid.Any(p => string.IsNullOrWhiteSpace(p)))
instance.SopInstanceUid!.Any(p => string.IsNullOrWhiteSpace(p)))
.Select(instance => "`SOPInstanceUID` cannot be empty."));
}
}

private static void CheckFhirConnectionDetails(string source, List<string> errors, DicomWebConnectionDetails connection)
private static void CheckFhirConnectionDetails(string source, List<string> errors, DicomWebConnectionDetails? connection)
{
if (!Uri.IsWellFormedUriString(connection.Uri, UriKind.Absolute))
if (connection is not null && !Uri.IsWellFormedUriString(connection.Uri, UriKind.Absolute))
{
errors.Add($"The provided URI '{connection.Uri}' in `{source}` is not well formed.");
}
}

private static void CheckDicomWebConnectionDetails(string source, List<string> errors, DicomWebConnectionDetails connection)
private static void CheckDicomWebConnectionDetails(string source, List<string> errors, DicomWebConnectionDetails? connection)
{
if (connection.AuthType != ConnectionAuthType.None && string.IsNullOrWhiteSpace(connection.AuthId))
if (connection is not null && connection.AuthType != ConnectionAuthType.None && string.IsNullOrWhiteSpace(connection.AuthId))
{
errors.Add($"One of the '{source}' has authType of '{connection.AuthType:F}' but does not include a valid value for 'authId'");
}

if (!Uri.IsWellFormedUriString(connection.Uri, UriKind.Absolute))
if (connection is not null && !Uri.IsWellFormedUriString(connection.Uri, UriKind.Absolute))
{
errors.Add($"The provided URI '{connection.Uri}' is not well formed.");
}
Expand Down
20 changes: 10 additions & 10 deletions src/Api/Test/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1267,22 +1267,22 @@
"monai.deploy.informaticsgateway.api": {
"type": "Project",
"dependencies": {
"Macross.Json.Extensions": "[3.0.0, )",
"Microsoft.EntityFrameworkCore.Abstractions": "[6.0.12, )",
"Monai.Deploy.InformaticsGateway.Common": "[1.0.0, )",
"Monai.Deploy.Messaging": "[0.1.19, )",
"Monai.Deploy.Storage": "[0.2.13, )"
"Macross.Json.Extensions": "3.0.0",
"Microsoft.EntityFrameworkCore.Abstractions": "6.0.12",
"Monai.Deploy.InformaticsGateway.Common": "1.0.0",
"Monai.Deploy.Messaging": "0.1.19",
"Monai.Deploy.Storage": "0.2.13"
}
},
"monai.deploy.informaticsgateway.common": {
"type": "Project",
"dependencies": {
"Ardalis.GuardClauses": "[4.0.1, )",
"System.IO.Abstractions": "[17.2.3, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )",
"fo-dicom": "[5.0.3, )"
"Ardalis.GuardClauses": "4.0.1",
"System.IO.Abstractions": "17.2.3",
"System.Threading.Tasks.Dataflow": "6.0.0",
"fo-dicom": "5.0.3"
}
}
}
}
}
}
10 changes: 5 additions & 5 deletions src/Api/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,12 @@
"monai.deploy.informaticsgateway.common": {
"type": "Project",
"dependencies": {
"Ardalis.GuardClauses": "[4.0.1, )",
"System.IO.Abstractions": "[17.2.3, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )",
"fo-dicom": "[5.0.3, )"
"Ardalis.GuardClauses": "4.0.1",
"System.IO.Abstractions": "17.2.3",
"System.Threading.Tasks.Dataflow": "6.0.0",
"fo-dicom": "5.0.3"
}
}
}
}
}
}
56 changes: 28 additions & 28 deletions src/CLI/Test/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1553,55 +1553,55 @@
"mig-cli": {
"type": "Project",
"dependencies": {
"Crayon": "[2.0.69, )",
"Docker.DotNet": "[3.125.12, )",
"Microsoft.Extensions.Hosting": "[6.0.1, )",
"Microsoft.Extensions.Logging": "[6.0.0, )",
"Microsoft.Extensions.Logging.Console": "[6.0.0, )",
"Monai.Deploy.InformaticsGateway.Api": "[1.0.0, )",
"Monai.Deploy.InformaticsGateway.Client": "[1.0.0, )",
"Monai.Deploy.InformaticsGateway.Common": "[1.0.0, )",
"System.CommandLine": "[2.0.0-beta4.22272.1, )",
"System.CommandLine.Hosting": "[0.4.0-alpha.22272.1, )",
"System.CommandLine.Rendering": "[0.4.0-alpha.22272.1, )",
"System.IO.Abstractions": "[17.2.3, )"
"Crayon": "2.0.69",
"Docker.DotNet": "3.125.12",
"Microsoft.Extensions.Hosting": "6.0.1",
"Microsoft.Extensions.Logging": "6.0.0",
"Microsoft.Extensions.Logging.Console": "6.0.0",
"Monai.Deploy.InformaticsGateway.Api": "1.0.0",
"Monai.Deploy.InformaticsGateway.Client": "1.0.0",
"Monai.Deploy.InformaticsGateway.Common": "1.0.0",
"System.CommandLine": "2.0.0-beta4.22272.1",
"System.CommandLine.Hosting": "0.4.0-alpha.22272.1",
"System.CommandLine.Rendering": "0.4.0-alpha.22272.1",
"System.IO.Abstractions": "17.2.3"
}
},
"monai.deploy.informaticsgateway.api": {
"type": "Project",
"dependencies": {
"Macross.Json.Extensions": "[3.0.0, )",
"Microsoft.EntityFrameworkCore.Abstractions": "[6.0.12, )",
"Monai.Deploy.InformaticsGateway.Common": "[1.0.0, )",
"Monai.Deploy.Messaging": "[0.1.19, )",
"Monai.Deploy.Storage": "[0.2.13, )"
"Macross.Json.Extensions": "3.0.0",
"Microsoft.EntityFrameworkCore.Abstractions": "6.0.12",
"Monai.Deploy.InformaticsGateway.Common": "1.0.0",
"Monai.Deploy.Messaging": "0.1.19",
"Monai.Deploy.Storage": "0.2.13"
}
},
"monai.deploy.informaticsgateway.client": {
"type": "Project",
"dependencies": {
"Microsoft.AspNet.WebApi.Client": "[5.2.9, )",
"Microsoft.Extensions.Http": "[6.0.0, )",
"Monai.Deploy.InformaticsGateway.Api": "[1.0.0, )",
"Monai.Deploy.InformaticsGateway.Client.Common": "[1.0.0, )"
"Microsoft.AspNet.WebApi.Client": "5.2.9",
"Microsoft.Extensions.Http": "6.0.0",
"Monai.Deploy.InformaticsGateway.Api": "1.0.0",
"Monai.Deploy.InformaticsGateway.Client.Common": "1.0.0"
}
},
"monai.deploy.informaticsgateway.client.common": {
"type": "Project",
"dependencies": {
"Ardalis.GuardClauses": "[4.0.1, )",
"System.Text.Json": "[6.0.7, )"
"Ardalis.GuardClauses": "4.0.1",
"System.Text.Json": "6.0.7"
}
},
"monai.deploy.informaticsgateway.common": {
"type": "Project",
"dependencies": {
"Ardalis.GuardClauses": "[4.0.1, )",
"System.IO.Abstractions": "[17.2.3, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )",
"fo-dicom": "[5.0.3, )"
"Ardalis.GuardClauses": "4.0.1",
"System.IO.Abstractions": "17.2.3",
"System.Threading.Tasks.Dataflow": "6.0.0",
"fo-dicom": "5.0.3"
}
}
}
}
}
}
32 changes: 16 additions & 16 deletions src/CLI/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1421,38 +1421,38 @@
"monai.deploy.informaticsgateway.api": {
"type": "Project",
"dependencies": {
"Macross.Json.Extensions": "[3.0.0, )",
"Microsoft.EntityFrameworkCore.Abstractions": "[6.0.12, )",
"Monai.Deploy.InformaticsGateway.Common": "[1.0.0, )",
"Monai.Deploy.Messaging": "[0.1.19, )",
"Monai.Deploy.Storage": "[0.2.13, )"
"Macross.Json.Extensions": "3.0.0",
"Microsoft.EntityFrameworkCore.Abstractions": "6.0.12",
"Monai.Deploy.InformaticsGateway.Common": "1.0.0",
"Monai.Deploy.Messaging": "0.1.19",
"Monai.Deploy.Storage": "0.2.13"
}
},
"monai.deploy.informaticsgateway.client": {
"type": "Project",
"dependencies": {
"Microsoft.AspNet.WebApi.Client": "[5.2.9, )",
"Microsoft.Extensions.Http": "[6.0.0, )",
"Monai.Deploy.InformaticsGateway.Api": "[1.0.0, )",
"Monai.Deploy.InformaticsGateway.Client.Common": "[1.0.0, )"
"Microsoft.AspNet.WebApi.Client": "5.2.9",
"Microsoft.Extensions.Http": "6.0.0",
"Monai.Deploy.InformaticsGateway.Api": "1.0.0",
"Monai.Deploy.InformaticsGateway.Client.Common": "1.0.0"
}
},
"monai.deploy.informaticsgateway.client.common": {
"type": "Project",
"dependencies": {
"Ardalis.GuardClauses": "[4.0.1, )",
"System.Text.Json": "[6.0.7, )"
"Ardalis.GuardClauses": "4.0.1",
"System.Text.Json": "6.0.7"
}
},
"monai.deploy.informaticsgateway.common": {
"type": "Project",
"dependencies": {
"Ardalis.GuardClauses": "[4.0.1, )",
"System.IO.Abstractions": "[17.2.3, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )",
"fo-dicom": "[5.0.3, )"
"Ardalis.GuardClauses": "4.0.1",
"System.IO.Abstractions": "17.2.3",
"System.Threading.Tasks.Dataflow": "6.0.0",
"fo-dicom": "5.0.3"
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/Client.Common/Test/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,8 @@
"monai.deploy.informaticsgateway.client.common": {
"type": "Project",
"dependencies": {
"Ardalis.GuardClauses": "[4.0.1, )",
"System.Text.Json": "[6.0.7, )"
"Ardalis.GuardClauses": "4.0.1",
"System.Text.Json": "6.0.7"
}
}
}
Expand Down
Loading