diff --git a/IRaCIS.Core.API/appsettings.Event_IRC.json b/IRaCIS.Core.API/appsettings.Event_IRC.json index ae67d935c..d59688ca2 100644 --- a/IRaCIS.Core.API/appsettings.Event_IRC.json +++ b/IRaCIS.Core.API/appsettings.Event_IRC.json @@ -35,7 +35,8 @@ }, "BasicSystemConfig": { - + // 启用质控风险控制功能 + "QCRiskControl": true, "OpenUserComplexPassword": true, "OpenSignDocumentBeforeWork": true, diff --git a/IRaCIS.Core.API/appsettings.Prod_IRC.json b/IRaCIS.Core.API/appsettings.Prod_IRC.json index c3fe60922..700dc1c83 100644 --- a/IRaCIS.Core.API/appsettings.Prod_IRC.json +++ b/IRaCIS.Core.API/appsettings.Prod_IRC.json @@ -36,7 +36,8 @@ } }, "BasicSystemConfig": { - + // 启用质控风险控制功能 + "QCRiskControl": true, "OpenUserComplexPassword": true, "OpenSignDocumentBeforeWork": true, diff --git a/IRaCIS.Core.API/appsettings.Test_IRC.json b/IRaCIS.Core.API/appsettings.Test_IRC.json index f92ac78ea..8811cf064 100644 --- a/IRaCIS.Core.API/appsettings.Test_IRC.json +++ b/IRaCIS.Core.API/appsettings.Test_IRC.json @@ -88,6 +88,8 @@ }, // 系统配置 "BasicSystemConfig": { + // 启用质控风险控制功能 + "QCRiskControl": true, // 打开用户复杂密码 "OpenUserComplexPassword": false, // 是否在开始工作前强制签署电子知情同意书 diff --git a/IRaCIS.Core.API/appsettings.Test_IRC_PGSQL.json b/IRaCIS.Core.API/appsettings.Test_IRC_PGSQL.json index 3fa1432e8..ebd2c44fe 100644 --- a/IRaCIS.Core.API/appsettings.Test_IRC_PGSQL.json +++ b/IRaCIS.Core.API/appsettings.Test_IRC_PGSQL.json @@ -47,7 +47,8 @@ }, "BasicSystemConfig": { - + // 启用质控风险控制功能 + "QCRiskControl": true, "OpenUserComplexPassword": false, "OpenSignDocumentBeforeWork": false, diff --git a/IRaCIS.Core.API/appsettings.US_Prod_IRC.json b/IRaCIS.Core.API/appsettings.US_Prod_IRC.json index e7096b058..299f040d6 100644 --- a/IRaCIS.Core.API/appsettings.US_Prod_IRC.json +++ b/IRaCIS.Core.API/appsettings.US_Prod_IRC.json @@ -38,7 +38,8 @@ } }, "BasicSystemConfig": { - + // 启用质控风险控制功能 + "QCRiskControl": true, "OpenUserComplexPassword": true, "OpenSignDocumentBeforeWork": true, diff --git a/IRaCIS.Core.API/appsettings.US_Test_IRC.json b/IRaCIS.Core.API/appsettings.US_Test_IRC.json index a8667d8c8..f0f8da12a 100644 --- a/IRaCIS.Core.API/appsettings.US_Test_IRC.json +++ b/IRaCIS.Core.API/appsettings.US_Test_IRC.json @@ -44,7 +44,8 @@ } }, "BasicSystemConfig": { - + // 启用质控风险控制功能 + "QCRiskControl": true, "OpenUserComplexPassword": true, "OpenSignDocumentBeforeWork": true, diff --git a/IRaCIS.Core.API/appsettings.US_Uat_IRC.json b/IRaCIS.Core.API/appsettings.US_Uat_IRC.json index 7a4a841a7..26eb2d496 100644 --- a/IRaCIS.Core.API/appsettings.US_Uat_IRC.json +++ b/IRaCIS.Core.API/appsettings.US_Uat_IRC.json @@ -48,7 +48,8 @@ } }, "BasicSystemConfig": { - + // 启用质控风险控制功能 + "QCRiskControl": true, "OpenUserComplexPassword": true, "OpenSignDocumentBeforeWork": true, diff --git a/IRaCIS.Core.API/appsettings.Uat_IRC.json b/IRaCIS.Core.API/appsettings.Uat_IRC.json index 1afacc3a0..d4d54aff4 100644 --- a/IRaCIS.Core.API/appsettings.Uat_IRC.json +++ b/IRaCIS.Core.API/appsettings.Uat_IRC.json @@ -54,7 +54,8 @@ }, "BasicSystemConfig": { - + // 启用质控风险控制功能 + "QCRiskControl": true, "OpenUserComplexPassword": true, "OpenSignDocumentBeforeWork": true, diff --git a/IRaCIS.Core.Application/BusinessFilter/_Config/_AppSettings.cs b/IRaCIS.Core.Application/BusinessFilter/_Config/_AppSettings.cs index 0983bd60c..a70e18aa8 100644 --- a/IRaCIS.Core.Application/BusinessFilter/_Config/_AppSettings.cs +++ b/IRaCIS.Core.Application/BusinessFilter/_Config/_AppSettings.cs @@ -7,6 +7,7 @@ namespace IRaCIS.Core.Domain.Share; [Description("多环境 配置环境实体")] public class ServiceVerifyConfigOption { + public bool QCRiskControl { get; set; } public bool OpenUserComplexPassword { get; set; } public bool OpenSignDocumentBeforeWork { get; set; } diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs index 56c35f245..cfa4430e9 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs @@ -265,6 +265,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO { public bool ExistsManual { get; set; } public bool IsHaveStudyClinicalData { get; set; } + public bool QCRiskControl { 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 26ff00d8f..a974c0f46 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -7,6 +7,7 @@ using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; using MassTransit.Initializers; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using NPOI.SS.Formula.Functions; using System.Linq; @@ -25,6 +26,7 @@ namespace IRaCIS.Core.Application.Image.QA IRepository _dicomSeriesRepository, IRepository _noneDicomStudyRepository, IRepository _qcChallengeRepository, + IOptionsMonitor _verifyConfig, IRepository _subjectVisitImageBackRecordReposiotry, IRepository _userRoleReposiotry, IReadingImageTaskService _IReadingImageTaskService, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IQCListService @@ -456,7 +458,7 @@ namespace IRaCIS.Core.Application.Image.QA return new TrialVisitQADTO { QCQuestionAnswerList = qacheckList, - + QCRiskControl = _verifyConfig.CurrentValue.QCRiskControl, SecondReviewList = secondReviewList, IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == sv.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study), diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index 58876c832..86294b8f0 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -1953,10 +1953,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var baseLineSpleenLength = await GetBaseLineSpleenLength(inDto); - var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); + var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturnNull(); + + if (presentSpleenLength == null) + { + return string.Empty; + } if (baseLineSpleenLength - 130 > 0 && presentSpleenLength > 130) { - return ReserveDecimal((presentSpleenLength - 130 - (baseLineSpleenLength - 130)) * 100 / (baseLineSpleenLength - 130), inDto.DigitPlaces); + return ReserveDecimal((presentSpleenLength.Value - 130 - (baseLineSpleenLength - 130)) * 100 / (baseLineSpleenLength - 130), inDto.DigitPlaces); } else { @@ -1981,11 +1986,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } if (TaskAnswer.Count() == 0) { - return "0"; + return string.Empty; + } + var presentSpd = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturnNull(); + if (presentSpd == null) + { + return string.Empty; } - var presentSpd = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); var lowSplenoncus = TaskAnswer.OrderBy(x => x.SpleenLength).Select(x => x.SpleenLength).FirstOrDefault(); - return (presentSpd - lowSplenoncus).ToString(); + return (presentSpd.Value - lowSplenoncus).ToString(); } @@ -2011,8 +2020,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate return "NA"; } - var lowSplenoncus = taskAnswer.OrderBy(x => x.SpleenLength).FirstOrDefault(); - return lowSplenoncus.BlindName; + var lowSplenoncus = taskAnswer.Where(x=>x.SpleenLength!=0).OrderBy(x => x.SpleenLength).FirstOrDefault(); + if (lowSplenoncus != null) + { + return lowSplenoncus.BlindName; + } + else + { + return string.Empty; + } + } @@ -3015,10 +3032,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } var baseLineTaskId = await GetBaseLineTaskId(inDto); - var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); + var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturnNull(); + if(presentSpleenLength==null) + { + return string.Empty; + } var baseLineSpleenLength = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0(); - return (presentSpleenLength - baseLineSpleenLength).ToString(); + return (presentSpleenLength.Value - baseLineSpleenLength).ToString(); } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs index 610d83594..80e2f74ee 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs @@ -1953,10 +1953,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var baseLineSpleenLength = await GetBaseLineSpleenLength(inDto); - var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); + var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturnNull(); + + if (presentSpleenLength == null) + { + return string.Empty; + } if (baseLineSpleenLength - 130 > 0 && presentSpleenLength > 130) { - return ReserveDecimal((presentSpleenLength - 130 - (baseLineSpleenLength - 130)) * 100 / (baseLineSpleenLength - 130), inDto.DigitPlaces); + return ReserveDecimal((presentSpleenLength.Value - 130 - (baseLineSpleenLength - 130)) * 100 / (baseLineSpleenLength - 130), inDto.DigitPlaces); } else { @@ -1981,11 +1986,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } if (TaskAnswer.Count() == 0) { - return "0"; + return string.Empty; + } + var presentSpd = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturnNull(); + if (presentSpd == null) + { + return string.Empty; } - var presentSpd = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); var lowSplenoncus = TaskAnswer.OrderBy(x => x.SpleenLength).Select(x => x.SpleenLength).FirstOrDefault(); - return (presentSpd - lowSplenoncus).ToString(); + return (presentSpd.Value - lowSplenoncus).ToString(); } @@ -2011,8 +2020,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate return "NA"; } - var lowSplenoncus = taskAnswer.OrderBy(x => x.SpleenLength).FirstOrDefault(); - return lowSplenoncus.BlindName; + var lowSplenoncus = taskAnswer.Where(x => x.SpleenLength != 0).OrderBy(x => x.SpleenLength).FirstOrDefault(); + if (lowSplenoncus != null) + { + return lowSplenoncus.BlindName; + } + else + { + return string.Empty; + } + } @@ -3015,10 +3032,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } var baseLineTaskId = await GetBaseLineTaskId(inDto); - var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); + var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturnNull(); + if (presentSpleenLength == null) + { + return string.Empty; + } var baseLineSpleenLength = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0(); - return (presentSpleenLength - baseLineSpleenLength).ToString(); + return (presentSpleenLength.Value - baseLineSpleenLength).ToString(); } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index c93824f17..66379bbe9 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -593,13 +593,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate TableQuestionId = x.TableQuestionId, TrialId = x.TrialId, VisitTaskId = visitTaskId, - }); + }).ToList(); var addList = _mapper.Map>(tableRowAnswers); + + await _generalCalculateService.CopyHistoryAnswer(taskinfo, addList, tableAnswers); await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList); await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);