修改c-find 测试pacs在线与否
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
6b385b619a
commit
468224cae9
|
@ -13147,7 +13147,7 @@
|
||||||
DicomAEService
|
DicomAEService
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.DicomAEService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomAE},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo)">
|
<member name="M:IRaCIS.Core.Application.Service.DicomAEService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomAE},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||||
<summary>
|
<summary>
|
||||||
DicomAEService
|
DicomAEService
|
||||||
</summary>
|
</summary>
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
client.NegotiateAsyncOps();
|
client.NegotiateAsyncOps();
|
||||||
|
|
||||||
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(5);
|
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(3);
|
||||||
|
|
||||||
var request = new DicomCEchoRequest
|
var request = new DicomCEchoRequest
|
||||||
{
|
{
|
||||||
|
|
|
@ -2914,8 +2914,34 @@ namespace IRaCIS.Application.Services
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
private bool CEchoTest(DicomAE find)
|
||||||
|
{
|
||||||
|
var client = DicomClientFactory.Create(find.IP, find.Port, false, "test-callingAE", find.CalledAE);
|
||||||
|
|
||||||
|
|
||||||
|
client.NegotiateAsyncOps();
|
||||||
|
|
||||||
|
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(3);
|
||||||
|
|
||||||
|
var request = new DicomCEchoRequest
|
||||||
|
{
|
||||||
|
OnResponseReceived = (req, response) =>
|
||||||
|
{
|
||||||
|
|
||||||
|
if (response.Status == DicomStatus.Success)
|
||||||
|
{
|
||||||
|
find.IsTestOK = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
find.IsTestOK = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return find.IsTestOK;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取 检查列表
|
/// 获取 检查列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2942,9 +2968,11 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
if (find != null)
|
if (find != null)
|
||||||
{
|
{
|
||||||
//// 设置 CancellationTokenSource
|
//测试失败
|
||||||
//var cts = new CancellationTokenSource();
|
if (!CEchoTest(find))
|
||||||
//CancellationToken token = cts.Token;
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["Patient_PacsAENotOnline"]);
|
||||||
|
}
|
||||||
|
|
||||||
var @lock = _distributedLockProvider.CreateLock($"CFind");
|
var @lock = _distributedLockProvider.CreateLock($"CFind");
|
||||||
|
|
||||||
|
@ -3034,17 +3062,20 @@ namespace IRaCIS.Application.Services
|
||||||
await client.AddRequestsAsync(requestList);
|
await client.AddRequestsAsync(requestList);
|
||||||
|
|
||||||
await client.SendAsync();
|
await client.SendAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var resultInstanceUidList = result.Select(t => t.StudyInstanceUID).ToList();
|
||||||
|
|
||||||
|
var existStudyIdList = _studyRepository.Where(t => resultInstanceUidList.Contains(t.StudyInstanceUid))
|
||||||
|
.Select(t => t.StudyInstanceUid).ToList();
|
||||||
|
|
||||||
|
foreach (var item in result)
|
||||||
|
{
|
||||||
|
item.IsStudyExist = existStudyIdList.Any(t => t == item.StudyInstanceUID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var resultInstanceUidList = result.Select(t => t.StudyInstanceUID).ToList();
|
|
||||||
|
|
||||||
var existStudyIdList = _studyRepository.Where(t => resultInstanceUidList.Contains(t.StudyInstanceUid))
|
|
||||||
.Select(t => t.StudyInstanceUid).ToList();
|
|
||||||
|
|
||||||
foreach (var item in result)
|
|
||||||
{
|
|
||||||
item.IsStudyExist = existStudyIdList.Any(t => t == item.StudyInstanceUID);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(result, find);
|
return ResponseOutput.Ok(result, find);
|
||||||
|
|
Loading…
Reference in New Issue