From 396c8ca2df4d02a86cdbea25f45d6f527cc8d469 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Tue, 5 Jul 2022 13:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Reading/ReadModuleService.cs | 15 ++++- .../Triggers/SubjectVisitFinalVisitTrigger.cs | 4 +- .../Reading/View/ReadingClinicalDataView.cs | 60 ------------------- .../_IRaCIS/IQueryableExtensions.cs | 2 +- 4 files changed, 17 insertions(+), 64 deletions(-) delete mode 100644 IRaCIS.Core.Domain/Reading/View/ReadingClinicalDataView.cs diff --git a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs index 9a6ba001a..1919d21db 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs @@ -27,6 +27,7 @@ namespace IRaCIS.Application.Services private readonly IRepository _visitstageRepository; private readonly IRepository _userRepository; private readonly IRepository _trialRepository; + private readonly IRepository _visitTaskRepository; private readonly IRepository _clinicalDataTrialSetRepository; private readonly IRepository _readModuleViewRepository; private readonly IRepository _dicomInstanceRepository; @@ -40,6 +41,7 @@ namespace IRaCIS.Application.Services IRepository visitstageRepository, IRepository UserRepository, IRepository trialRepository, + IRepository visitTaskRepository, IRepository clinicalDataTrialSetRepository, IRepository readModuleViewRepository, IRepository dicomInstanceRepository, @@ -53,6 +55,7 @@ namespace IRaCIS.Application.Services this._visitstageRepository = visitstageRepository; this._userRepository = UserRepository; this._trialRepository = trialRepository; + this._visitTaskRepository = visitTaskRepository; this._clinicalDataTrialSetRepository = clinicalDataTrialSetRepository; this._readModuleViewRepository = readModuleViewRepository; this._dicomInstanceRepository = dicomInstanceRepository; @@ -187,10 +190,12 @@ namespace IRaCIS.Application.Services { maxcount = maxcount < x.Data.Count ? x.Data.Count : maxcount; }); + var trialinfo = await _trialRepository.Where(x => x.Id == dto.TrialId).FirstNotNullAsync(); return (pageOutput, new { MaxLength = maxcount, - IsClinicalReading = await _trialRepository.Where(x => x.Id == dto.TrialId).Select(x => x.IsClinicalReading).FirstOrDefaultAsync(), + IsReadingTaskViewInOrder=trialinfo.IsReadingTaskViewInOrder, + IsClinicalReading = trialinfo.IsClinicalReading, OnlyExistsMedicalHistory = !(await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId && x.ClinicalDataSetName != "既往局部治疗史" && x.IsConfirm)), IsExistsSubjectClinicalData= await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId&&x.ClinicalDataLevel== ClinicalLevel.Subject && x.IsConfirm), IsExistsVisitClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == dto.TrialId && x.ClinicalDataLevel == ClinicalLevel.SubjectVisit && x.IsConfirm), @@ -261,6 +266,14 @@ namespace IRaCIS.Application.Services { stakeholderIds.Add(subjectVisit.CheckUserId.Value); } + break; + case ReadingStatusEnum.ImageReading: + + + var doctorUserId = await _visitTaskRepository.Where(x => x.SouceReadModuleId == dto.Id || x.SourceSubjectVisitId == dto.Id) + .Where(x => x.DoctorUserId != null).Select(x => x.DoctorUserId.Value).ToListAsync(); + + stakeholderIds.AddRange(doctorUserId); break; }; diff --git a/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs b/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs index 1901c0ef3..56e2c1d09 100644 --- a/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs @@ -100,10 +100,10 @@ namespace IRaCIS.Core.Application.Triggers var trialId = subjectVisit.TrialId; var subjectVisitId= subjectVisit.Id; // 是否全局阅片 - var isGlobalReading = await _repository.Where(x => x.Id == trialId).Select(x => x.IsGlobalReading).FirstOrDefaultAsync(); + var trial = await _repository.Where(x => x.Id == trialId).FirstNotNullAsync(); - if (isGlobalReading) + if (trial.IsGlobalReading&&trial.IsReadingTaskViewInOrder) { ReadingPeriodSet? readingPeriodSet =await _readingPeriodSetRepository.FirstOrDefaultNoTrackingAsync(x => x.TrialId == trialId && x.IsGlobal); diff --git a/IRaCIS.Core.Domain/Reading/View/ReadingClinicalDataView.cs b/IRaCIS.Core.Domain/Reading/View/ReadingClinicalDataView.cs deleted file mode 100644 index ae0dcb095..000000000 --- a/IRaCIS.Core.Domain/Reading/View/ReadingClinicalDataView.cs +++ /dev/null @@ -1,60 +0,0 @@ -using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace IRaCIS.Core.Domain.Models -{ - //public class ReadingClinicalDataView : Entity - //{ - - // /// - // /// 项目ID - // /// - // public Guid TrialId { get; set; } - - // /// - // /// 受试者ID - // /// - // public Guid SubjectId { get; set; } - - - // /// - // /// 阅片 - // /// - // public Guid? ReadingId { get; set; } - - - // /// - // /// 项目配置临床类型ID - // /// - // public Guid ClinicalDataTrialSetId { get; set; } - - // /// - // /// 项目配置临床类型Name - // /// - // public string ClinicalDataSetName { get; set; } - - - // public ClinicalUploadType ClinicalUploadType { get; set; } - - - // /// - // /// 临床数据级别 - // /// - // public ClinicalLevel ClinicalDataLevel { get; set; } - - // /// - // /// 是否为CRC上传 - // /// - // public bool IsCRCUpload { get; set; } - - // /// - // /// 是否签名 - // /// - // public bool IsSign { get; set; } - - //} -} diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryableExtensions.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryableExtensions.cs index e3f2e219a..1ec3f7336 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryableExtensions.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryableExtensions.cs @@ -9,7 +9,7 @@ namespace IRaCIS.Core.Infrastructure.Extention public static class IQueryableExtensions { /// - /// 获取第一条 null提示 + /// 获取第一条 为null提示 /// /// ///