diff --git a/IRaCIS.Core.API/Properties/launchSettings.json b/IRaCIS.Core.API/Properties/launchSettings.json index adf4910a..a5c135eb 100644 --- a/IRaCIS.Core.API/Properties/launchSettings.json +++ b/IRaCIS.Core.API/Properties/launchSettings.json @@ -45,6 +45,14 @@ "ASPNETCORE_ENVIRONMENT": "Production" }, "applicationUrl": "http://localhost:6300" + }, + "IRaCIS.CertificateApply": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "CertificateApply" + }, + "applicationUrl": "http://localhost:6400" } } } \ No newline at end of file diff --git a/IRaCIS.Core.API/appsettings.CertificateApply.json b/IRaCIS.Core.API/appsettings.CertificateApply.json new file mode 100644 index 00000000..2c04ce92 --- /dev/null +++ b/IRaCIS.Core.API/appsettings.CertificateApply.json @@ -0,0 +1,33 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "ConnectionStrings": { + "RemoteNew": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_Certificate;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true", + "Hangfire": "Server=123.56.94.154,1433\\MSSQLSERVER;Database=Hangfire_IRaCIS;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true" + + }, + "BasicSystemConfig": { + + "OpenUserComplexPassword": false, + + "OpenSignDocumentBeforeWork": false, + + "OpenTrialRelationDelete": true, + + "OpenLoginLimit": false + }, + + "SystemEmailSendConfig": { + "Port": 465, + "Host": "smtp.qiye.aliyun.com", + "FromEmail": "test@extimaging.com", + "FromName": "Test_IRC", + "AuthorizationCode": "SHzyyl2021" + } + +} diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 26d9aad8..7f6c1b47 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -8614,6 +8614,13 @@ 处理 访视 末次评估 会影响Subject 状态 + + + 处理生成阅片期 以及后续访视状态 + + + + 处理 访视 1、提交状态 2、执行状态 3、最早最晚 拍片日期 diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 2b0f0ba1..7e5d58c6 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1982,7 +1982,7 @@ namespace IRaCIS.Core.Application.Service.Allocation if (criterionConfig.IsReadingTaskViewInOrder) { - Expression> filterExpression = t => t.TrialId == trialId && t.SubjectId == task.SubjectId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false; + Expression> filterExpression = t => t.TrialId == trialId && t.SubjectId == task.SubjectId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.TaskAllocationState == TaskAllocationState.Allocated; //另一个阅片人的任务根据任务进度自动进入PM退回或PM申请重阅 diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 94470861..167d0841 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -461,8 +461,9 @@ namespace IRaCIS.Core.Application.Service.Common var dicomStudyQuery = _repository.Where(t => t.TrialId == studyQuery.TrialId) .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id)) - .WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression) + .WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression) .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo)) + .Where(x => x.SubjectVisit.AuditState == AuditStateEnum.QCPassed) .Select(t => new UnionStudyExportDTO() { VisitName = t.SubjectVisit.VisitName, @@ -490,7 +491,7 @@ namespace IRaCIS.Core.Application.Service.Common .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id)) .WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2) .WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo)) - + .Where(x => x.SubjectVisit.AuditState == AuditStateEnum.QCPassed) .Select(t => new UnionStudyExportDTO() { diff --git a/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs b/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs index 8164b797..4f966504 100644 --- a/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs @@ -56,13 +56,9 @@ namespace IRaCIS.Core.Application.Triggers { await VerifyDealFinalVisitAsync(subjectVisit); - await _subjectRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisit.SubjectId, - u => new Subject() { Status = SubjectStatus.OutOfVisit, FinalSubjectVisitId = subjectVisit.Id }); + await DealGenerateReadModuleAndSubjectVisit(subjectVisit); - - //末次访视后的 访视设置为不可用 - await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == subjectVisit.SubjectId && t.VisitNum > subjectVisit.VisitNum && - t.VisitExecuted == VisitExecutedEnum.UnExecuted, u => new SubjectVisit() { VisitExecuted = VisitExecutedEnum.Unavailable }); + } else { @@ -73,18 +69,6 @@ namespace IRaCIS.Core.Application.Triggers await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == subjectVisit.SubjectId && t.VisitExecuted == VisitExecutedEnum.Unavailable, u => new SubjectVisit() { VisitExecuted = VisitExecutedEnum.UnExecuted }); - //var readingPeriodSet =await _readingPeriodSetRepository.Where(x => x.TrialId == subjectVisit.TrialId && x.IsGlobal).FirstOrDefaultAsync(); - - //if (readingPeriodSet != null) - //{ - // await _readingPeriodPlanRepository.DeleteFromQueryAsync(x => x.ReadingPeriodSetId == readingPeriodSet.Id && x.SubjectVisitId == subjectVisit.Id); - // await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.SubjectVisitId == subjectVisit.Id && x.ReadingPeriodSetId == readingPeriodSet.Id,x=> new ReadModule() { - // IsDeleted = true - // }); - // await _readModuleRepository.SaveChangesAsync(); - //} - - } } @@ -93,19 +77,29 @@ namespace IRaCIS.Core.Application.Triggers else if (context.ChangeType == ChangeType.Added && subjectVisit.IsFinalVisit) { await VerifyDealFinalVisitAsync(subjectVisit); + + await DealGenerateReadModuleAndSubjectVisit(subjectVisit); } } - private async Task VerifyDealFinalVisitAsync(SubjectVisit subjectVisit) + /// + /// 处理生成阅片期 以及后续访视状态 + /// + /// + /// + private async Task DealGenerateReadModuleAndSubjectVisit(SubjectVisit subjectVisit) { - if (await _subjectVisitRepository.AnyAsync(t => t.SubjectId == subjectVisit.SubjectId && t.VisitNum > subjectVisit.VisitNum && - (t.SubmitState == SubmitStateEnum.ToSubmit || t.SubmitState == SubmitStateEnum.Submitted))) - { - throw new BusinessValidationFailedException("该受试者已有后续访视已上传影像或已提交,当前访视不允许设置为末次访视。"); - } + + await _subjectRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisit.SubjectId, + u => new Subject() { Status = SubjectStatus.OutOfVisit, FinalSubjectVisitId = subjectVisit.Id }); - #region 末次访视生成阅片器和任务 更换位置 废弃 + //末次访视后的 访视设置为不可用 + await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == subjectVisit.SubjectId && t.VisitNum > subjectVisit.VisitNum && + t.VisitExecuted == VisitExecutedEnum.UnExecuted, u => new SubjectVisit() { VisitExecuted = VisitExecutedEnum.Unavailable }); + + + #region 末次访视生成阅片器和任务 var trialId = subjectVisit.TrialId; @@ -121,34 +115,6 @@ namespace IRaCIS.Core.Application.Triggers var criterionList = await _repository.Where(x => x.TrialId == trialId && x.ReadingInfoSignTime != null && x.IsConfirm && x.IsReadingPeriod && x.IsReadingTaskViewInOrder).ToListAsync(); foreach (var item in criterionList) { - //ReadingPeriodSet? readingPeriodSet = await _readingPeriodSetRepository.FirstOrDefaultNoTrackingAsync(x => x.TrialId == trialId && x.IsGlobal && x.TrialReadingCriterionId == item.Id); - - //if (readingPeriodSet == null) - //{ - // readingPeriodSet = new ReadingPeriodSet() - // { - // Id = NewId.NextGuid(), - // ReadingScope = ReadingScopeEnum.All, - // ReadingSetType = ReadingSetType.ImageReading, - // IsTakeEffect = ReadingPeriodStatus.TakeEffect, - // ReadingPeriodName = "Global", - // TrialId = trialId, - // EffectOfTime = DateTime.Now, - // IsGlobal = true, - // TrialReadingCriterionId = item.Id, - // }; - - // await _readingPeriodSetRepository.AddAsync(readingPeriodSet); - - //} - - //await _readingPeriodPlanRepository.AddAsync(new ReadingPeriodPlan() - //{ - // SubjectVisitId = subjectVisitId, - // ReadingPeriodSetId = readingPeriodSet.Id, - //}); - - var readModule = await _readModuleRepository.Where(x => x.ReadingSetType == ReadingSetType.ImageReading && x.TrialReadingCriterionId == item.Id && x.SubjectVisitId == subjectVisitId).FirstOrDefaultAsync(); @@ -207,7 +173,15 @@ namespace IRaCIS.Core.Application.Triggers #endregion + } + private async Task VerifyDealFinalVisitAsync(SubjectVisit subjectVisit) + { + if (await _subjectVisitRepository.AnyAsync(t => t.SubjectId == subjectVisit.SubjectId && t.VisitNum > subjectVisit.VisitNum && + (t.SubmitState == SubmitStateEnum.ToSubmit || t.SubmitState == SubmitStateEnum.Submitted))) + { + throw new BusinessValidationFailedException("该受试者已有后续访视已上传影像或已提交,当前访视不允许设置为末次访视。"); + } } }