From c69b2569cec245257300ca509ed9475dd6d7bf02 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 7 Feb 2025 17:21:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=8F=91=E9=80=81Cmove?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Visit/PatientService.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index f1216a2b1..6ccf938a3 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -50,6 +50,7 @@ using static Microsoft.EntityFrameworkCore.DbLoggerCategory; using DocumentFormat.OpenXml.Vml.Office; using IRaCIS.Core.Infra.EFCore.Migrations; using System.Dynamic; +using System.Threading.Channels; namespace IRaCIS.Application.Services @@ -3152,15 +3153,17 @@ namespace IRaCIS.Application.Services { 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(CacheKeys.CmoveStudyId(req.Dataset.GetString(DicomTag.StudyInstanceUID)), null, TimeSpan.FromSeconds(1)); } // 判断是否传输完成或中断,执行缓存清理 if (response.Status.State == DicomState.Success && response.Remaining == 0) { - _fusionCache.Set(CacheKeys.CmoveStudyId(req.Dataset.GetString(DicomTag.StudyInstanceUID)), null, TimeSpan.FromSeconds(1)); + _fusionCache.Set(CacheKeys.CmoveStudyId(req.Dataset.GetString(DicomTag.StudyInstanceUID)), null, TimeSpan.FromSeconds(1)); } }; @@ -3192,7 +3195,16 @@ namespace IRaCIS.Application.Services cmoveRequest.OnResponseReceived += responseDelegate; cmoveRequestList.Add(cmoveRequest); + + _logger.LogInformation($"执行 Cmove StudyInstanceUid:{item}"); + } + else + { + _logger.LogInformation($"忽略 Cmove StudyInstanceUid:{item}"); + + } + } await client.AddRequestsAsync(cmoveRequestList);