Skip to content

Commit 13a6e83

Browse files
authored
Merge pull request #391 from Project-MONAI/patch/0.3.18
Patch/0.3.18
2 parents 7b451ed + 6edaa54 commit 13a6e83

File tree

13 files changed

+164
-14
lines changed

13 files changed

+164
-14
lines changed

.github/.gitversion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ branches:
2929
ignore:
3030
sha: []
3131
merge-message-formats: {}
32-
next-version: 0.3.16
32+
next-version: 0.3.17

docs/api/rest/config.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,45 @@ curl --location --request GET 'http://localhost:5000/config/source/USEAST'
345345

346346
---
347347

348+
## GET /config/source/aetitle/{aeTitle}
349+
350+
Returns configurations for the specified calling (source) AET.
351+
352+
### Parameters
353+
354+
| Name | Type | Description |
355+
| ---- | ------ | ------------------------------------------ |
356+
| name | string | The aeTitle of an AE Title to be retrieved. |
357+
358+
### Responses
359+
360+
Response Content Type: JSON - [SourceApplicationEntity[]](xref:Monai.Deploy.InformaticsGateway.Api.SourceApplicationEntity).
361+
362+
| Code | Description |
363+
| ---- | --------------------------------------------------------------------------------------------------------------------------------------- |
364+
| 200 | AE Titles retrieved successfully. |
365+
| 404 | Named source not found. |
366+
| 500 | Server error. The response will be a [Problem details](https://datatracker.ietf.org/doc/html/rfc7807) object with server error details. |
367+
368+
### Example Request
369+
370+
```bash
371+
curl --location --request GET 'http://localhost:5000/config/source/aetitle/USEAST'
372+
```
373+
374+
### Example Response
375+
376+
```json
377+
[{
378+
"name": "USEAST",
379+
"aeTitle": "PACSUSEAST",
380+
"hostIp": "10.20.3.4"
381+
},
382+
{...}]
383+
```
384+
385+
---
386+
348387
## POST /config/source
349388

350389
Adds a new calling (source) AE Title to the Informatics Gateway to allow DICOM instances from the specified IP address and AE Title.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
~ limitations under the License.
1515
-->
1616

17-
# MONAI Deploy Informatics Gateway <small>v0.0.0</small>
17+
# MONAI Deploy Informatics Gateway
1818

1919
![NVIDIA](./images/MONAI-logo_color.svg)
2020

src/Common/packages.lock.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@
3434
"resolved": "17.2.3",
3535
"contentHash": "VcozGeE4SxIo0cnXrDHhbrh/Gb8KQnZ3BvMelvh+iw0PrIKtuuA46U2Xm4e4pgnaWFgT4RdZfTpWl/WPRdw0WQ=="
3636
},
37-
"System.IO.Abstractions": {
38-
"type": "Direct",
39-
"requested": "[17.2.3, )",
40-
"resolved": "17.2.3",
41-
"contentHash": "VcozGeE4SxIo0cnXrDHhbrh/Gb8KQnZ3BvMelvh+iw0PrIKtuuA46U2Xm4e4pgnaWFgT4RdZfTpWl/WPRdw0WQ=="
42-
},
4337
"System.Threading.Tasks.Dataflow": {
4438
"type": "Direct",
4539
"requested": "[6.0.0, )",

src/Database/Api/Repositories/ISourceApplicationEntityRepository.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public interface ISourceApplicationEntityRepository
2525

2626
Task<SourceApplicationEntity?> FindByNameAsync(string name, CancellationToken cancellationToken = default);
2727

28+
Task<SourceApplicationEntity[]?> FindByAETAsync(string name, CancellationToken cancellationToken = default);
29+
2830
Task<SourceApplicationEntity> AddAsync(SourceApplicationEntity item, CancellationToken cancellationToken = default);
2931

3032
Task<SourceApplicationEntity> UpdateAsync(SourceApplicationEntity entity, CancellationToken cancellationToken = default);

src/Database/EntityFramework/Repositories/SourceApplicationEntityRepository.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ public async Task<bool> ContainsAsync(Expression<Func<SourceApplicationEntity, b
8787
}).ConfigureAwait(false);
8888
}
8989

90+
public async Task<SourceApplicationEntity[]?> FindByAETAsync(string aeTitle, CancellationToken cancellationToken = default)
91+
{
92+
Guard.Against.NullOrWhiteSpace(aeTitle);
93+
94+
return await _retryPolicy.ExecuteAsync(async () =>
95+
{
96+
return await _dataset.Where(p => p.AeTitle.Equals(aeTitle)).ToArrayAsync(cancellationToken).ConfigureAwait(false);
97+
}).ConfigureAwait(false);
98+
}
99+
90100
public async Task<SourceApplicationEntity> RemoveAsync(SourceApplicationEntity entity, CancellationToken cancellationToken = default)
91101
{
92102
Guard.Against.Null(entity);

src/Database/EntityFramework/Test/SourceApplicationEntityRepositoryTest.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,20 @@ public async Task GivenAAETitleName_WhenFindByNameAsyncIsCalled_ExpectItToReturn
108108
Assert.Null(actual);
109109
}
110110

111+
[Fact]
112+
public async Task GivenAAETitleName_WhenFindByAETAsyncIsCalled_ExpectItToReturnMatchingEntity()
113+
{
114+
var store = new SourceApplicationEntityRepository(_serviceScopeFactory.Object, _logger.Object, _options);
115+
116+
var actual = await store.FindByAETAsync("AET1").ConfigureAwait(false);
117+
Assert.NotNull(actual);
118+
Assert.Equal("AET1", actual.FirstOrDefault()!.AeTitle);
119+
Assert.Equal("AET1", actual.FirstOrDefault()!.Name);
120+
121+
actual = await store.FindByAETAsync("AET6").ConfigureAwait(false);
122+
Assert.Empty(actual);
123+
}
124+
111125
[Fact]
112126
public async Task GivenASourceApplicationEntity_WhenRemoveIsCalled_ExpectItToDeleted()
113127
{

src/Database/MongoDB/Integration.Test/SourceApplicationEntityRepositoryTest.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ public async Task GivenAAETitleName_WhenFindByNameAsyncIsCalled_ExpectItToReturn
113113
Assert.Null(actual);
114114
}
115115

116+
[Fact]
117+
public async Task GivenAETitle_WhenFindByAETitleAsyncIsCalled_ExpectItToReturnMatchingEntity()
118+
{
119+
var store = new SourceApplicationEntityRepository(_serviceScopeFactory.Object, _logger.Object, _options, _databaseFixture.Options);
120+
121+
var actual = await store.FindByAETAsync("AET1").ConfigureAwait(false);
122+
Assert.NotNull(actual);
123+
Assert.Equal("AET1", actual.FirstOrDefault()!.AeTitle);
124+
Assert.Equal("AET1", actual.FirstOrDefault()!.Name);
125+
126+
actual = await store.FindByAETAsync("AET6").ConfigureAwait(false);
127+
Assert.Empty(actual);
128+
}
129+
116130
[Fact]
117131
public async Task GivenASourceApplicationEntity_WhenRemoveIsCalled_ExpectItToDeleted()
118132
{
@@ -158,5 +172,7 @@ public async Task GivenASourceApplicationEntity_WhenUpdatedIsCalled_ExpectItToSa
158172
Assert.NotNull(dbResult);
159173
Assert.Equal(expected.AeTitle, dbResult!.AeTitle);
160174
}
175+
176+
161177
}
162178
}

src/Database/MongoDB/Repositories/SourceApplicationEntityRepository.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ public async Task<List<SourceApplicationEntity>> ToListAsync(CancellationToken c
9797
}).ConfigureAwait(false);
9898
}
9999

100+
public async Task<SourceApplicationEntity[]?> FindByAETAsync(string aeTitle, CancellationToken cancellationToken = default)
101+
{
102+
return await _retryPolicy.ExecuteAsync(async () =>
103+
{
104+
return (await _collection
105+
.Find(x => x.AeTitle == aeTitle)
106+
.ToListAsync(cancellationToken).ConfigureAwait(false)).ToArray();
107+
}).ConfigureAwait(false);
108+
}
109+
100110
public async Task<SourceApplicationEntity> AddAsync(SourceApplicationEntity item, CancellationToken cancellationToken = default)
101111
{
102112
Guard.Against.Null(item);

src/DicomWebClient/packages.lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,8 +1248,8 @@
12481248
"monai.deploy.informaticsgateway.client.common": {
12491249
"type": "Project",
12501250
"dependencies": {
1251-
"Ardalis.GuardClauses": "4.0.1",
1252-
"System.Text.Json": "6.0.7"
1251+
"Ardalis.GuardClauses": "[4.0.1, )",
1252+
"System.Text.Json": "[6.0.7, )"
12531253
}
12541254
}
12551255
}

0 commit comments

Comments
 (0)