From 49e4980fd0efa579ac5c0be4741b9f9860f1c4a6 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Mon, 24 Nov 2025 15:48:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BD=B1=E5=83=8F=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=A3=80=E6=9F=A5=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Visit/PatientService.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index bcc9681ee..066fa7c26 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -3303,6 +3303,18 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task GetDownloadPatientStudyInfo(PatientImageDownloadCommand inCommand) { + var isAdminOrOA = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.Admin || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.OA || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin; + + + var currentUserHospitalGroupIdList = new List(); + + if (!isAdminOrOA) + { + currentUserHospitalGroupIdList = _identityUserRepository.Where(t => t.Id == _userInfo.IdentityUserId).SelectMany(t => t.IdentityUserHospitalGroupList) + .Where(t => t.IsDisabled == false && t.HospitalGroup.IsEnable).Select(t => t.HospitalGroupId).ToList(); + } + + var patientIdList = inCommand.PatientIdList.Distinct().ToList(); var studyIdList = inCommand.SCPStudyIdList.Distinct().ToList(); @@ -3316,6 +3328,7 @@ namespace IRaCIS.Application.Services { var list = _patientRepository.Where(t => patientIdList.Contains(t.Id)) .SelectMany(t => t.SCPStudyList.Where(t => studyIdList.Count > 0 ? studyIdList.Contains(t.Id) : true)) + .Where(t => isAdminOrOA ? true : t.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId))) .SelectMany(t => t.InstanceList) .Select(t => new StudyDIRInfo() {