From b6ceca9744abeb88ef85edd1a5163d54d2c77822 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 17 Sep 2025 15:03:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=82=A3=E8=80=85=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=88=97=E8=A1=A8=E5=92=8C=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Visit/DTO/PatientViewModel.cs | 24 ++++++++++++-- .../Service/Visit/PatientService.cs | 32 +++++++++++++++---- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs index ab9d65b19..09b7904f2 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs @@ -532,13 +532,22 @@ namespace IRaCIS.Application.Contracts public class PatientStudyInfoQuery : PageInput { - [NotDefault] - public Guid PatientId { get; set; } + public Guid? PatientId { get; set; } public DateTime? EarliestStudyTime { get; set; } public DateTime? LatestStudyTime { get; set; } public string? Modalities { get; set; } + + public List HospitalGroupIdList { get; set; } = new List(); + + public List PatientHospitalGroupTagIdList { get; set; } = new List(); + + public string? PatientIdStr { get; set; } + public string? PatientName { get; set; } + public List CalledAEList { get; set; } = new List(); + + public string? CallingAE { get; set; } } @@ -1094,6 +1103,17 @@ namespace IRaCIS.Application.Contracts public List ViewHospitalGroupList => HospitalGroupList.Where(t => CurrentUserHospitalGroupList.Any(c => c.Id == t.Id)).ToList(); + + #region 检查列表 展示患者信息 联合列表 + + public string PatientIdStr { get; set; } = string.Empty; + public string PatientName { get; set; } = string.Empty; + public string PatientAge { get; set; } = string.Empty; + public string PatientSex { get; set; } = string.Empty; + public string PatientBirthDate { get; set; } = string.Empty; + + #endregion + } public class SCPStudyHospitalGroupInfo diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index 8b105f052..177637660 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -44,6 +44,7 @@ using System.Dynamic; using System.Threading.Channels; using IRaCIS.Core.Application.Helper.OtherTool; using IRaCIS.Core.Infrastructure.Extention; +using NPOI.POIFS.Properties; namespace IRaCIS.Application.Services @@ -647,6 +648,8 @@ namespace IRaCIS.Application.Services #region new ok var query = _patientRepository.Where(t => isAdminOrOA ? true : t.SCPStudyList.Any(c => c.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId)))) + + .WhereIf(inQuery.CalledAEList.Any(), t => t.SCPStudyList.Any(c=> inQuery.CalledAEList.Contains(c.CalledAE))) .WhereIf(inQuery.HospitalGroupIdList.Any(), t => t.SCPStudyList.Any(c => c.HospitalGroupList.Any(c => inQuery.HospitalGroupIdList.Contains(c.HospitalGroupId)))) .WhereIf(inQuery.PatientHospitalGroupTagIdList.Any(), t => t.PatientHospitalGroupTagList.Any(k => inQuery.PatientHospitalGroupTagIdList.Contains(k.HospitalGroupTagId))) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientIdStr), t => t.PatientIdStr.Contains(inQuery.PatientIdStr)) @@ -656,11 +659,10 @@ namespace IRaCIS.Application.Services .WhereIf(inQuery.BeginPushTime != null, t => t.LatestPushTime >= inQuery.BeginPushTime) .WhereIf(inQuery.EndPushTime != null, t => t.LatestPushTime <= inQuery.EndPushTime); - foreach (var calledAE in inQuery.CalledAEList) - { - query = query.Where(t => t.SCPStudyList.Select(c => c.CalledAE).Contains(calledAE)); - } - + //foreach (var calledAE in inQuery.CalledAEList) + //{ + // query = query.Where(t => t.SCPStudyList.Select(c => c.CalledAE).Contains(calledAE)); + //} var resultQuery = from patient in query @@ -827,11 +829,20 @@ namespace IRaCIS.Application.Services .Where(t => t.IsDisabled == false && t.HospitalGroup.IsEnable).Select(t => t.HospitalGroupId).ToList(); } - var query = from scpStudy in _studyRepository.Where(t => t.PatientId == inQuery.PatientId) + var query = from scpStudy in _studyRepository + .WhereIf(inQuery.PatientId != null, t => t.PatientId == inQuery.PatientId) .Where(t => isAdminOrOA ? true : t.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId))) .WhereIf(inQuery.EarliestStudyTime != null, t => t.StudyTime >= inQuery.EarliestStudyTime) .WhereIf(inQuery.LatestStudyTime != null, t => t.StudyTime <= inQuery.LatestStudyTime) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Modalities), t => t.Modalities.Contains(inQuery.Modalities)) + .Where(t => isAdminOrOA ? true : t.HospitalGroupList.Any(c => currentUserHospitalGroupIdList.Contains(c.HospitalGroupId))) + + .WhereIf(inQuery.CalledAEList.Any(), t => inQuery.CalledAEList.Contains(t.CalledAE)) + .WhereIf(inQuery.HospitalGroupIdList.Any(), t => t.HospitalGroupList.Any(c => inQuery.HospitalGroupIdList.Contains(c.HospitalGroupId))) + .WhereIf(inQuery.PatientHospitalGroupTagIdList.Any(), t => t.Patient.PatientHospitalGroupTagList.Any(k => inQuery.PatientHospitalGroupTagIdList.Contains(k.HospitalGroupTagId))) + .WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientIdStr), t => t.Patient.PatientIdStr.Contains(inQuery.PatientIdStr)) + .WhereIf(!string.IsNullOrWhiteSpace(inQuery.PatientName), t => t.Patient.PatientName.Contains(inQuery.PatientName)) + .WhereIf(!string.IsNullOrWhiteSpace(inQuery.CallingAE), t => t.CallingAE == inQuery.CallingAE) select new PatientStudySimpleView() { Description = scpStudy.Description, @@ -850,7 +861,14 @@ namespace IRaCIS.Application.Services { Id = t.HospitalGroupId, Name = t.HospitalGroup.Name - }).ToList() + }).ToList(), + + + PatientAge = scpStudy.Patient.PatientAge, + PatientName = scpStudy.Patient.PatientName, + PatientIdStr = scpStudy.Patient.PatientIdStr, + PatientSex = scpStudy.Patient.PatientSex, + PatientBirthDate = scpStudy.Patient.PatientBirthDate, }; var pageList = await query.ToPagedListAsync(inQuery, nameof(PatientStudySimpleView.StudyTime));