From 81aa7fb8ef6fbdb869b0551af84f822c6e3b63d0 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 31 Jul 2024 13:42:49 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=86=8D=E6=AC=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/StudyService.cs | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 5bf595a63..e3bac406e 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -145,6 +145,22 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] public async Task AddOrUpdateArchiveStudy(NewArchiveStudyCommand incommand) { + + var @uploadLock = _distributedLockProvider.CreateLock($"UploadDicom"); + + using (await @uploadLock.AcquireAsync()) + { + if (_provider.Exists($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}")) + { + //---当前已有人正在上传和归档该检查! + return ResponseOutput.NotOk(StaticData.International("UploadDownLoad_ArchiveInProgress")); + } + else + { + _provider.Set($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}", _userInfo.Id, TimeSpan.FromSeconds(30)); + } + } + var modalitys = string.Empty; try @@ -191,7 +207,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc study.SubjectVisitId = incommand.SubjectVisitId; //如果因为意外情况,连续点击两次,导致第一次插入了,第二次进来也会插入,在此判断一下 - var findStudy = await _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == study.Id); + var findStudy = await _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == study.Id); if (findStudy != null) { @@ -372,7 +388,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc VisitNum = t.SubjectVisit.VisitNum, IsDicom = true, - IsFromPACS=t.IsFromPACS, + IsFromPACS = t.IsFromPACS, SubjectCode = t.Subject.Code, @@ -422,7 +438,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc VisitNum = t.SubjectVisit.VisitNum, IsDicom = false, - IsFromPACS=false, + IsFromPACS = false, SubjectCode = t.Subject.Code, @@ -543,7 +559,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc path = (await _dicomInstanceRepository.Where(s => s.StudyId == studyId).Select(t => t.Path).FirstOrDefaultAsync()).IfNullThrowException(); - + using (var sw = ImageHelper.RenderPreviewJpeg(path)) { From ca41fac53d38c18e56aeb1421cfe80c158f9a0a6 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 31 Jul 2024 13:44:50 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E6=92=A4=E5=9B=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/StudyService.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index e3bac406e..13a2857bb 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -146,20 +146,20 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc public async Task AddOrUpdateArchiveStudy(NewArchiveStudyCommand incommand) { - var @uploadLock = _distributedLockProvider.CreateLock($"UploadDicom"); + //var @uploadLock = _distributedLockProvider.CreateLock($"UploadDicom"); - using (await @uploadLock.AcquireAsync()) - { - if (_provider.Exists($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}")) - { - //---当前已有人正在上传和归档该检查! - return ResponseOutput.NotOk(StaticData.International("UploadDownLoad_ArchiveInProgress")); - } - else - { - _provider.Set($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}", _userInfo.Id, TimeSpan.FromSeconds(30)); - } - } + //using (await @uploadLock.AcquireAsync()) + //{ + // if (_provider.Exists($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}")) + // { + // //---当前已有人正在上传和归档该检查! + // return ResponseOutput.NotOk(StaticData.International("UploadDownLoad_ArchiveInProgress")); + // } + // else + // { + // _provider.Set($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}", _userInfo.Id, TimeSpan.FromSeconds(30)); + // } + //} var modalitys = string.Empty; From d3f7c199c7b917768fe9943573dbe6fac76bbfb0 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 31 Jul 2024 14:05:38 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/StudyService.cs | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 13a2857bb..dbed0f7c8 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -146,20 +146,21 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc public async Task AddOrUpdateArchiveStudy(NewArchiveStudyCommand incommand) { - //var @uploadLock = _distributedLockProvider.CreateLock($"UploadDicom"); + var @uploadLock = _distributedLockProvider.CreateLock($"UploadDicom"); - //using (await @uploadLock.AcquireAsync()) - //{ - // if (_provider.Exists($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}")) - // { - // //---当前已有人正在上传和归档该检查! - // return ResponseOutput.NotOk(StaticData.International("UploadDownLoad_ArchiveInProgress")); - // } - // else - // { - // _provider.Set($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}", _userInfo.Id, TimeSpan.FromSeconds(30)); - // } - //} + using (await @uploadLock.AcquireAsync()) + { + if (_provider.Exists($"{incommand.TrialId}_{incommand.Study.StudyInstanceUid}")) + { + //---当前已有人正在上传和归档该检查! + return ResponseOutput.NotOk(StaticData.International("UploadDownLoad_ArchiveInProgress")); + } + else + { + //在事务未完成前 防止前端重复提交 + _provider.Set($"{incommand.TrialId}_{incommand.Study.StudyInstanceUid}", _userInfo.Id, TimeSpan.FromMinutes(3)); + } + } var modalitys = string.Empty; @@ -355,6 +356,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc finally { _provider.Remove($"StudyUid_{incommand.TrialId}_{incommand.Study.StudyInstanceUid}"); + _provider.Remove($"{incommand.TrialId}_{incommand.Study.StudyInstanceUid}"); } From aae243e36e331b9da3a7927b2280491e3c09a1d6 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 31 Jul 2024 15:08:28 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E9=A1=B9=E7=9B=AEdicom=20ae=20=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TrialSiteUser/TrialDicomAEService.cs | 10 +++++++++- .../Service/Visit/DTO/PatientViewModel.cs | 2 ++ .../Service/Visit/PatientService.cs | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs index 7c24b56c9..58d71629b 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs @@ -76,6 +76,14 @@ namespace IRaCIS.Core.Application.Service VerifyMsg = _localizer["TrialDicomAE_RepeatIPAndPort"] }; + var verifyExp2 = new EntityVerifyExp() + { + VerifyExp = u => u.IP == addOrEditDicomAE.CalledAE , + + //"AE名称不能与其他项目相同" + VerifyMsg = _localizer["TrialDicomAE_RepeatCalledAE"] + }; + //var verifyExp2 = new EntityVerifyExp() //{ // VerifyExp = u => u.TrialId == addOrEditDicomAE.TrialId, @@ -90,7 +98,7 @@ namespace IRaCIS.Core.Application.Service if (addOrEditDicomAE.IsPACSConnect) { // 在此处拷贝automapper 映射 - var entity = await _dicomAERepository.InsertOrUpdateAsync(addOrEditDicomAE, true, verifyExp1); + var entity = await _dicomAERepository.InsertOrUpdateAsync(addOrEditDicomAE, true, verifyExp1, verifyExp2); return ResponseOutput.Ok(entity.Id.ToString()); } diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs index 178dc34b8..05d8d3fcc 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs @@ -954,6 +954,8 @@ namespace IRaCIS.Application.Contracts public class SCPImageUploadQuery : PageInput { + [NotDefault] + public Guid TrialId { get; set; } public string TrialSiteKeyInfo { get; set; } public string? CallingAE { get; set; } diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index da2f95207..1d98ce922 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -75,7 +75,7 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task>> GetSCPImageUploadList(SCPImageUploadQuery inQuery) { - var query = _repository.Where() + var query = _repository.Where(t=>t.TrialId==inQuery.TrialId) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.CalledAE), t => t.CalledAE.Contains(inQuery.CalledAE)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAEIP), t => t.CallingAEIP.Contains(inQuery.CallingAEIP)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.CallingAE.Contains(inQuery.CallingAE)) From de01da975e26c4d529e14670701807493a2fdf53 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 31 Jul 2024 15:13:00 +0800 Subject: [PATCH 5/7] =?UTF-8?q?CalledAE=20=E5=90=8D=E5=AD=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TrialSiteUser/TrialDicomAEService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs index 58d71629b..b0e1be07c 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs @@ -78,7 +78,7 @@ namespace IRaCIS.Core.Application.Service var verifyExp2 = new EntityVerifyExp() { - VerifyExp = u => u.IP == addOrEditDicomAE.CalledAE , + VerifyExp = u => u.CalledAE == addOrEditDicomAE.CalledAE , //"AE名称不能与其他项目相同" VerifyMsg = _localizer["TrialDicomAE_RepeatCalledAE"] From cdbe74f1d94e259df9097536b00e9de8f7fbc638 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 31 Jul 2024 15:51:38 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=94=A8=E6=88=B7=E7=9A=84=E6=9C=BA=E6=9E=84?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Management/UserService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 7aab3e7b6..a719dbab3 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -560,7 +560,9 @@ namespace IRaCIS.Application.Services if (saveItem.IsZhiZhun) { - saveItem.OrganizationName = AppSettings.DefaultInternalOrganizationName; + var organizationName = _userInfo.IsEn_Us ? _systemEmailConfig.OrganizationName : _systemEmailConfig.OrganizationNameCN; + + saveItem.OrganizationName = organizationName; } From 7f5a3bffd1b300fc1b2373c48462adf70b8e4932 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 31 Jul 2024 16:11:55 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=9C=BA=E6=9E=84?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/appsettings.json | 1 - IRaCIS.Core.Domain/_Config/_AppSettings.cs | 2 -- 2 files changed, 3 deletions(-) diff --git a/IRaCIS.Core.API/appsettings.json b/IRaCIS.Core.API/appsettings.json index 59dd671c2..8fa44ed41 100644 --- a/IRaCIS.Core.API/appsettings.json +++ b/IRaCIS.Core.API/appsettings.json @@ -90,7 +90,6 @@ "DicomStudyCodePrefix": "ST", "SystemSiteCodePrefix": "S", "DefaultPassword": "123456", - "DefaultInternalOrganizationName": "ExtImaging", "ImageShareExpireDays": 10 }, diff --git a/IRaCIS.Core.Domain/_Config/_AppSettings.cs b/IRaCIS.Core.Domain/_Config/_AppSettings.cs index a4833050b..b4c890257 100644 --- a/IRaCIS.Core.Domain/_Config/_AppSettings.cs +++ b/IRaCIS.Core.Domain/_Config/_AppSettings.cs @@ -90,7 +90,6 @@ namespace IRaCIS.Core.Domain.Share public static string NoneDicomStudyCodePrefix { get; set; } - public static string DefaultInternalOrganizationName { get; set; } public static int ImageShareExpireDays { get; set; } = 7; @@ -123,7 +122,6 @@ namespace IRaCIS.Core.Domain.Share DefaultPassword = configuration.GetSection("IRaCISBasicConfig").GetValue("DefaultPassword"); SystemSiteCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue("SystemSiteCodePrefix"); - DefaultInternalOrganizationName = configuration.GetSection("IRaCISBasicConfig").GetValue("DefaultInternalOrganizationName"); ImageShareExpireDays = configuration.GetSection("IRaCISBasicConfig").GetValue("ImageShareExpireDays");