Skip to content

Commit

Permalink
Merge pull request #983 from Project-MONAI/nds-payload-add-workflownames
Browse files Browse the repository at this point in the history
fix for GetSeriesInstanceUID in payload table
  • Loading branch information
neildsouth committed May 23, 2024
2 parents b66663d + 14e90aa commit 790f4ac
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/WorkflowManager/Common/Services/PayloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public async Task<bool> DeletePayloadFromStorageAsync(string payloadId)

public Task<bool> UpdateAsyncWorkflowIds(Payload payload)
{
ArgumentNullException.ThrowIfNull(payload, nameof(payload));
ArgumentNullException.ThrowIfNull(payload);

return _payloadRepository.UpdateAsyncWorkflowIds(payload);
}
Expand Down
4 changes: 2 additions & 2 deletions src/WorkflowManager/Contracts/Models/Payload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class Payload : IDocument
[JsonProperty(PropertyName = "workflows")]
public IEnumerable<string> Workflows { get; set; } = [];

[JsonProperty(PropertyName = "workflow_names")]
public List<string> TriggeredWorkflowNames { get; set; } = [];
[JsonProperty(PropertyName = "triggered_workflow_names")]
public IEnumerable<string> TriggeredWorkflowNames { get; set; } = [];

[JsonProperty(PropertyName = "workflow_instance_ids")]
public IEnumerable<string> WorkflowInstanceIds { get; set; } = [];
Expand Down
1 change: 1 addition & 0 deletions src/WorkflowManager/Contracts/Models/PayloadDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public PayloadDto(Payload payload)
PatientDetails = payload.PatientDetails;
PayloadDeleted = payload.PayloadDeleted;
SeriesInstanceUid = payload.SeriesInstanceUid;
TriggeredWorkflowNames = payload.TriggeredWorkflowNames;
}

[JsonProperty(PropertyName = "payload_status")]
Expand Down
2 changes: 1 addition & 1 deletion src/WorkflowManager/Storage/Services/DicomService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public string GetValue(Dictionary<string, DicomValue> dict, string keyId)

if (dict.TryGetValue(DicomTagConstants.SeriesInstanceUIDTag, out var value))
{
return value.Value.ToString();
return JsonConvert.SerializeObject(value.Value);
}
return null;
}
Expand Down
4 changes: 4 additions & 0 deletions tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,15 @@ public async Task PayloadServiceCreate_Should_Call_GetExpiry()
[Fact]
public async Task UpdateAsync_NullPayload_ThrowsArgumentNullException()
{

#pragma warning disable CS8604 // Possible null reference argument.
// Arrange
Payload payload = null;

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / task-manager-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / task-manager-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / workflow-executor-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / workflow-executor-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / analyze

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / analyze

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Converting null literal or possible null value to non-nullable type.

// Act & Assert

await Assert.ThrowsAsync<ArgumentNullException>(() => PayloadService.UpdateAsyncWorkflowIds(payload));
#pragma warning restore CS8604 // Possible null reference argument.
}

}
Expand Down

0 comments on commit 790f4ac

Please sign in to comment.