diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs index 2b6a9ce10..204ab5a22 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs @@ -104,6 +104,15 @@ namespace IRaCIS.Core.Application.ViewModel } + + public class SetMedicalReviewInvalidCommand + { + [NotDefault] + public Guid TrialId { get; set; } + + public List MedicalReviewIdList { get; set; } + } + public class GenerateMedicalReviewTaskQuery : TaskMedicalReviewQuery { public bool? IsGeneratedJudge { get; set; } diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs index 81fe1334f..4475536be 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs @@ -56,7 +56,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.VisitTask.TaskName.Contains(inQuery.TaskName) || t.VisitTask.TaskBlindName.Contains(inQuery.TaskName)) .WhereIf(inQuery.IsUrgent != null, t => t.VisitTask.IsUrgent == inQuery.IsUrgent) .WhereIf(inQuery.DoctorUserId != null, t => t.VisitTask.DoctorUserId == inQuery.DoctorUserId) - .WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.VisitTask.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode) && t.VisitTask.IsAnalysisCreate) || (t.VisitTask.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode)&& t.VisitTask.IsAnalysisCreate==false)) + .WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.VisitTask.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode) && t.VisitTask.IsAnalysisCreate) || (t.VisitTask.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode) && t.VisitTask.IsAnalysisCreate == false)) .WhereIf(inQuery.ReadingCategory != null, t => t.VisitTask.ReadingCategory == inQuery.ReadingCategory) .WhereIf(inQuery.ReadingTaskState != null, t => t.VisitTask.ReadingTaskState == inQuery.ReadingTaskState) .ProjectTo(_mapper.ConfigurationProvider); @@ -149,6 +149,25 @@ namespace IRaCIS.Core.Application.Service } + /// + /// 设置医学审核失效 + /// + /// + /// + [HttpPost] + public async Task SetMedicalReviewInvalid(SetMedicalReviewInvalidCommand command) + { + + if (await _taskMedicalReviewRepository.Where(t => command.MedicalReviewIdList.Contains(t.Id)).AnyAsync(t => t.AuditState == MedicalReviewAuditState.HaveSigned)) + { + return ResponseOutput.NotOk("已签名的不允许设置为失效"); + } + + await _taskMedicalReviewRepository.BatchUpdateNoTrackingAsync(t => command.MedicalReviewIdList.Contains(t.Id), c => new TaskMedicalReview() { IsInvalid = true }); + + return ResponseOutput.Ok(); + + } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 5ed24fb99..b228593d5 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1316,12 +1316,16 @@ namespace IRaCIS.Core.Application.Service.Allocation origenalTask.TaskState = agreeReReadingCommand.RequestReReadingResultEnum == RequestReReadingResult.Agree ? TaskState.HaveReturned : origenalTask.TaskState; } - private async Task SetMedicalReviewInvalidAsync(List influenceTaskList, bool isPM = true) + private async Task SetMedicalReviewInvalidAsync(List influenceTaskList, bool isPMApply = true) { //将医学审核设置为失效 var taskIdList = influenceTaskList.Select(t => t.Id).ToList(); - if (isPM) + //PM 申请 医学审核任务状态为待审核、审核中的,设置为失效。 + + //IR 申请 当前任务进入医学审核,医学审核任务未签名且结论中是否有问题项,答案为否的,设置为失效 + + if (isPMApply) { await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(t => taskIdList.Contains(t.VisitTaskId) && t.AuditState != MedicalReviewAuditState.HaveSigned, u => new TaskMedicalReview() { IsInvalid = true });