增加日志记录发送Cmove
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
6f8b88422b
commit
c69b2569ce
|
@ -50,6 +50,7 @@ using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||||
using DocumentFormat.OpenXml.Vml.Office;
|
using DocumentFormat.OpenXml.Vml.Office;
|
||||||
using IRaCIS.Core.Infra.EFCore.Migrations;
|
using IRaCIS.Core.Infra.EFCore.Migrations;
|
||||||
using System.Dynamic;
|
using System.Dynamic;
|
||||||
|
using System.Threading.Channels;
|
||||||
|
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
|
@ -3152,15 +3153,17 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
DicomCMoveRequest.ResponseDelegate responseDelegate = (req, response) =>
|
DicomCMoveRequest.ResponseDelegate responseDelegate = (req, response) =>
|
||||||
{
|
{
|
||||||
if (response.Status.State == DicomState.Failure)
|
if (response.Status.State == DicomState.Failure || response.Status.State == DicomState.Cancel)
|
||||||
{
|
{
|
||||||
_logger.LogError($" Cmove Pacs 状态返回失败: {response.SOPClassUID.ToJsonNotIgnoreNull()}");
|
_logger.LogError($" Cmove Pacs 返回状态: {response.Status.State} {response.SOPClassUID.ToJsonNotIgnoreNull()}");
|
||||||
|
|
||||||
|
_fusionCache.Set<string?>(CacheKeys.CmoveStudyId(req.Dataset.GetString(DicomTag.StudyInstanceUID)), null, TimeSpan.FromSeconds(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断是否传输完成或中断,执行缓存清理
|
// 判断是否传输完成或中断,执行缓存清理
|
||||||
if (response.Status.State == DicomState.Success && response.Remaining == 0)
|
if (response.Status.State == DicomState.Success && response.Remaining == 0)
|
||||||
{
|
{
|
||||||
_fusionCache.Set<string?>(CacheKeys.CmoveStudyId(req.Dataset.GetString(DicomTag.StudyInstanceUID)), null, TimeSpan.FromSeconds(1));
|
_fusionCache.Set<string?>(CacheKeys.CmoveStudyId(req.Dataset.GetString(DicomTag.StudyInstanceUID)), null, TimeSpan.FromSeconds(1));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3192,7 +3195,16 @@ namespace IRaCIS.Application.Services
|
||||||
cmoveRequest.OnResponseReceived += responseDelegate;
|
cmoveRequest.OnResponseReceived += responseDelegate;
|
||||||
|
|
||||||
cmoveRequestList.Add(cmoveRequest);
|
cmoveRequestList.Add(cmoveRequest);
|
||||||
|
|
||||||
|
_logger.LogInformation($"执行 Cmove StudyInstanceUid:{item}");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogInformation($"忽略 Cmove StudyInstanceUid:{item}");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await client.AddRequestsAsync(cmoveRequestList);
|
await client.AddRequestsAsync(cmoveRequestList);
|
||||||
|
|
Loading…
Reference in New Issue