-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dicom association controller. Signed-off-by: Lillie Dae <lillie.dae@answerdigital.com> --------- Signed-off-by: Lillie Dae <lillie.dae@answerdigital.com>
- Loading branch information
1 parent
8ceee8a
commit fefb2ea
Showing
22 changed files
with
963 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!-- | ||
~ Copyright 2021-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. | ||
--> | ||
|
||
# DICOM Association information | ||
|
||
The `/dicom-associations' endpoint is for retrieving a list of information regarding dicom | ||
associations. | ||
|
||
## GET /dicom-associations/ | ||
|
||
#### Query Parameters | ||
|
||
| Name | Type | Description | | ||
|------------|----------|---------------------------------------------| | ||
| startTime | DateTime | (Optional) Start date to query from. | | ||
| endTime | DateTime | (Optional) End date to query from. | | ||
| pageNumber | Number | (Optional) Page number to query.(default 0) | | ||
| pageSize | Number | (Optional) Page size of query. | | ||
|
||
Max & Defaults for PageSize can be set in appSettings. | ||
|
||
```json | ||
"endpointSettings": { | ||
"defaultPageSize": number, | ||
"maxPageSize": number | ||
} | ||
``` | ||
|
||
Endpoint returns a paged result for example | ||
|
||
```json | ||
{ | ||
"PageNumber": 1, | ||
"PageSize": 10, | ||
"FirstPage": "/payload?pageNumber=1&pageSize=10", | ||
"LastPage": "/payload?pageNumber=1&pageSize=10", | ||
"TotalPages": 1, | ||
"TotalRecords": 3, | ||
"NextPage": null, | ||
"PreviousPage": null, | ||
"Data": [...] | ||
"Succeeded": true, | ||
"Errors": null, | ||
"Message": null | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2021-2023 MONAI Consortium | ||
* Copyright 2019-2021 NVIDIA Corporation | ||
* | ||
* 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 Microsoft.Extensions.Configuration; | ||
|
||
namespace Monai.Deploy.InformaticsGateway.Configuration | ||
{ | ||
public class HttpEndpointSettings | ||
{ | ||
[ConfigurationKeyName("defaultPageSize")] | ||
public int DefaultPageSize { get; set; } = 10; | ||
|
||
[ConfigurationKeyName("maxPageSize")] | ||
public int MaxPageSize { get; set; } = 10; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/Database/MongoDB/Repositories/MongoDBRepositoryBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright 2021-2023 MONAI Consortium | ||
* Copyright 2019-2021 NVIDIA Corporation | ||
* | ||
* 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 System.Linq.Expressions; | ||
using MongoDB.Driver; | ||
|
||
namespace Monai.Deploy.InformaticsGateway.Database.MongoDB.Repositories | ||
{ | ||
public abstract class MongoDBRepositoryBase | ||
{ | ||
/// <summary> | ||
/// Get All T that match filters provided. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="collection">Collection to run against.</param> | ||
/// <param name="filterFunction">Filter function you can filter on properties of T.</param> | ||
/// <param name="sortFunction">Function used to sort data.</param> | ||
/// <param name="skip">Items to skip.</param> | ||
/// <param name="limit">Items to limit results by.</param> | ||
/// <returns></returns> | ||
protected static async Task<IList<T>> GetAllAsync<T>(IMongoCollection<T> collection, | ||
Expression<Func<T, bool>>? filterFunction, | ||
SortDefinition<T> sortFunction, | ||
int? skip = null, | ||
int? limit = null) | ||
{ | ||
return await collection | ||
.Find(filterFunction) | ||
.Skip(skip) | ||
.Limit(limit) | ||
.Sort(sortFunction) | ||
.ToListAsync().ConfigureAwait(false); | ||
} | ||
|
||
protected static async Task<IList<T>> GetAllAsync<T>(IMongoCollection<T> collection, | ||
FilterDefinition<T> filterFunction, | ||
SortDefinition<T> sortFunction, | ||
int? skip = null, | ||
int? limit = null) | ||
{ | ||
var result = await collection | ||
.Find(filterFunction) | ||
.Skip(skip) | ||
.Limit(limit) | ||
.Sort(sortFunction) | ||
.ToListAsync().ConfigureAwait(false); | ||
return result; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.