From cee9d92a721d103704f9b2e4a64770de5d7074f0 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 9 Sep 2025 10:49:41 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E9=A2=98?= =?UTF-8?q?=E7=BB=84=20=E5=92=8C=E5=AF=BC=E8=A1=A8=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Common/ExcelExportService.cs | 1 + IRaCIS.Core.Application/Service/Management/UserService.cs | 4 ++-- IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs | 2 +- IRaCIS.Core.Application/Service/QC/_MapConfig.cs | 2 +- IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 0d31f69b6..0b497bc62 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -1601,6 +1601,7 @@ namespace IRaCIS.Core.Application.Service.Common .WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate); + var list = new List(); var taskList = new List(); diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 92f12e3bb..5baefb37d 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -597,7 +597,7 @@ namespace IRaCIS.Core.Application.Service }; - await _trialIdentityUserRepository.AddAsync(currentUser,true); + await _trialIdentityUserRepository.AddAsync(currentUser, true); } } @@ -1338,7 +1338,7 @@ namespace IRaCIS.Core.Application.Service UserName = t.IdentityUser.UserName, UserTypeShortName = t.UserTypeRole.UserTypeShortName, - HospitalGroupList = t.IdentityUser.IdentityUserHospitalGroupList.Where(t => t.IsDisabled == false).Select(t => new HospitalGroupInfo() + HospitalGroupList = t.IdentityUser.IdentityUserHospitalGroupList.Where(t => t.IsDisabled == false /*&& t.HospitalGroup.IsEnable == true*/).Select(t => new HospitalGroupInfo() { Id = t.HospitalGroupId, IsManager = t.IsManager, diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index fa89c036b..2a9a33da8 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -1176,7 +1176,7 @@ namespace IRaCIS.Core.Application.Contracts public List SubjectCriterionReadingPeriodVisitNumList { get; set; } - public String TrialSiteCode { get; set; } = String.Empty; + //public String TrialSiteCode { get; set; } = String.Empty; public string SubjectCode { get; set; } = String.Empty; public Guid Id { get; set; } diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index f7075ff93..dc82c05dd 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -267,7 +267,7 @@ namespace IRaCIS.Core.Application.Service //.ForMember(o => o.ResearchProgramNo, t => t.MapFrom(u => u.Trial.ResearchProgramNo)) //.ForMember(o => o.VisitName, t => t.MapFrom(u => u.SourceSubjectVisit.VisitName)) - .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode)) + //.ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode)) //.ForMember(o => o.LatestScanDate, t => t.MapFrom(u => u.SourceSubjectVisit.LatestScanDate)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code)) .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)) diff --git a/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs b/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs index 43f8930e4..c9f53c956 100644 --- a/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs +++ b/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs @@ -43,7 +43,7 @@ public class HospitalGroupService(IRepository _hospitalGroupRepos public async Task> GetHospitalGroupList(HospitalGroupQuery inQuery) { - var hospitalGroupQueryable = _hospitalGroupRepository + var hospitalGroupQueryable = _hospitalGroupRepository.Where(t => t.IsEnable == true)//都是查询启用的 .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Code), t => t.Code.Contains(inQuery.Code)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.Name.Contains(inQuery.Name)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation)) @@ -51,7 +51,7 @@ public class HospitalGroupService(IRepository _hospitalGroupRepos .WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactName), t => t.ContactName.Contains(inQuery.ContactName)) .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, t => _userInfo.HospitalGroupAdminIdList.Contains(t.Id)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.CallingAE.Contains(inQuery.CallingAE)) - .WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable) + //.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable) .ProjectTo(_mapper.ConfigurationProvider); var pageList = await hospitalGroupQueryable.SortToListAsync(inQuery); From 81d9fcae2e2792b74f12dc8f610c4d907a69e9a8 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 9 Sep 2025 11:38:17 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Visit/PatientService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 35531a08c..4eeeca0f9 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -963,7 +963,8 @@ namespace IRaCIS.Application.Services if (_studySubjectVisitRepository.Any(t => t.SCPStudyId == scpStudyId && t.StudyId != null)) { - return ResponseOutput.NotOk("该检查已绑定某项目下受试者访视(不一定是你所创建的项目)并已提交生成任务,不允许删除该检查"); + //"该检查已绑定某项目下受试者访视(不一定是你所创建的项目)并已提交生成任务,不允许删除该检查" + return ResponseOutput.NotOk(_localizer["Patient_SCPStudyVisitBindedSubmit"]); } else { From db2bd6b7254722796958b84bd15f30eed414687e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 9 Sep 2025 11:42:20 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs | 2 ++ IRaCIS.Core.Application/Service/Management/UserService.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs index c9412e436..340b3a327 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs @@ -321,6 +321,8 @@ namespace IRaCIS.Application.Contracts public DateTime? BeginLastChangePassWordTime { get; set; } public DateTime? EndLastChangePassWordTime { get; set; } + + public Guid? HospitalGroupId { get; set; } } public class UserRoleInfoDTO diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 5baefb37d..39f4fe9a7 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -479,6 +479,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.UserState != null, t => t.Status == inQuery.UserState) .WhereIf(inQuery.IsTestUser != null, t => t.IsTestUser == inQuery.IsTestUser) .WhereIf(inQuery.IsZhiZhun != null, t => t.IsZhiZhun == inQuery.IsZhiZhun) + .WhereIf(inQuery.HospitalGroupId != null, t => t.IdentityUserHospitalGroupList.Any(t => t.HospitalGroupId == inQuery.HospitalGroupId)) //OA 不能看admin .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.OA, t => !t.UserRoleList.Any(t => t.UserTypeEnum == UserTypeEnum.Admin || t.UserTypeEnum == UserTypeEnum.SuperAdmin)) From 563be56d270c04e80325c1737544e6c48496ba98 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 9 Sep 2025 13:19:09 +0800 Subject: [PATCH 4/5] =?UTF-8?q?PM=20=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=AF=BE=E9=A2=98=E7=BB=84=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Management/UserService.cs | 2 +- IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 39f4fe9a7..ccfe69ac8 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -479,7 +479,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.UserState != null, t => t.Status == inQuery.UserState) .WhereIf(inQuery.IsTestUser != null, t => t.IsTestUser == inQuery.IsTestUser) .WhereIf(inQuery.IsZhiZhun != null, t => t.IsZhiZhun == inQuery.IsZhiZhun) - .WhereIf(inQuery.HospitalGroupId != null, t => t.IdentityUserHospitalGroupList.Any(t => t.HospitalGroupId == inQuery.HospitalGroupId)) + .WhereIf(inQuery.HospitalGroupId != null, t => t.IdentityUserHospitalGroupList.Any(t => t.HospitalGroupId == inQuery.HospitalGroupId)) //OA 不能看admin .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.OA, t => !t.UserRoleList.Any(t => t.UserTypeEnum == UserTypeEnum.Admin || t.UserTypeEnum == UserTypeEnum.SuperAdmin)) diff --git a/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs b/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs index c9f53c956..7eee0cd4e 100644 --- a/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs +++ b/IRaCIS.Core.Application/Service/Visit/HospitalGroupService.cs @@ -49,6 +49,7 @@ public class HospitalGroupService(IRepository _hospitalGroupRepos .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Affiliation), t => t.Affiliation.Contains(inQuery.Affiliation)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactPhone), t => t.ContactPhone.Contains(inQuery.ContactPhone)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.ContactName), t => t.ContactName.Contains(inQuery.ContactName)) + .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager, t => _userInfo.HospitalGroupIdList.Contains(t.Id)) .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.GA, t => _userInfo.HospitalGroupAdminIdList.Contains(t.Id)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.CallingAE.Contains(inQuery.CallingAE)) //.WhereIf(inQuery.IsEnable != null, t => t.IsEnable == inQuery.IsEnable) From 758e0aedcb05ef11e45913af62bb48e6bfbc0cbf Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 9 Sep 2025 14:41:04 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E6=A3=80=E6=9F=A5=E8=AF=BE=E9=A2=98=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Visit/PatientService.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 4eeeca0f9..f66f885dd 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -1378,9 +1378,12 @@ namespace IRaCIS.Application.Services [TrialGlobalLimit("AfterStopCannNotOpt")] public async Task AutoBindingPatientStudyVisit(AutoBindingPatientStudyVisitCommand inCommand) { + var trialHospitalGroupId = await _trialRepository.Where(t => t.Id == inCommand.TrialId).Select(t => t.HospitalGroupId).FirstOrDefaultAsync(); + //找到已绑定患者,但是没绑定检查的 新来的检查->现在换成未提交的 //var query = from scpStudy in _studyRepository.Where(t => !t.SCPStudySubjectVisitList.Any(t => t.TrialId == inCommand.TrialId)) var query = from scpStudy in _studyRepository.Where(t => !t.SCPStudySubjectVisitList.Any(t => t.TrialId == inCommand.TrialId && t.SubjectVisit.SubmitState == SubmitStateEnum.Submitted)) + .Where(t => t.HospitalGroupList.Any(t => t.HospitalGroupId == trialHospitalGroupId)) join subjectPatient in _subjectPatientRepository.Where(t => t.Subject.TrialId == inCommand.TrialId) on scpStudy.PatientId equals subjectPatient.PatientId select new @@ -1543,8 +1546,11 @@ namespace IRaCIS.Application.Services // 预处理4: 处理需要绑定的检查 //获取 该受试者绑定患者已存在的检查,考虑要生成多少个访视,去除已提交的检查 + var trialHospitalGroupId = await _trialRepository.Where(t => t.Id == inCommand.TrialId).Select(t => t.HospitalGroupId).FirstOrDefaultAsync(); + var studyList = await _studyRepository.Where(t => inCommand.PatientIdList.Contains(t.PatientId) && !t.SCPStudySubjectVisitList.Any(t => t.SubjectId == subjectId && t.SubjectVisit.SubmitState == SubmitStateEnum.Submitted)) + .Where(t => t.HospitalGroupList.Any(t => t.HospitalGroupId == trialHospitalGroupId)) .WhereIf(maxStudyTime != null, t => t.StudyTime > maxStudyTime) .Select(t => new AuToBindingStudyInfo { SCPStudyId = t.Id, StudyTime = t.StudyTime }).OrderBy(t => t.StudyTime).Distinct().ToListAsync(); @@ -1606,8 +1612,11 @@ namespace IRaCIS.Application.Services // 预处理4: 处理需要绑定的检查 //获取 该受试者绑定患者已存在的检查,考虑要生成多少个访视,去除已提交的检查 + var trialHospitalGroupId = await _trialRepository.Where(t => t.Id == inCommand.TrialId).Select(t => t.HospitalGroupId).FirstOrDefaultAsync(); + var studyList = await _studyRepository.Where(t => dbPatientIdList.Contains(t.PatientId) && !t.SCPStudySubjectVisitList.Any(t => t.SubjectId == subjectId && t.SubjectVisit.SubmitState == SubmitStateEnum.Submitted)) + .Where(t => t.HospitalGroupList.Any(t => t.HospitalGroupId == trialHospitalGroupId)) .WhereIf(maxStudyTime != null, t => t.StudyTime > maxStudyTime) .Select(t => new AuToBindingStudyInfo { SCPStudyId = t.Id, StudyTime = t.StudyTime }).OrderBy(t => t.StudyTime).Distinct().ToListAsync();