diff --git a/src/Shentun.Peis.Application.Contracts/PrintReports/PacsNoReportInputDto.cs b/src/Shentun.Peis.Application.Contracts/PrintReports/PacsNoReportInputDto.cs deleted file mode 100644 index 8b90308..0000000 --- a/src/Shentun.Peis.Application.Contracts/PrintReports/PacsNoReportInputDto.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Shentun.Peis.PrintReports -{ - public class PacsNoReportInputDto - { - public Guid PatientRegisterId { get; set; } - - public List CheckRequestNos { get; set; } - } -} diff --git a/src/Shentun.Peis.Application.Contracts/PrintReports/RegisterCheckIdsInputDto.cs b/src/Shentun.Peis.Application.Contracts/PrintReports/RegisterCheckIdsInputDto.cs new file mode 100644 index 0000000..bada4db --- /dev/null +++ b/src/Shentun.Peis.Application.Contracts/PrintReports/RegisterCheckIdsInputDto.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shentun.Peis.PrintReports +{ + public class RegisterCheckIdsInputDto + { + public List RegisterCheckIds { get; set; } + + } +} diff --git a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs index 9634582..3eda614 100644 --- a/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs +++ b/src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs @@ -293,7 +293,7 @@ namespace Shentun.Peis.PeisReports IsReportPrint = s.a.ReportPrintTimes > 0 ? 'Y' : 'N', MedicalPackageName = s.ad.DisplayName, MedicalTypeName = s.ae.DisplayName, - MobileTelephone = s.ab.DisplayName, + MobileTelephone = s.ab.MobileTelephone, PatientNo = s.ab.PatientNo, PatientRegisterNo = s.a.PatientRegisterNo, PersonnelTypeName = s.af.DisplayName, diff --git a/src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs b/src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs index c06cb17..555268b 100644 --- a/src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs +++ b/src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs @@ -220,7 +220,7 @@ namespace Shentun.Peis.PrintReports MedicalStartDate = Convert.ToDateTime(a.MedicalStartDate.ToString()).ToString("yyyy-MM-dd"), OrganizationUnitId = a.MedicalCenterId, OrganizationUnitName = ag.DisplayName, - Detail = PatientRegisterGuideAsbitem(a.Id, medicalCenterId, a.SexId), + Detail = PatientRegisterGuideAsbitem(a.Id, a.PatientRegisterNo, medicalCenterId, a.SexId), HisPatientId = a.HisPatientId }; @@ -488,6 +488,7 @@ namespace Shentun.Peis.PrintReports Age = patientRegister.Age, AsbitemName = asbitemHaveEmpty.DisplayName, CheckRequestNo = registerCheck.CheckRequestNo, + RegisterCheckId = registerCheck.Id, PatientName = patientRegister.PatientName, PatientRegisterNo = patientRegister.PatientRegisterNo, SexName = _cacheService.GetSexNameAsync(patientRegister.SexId).Result, @@ -512,6 +513,7 @@ namespace Shentun.Peis.PrintReports Age = s.FirstOrDefault().Age, AsbitemName = string.Join(',', s.Select(s => s.AsbitemName)), CheckRequestNo = s.FirstOrDefault().CheckRequestNo, + RegisterCheckId = s.FirstOrDefault().RegisterCheckId, PatientName = s.FirstOrDefault().PatientName, PatientRegisterNo = s.FirstOrDefault().PatientRegisterNo, SexName = s.FirstOrDefault().SexName, @@ -526,6 +528,7 @@ namespace Shentun.Peis.PrintReports Age = s.FirstOrDefault().Age, AsbitemName = string.Join(',', s.Select(s => s.AsbitemName)), CheckRequestNo = s.FirstOrDefault().PatientRegisterNo, + RegisterCheckId = s.FirstOrDefault().RegisterCheckId, PatientName = s.FirstOrDefault().PatientName, PatientRegisterNo = s.FirstOrDefault().PatientRegisterNo, SexName = s.FirstOrDefault().SexName, @@ -548,12 +551,12 @@ namespace Shentun.Peis.PrintReports /// /// [HttpPost("api/app/PrintReport/GetPacsNoReportByCheckRequestNo")] - public async Task> GetPacsNoReportByCheckRequestNoAsync(PacsNoReportInputDto input) + public async Task> GetPacsNoReportByCheckRequestNoAsync(RegisterCheckIdsInputDto input) { List pacsNoReportDtos = new List(); - if (input.CheckRequestNos.Count > 0) + if (input.RegisterCheckIds.Count > 0) { var query = (from patientRegister in await _patientRegisterRepository.GetQueryableAsync() join registerCheck in await _registerCheckRepository.GetQueryableAsync() on patientRegister.Id equals registerCheck.PatientRegisterId @@ -562,7 +565,7 @@ namespace Shentun.Peis.PrintReports from asbitemHaveEmpty in asbitemTemp.DefaultIfEmpty() join itemType in await _itemTypeRepository.GetQueryableAsync() on asbitemHaveEmpty.ItemTypeId equals itemType.Id into itemTypeTemp from itemTypeHaveEmpty in itemTypeTemp.DefaultIfEmpty() - where (patientRegister.Id == input.PatientRegisterId + where (input.RegisterCheckIds.Contains(registerCheck.Id) && !string.IsNullOrEmpty(registerCheck.CheckRequestNo) && asbitemHaveEmpty.BarcodeMode != '2' ) @@ -582,7 +585,7 @@ namespace Shentun.Peis.PrintReports var queryGroup = query.GroupBy(g => g.CheckRequestNo); - + foreach (var s in queryGroup) { if (s.Where(m => m.BarcodeMode == '0' && m.IsCheckRequest == 'Y').Count() > 0) @@ -615,8 +618,8 @@ namespace Shentun.Peis.PrintReports } } - pacsNoReportDtos = pacsNoReportDtos.Where(m => input.CheckRequestNos.Contains(m.CheckRequestNo)).ToList(); } + return pacsNoReportDtos; } @@ -777,7 +780,7 @@ namespace Shentun.Peis.PrintReports SuggestionFlag = s.SuggestionFlag, DisplayOrder = s.DisplayOrder, MedicalInterpretations = s.SumSuggestionContents. - Where(o => o.SuggestionType == SuggestionTypeFlag.MedicalInterpretation&&!string.IsNullOrWhiteSpace( o.SuggestionContent)) + Where(o => o.SuggestionType == SuggestionTypeFlag.MedicalInterpretation && !string.IsNullOrWhiteSpace(o.SuggestionContent)) .OrderBy(o => o.DisplayOrder) .Select(sa => new MedicalReportSumSuggestionContentDto { @@ -987,11 +990,12 @@ namespace Shentun.Peis.PrintReports return MedicalReportMedicalReportTypeDtos; } - private static List PatientRegisterGuideAsbitem(Guid PatientRegisterId, Guid medicalCenterId, char SexId) + private static List PatientRegisterGuideAsbitem(Guid PatientRegisterId, string PatientRegisterNo, Guid medicalCenterId, char SexId) { var entlist = _registerCheckAsbitemStaticRepository.GetQueryableAsync().Result .Include(x => x.Asbitem.ItemType) .Include(x => x.Asbitem.ItemType.GuidType) + .Include(x => x.RegisterCheck) .Where(m => m.PatientRegisterId == PatientRegisterId && m.Asbitem.IsCheck == 'Y') .Select(s => new PatientRegisterGuideReport_Asbitem_Temp { @@ -1000,7 +1004,8 @@ namespace Shentun.Peis.PrintReports AsbitemDisplayOrder = s.Asbitem.DisplayOrder, ItemTypeDisplayOrder = s.Asbitem.ItemType.DisplayOrder, GuideDisplayOrder = s.Asbitem.ItemType.GuidType.DisplayOrder, - GuideName = s.Asbitem.ItemType.GuidType.DisplayName + GuideName = s.Asbitem.ItemType.GuidType.DisplayName, + CheckRequestNo = GetCheckRequestNobyAsbitem(s.Asbitem, PatientRegisterNo, s.RegisterCheck.CheckRequestNo, s.Asbitem.ItemType.IsCheckRequest) }) .OrderBy(o => o.GuideDisplayOrder) .GroupBy(g => new { g.GuideName, g.GuideDisplayOrder }) @@ -1013,7 +1018,8 @@ namespace Shentun.Peis.PrintReports { AsbitemName = ss.AsbitemName, AsbitemGuide = ss.AsbitemGuide, - DisplayOrder = (ss.ItemTypeDisplayOrder * 3000) + ss.AsbitemDisplayOrder + DisplayOrder = (ss.ItemTypeDisplayOrder * 3000) + ss.AsbitemDisplayOrder, + CheckRequestNo = ss.CheckRequestNo }).OrderBy(o => o.DisplayOrder).ToList() }).OrderBy(o => o.DisplayOrder).ToList(); @@ -1023,5 +1029,23 @@ namespace Shentun.Peis.PrintReports return entlist; } + + /// + /// 获取检查单号 + /// + /// + private static string GetCheckRequestNobyAsbitem(Asbitem asbitem, string PatientRegisterNo, string CheckRequestNo, char IsCheckRequest) + { + string result = ""; + if (asbitem.BarcodeMode == BarcodeModeFlag.UsingItemType && IsCheckRequest == 'Y') + { + result = CheckRequestNo; + } + else if (asbitem.BarcodeMode == BarcodeModeFlag.PrintPatientRegisterNumber) + { + result = PatientRegisterNo; + } + return result; + } } } diff --git a/src/Shentun.Peis.Domain/LisRequests/LisRequestManager.cs b/src/Shentun.Peis.Domain/LisRequests/LisRequestManager.cs index 15874d8..7cdabc7 100644 --- a/src/Shentun.Peis.Domain/LisRequests/LisRequestManager.cs +++ b/src/Shentun.Peis.Domain/LisRequests/LisRequestManager.cs @@ -144,7 +144,7 @@ namespace Shentun.Peis.LisRequests continue; } var haveRegisterCheckAsbitemLis = registerCheckAsbitemLisList.Where(o => o.SampleGroupId == registerCheckAsbitemLis.SampleGroupId - && o.LisRequestId != null && o.LisRequestId != Guid.Empty).SingleOrDefault(); + && o.LisRequestId != null && o.LisRequestId != Guid.Empty).FirstOrDefault(); if (haveRegisterCheckAsbitemLis != null) { registerCheckAsbitem.LisRequestId = haveRegisterCheckAsbitemLis.LisRequestId; diff --git a/src/Shentun.Peis.Domain/PrintReports/PacsNoReportDto.cs b/src/Shentun.Peis.Domain/PrintReports/PacsNoReportDto.cs index ca03a76..77287cd 100644 --- a/src/Shentun.Peis.Domain/PrintReports/PacsNoReportDto.cs +++ b/src/Shentun.Peis.Domain/PrintReports/PacsNoReportDto.cs @@ -23,7 +23,10 @@ namespace Shentun.Peis.PrintReports /// public short? Age { get; set; } - + /// + /// RegisterCheckId + /// + public Guid RegisterCheckId { get; set; } /// /// Pacs申请号 diff --git a/src/Shentun.Peis.Domain/PrintReports/PatientRegisterGuideReportDto.cs b/src/Shentun.Peis.Domain/PrintReports/PatientRegisterGuideReportDto.cs index e261c49..a620ad1 100644 --- a/src/Shentun.Peis.Domain/PrintReports/PatientRegisterGuideReportDto.cs +++ b/src/Shentun.Peis.Domain/PrintReports/PatientRegisterGuideReportDto.cs @@ -178,6 +178,12 @@ namespace Shentun.Peis.PrintReports /// 指引单提示信息 /// public string AsbitemGuide { get; set; } + + /// + /// 检查条码 + /// + public string CheckRequestNo { get; set; } + public int DisplayOrder { get; set; } } @@ -193,6 +199,13 @@ namespace Shentun.Peis.PrintReports public int AsbitemDisplayOrder { get; set; } public int ItemTypeDisplayOrder { get; set; } + + + /// + /// 检查条码 + /// + public string CheckRequestNo { get; set; } + /// /// 指引名称 ///