From 4ec15c2333fc1194271980cd3e52543fb4abca2c Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 16 Sep 2025 17:14:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/CStoreSCPService.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index c173a9caa..15fb28701 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -47,6 +47,8 @@ namespace IRaCIS.Core.SCP.Service private List _SCPStudyIdList { get; set; } = new List(); + private List _StudyInstanceUIdList { get; set; } = new List(); + private SCPImageUpload _upload { get; set; } public HospitalGroup CurrentHospitalGroup { get; set; } @@ -167,7 +169,7 @@ namespace IRaCIS.Core.SCP.Service var _SCPImageUploadRepository = _serviceProvider.GetService>(); _upload.EndTime = DateTime.Now; - _upload.StudyCount = _SCPStudyIdList.Count; + _upload.StudyCount = _StudyInstanceUIdList.Count; //可能是测试echo 导致记录了 await _SCPImageUploadRepository.AddAsync(_upload, _upload.FileCount > 0 ? true : false); @@ -283,6 +285,11 @@ namespace IRaCIS.Core.SCP.Service return new DicomCStoreResponse(request, DicomStatus.Success); } + if (!_StudyInstanceUIdList.Contains(studyInstanceUid)) + { + _StudyInstanceUIdList.Add(studyInstanceUid); + } + Guid seriesId = IdentifierHelper.CreateGuid(studyInstanceUid, seriesInstanceUid); Guid instanceId = IdentifierHelper.CreateGuid(studyInstanceUid, seriesInstanceUid, sopInstanceUid); From 0f7b80ff63d6dbb1c74fe1f1e4a9b574236f3884 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 16 Sep 2025 17:56:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=BA=9F=E5=BC=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/CStoreSCPService.cs | 17 ----------------- IRC.Core.SCP/Service/DicomArchiveService.cs | 1 + 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index 15fb28701..a4f599084 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -256,23 +256,6 @@ namespace IRaCIS.Core.SCP.Service public async Task OnCStoreRequestAsync(DicomCStoreRequest request) { - #region 测试接收课题组信息 这里无法获取 - - //var privateTag = new DicomTag(0x9999, 0x1001); - //var groupIdsJsonStr = request.Dataset.GetSingleValueOrDefault(privateTag, string.Empty); - - //if (!string.IsNullOrEmpty(groupIdsJsonStr)) - //{ - // var projectGroupIds = JsonConvert.DeserializeObject>(groupIdsJsonStr); - - // Log.Logger.Information("收到课题组信息: " + string.Join(", ", projectGroupIds)); - - //} - #endregion - - - - string studyInstanceUid = request.Dataset.GetSingleValueOrDefault(DicomTag.StudyInstanceUID, string.Empty); string seriesInstanceUid = request.Dataset.GetSingleValueOrDefault(DicomTag.SeriesInstanceUID, string.Empty); diff --git a/IRC.Core.SCP/Service/DicomArchiveService.cs b/IRC.Core.SCP/Service/DicomArchiveService.cs index c17f2eac4..b1ec53800 100644 --- a/IRC.Core.SCP/Service/DicomArchiveService.cs +++ b/IRC.Core.SCP/Service/DicomArchiveService.cs @@ -219,6 +219,7 @@ namespace IRaCIS.Core.SCP.Service findStudy.DicomStudyDate = dataset.GetSingleValueOrDefault(DicomTag.StudyDate, string.Empty); findStudy.DicomStudyTime = dataset.GetSingleValueOrDefault(DicomTag.StudyTime, string.Empty); findStudy.CalledAE = calledAE; + findStudy.CallingAE = callingAE; findStudy.PatientName = dataset.GetSingleValueOrDefault(DicomTag.PatientName, string.Empty); findStudy.PatientSex = dataset.GetSingleValueOrDefault(DicomTag.PatientSex, string.Empty); findStudy.PatientAge = dataset.GetSingleValueOrDefault(DicomTag.PatientAge, string.Empty); From 2d06b12368c3097b0d5d7a245b5a17f3ebba245f Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 16 Sep 2025 18:05:47 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRC.Core.SCP/Service/DicomArchiveService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IRC.Core.SCP/Service/DicomArchiveService.cs b/IRC.Core.SCP/Service/DicomArchiveService.cs index b1ec53800..ced8e195d 100644 --- a/IRC.Core.SCP/Service/DicomArchiveService.cs +++ b/IRC.Core.SCP/Service/DicomArchiveService.cs @@ -223,6 +223,8 @@ namespace IRaCIS.Core.SCP.Service findStudy.PatientName = dataset.GetSingleValueOrDefault(DicomTag.PatientName, string.Empty); findStudy.PatientSex = dataset.GetSingleValueOrDefault(DicomTag.PatientSex, string.Empty); findStudy.PatientAge = dataset.GetSingleValueOrDefault(DicomTag.PatientAge, string.Empty); + + await _patientRepository.BatchUpdateNoTrackingAsync(t => t.Id == findStudy.PatientId, u => new SCPPatient() { LatestPushTime = DateTime.Now }); }