修改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
|
||||
</summary>
|
||||
</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>
|
||||
DicomAEService
|
||||
</summary>
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
client.NegotiateAsyncOps();
|
||||
|
||||
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(5);
|
||||
client.ServiceOptions.RequestTimeout = TimeSpan.FromSeconds(3);
|
||||
|
||||
var request = new DicomCEchoRequest
|
||||
{
|
||||
|
|
|
@ -2914,8 +2914,34 @@ namespace IRaCIS.Application.Services
|
|||
#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>
|
||||
|
@ -2942,9 +2968,11 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
if (find != null)
|
||||
{
|
||||
//// 设置 CancellationTokenSource
|
||||
//var cts = new CancellationTokenSource();
|
||||
//CancellationToken token = cts.Token;
|
||||
//测试失败
|
||||
if (!CEchoTest(find))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["Patient_PacsAENotOnline"]);
|
||||
}
|
||||
|
||||
var @lock = _distributedLockProvider.CreateLock($"CFind");
|
||||
|
||||
|
@ -3034,7 +3062,7 @@ namespace IRaCIS.Application.Services
|
|||
await client.AddRequestsAsync(requestList);
|
||||
|
||||
await client.SendAsync();
|
||||
}
|
||||
|
||||
|
||||
var resultInstanceUidList = result.Select(t => t.StudyInstanceUID).ToList();
|
||||
|
||||
|
@ -3045,6 +3073,9 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
item.IsStudyExist = existStudyIdList.Any(t => t == item.StudyInstanceUID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok(result, find);
|
||||
|
|
Loading…
Reference in New Issue