diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index ef881fbd6..fed48da3d 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -11317,7 +11317,7 @@ - + IR影像阅片 diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs index 9c8953122..571f4e1f3 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs @@ -415,6 +415,8 @@ namespace IRaCIS.Core.Application.Contracts [NotDefault] public string SubjectCode { get; set; } + + public Guid? VisitTaskId { get; set; } } public class IRTaskUploadedDicomStudyQuery diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index 29fedaebe..21f87dece 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -112,8 +112,14 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc { await SubejctRandomReadingTaskNameDeal(inQuery.SubjectId, inQuery.TrialReadingCriterionId); + //要根据标准阅片顺序,确定是否查询单个任务的,还是查询所有的 + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId) + .Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync(); + var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect) + //满足 有序,或者随机只看到当前任务的dicom 非dicom检查 + .WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId) .Select(u => new SubjectImageUploadDTO() { VisitTaskId = u.Id, @@ -587,10 +593,12 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc public async Task> GetIRUploadTaskNoneDicomStudyList(IRUploadStudyQuery inQuery) { var info = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId) - .Select(t => new { t.IsImageFilter, t.CriterionModalitys }).FirstNotNullAsync(); + .Select(t => new { t.IsImageFilter, t.CriterionModalitys,t.IsReadingTaskViewInOrder }).FirstNotNullAsync(); var query = from u in _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect) + //满足 有序,或者随机只看到当前任务的dicom 非dicom检查 + .WhereIf(info.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId) join ns in _noneDicomStudyReposiotry.Where(t => t.SubjectId == inQuery.SubjectId).WhereIf(info.IsImageFilter, t => ("|" + info.CriterionModalitys + "|").Contains("|" + t.Modality + "|")) on u.SourceSubjectVisitId equals ns.SubjectVisitId @@ -745,7 +753,6 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc public async Task> GetSubjectImageDownloadSelectList(IRReadingDownloadQuery inQuery) { //要根据标准阅片顺序,确定是否查询单个任务的,还是查询所有的 - var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId) .Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync(); diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 2b1c6b3c8..779c7daf3 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using NPOI.SS.Formula.Functions; using Panda.DynamicWebApi.Attributes; using ZiggyCreatures.Caching.Fusion; @@ -60,6 +61,7 @@ namespace IRaCIS.Core.Application.Service IRepository _noneDicomStudyFileSystem, IGeneralCalculateService _generalCalculateService, IRepository _readingQuestionTrialRepository, + IRepository _taskStudyRepository, ITrialEmailNoticeConfigService _trialEmailNoticeConfigService) : BaseService, IReadingImageTaskService { @@ -2603,6 +2605,14 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto) { + //验证后处理影像必须传 + if (_visitTaskRepository.Any(t => t.Id==inDto.VisitTaskId && t.TrialReadingCriterion.ImageUploadEnum != ReadingImageUpload.None)) + { + if (!_taskStudyRepository.Any(t => t.VisitTaskId == inDto.VisitTaskId)) + { + return ResponseOutput.NotOk("ReadingImage_BackImageNotExist"); + } + } await VerifyTaskIsSign(inDto.VisitTaskId); await VerifyDefaultQuestionBeAnswer(inDto);