diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs index 98240a51a..346c40b64 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs @@ -255,7 +255,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO public class TrialVisitQADTO { - + public bool ExistsManual { get; set; } public SubjectClinicalDataDto SubjectClinicalData { get; set; } = new SubjectClinicalDataDto(); public List NoneDicomStudyList { get; set; } = new List(); diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index 5ede37c99..b5a41f3d9 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -21,15 +21,19 @@ namespace IRaCIS.Core.Application.Image.QA private readonly IRepository _trialQCQuestionRepository; private readonly IRepository _consistencyCheckFileRepository; + private IReadingImageTaskService _IReadingImageTaskService; + public QCListService( IRepository subjectVisitRepository, IRepository trialRepository, IRepository clinicalDataTrialSet, IRepository trialQCQuestionAnswerRepository, IRepository trialQCQuestionRepository, + IReadingImageTaskService IReadingImageTaskService, IRepository consistencyCheckFileRepository ) { + this._IReadingImageTaskService = IReadingImageTaskService; _subjectVisitRepository = subjectVisitRepository; this._trialQCQuestionAnswerRepository = trialQCQuestionAnswerRepository; this._trialQCQuestionRepository = trialQCQuestionRepository; @@ -606,6 +610,7 @@ namespace IRaCIS.Core.Application.Image.QA { QCQuestionAnswerList = qacheckList, StudyList = temp.StudyList, + ExistsManual= (await _IReadingImageTaskService.GetManualList(new GetManualListInDto() { TrialId = sv.TrialId })).Count() > 0, SeriesList = temp.SeriesList, RelationInfo = await GetVisitQCSubjectInfo(subjectVisitId), NoneDicomStudyList = await _repository.Where(t => t.SubjectVisitId == subjectVisitId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(), diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs index 79dfc0603..88728c9a4 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs @@ -33,5 +33,7 @@ namespace IRaCIS.Core.Application.Contracts Task SubmitOncologyReadingInfo(SubmitOncologyReadingInfoInDto inDto); Task AddOncologyTask(Guid oncologModuleId); + + Task> GetManualList(GetManualListInDto inDto); } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 1c52065c3..2d1f40204 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -147,26 +147,36 @@ namespace IRaCIS.Application.Services public async Task> GetManualList(GetManualListInDto inDto) { UserTypeEnum userType = (UserTypeEnum)_userInfo.UserTypeEnumInt; - //_userInfo.UserTypeId + + + List canViewUserType = new List() + { + UserTypeEnum.IndependentReviewer, + UserTypeEnum.IQC, + + }; return await _trialDocumentRepository.Where(x => x.TrialId == inDto.TrialId - && x.TrialDocConfirmedUserList.Any(y => y.ConfirmUserId == _userInfo.Id) + && x.TrialDocConfirmedUserList.Any(y => y.ConfirmUserId == _userInfo.Id && y.ConfirmTime != null) && x.NeedConfirmedUserTypeList.Any(y => y.NeedConfirmUserTypeId == _userInfo.UserTypeId)) - .Where(t => t.FileType.Code == "2" || t.FileType.Code == "6") - .Select(x => new GetManualListOutDto() - { - Id=x.Id, - Name = x.Name, - Path = x.Path - }).ToListAsync(); - } + .WhereIf(userType== UserTypeEnum.IndependentReviewer, t => t.FileType.Code == "2" || t.FileType.Code == "6") + .WhereIf(userType == UserTypeEnum.IQC, t => t.FileType.Code == "4" || t.FileType.Code == "5") + .WhereIf(!canViewUserType.Contains(userType),t=>false) + .IgnoreQueryFilters() + .Select(x => new GetManualListOutDto() + { + Id = x.Id, + Name = x.Name, + Path = x.Path + }).ToListAsync(); + } - /// - /// 获取任务附加问题 - /// - /// - /// - [HttpPost] + /// + /// 获取任务附加问题 + /// + /// + /// + [HttpPost] public async Task<(List, bool)> GetTaskAdditionalQuestion(GetTaskAdditionalQuestionInDto inDto) { diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs index c2373fe8d..8fcfa0e0e 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs @@ -766,7 +766,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto) { + if (await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.ReadingQuestionTrial.QuestionType == QuestionType.ImageQualityAssessment && x.VisitTaskId == inDto.VisitTaskId && x.Answer == ImageQualityEvaluation.Abnormal.GetEnumInt())) + { + return; + } var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Answer == string.Empty || x.Answer == null) && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State ) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs index 845f43f6e..f396c0497 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs @@ -1027,6 +1027,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto) { + + if (await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.ReadingQuestionTrial.QuestionType == QuestionType.ImageQualityAssessment && x.VisitTaskId == inDto.VisitTaskId && x.Answer == ImageQualityEvaluation.Abnormal.GetEnumInt())) + { + + return; + } + var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Answer == string.Empty || x.Answer == null) && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State ) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index 85eee1514..c44e8815c 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -633,6 +633,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto) { + if (await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.ReadingQuestionTrial.QuestionType == QuestionType.ImageQualityAssessment && x.VisitTaskId == inDto.VisitTaskId && x.Answer == ImageQualityEvaluation.Abnormal.GetEnumInt())) + { + + return; + } + + var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Answer == string.Empty || x.Answer == null) && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State ) diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs index 3fd7eecc2..bd528675f 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs @@ -629,6 +629,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto) { + if (await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.ReadingQuestionTrial.QuestionType == QuestionType.ImageQualityAssessment && x.VisitTaskId == inDto.VisitTaskId && x.Answer == ImageQualityEvaluation.Abnormal.GetEnumInt())) + { + + return; + } + var tableAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && (x.Answer == string.Empty || x.Answer == null) && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State ) diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 7ed9a7783..e17780ed5 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -16,11 +16,26 @@ namespace IRaCIS.Core.Domain.Share public static readonly string Group = "group"; } + /// + /// 影像质量评估 + /// + public enum ImageQualityEvaluation + { + /// + /// 正常 + /// + Normal = 1, - /// - /// 语言类型 - /// - public enum LanguageType + /// + /// 不正常 + /// + Abnormal = 2, + } + + /// + /// 语言类型 + /// + public enum LanguageType { /// @@ -1490,7 +1505,12 @@ namespace IRaCIS.Core.Domain.Share /// IsBrainMetastasis =43, - + /// + /// 影像质量评估 + /// + ImageQualityAssessment=44, + + } ///