From 1d5c274e38c14027437b5f236bbfc9d200829cf3 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 25 Sep 2024 16:47:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=E5=BF=85?= =?UTF-8?q?=E4=BC=A0=E4=B8=8E=E5=90=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ImageAndDoc/DTO/UnionStudyViewDodel.cs | 6 +-- .../ImageAndDoc/DownloadAndUploadService.cs | 39 +++++++++++++++++-- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs index 804a7d83e..c9835af4a 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs @@ -409,14 +409,12 @@ namespace IRaCIS.Core.Application.Contracts public class IRUploadStudyQuery : SortInput { - [NotDefault] - public Guid SubjectId { get; set; } + public Guid? SubjectId { get; set; } [NotDefault] public Guid TrialReadingCriterionId { get; set; } - [NotDefault] - public string SubjectCode { get; set; } + public string? SubjectCode { get; set; } public Guid? VisitTaskId { get; set; } } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index a620f9913..51b3081f7 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -111,11 +111,42 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc [HttpPost] public async Task>> GetSubjectImageUploadList(IRUploadStudyQuery inQuery) { - await SubejctRandomReadingTaskNameDeal(inQuery.SubjectId, inQuery.TrialReadingCriterionId); //要根据标准阅片顺序,确定是否查询单个任务的,还是查询所有的 var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId) - .Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync(); + .Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync(); + + var subjectCode = string.Empty; + var subjectId = inQuery.SubjectId; + + if (criterionInfo.IsReadingTaskViewInOrder == ReadingOrder.Random) + { + if (inQuery.VisitTaskId == null) + { + throw new Exception("无序阅片,前端参数传递错误"); + } + //考虑到一致性分析,必须要这个编号进行过滤 + var taskInfo = _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId).Select(t => new { + SubjectCode= t.IsAnalysisCreate ? t.BlindSubjectCode : t.Subject.Code, + SubjectId= t.SubjectId, + }).FirstOrDefault(); + subjectId = taskInfo.SubjectId; + subjectCode = taskInfo.SubjectCode; + } + else + { + if (inQuery.SubjectId == null || inQuery.SubjectCode == null) + { + throw new Exception("有序阅片,前端参数传递错误"); + } + + //考虑到一致性分析,必须要这个编号进行过滤 + subjectCode = inQuery.SubjectCode; + } + + await SubejctRandomReadingTaskNameDeal((Guid)subjectId, inQuery.TrialReadingCriterionId); + + var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect) @@ -178,7 +209,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc }) ; - var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).ToListAsync(); + var list = await query.Where(t => t.SubjectCode == subjectCode).ToListAsync(); return ResponseOutput.Ok(list); @@ -293,7 +324,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc result.Add(new TaskStudyArchiveConfirmResult() { StudyInstanceUid = studyUid, IsAllowReUpload = false, IsAllowUpload = false }); } //在原始crc 里面上传了,并且不是当前访视 - else if (inCommand.VisitTaskId != null && findStudy.VisitTaskId == null && findStudy.SubjectVisitId!= currentUploadSubjectVisitId) + else if (inCommand.VisitTaskId != null && findStudy.VisitTaskId == null && findStudy.SubjectVisitId != currentUploadSubjectVisitId) { result.Add(new TaskStudyArchiveConfirmResult() { StudyInstanceUid = studyUid, IsAllowReUpload = false, IsAllowUpload = false }); }