From 5f338de0cdd6687f07c0017ad00991342bb13122 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 19 Dec 2024 12:29:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E8=A7=A3?= =?UTF-8?q?=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Visit/PatientService.cs | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index df85cb38e..c98cad410 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -2962,45 +2962,42 @@ namespace IRaCIS.Application.Services { using (@lock.Acquire()) { - if (result.Count == maxStudyCount) + if (result.Count >= maxStudyCount) { response.Status = DicomStatus.Cancel; return; } - - var studyTime = response.Dataset.GetDateTime(DicomTag.StudyDate, DicomTag.StudyTime); - - DateOnly datePart = DateOnly.FromDateTime(studyTime); - TimeOnly timePart = TimeOnly.FromDateTime(studyTime); - - DateTime? birthDate = DateTime.ParseExact(response.Dataset?.GetSingleValueOrDefault(DicomTag.PatientBirthDate, ""), "yyyyMMdd", null); - // 格式化为你需要的日期格式,例如:yyyy-MM-dd - string formattedBirthDate = birthDate?.ToString("yyyy-MM-dd") ?? string.Empty; - - - result.Add(new SCUStudyView() + else { - PatientID = response.Dataset?.GetSingleValueOrDefault(DicomTag.PatientID, ""), - PatientName = response.Dataset?.GetSingleValueOrDefault(DicomTag.PatientName, ""), - PatientSex = response.Dataset?.GetSingleValueOrDefault(DicomTag.PatientSex, ""), - PatientBirthDate = formattedBirthDate, - StudyID = response.Dataset?.GetSingleValueOrDefault(DicomTag.StudyID, ""), - AccessionNumber = response.Dataset?.GetSingleValueOrDefault(DicomTag.AccessionNumber, ""), - ModalitiesInStudy = response.Dataset?.GetSingleValueOrDefault(DicomTag.ModalitiesInStudy, ""), - StudyDate = datePart.ToString("yyyy-MM-dd"), - StudyTime = timePart.ToString("HH:mm:ss"), - BodyPartExamined = response.Dataset?.GetSingleValueOrDefault(DicomTag.BodyPartExamined, ""), - StudyDescription = response.Dataset?.GetSingleValueOrDefault(DicomTag.StudyDescription, ""), - StudyInstanceUID = response.Dataset?.GetSingleValueOrDefault(DicomTag.StudyInstanceUID, "") - }); + var studyTime = response.Dataset.GetDateTime(DicomTag.StudyDate, DicomTag.StudyTime); - if (result.Count == maxStudyCount) - { - response.Status = DicomStatus.Cancel; + DateOnly datePart = DateOnly.FromDateTime(studyTime); + TimeOnly timePart = TimeOnly.FromDateTime(studyTime); - return; + var canParce = DateTime.TryParseExact(response.Dataset?.GetSingleValueOrDefault(DicomTag.PatientBirthDate, ""), "yyyyMMdd", null, System.Globalization.DateTimeStyles.None, out DateTime birthDate); + + // 格式化为你需要的日期格式,例如:yyyy-MM-dd + string formattedBirthDate = canParce? birthDate.ToString("yyyy-MM-dd"):string.Empty; + + + result.Add(new SCUStudyView() + { + PatientID = response.Dataset?.GetSingleValueOrDefault(DicomTag.PatientID, ""), + PatientName = response.Dataset?.GetSingleValueOrDefault(DicomTag.PatientName, ""), + PatientSex = response.Dataset?.GetSingleValueOrDefault(DicomTag.PatientSex, ""), + PatientBirthDate = formattedBirthDate, + StudyID = response.Dataset?.GetSingleValueOrDefault(DicomTag.StudyID, ""), + AccessionNumber = response.Dataset?.GetSingleValueOrDefault(DicomTag.AccessionNumber, ""), + ModalitiesInStudy = response.Dataset?.GetSingleValueOrDefault(DicomTag.ModalitiesInStudy, ""), + StudyDate = datePart.ToString("yyyy-MM-dd"), + StudyTime = timePart.ToString("HH:mm:ss"), + BodyPartExamined = response.Dataset?.GetSingleValueOrDefault(DicomTag.BodyPartExamined, ""), + StudyDescription = response.Dataset?.GetSingleValueOrDefault(DicomTag.StudyDescription, ""), + StudyInstanceUID = response.Dataset?.GetSingleValueOrDefault(DicomTag.StudyInstanceUID, "") + }); } + } @@ -3017,14 +3014,14 @@ namespace IRaCIS.Application.Services } - - //看当前前端有没有传递modality,有的话以前端为准,没有的话以配置为准 构造同样数量的请求 var requestModalityList = (inQuery.ModalitiesInStudyList != null && inQuery.ModalitiesInStudyList.Count > 0) ? inQuery.ModalitiesInStudyList : find.ModalityList; requestModalityList = requestModalityList.Count == 0 ? new List() { "" } : requestModalityList; + //requestModalityList = new List() { "" }; + var requestList = new List(); foreach (var modality in requestModalityList) {