From 4b621e94547f2630e65da11ab6ecdc0f4b20b3bb Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Sun, 24 Nov 2024 17:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2pacs=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=EF=BC=8C=E7=BB=93=E8=AE=BA=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E7=BB=93=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GetPatientRegisterPacsCheckInputDto.cs | 7 ++++++- .../BigtextResultTemplateAppService.cs | 1 + .../PacsBusiness/PacsBusinessAppService.cs | 21 ++++++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Shentun.Peis.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckInputDto.cs b/src/Shentun.Peis.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckInputDto.cs index 6bdbad3..2054f5e 100644 --- a/src/Shentun.Peis.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckInputDto.cs +++ b/src/Shentun.Peis.Application.Contracts/PacsBusiness/GetPatientRegisterPacsCheckInputDto.cs @@ -19,7 +19,7 @@ namespace Shentun.Peis.PacsBusiness /// /// 日期类型 0-检查日期 1-上传日期 /// - public char DateType { get; set; } + public char DateType { get; set; } public string StartDate { get; set; } @@ -30,6 +30,11 @@ namespace Shentun.Peis.PacsBusiness /// public char? CheckTypeFlag { get; set; } + /// + /// 单位id集合 可传多个单位(传顶级单位,要求能查本级所有下级的数据),不传或为空时表示所有单位 + /// + public List CustomerOrgIds { get; set; } = new List(); + public int MaxResultCount { get; set; } = 1000; public int SkipCount { get; set; } = 0; diff --git a/src/Shentun.Peis.Application/BigtextResultTemplates/BigtextResultTemplateAppService.cs b/src/Shentun.Peis.Application/BigtextResultTemplates/BigtextResultTemplateAppService.cs index b509807..bce4b62 100644 --- a/src/Shentun.Peis.Application/BigtextResultTemplates/BigtextResultTemplateAppService.cs +++ b/src/Shentun.Peis.Application/BigtextResultTemplates/BigtextResultTemplateAppService.cs @@ -236,6 +236,7 @@ namespace Shentun.Peis.BigtextResultTemplates join bigtextResultDescription in await _bigtextResultDescriptionRepository.GetQueryableAsync() on bigtextResultTemplate.Id equals bigtextResultDescription.BigtextResultTemplateId into bigtextResultDescriptionTemp from bigtextResultDescriptionHaveEmpty in bigtextResultDescriptionTemp.DefaultIfEmpty() where itemBigtextResultType.ItemId == input.ItemId + && bigtextResultConclusionHaveEmpty.IsAbnormal == 'Y' orderby bigtextResultTemplate.DisplayOrder ascending select new { diff --git a/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs b/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs index 9f3c8e9..7d973af 100644 --- a/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs +++ b/src/Shentun.Peis.Application/PacsBusiness/PacsBusinessAppService.cs @@ -6,6 +6,7 @@ using Microsoft.Extensions.Logging; using NPOI.POIFS.Storage; using NPOI.Util; using NUglify.Helpers; +using Shentun.Peis.CustomerOrgs; using Shentun.Peis.Enums; using Shentun.Peis.Models; using Shentun.Peis.PatientRegisters; @@ -59,6 +60,7 @@ namespace Shentun.Peis.PacsBusiness private readonly IRepository _dicomFileDetailRepository; private readonly ILogger _logger; private readonly IRepository _itemTypeRepository; + private readonly CustomerOrgManager _customerOrgManager; public PacsBusinessAppService( IConfiguration configuration, IRepository registerCheckRepository, @@ -78,7 +80,8 @@ namespace Shentun.Peis.PacsBusiness IRepository userItemTypeRepository, IRepository dicomFileDetailRepository, ILogger logger, - IRepository itemTypeRepository) + IRepository itemTypeRepository, + CustomerOrgManager customerOrgManager) { _configuration = configuration; _registerCheckRepository = registerCheckRepository; @@ -99,6 +102,7 @@ namespace Shentun.Peis.PacsBusiness _dicomFileDetailRepository = dicomFileDetailRepository; _logger = logger; _itemTypeRepository = itemTypeRepository; + _customerOrgManager = customerOrgManager; } @@ -348,6 +352,7 @@ namespace Shentun.Peis.PacsBusiness orderby registerCheck.PacsCheckDate descending select new { + customerOrgId = patientRegister.CustomerOrgId, patientName = patientRegister.PatientName, checkRequestNo = registerCheck.CheckRequestNo, asbitemName = asbitem.DisplayName, @@ -391,6 +396,20 @@ namespace Shentun.Peis.PacsBusiness query = query.Where(m => m.checkTypeFlag == input.CheckTypeFlag); } + if (input.CustomerOrgIds.Any()) + { + + List customerOrgIds = new List(); + + foreach (var customerOrgId in input.CustomerOrgIds) + { + var customerOrgIdsTemp = await _customerOrgManager.GetCustomerOrgChildrenId(customerOrgId); + customerOrgIds.AddRange(customerOrgIdsTemp); + } + + query = query.Where(m => customerOrgIds.Contains(m.customerOrgId)); + } + #region 增加项目类别权限 string AdminId = _configuration.GetValue("AdminId");