Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
						commit
						7476f8a8e9
					
				| 
						 | 
				
			
			@ -254,6 +254,24 @@ namespace IRaCIS.Core.API.Controllers
 | 
			
		|||
            return result;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// CRC确认临床数据
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="opt"></param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        [HttpPost, Route("Inspection/ClinicalAnswer/CRCConfirmClinical")]
 | 
			
		||||
        [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
 | 
			
		||||
 | 
			
		||||
        [UnitOfWork]
 | 
			
		||||
        public async Task<IResponseOutput> CRCConfirmClinical(DataInspectionDto<CRCConfirmClinicalInDto> opt)
 | 
			
		||||
        {
 | 
			
		||||
            var singid = await _inspectionService.RecordSing(opt.SignInfo);
 | 
			
		||||
            var result = await _clinicalAnswerService.CRCConfirmClinical(opt.Data);
 | 
			
		||||
            await _inspectionService.CompletedSign(singid, result);
 | 
			
		||||
            return result;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// CRC撤销临床数据
 | 
			
		||||
        /// </summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -146,6 +146,13 @@
 | 
			
		|||
            <param name="opt"></param>
 | 
			
		||||
            <returns></returns>
 | 
			
		||||
        </member>
 | 
			
		||||
        <member name="M:IRaCIS.Core.API.Controllers.InspectionController.CRCConfirmClinical(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.CRCConfirmClinicalInDto})">
 | 
			
		||||
            <summary>
 | 
			
		||||
            CRC确认临床数据
 | 
			
		||||
            </summary>
 | 
			
		||||
            <param name="opt"></param>
 | 
			
		||||
            <returns></returns>
 | 
			
		||||
        </member>
 | 
			
		||||
        <member name="M:IRaCIS.Core.API.Controllers.InspectionController.CRCCancelConfirmClinical(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Service.Reading.Dto.CRCCancelConfirmClinicalInDto})">
 | 
			
		||||
            <summary>
 | 
			
		||||
            CRC撤销临床数据
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2786,6 +2786,16 @@
 | 
			
		|||
            模块名称
 | 
			
		||||
            </summary>
 | 
			
		||||
        </member>
 | 
			
		||||
        <member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CRCConfirmClinicalInDto.IsClinicalDataComplete">
 | 
			
		||||
            <summary>
 | 
			
		||||
            临床数据是否完整
 | 
			
		||||
            </summary>
 | 
			
		||||
        </member>
 | 
			
		||||
        <member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CRCConfirmClinicalInDto.IsClinicalDataBlind">
 | 
			
		||||
            <summary>
 | 
			
		||||
            临床数据是否盲化
 | 
			
		||||
            </summary>
 | 
			
		||||
        </member>
 | 
			
		||||
        <member name="P:IRaCIS.Core.Application.Service.Reading.Dto.CRCClinicalForm.SubjectId">
 | 
			
		||||
            <summary>
 | 
			
		||||
            受试者Id
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1167,8 +1167,8 @@ namespace IRaCIS.Core.Application.Image.QA
 | 
			
		|||
                }
 | 
			
		||||
 | 
			
		||||
                //基线  且配置了临床数据  
 | 
			
		||||
                if (trialConfig.ClinicalInformationTransmissionEnum != 0 /*&& dbSubjectVisit.IsBaseLine*//*&&dbSubjectVisit.ClinicalDataSignUserId==null*/)
 | 
			
		||||
                {
 | 
			
		||||
                //if (trialConfig.ClinicalInformationTransmissionEnum != 0 /*&& dbSubjectVisit.IsBaseLine*//*&&dbSubjectVisit.ClinicalDataSignUserId==null*/)
 | 
			
		||||
                //{
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
                    ////找到需要确认的PDF 临床数据  如果没有CRC 没有上传  那么就添加一条没有文件的记录
 | 
			
		||||
| 
						 | 
				
			
			@ -1231,7 +1231,7 @@ namespace IRaCIS.Core.Application.Image.QA
 | 
			
		|||
                    //}
 | 
			
		||||
 | 
			
		||||
                    //return ResponseOutput.NotOk("没有签名临床数据,不允许提交");
 | 
			
		||||
                }
 | 
			
		||||
                //}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -225,6 +225,9 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
 | 
			
		||||
            var clinicalData= _readingClinicalDataRepository.Where(x=>x.TrialId == inDto.TrialId&&x.ClinicalDataTrialSet.UploadRole==UploadRole.CRC&&x.ClinicalDataTrialSet.ClinicalDataLevel!= ClinicalLevel.SubjectVisit)
 | 
			
		||||
                .Where(x=>!x.IsSign)
 | 
			
		||||
                .WhereIf(inDto.SubjectId!=null,x=>x.SubjectId==inDto.SubjectId)
 | 
			
		||||
                .WhereIf(inDto.SubjectCode != null, x => x.Subject.Code.Contains(inDto.SubjectCode??string.Empty))
 | 
			
		||||
                .Where(x=> x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject)
 | 
			
		||||
                .Include(x=>x.ClinicalDataTrialSet).Select(x=>new GetCRCSubjectClinicalOutDto() { 
 | 
			
		||||
                  SubjectId=x.SubjectId,
 | 
			
		||||
					SubjectCode=x.Subject.Code,
 | 
			
		||||
| 
						 | 
				
			
			@ -266,7 +269,7 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
            result.AnswerList = new List<Dictionary<string, string>>();
 | 
			
		||||
            result.QuestionList=await _trialClinicalQuestionRepository.Where(x=>x.TrialClinicalId==inDto.ClinicalDataTrialSetId
 | 
			
		||||
            &&x.ClinicalQuestionType!= ReadingQestionType.Group
 | 
			
		||||
            && x.ClinicalQuestionType != ReadingQestionType.Table).OrderBy(x=>x.ShowOrder)
 | 
			
		||||
            && x.ClinicalQuestionType != ReadingQestionType.Table).OrderByDescending(x=>x.IsCheckDate).ThenBy(x=>x.ShowOrder)
 | 
			
		||||
               .ProjectTo<TrialClinicalQuestionDto>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            var answers = await _clinicalQuestionAnswerRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
 | 
			
		||||
| 
						 | 
				
			
			@ -515,16 +518,25 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        [HttpPost]
 | 
			
		||||
        public async Task<PageOutput<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            if (inDto.ReadModuleId != null)
 | 
			
		||||
            {
 | 
			
		||||
                var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync();
 | 
			
		||||
                inDto.TrialReadingCriterionId = readModule.TrialReadingCriterionId;
 | 
			
		||||
            }
 | 
			
		||||
            var query = _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)
 | 
			
		||||
                .WhereIf(inDto.ReadModuleId != null, x => x.Id == inDto.ReadModuleId)
 | 
			
		||||
                .WhereIf(inDto.IsCRCConfirm != null, x => x.IsCRCConfirm == inDto.IsCRCConfirm)
 | 
			
		||||
                 .WhereIf(inDto.IsPMConfirm != null, x => x.IsPMConfirm == inDto.IsPMConfirm)
 | 
			
		||||
                .WhereIf(inDto.SubjectCode != null, x => x.Subject.Code.Contains(inDto.SubjectCode??string.Empty))
 | 
			
		||||
                .WhereIf(inDto.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId)
 | 
			
		||||
				.WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId)
 | 
			
		||||
                .WhereIf(inDto.StartTime != null, x => x.SubjectVisit.LatestScanDate >= inDto.StartTime)
 | 
			
		||||
                .WhereIf(inDto.EndTime != null, x => x.SubjectVisit.LatestScanDate <= inDto.EndTime)
 | 
			
		||||
                .Select(x => new GetCRCConfirmListOutDto()
 | 
			
		||||
                {
 | 
			
		||||
                 
 | 
			
		||||
                    SubjectId = x.SubjectId,
 | 
			
		||||
                    IsNotNeedPMConfirm=x.IsNotNeedPMConfirm,
 | 
			
		||||
                    IsCRCConfirm = x.IsCRCConfirm,
 | 
			
		||||
                    IsCRCApplicationRevoke=x.IsCRCApplicationRevoke,
 | 
			
		||||
                    VisitBlindName=x.SubjectVisit.BlindName,
 | 
			
		||||
| 
						 | 
				
			
			@ -757,12 +769,16 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
            {
 | 
			
		||||
                TrialId = inDto.TrialId,
 | 
			
		||||
                SubjectId= readModule.SubjectId,
 | 
			
		||||
                ReadModuleId= inDto.ReadModuleId,
 | 
			
		||||
                IsCRCConfirm=false,
 | 
			
		||||
                TrialReadingCriterionId = readModule.TrialReadingCriterionId,
 | 
			
		||||
                ReadModuleId = inDto.ReadModuleId,
 | 
			
		||||
                PageIndex =1,
 | 
			
		||||
                PageSize=9999,
 | 
			
		||||
			})).CurrentPageData;
 | 
			
		||||
			})).CurrentPageData.ToList();
 | 
			
		||||
 | 
			
		||||
            var presentData = confirmlist.Where(x => x.ReadModuleId == inDto.ReadModuleId).First();
 | 
			
		||||
 | 
			
		||||
            confirmlist = confirmlist.Where(x => x.LatestScanDate <= presentData.LatestScanDate).ToList();
 | 
			
		||||
 | 
			
		||||
            await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== inDto.ReadModuleId);
 | 
			
		||||
            List<ReadModuleCriterionFrom> needAddList = new List<ReadModuleCriterionFrom>()
 | 
			
		||||
| 
						 | 
				
			
			@ -783,15 +799,20 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
				});
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            var readModuleIds = confirmlist.Select(x => x.ReadModuleId).ToList();
 | 
			
		||||
 | 
			
		||||
            await _readModuleRepository.UpdatePartialFromQueryAsync(x => readModuleIds.Contains(x.Id),x=>new ReadModule() { 
 | 
			
		||||
            IsCRCConfirm=true
 | 
			
		||||
            foreach (var item in confirmlist)
 | 
			
		||||
            {
 | 
			
		||||
                await _readModuleRepository.UpdatePartialFromQueryAsync(x =>x.Id==item.ReadModuleId , x => new ReadModule()
 | 
			
		||||
                {
 | 
			
		||||
                    IsCRCConfirm = true,
 | 
			
		||||
                    IsPMConfirm=item.ClinicalFormList.Count()==0?true:false,
 | 
			
		||||
                    IsNotNeedPMConfirm= item.ClinicalFormList.Count() == 0 ? true : false,
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            await _readModuleCriterionFromRepository.AddRangeAsync(needAddList);
 | 
			
		||||
 | 
			
		||||
            await _readModuleCriterionFromRepository.SaveChangesAsync();
 | 
			
		||||
 | 
			
		||||
            await _iReadingClinicalDataService.DealVisiTaskClinicalDataSignedAsync(inDto.TrialId, inDto.SubjectId, inDto.ReadModuleId, false, readModule.TrialReadingCriterionId);
 | 
			
		||||
            return ResponseOutput.Ok(true);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -816,7 +837,7 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
 | 
			
		||||
			var presentData = dataList.Where(x => x.ReadModuleId == inDto.ReadModuleId).First();
 | 
			
		||||
 | 
			
		||||
            if (dataList.Any(x => x.IsPMConfirm && x.LatestScanDate > presentData.LatestScanDate && x.ReadingSetType == presentData.ReadingSetType))
 | 
			
		||||
            if (dataList.Any(x => x.IsCRCConfirm && x.LatestScanDate > presentData.LatestScanDate && x.ReadingSetType == presentData.ReadingSetType))
 | 
			
		||||
            {
 | 
			
		||||
				throw new BusinessValidationFailedException("当前数据并非最后一条确认信息,无法取消!");
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			@ -826,16 +847,27 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
				throw new BusinessValidationFailedException("PM已确认,无法取消!");
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            if (presentData.IsNotNeedPMConfirm)
 | 
			
		||||
            {
 | 
			
		||||
                await _readModuleRepository.UpdatePartialFromQueryAsync(x => presentData.ReadModuleId == x.Id, x => new ReadModule()
 | 
			
		||||
                {
 | 
			
		||||
				IsCRCApplicationRevoke = true
 | 
			
		||||
                    IsPMConfirm = false,
 | 
			
		||||
                    IsCRCConfirm = false,
 | 
			
		||||
                    IsNotNeedPMConfirm = false,
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                await _readModuleRepository.UpdatePartialFromQueryAsync(x => presentData.ReadModuleId == x.Id, x => new ReadModule()
 | 
			
		||||
                {
 | 
			
		||||
                    IsCRCApplicationRevoke = true,
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
			
 | 
			
		||||
 | 
			
		||||
			//await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== presentData.ReadModuleId);
 | 
			
		||||
 | 
			
		||||
			await _readModuleCriterionFromRepository.SaveChangesAsync();
 | 
			
		||||
 | 
			
		||||
            return ResponseOutput.Ok(true);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -868,7 +900,9 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
            {
 | 
			
		||||
                await _readModuleRepository.UpdatePartialFromQueryAsync(x => inDto.ReadModuleId == x.Id, x => new ReadModule()
 | 
			
		||||
                {
 | 
			
		||||
                    IsPMConfirm = true
 | 
			
		||||
                    IsPMConfirm = true,
 | 
			
		||||
                    IsClinicalDataBlind=inDto.IsClinicalDataBlind,
 | 
			
		||||
                    IsClinicalDataComplete=inDto.IsClinicalDataComplete,
 | 
			
		||||
                });
 | 
			
		||||
                await _readModuleRepository.SaveChangesAsync();
 | 
			
		||||
                await _iReadingClinicalDataService.DealVisiTaskClinicalDataSignedAsync(inDto.TrialId, inDto.SubjectId, inDto.ReadModuleId, false, readModuleData.TrialReadingCriterionId);
 | 
			
		||||
| 
						 | 
				
			
			@ -880,7 +914,7 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
                    IsCRCConfirm = false,
 | 
			
		||||
                    IsCRCApplicationRevoke=false,
 | 
			
		||||
                });
 | 
			
		||||
                await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== x.Id);
 | 
			
		||||
                await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== inDto.ReadModuleId);
 | 
			
		||||
 | 
			
		||||
                await _readModuleRepository.SaveChangesAsync();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -229,6 +229,10 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
                //---存在同类型的临床数据,操作失败
 | 
			
		||||
                return ResponseOutput.NotOk(_localizer["ClinicalDataSet_DupTypeFail"]);
 | 
			
		||||
            }
 | 
			
		||||
            if (indto.Id != null && indto.IsApply == null)
 | 
			
		||||
            {
 | 
			
		||||
                indto.IsApply = await _clinicalDataTrialSetRepository.Where(x => x.Id == indto.Id).Select(x => x.IsApply).FirstOrDefaultAsync();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            //indto.CriterionEnumListStr = $"|{String.Join('|', indto.CriterionEnumList)}|";
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -118,10 +118,10 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        public async Task<(List<ClinicalQuestionPreviewDto>, bool)> GetSystemClinicalQuestionPreview(GetSystemClinicalQuestionPreviewDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            var questions = await _systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId)
 | 
			
		||||
                .ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
                .ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            var tableQuestions= await _systemClinicalTableQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId)
 | 
			
		||||
                .ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
                .ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).ToList();
 | 
			
		||||
| 
						 | 
				
			
			@ -144,13 +144,13 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        public async Task<(List<ClinicalQuestionPreviewDto>, bool)> GetTrialClinicalQuestionPreview(GetTrialClinicalQuestionPreviewDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            var questions = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
 | 
			
		||||
                .ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
                .ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync();
 | 
			
		||||
 | 
			
		||||
            var tableQuestions = await _trialClinicalTableQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
 | 
			
		||||
                .ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
 | 
			
		||||
                .ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).ToList();
 | 
			
		||||
            var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).OrderBy(x => x.ShowOrder).ToList();
 | 
			
		||||
 | 
			
		||||
            result.ForEach(x =>
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -170,7 +170,7 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        /// <param name="tableQuestions"></param>
 | 
			
		||||
        public void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions,List<ClinicalFormQuestionAnswer> answers, List<ClinicalFormTableQuestionAnswer> tableAnswers)
 | 
			
		||||
        {
 | 
			
		||||
            item.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).ToList();
 | 
			
		||||
            item.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).OrderBy(x => x.ShowOrder).ToList();
 | 
			
		||||
 | 
			
		||||
			item.RelationQuestions = questions.Where(x => x.RelevanceId == item.Id).ToList();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -188,7 +188,7 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
            });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).OrderBy(x=>x.ShowOrder).ToList();
 | 
			
		||||
            item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).OrderBy(x=>x.ShowOrder).OrderBy(x => x.ShowOrder).ToList();
 | 
			
		||||
 | 
			
		||||
            item.RelationQuestions.ForEach(x => {
 | 
			
		||||
                this.FindChildQuestion(x, questions, tableQuestions, answers, tableAnswers);
 | 
			
		||||
| 
						 | 
				
			
			@ -227,12 +227,17 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        /// <returns></returns>
 | 
			
		||||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> AddOrUpdateTrialClinicalQuestion(TrialClinicalQuestionDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            if (inDto.IsVerify)
 | 
			
		||||
            {
 | 
			
		||||
                if (await _trialClinicalQuestionRepository.AnyAsync(x => x.TrialClinicalId == inDto.TrialClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
 | 
			
		||||
                {
 | 
			
		||||
                return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
 | 
			
		||||
                    return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"],string.Empty,ApiResponseCodeEnum.NeedTips);
 | 
			
		||||
                }
 | 
			
		||||
              
 | 
			
		||||
            }
 | 
			
		||||
         
 | 
			
		||||
 | 
			
		||||
            if (await _trialClinicalQuestionRepository.AnyAsync(x => x.TrialClinicalId == inDto.TrialClinicalId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
 | 
			
		||||
            {
 | 
			
		||||
                return ResponseOutput.NotOk("问题序号存在重复!");
 | 
			
		||||
| 
						 | 
				
			
			@ -322,10 +327,14 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        public async Task<IResponseOutput> AddOrUpdateSystemClinicalQuestion(SystemClinicalQuestionDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            if (inDto.IsVerify)
 | 
			
		||||
            {
 | 
			
		||||
                if (await _systemClinicalQuestionRepository.AnyAsync(x => x.SystemClinicalId == inDto.SystemClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
 | 
			
		||||
                {
 | 
			
		||||
                return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
 | 
			
		||||
                    return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"], string.Empty, ApiResponseCodeEnum.NeedTips);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
            if (await _systemClinicalQuestionRepository.AnyAsync(x => x.SystemClinicalId == inDto.SystemClinicalId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
 | 
			
		||||
            {
 | 
			
		||||
| 
						 | 
				
			
			@ -415,10 +424,13 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        /// <returns></returns>
 | 
			
		||||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> AddOrUpdateSystemClinicalTableQuestion(SystemClinicalTableQuestionDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            if (inDto.IsVerify)
 | 
			
		||||
            {
 | 
			
		||||
                if (await _systemClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
 | 
			
		||||
                {
 | 
			
		||||
                return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
 | 
			
		||||
                    return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"], string.Empty, ApiResponseCodeEnum.NeedTips);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (await _systemClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
 | 
			
		||||
| 
						 | 
				
			
			@ -475,10 +487,13 @@ namespace IRaCIS.Core.Application.Service
 | 
			
		|||
        /// <returns></returns>
 | 
			
		||||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput> AddOrUpdateTrialClinicalTableQuestion(TrialClinicalTableQuestionDto inDto)
 | 
			
		||||
        {
 | 
			
		||||
            if (inDto.IsVerify)
 | 
			
		||||
            {
 | 
			
		||||
                if (await _trialClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
 | 
			
		||||
                {
 | 
			
		||||
                return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
 | 
			
		||||
                    return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"], string.Empty, ApiResponseCodeEnum.NeedTips);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (await _trialClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.ShowOrder == inDto.ShowOrder))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -400,6 +400,13 @@ namespace IRaCIS.Application.Services
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCritrialId && t.SouceReadModuleId == readingId, u => new VisitTask()
 | 
			
		||||
                    {
 | 
			
		||||
                        IsClinicalDataSign = false
 | 
			
		||||
                    });
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,6 +25,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
	public class GetCRCSubjectClinicalInDto:PageInput
 | 
			
		||||
    {
 | 
			
		||||
        public Guid TrialId { get; set; }
 | 
			
		||||
 | 
			
		||||
        public Guid? SubjectId { get; set; }
 | 
			
		||||
 | 
			
		||||
        public string? SubjectCode { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -145,9 +149,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
 | 
			
		||||
		public Guid? SubjectId { get; set; }
 | 
			
		||||
 | 
			
		||||
        public DateTime? StartTime { get; set; }
 | 
			
		||||
        public DateTime? EndTime { get; set; }
 | 
			
		||||
 | 
			
		||||
        public Guid TrialId { get; set; }
 | 
			
		||||
 | 
			
		||||
		public Guid? ReadModuleId { get; set; }
 | 
			
		||||
 | 
			
		||||
        public string? SubjectCode { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class CRCCancelConfirmClinicalInDto
 | 
			
		||||
| 
						 | 
				
			
			@ -222,6 +231,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
 | 
			
		||||
		public Guid ReadModuleId { get; set; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 临床数据是否完整
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool? IsClinicalDataComplete { get; set; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 临床数据是否盲化
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool? IsClinicalDataBlind { get; set; }
 | 
			
		||||
 | 
			
		||||
        public bool IsConfirm { get; set; }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -260,6 +279,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
		/// 受试者ID
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		public Guid SubjectId { get; set; }
 | 
			
		||||
 | 
			
		||||
        public bool IsNotNeedPMConfirm { get; set; } = false;
 | 
			
		||||
        public Guid ReadModuleId { get; set; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
        /// <summary>
 | 
			
		||||
        /// 是否应用
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public bool IsApply { get; set; } = false;
 | 
			
		||||
        public bool? IsApply { get; set; }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 名称
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -156,6 +156,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        public Guid? Id { get; set; }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        public bool IsVerify { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 问题名称
 | 
			
		||||
        /// </summary>
 | 
			
		||||
| 
						 | 
				
			
			@ -365,6 +368,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
 | 
			
		|||
 | 
			
		||||
        public Guid? Id { get; set; }
 | 
			
		||||
 | 
			
		||||
        public bool IsVerify { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 问题名称
 | 
			
		||||
        /// </summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,6 +17,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Interface
 | 
			
		|||
 | 
			
		||||
        Task<IResponseOutput> SubmitClinicalForm(SubmitClinicalFormInDto inDto);
 | 
			
		||||
 | 
			
		||||
        Task<IResponseOutput> CRCConfirmClinical(CRCConfirmClinicalInDto inDto);
 | 
			
		||||
 | 
			
		||||
        Task<IResponseOutput> CRCCancelConfirmClinical(CRCCancelConfirmClinicalInDto inDto);
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -256,6 +256,12 @@ namespace IRaCIS.Core.Application.Contracts
 | 
			
		|||
        public int? UrgentCount { get; set; }
 | 
			
		||||
 | 
			
		||||
        public int? ToBeDealedCount { get; set; }
 | 
			
		||||
 | 
			
		||||
        public int? ToAllCount { get; set; }
 | 
			
		||||
 | 
			
		||||
        public int? ToBeVisitCount { get; set; }
 | 
			
		||||
 | 
			
		||||
        public int? ReadModuleCount { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public class TrialToBeDoneQuery : PageInput
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -205,7 +205,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
 | 
			
		||||
                    ToBeRepliedCount = t.SubjectVisitList.Where(u => u.CheckState == CheckStateEnum.CVIng &&
 | 
			
		||||
                    u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
 | 
			
		||||
                });
 | 
			
		||||
                }).Where(x => x.ToBeRepliedCount > 0); 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -248,7 +248,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
                     UrgentCount = g.Where(u => u.OriginalReReadingTask.IsUrgent == true).Count(),
 | 
			
		||||
                     ToBeApprovalCount = g.Count(),
 | 
			
		||||
 | 
			
		||||
                 });
 | 
			
		||||
                 }).Where(x => x.ToBeApprovalCount > 0);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReReadingApplyToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
| 
						 | 
				
			
			@ -286,7 +286,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
 | 
			
		||||
                        IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
 | 
			
		||||
                        ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup).Count()
 | 
			
		||||
                    });
 | 
			
		||||
                    }).Where(x => x.ToBeApprovalCount > 0);
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +318,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
 | 
			
		||||
                 
 | 
			
		||||
                    ToBeApprovalCount = t.ReadModuleList.Where(u => u.IsCRCConfirm&&!u.IsPMConfirm).Count()
 | 
			
		||||
                });
 | 
			
		||||
                }).Where(x => x.ToBeApprovalCount > 0);
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
       
 | 
			
		||||
| 
						 | 
				
			
			@ -363,7 +363,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
 | 
			
		||||
                        IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
 | 
			
		||||
                        ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count()
 | 
			
		||||
                    });
 | 
			
		||||
                    }).Where(x => x.ToBeApprovalCount > 0) ;
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReviewerSelectToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -400,7 +400,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
                    UrgentCount = g.Where(u => u.OriginalReReadingTask.IsUrgent == true).Count(),
 | 
			
		||||
                    ToBeApprovalCount = g.Count(),
 | 
			
		||||
 | 
			
		||||
                });
 | 
			
		||||
                }).Where(x => x.ToBeApprovalCount > 0);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ReReadingApprovalToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
| 
						 | 
				
			
			@ -441,9 +441,50 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
                    ExperimentName = t.ExperimentName,
 | 
			
		||||
                    TrialCode = t.TrialCode,
 | 
			
		||||
                    UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent).Count(),
 | 
			
		||||
                    ToBeDealedCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count(),
 | 
			
		||||
                    ToBeDealedCount = t.ReadingClinicalDataList.Where(x=>!x.IsSign&& x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.SubjectVisit&& x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject).Count(),
 | 
			
		||||
                    ToBeVisitCount= t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Count(),
 | 
			
		||||
                    ToAllCount= t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC ).Count(),
 | 
			
		||||
                    ReadModuleCount =t.ReadModuleList.Where(x=>!x.IsPMConfirm).Count(),
 | 
			
		||||
                }).Where(x=>x.ToBeDealedCount > 0);
 | 
			
		||||
 | 
			
		||||
                });
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageClinicalDataToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
 | 
			
		||||
            var toBeDealedCount = _subjectVisitRepository
 | 
			
		||||
                 //.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.Trial.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
 | 
			
		||||
                 .Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted).Count();
 | 
			
		||||
 | 
			
		||||
            return ResponseOutput.Ok(result, new { TotalToBeDealedCount = toBeDealedCount });
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 临床数据  --CRC 待确认
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="inQuery"></param>
 | 
			
		||||
        /// <param name="_subjectVisitRepository"></param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        [HttpPost]
 | 
			
		||||
        public async Task<IResponseOutput<PageOutput<ImageClinicalDataToBeDoneDto>>> GetImageClinicalDataToBeConfirmList(ImageClinicalDataToBeDoneQuery inQuery,
 | 
			
		||||
            [FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
 | 
			
		||||
              [FromServices] IRepository<Trial> _trialRepository)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            var query = _trialRepository
 | 
			
		||||
                .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
 | 
			
		||||
                //.Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
 | 
			
		||||
                .Select(t => new ImageClinicalDataToBeDoneDto()
 | 
			
		||||
                {
 | 
			
		||||
                    TrialId = t.Id,
 | 
			
		||||
                    ResearchProgramNo = t.ResearchProgramNo,
 | 
			
		||||
                    ExperimentName = t.ExperimentName,
 | 
			
		||||
                    TrialCode = t.TrialCode,
 | 
			
		||||
                    UrgentCount = t.SubjectVisitList.Where(u => u.IsBaseLine && u.SubmitState != SubmitStateEnum.Submitted && u.IsUrgent).Count(),
 | 
			
		||||
                    ToBeDealedCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.SubjectVisit && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject).Count(),
 | 
			
		||||
                    ToBeVisitCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Count(),
 | 
			
		||||
                    ToAllCount = t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC).Count(),
 | 
			
		||||
                    ReadModuleCount = t.ReadModuleList.Where(x => !x.IsPMConfirm).Count(),
 | 
			
		||||
                }).Where(x => x.ReadModuleCount > 0);
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageClinicalDataToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -490,7 +531,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
 | 
			
		||||
                    .Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count(),
 | 
			
		||||
 | 
			
		||||
                });
 | 
			
		||||
                }).Where(x => x.ToBeDealedCount > 0); ;
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQuestionToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -531,7 +572,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
                    ToBeReplyedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
 | 
			
		||||
                    .Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count()
 | 
			
		||||
 | 
			
		||||
                });
 | 
			
		||||
                }).Where(x => x.ToBeReplyedCount > 0);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -577,7 +618,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
                    .Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
 | 
			
		||||
                    .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading).Count(),
 | 
			
		||||
 | 
			
		||||
                });
 | 
			
		||||
                }).Where(x => x.ToBeReUploadCount > 0);
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageReUploadToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -621,7 +662,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
                    .Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
 | 
			
		||||
                    .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(),
 | 
			
		||||
 | 
			
		||||
                });
 | 
			
		||||
                }).Where(x => x.ToBeDealedCount > 0); ;
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageSubmittedToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -674,7 +715,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
                    //待审核通过,统计从已领取到QC提交之间的      已领取 待审核 审核中   (审核完成  领取人就会清理 所以只用查询当前领取人是自己的就好了)
 | 
			
		||||
                    ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
 | 
			
		||||
 | 
			
		||||
                });
 | 
			
		||||
                }).Where(x => x.UrgentCount > 0); 
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQualityToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -719,7 +760,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
                    ToBeDealedCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
 | 
			
		||||
                    .Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
 | 
			
		||||
 | 
			
		||||
                });
 | 
			
		||||
                }).Where(x => x.ToBeDealedCount > 0); ;
 | 
			
		||||
 | 
			
		||||
            var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrEmpty(inQuery.SortField) ? nameof(ImageQuestionToBeDoneDto.TrialId) : inQuery.SortField, inQuery.Asc);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -791,7 +832,7 @@ namespace IRaCIS.Core.Application
 | 
			
		|||
 | 
			
		||||
                     HaveSignedCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
 | 
			
		||||
                                       && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
 | 
			
		||||
                 })
 | 
			
		||||
                 }).Where(x => x.UnReadCount > 0);
 | 
			
		||||
 | 
			
		||||
            ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -75,6 +75,13 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
 | 
			
		||||
		public ClinicalDataTrialSet ClinicalDataTrialSet { get; set; }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        [JsonIgnore]
 | 
			
		||||
        [ForeignKey("TrialId")]
 | 
			
		||||
 | 
			
		||||
        public Trial Trial { get; set; }
 | 
			
		||||
 | 
			
		||||
        [JsonIgnore]
 | 
			
		||||
		[ForeignKey("ReadingId")]
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,6 +80,8 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
 | 
			
		||||
		public bool IsPMConfirm { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
		public bool IsNotNeedPMConfirm { get; set; } = false;
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// CRC是否正在申请撤回
 | 
			
		||||
        /// </summary>
 | 
			
		||||
| 
						 | 
				
			
			@ -90,6 +92,16 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
 | 
			
		||||
		public Guid? DeleteUserId { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 临床数据是否完整
 | 
			
		||||
		/// </summary>
 | 
			
		||||
        public bool? IsClinicalDataComplete { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// 临床数据是否盲化
 | 
			
		||||
		/// </summary>
 | 
			
		||||
        public bool? IsClinicalDataBlind { get; set; }
 | 
			
		||||
 | 
			
		||||
        ///// <summary>
 | 
			
		||||
        ///// 
 | 
			
		||||
        ///// </summary>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -85,8 +85,8 @@ namespace IRaCIS.Core.Domain.Models
 | 
			
		|||
        public virtual ICollection<TrialStatusDetail> ClinicalTrialProjectDetails { get; set; }
 | 
			
		||||
        [JsonIgnore]
 | 
			
		||||
        public virtual ICollection<TrialDictionary> TrialDicList { get; set; }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        [JsonIgnore]
 | 
			
		||||
        public List<ReadingClinicalData> ReadingClinicalDataList { get; set; }
 | 
			
		||||
 | 
			
		||||
        [StringLength(100)]
 | 
			
		||||
        public string TrialCode { get; set; } = string.Empty;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue