diff --git a/IRaCIS.Core.API/_ServiceExtensions/Authorization/ApiResponseHandler.cs b/IRaCIS.Core.API/_ServiceExtensions/Authorization/ApiResponseHandler.cs index 32f999568..b2eb8e922 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/Authorization/ApiResponseHandler.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/Authorization/ApiResponseHandler.cs @@ -1,6 +1,7 @@ using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json; @@ -12,9 +13,14 @@ namespace IRaCIS.Core.API { public class ApiResponseHandler : AuthenticationHandler { - public ApiResponseHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock) + public IStringLocalizer _localizer; + public ApiResponseHandler(IOptionsMonitor options, + IStringLocalizer localizer, + ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock) { - } + _localizer = localizer; + + } protected override Task HandleAuthenticateAsync() { @@ -24,14 +30,16 @@ namespace IRaCIS.Core.API { Response.ContentType = "application/json"; Response.StatusCode = StatusCodes.Status401Unauthorized; - await Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk("您无权访问该接口", ApiResponseCodeEnum.NoToken))); + //---您无权访问该接口 + await Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk(_localizer["ApiResponse_NoAccess"], ApiResponseCodeEnum.NoToken))); } protected override async Task HandleForbiddenAsync(AuthenticationProperties properties) { Response.ContentType = "application/json"; Response.StatusCode = StatusCodes.Status403Forbidden; - await Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk("您的权限不允许进行该操作",ApiResponseCodeEnum.HaveTokenNotAccess))); + //---您的权限不允许进行该操作 + await Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk(_localizer["ApiResponse_Permission"],ApiResponseCodeEnum.HaveTokenNotAccess))); } } diff --git a/IRaCIS.Core.Application/BusinessFilter/ModelActionFilter .cs b/IRaCIS.Core.Application/BusinessFilter/ModelActionFilter .cs index 900583e6d..79c1788cb 100644 --- a/IRaCIS.Core.Application/BusinessFilter/ModelActionFilter .cs +++ b/IRaCIS.Core.Application/BusinessFilter/ModelActionFilter .cs @@ -11,6 +11,12 @@ namespace IRaCIS.Core.Application.Filter public class ModelActionFilter : ActionFilterAttribute, IActionFilter { + public IStringLocalizer _localizer; + public ModelActionFilter(IStringLocalizer localizer) + { + _localizer = localizer; + } + public override void OnActionExecuting(ActionExecutingContext context) { if (!context.ModelState.IsValid) @@ -23,7 +29,7 @@ namespace IRaCIS.Core.Application.Filter .ToArray(); //---提供给接口的参数无效。 - context.Result = new JsonResult(ResponseOutput.NotOk("Invalid parameters provided for the API." + JsonConvert.SerializeObject( validationErrors))); + context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["ModelAction_InvalidAPIParameter"] + JsonConvert.SerializeObject( validationErrors))); } } } diff --git a/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs b/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs index 0112952ab..2948ee64f 100644 --- a/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs +++ b/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs @@ -2,6 +2,7 @@ using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; namespace IRaCIS.Core.Application.Filter @@ -10,10 +11,13 @@ namespace IRaCIS.Core.Application.Filter { private readonly ILogger _logger; - public ProjectExceptionFilter(ILogger logger) + public IStringLocalizer _localizer; + + public ProjectExceptionFilter(IStringLocalizer localizer, ILogger logger) { _logger = logger; - } + _localizer = localizer; + } public void OnException(ExceptionContext context) { //context.ExceptionHandled;//记录当前这个异常是否已经被处理过了 @@ -23,7 +27,7 @@ namespace IRaCIS.Core.Application.Filter if (context.Exception.GetType().Name == "DbUpdateConcurrencyException") { //---并发更新,当前不允许该操作 - context.Result = new JsonResult(ResponseOutput.NotOk("Concurrent update, operation not allowed at this time." + context.Exception.Message)); + context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["ProjectException_ConcurrentUpdateNotAllowed"] + context.Exception.Message)); } if (context.Exception.GetType() == typeof(BusinessValidationFailedException)) @@ -36,7 +40,7 @@ namespace IRaCIS.Core.Application.Filter } else { - context.Result = new JsonResult(ResponseOutput.NotOk("程序异常,请联系开发人员。" + (context.Exception.InnerException is null ? (context.Exception.Message /*+ context.Exception.StackTrace*/) + context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["Project_ExceptionContactDeveloper"] + (context.Exception.InnerException is null ? (context.Exception.Message /*+ context.Exception.StackTrace*/) : (context.Exception.InnerException?.Message /*+ context.Exception.InnerException?.StackTrace*/)), ApiResponseCodeEnum.ProgramException)); } diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 44812cf88..17ca78f84 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -3369,6 +3369,16 @@ 序号标记 + + + Name + + + + + Path + + 第一层的Question @@ -3384,6 +3394,11 @@ VisitTaskId + + + 标记工具 + + TrialId @@ -3824,6 +3839,11 @@ 任务Id + + + 标记工具 + + 截图地址 @@ -6921,6 +6941,45 @@ + + + 用户WL模板 + + + + + 获取模板 + + + + + + + 新增修改模板 + + + + + + + 删除模板 + + + + + + + 获取自动切换任务配置 + + + + + + 设置自动切换任务 + + + + 项目外部人员 录入流程相关 @@ -8019,6 +8078,15 @@ 任务类型 + + UserWLTemplateView 列表视图模型 + + + UserWLTemplateQuery 列表查询参数模型 + + + UserWLTemplateAddOrEdit 列表查询参数模型 + TrialExternalUserView 列表视图模型 @@ -11020,6 +11088,13 @@ + + + 获取手册 + + + + 获取任务附加问题 @@ -11156,7 +11231,7 @@ - + 获取子元素 diff --git a/IRaCIS.Core.Application/Resources/en-US.json b/IRaCIS.Core.Application/Resources/en-US.json index 6a5a6157b..a6b8a6b93 100644 --- a/IRaCIS.Core.Application/Resources/en-US.json +++ b/IRaCIS.Core.Application/Resources/en-US.json @@ -2,6 +2,11 @@ "test{0}{1}": "英文本地化{0}{1}", "RequiredAttribute": "{0} is required", + // ------------------------------------------------------------_ServiceExtensions-------------------------------------------------------------------- + //ApiResponseHandler + "ApiResponse_NoAccess": "You do not have access to this API", + "ApiResponse_Permission": "Your permission does not allow you to perform this operation", + // ------------------------------------------------------------Controllers-------------------------------------------------------------------- //FinancialChangeController "Financial_ChargeSettled": "Expenses have been settled and workload can not be reset.", @@ -89,6 +94,8 @@ "ReadingQuestion_ExcludeWithDependency": "The displayed dependent parent problem and the required dependent problem are the same, but the answers are mutually exclusive, operation failed.", "ReadingQuestion_CircularDependency": "Calculation dependency has looped!", //ReadingPeriodSetService + "ReadingPeriodSet_NameDup": "Reading period name duplicate, operation failed", + "ReadingPeriodSet_Global": "Reading period name cannot be Global", "ReadingPeriodSet_AlreadyAdded": "{0} has already added the review period, cannot set it effective.", "ReadingPeriodSet_TaskCompletedCannotRevoke": "The current standard review has generated tasks and the review is completed, revoke failed.", "ReadingPeriodSet_LastVisit": "Last visit.", @@ -182,6 +189,8 @@ "Mail_AccountCreationReminder": "[from Extensive Imaging IRC] A reminder about creating an account", "Mail_AccountPasswordResetReminder": "[from Film IRC] A reminder about resetting account passwords", "Mail_InvitationEmail": "[from Extensive Imaging IRC][{0}]Invitation", + //SystemMonitor + "SysMon_JsonConfig": "Parsing the Json file configuration failed", // ------------------------------------------------------------Doctor-------------------------------------------------------------------- //DoctorService @@ -421,6 +430,7 @@ //TrialConfigService "TrialConfig_JudgeTaskFail": "There are judge questions that the conditions for generating judge reading task are not configured, and the operation has failed!", "TrialConfig_StdConfigMissing": "Questions are not configured under the current standard.", + "TrialConfig_AddEvalReq": "Selected additional evaluation, must check additional evaluation type", "TrialConfig_SignTemplateMissing": "This operation requires electronic signature confirmation, but the signature template for this scenario is not found in the system.", "TrialConfig_ProjectEnded": "The trial project has ended or stopped, and configuration changes are not allowed.", "TrialConfig_NoImageAuditQuestion": "No image quality control review question is currently added. Please add the image quality control review question first, and then confirm.", @@ -545,6 +555,12 @@ // ------------------------------------------------------------IRaCIS.Core.Domain-------------------------------------------------------------------- //Trial - "Trial_number": "The serial number consists of five digits. The first two digits are the center number and the last three digits are the serial number. The serial number must be the same as that recorded by the EDC" + "Trial_number": "The serial number consists of five digits. The first two digits are the center number and the last three digits are the serial number. The serial number must be the same as that recorded by the EDC", + + // ------------------------------------------------------------IRaCIS.Core.Infrastructure-------------------------------------------------------------------- + //ResponseOutput + "RO_BizObjNotExistsOrParamIncorrect": "The business object{0} does not exist in the database, or was deleted by someone else, or an incorrect parameter query caused", + "RO_ExpectChangeButNoEffect": "Expect a change, but the database data has not changed", + "RO_SaveFailed": "Saved failed" } diff --git a/IRaCIS.Core.Application/Resources/zh-CN.json b/IRaCIS.Core.Application/Resources/zh-CN.json index 8335865d2..ea777ab64 100644 --- a/IRaCIS.Core.Application/Resources/zh-CN.json +++ b/IRaCIS.Core.Application/Resources/zh-CN.json @@ -2,6 +2,11 @@ "test{0}{1}": "中文本地化{0}{1}", "RequiredAttribute": "{0} 字段是必须的", + // ------------------------------------------------------------_ServiceExtensions-------------------------------------------------------------------- + //ApiResponseHandler + "ApiResponse_NoAccess": "您无权访问该接口", + "ApiResponse_Permission": "您的权限不允许进行该操作", + // ------------------------------------------------------------Controllers-------------------------------------------------------------------- //FinancialChangeController "Financial_ChargeSettled": "费用已经结算,无法重置工作量", @@ -89,6 +94,8 @@ "ReadingQuestion_ExcludeWithDependency": "显示依赖父问题和必填依赖的问题为同一个,但答案互斥,操作失败", "ReadingQuestion_CircularDependency": "计算依赖循环了!", //ReadingPeriodSetService + "ReadingPeriodSet_NameDup": "阅片期名称重复,操作失败", + "ReadingPeriodSet_Global": "阅片期名称不能为Global", "ReadingPeriodSet_AlreadyAdded": "{0}已经添加过阅片期,无法设置生效", "ReadingPeriodSet_TaskCompletedCannotRevoke": "当前标准阅片已生成任务并且阅片完成,撤销失败。", "ReadingPeriodSet_LastVisit": "末次访视", @@ -182,6 +189,8 @@ "Mail_AccountCreationReminder": "[来自展影IRC] 关于创建账户的提醒", "Mail_AccountPasswordResetReminder": "[来自展影IRC] 关于重置账户密码的提醒", "Mail_InvitationEmail": "[来自展影IRC] [{0}]邀请信", + //SystemMonitor + "SysMon_JsonConfig": "解析Json文件配置出现问题", // ------------------------------------------------------------Doctor-------------------------------------------------------------------- //DoctorService @@ -421,6 +430,7 @@ //TrialConfigService "TrialConfig_JudgeTaskFail": "有裁判问题未配置产生裁判阅片任务的条件,操作失败!", "TrialConfig_StdConfigMissing": "当前标准下未配置问题", + "TrialConfig_AddEvalReq": "选择了附加评估,必须勾选附加评估类型", "TrialConfig_SignTemplateMissing": "该操作需要电子签名确认,但未在系统中找到该场景的签名模板。", "TrialConfig_ProjectEnded": "该项目已结束或停止,不允许修改配置。", "TrialConfig_NoImageAuditQuestion": "当前未添加影像质控审核问题。请先添加影像质控审核问题,再进行确认。", @@ -545,6 +555,12 @@ // ------------------------------------------------------------IRaCIS.Core.Domain-------------------------------------------------------------------- //Trial - "Trial_number": "编号由5位数字组成,前2位为中心编号,后3位为顺序号,请与EDC录入的编号保持一致" + "Trial_number": "编号由5位数字组成,前2位为中心编号,后3位为顺序号,请与EDC录入的编号保持一致", + + // ------------------------------------------------------------IRaCIS.Core.Infrastructure-------------------------------------------------------------------- + //ResponseOutput + "RO_BizObjNotExistsOrParamIncorrect": "业务对象{0}在数据库中不存在,或被他人删除,或参数查询不正确导致", + "RO_ExpectChangeButNoEffect": "期望发生更改,但数据库数据没有更改", + "RO_SaveFailed": "保存失败" } diff --git a/IRaCIS.Core.Application/Service/Common/SystemMonitor.cs b/IRaCIS.Core.Application/Service/Common/SystemMonitor.cs index 72e260849..88caed6fe 100644 --- a/IRaCIS.Core.Application/Service/Common/SystemMonitor.cs +++ b/IRaCIS.Core.Application/Service/Common/SystemMonitor.cs @@ -64,7 +64,8 @@ namespace IRaCIS.Core.Application.Service.Common catch (Exception e) { - throw new BusinessValidationFailedException("解析Json文件配置出现问题:"+e.Message); + //---解析Json文件配置出现问题 + throw new BusinessValidationFailedException(_localizer["SysMon_JsonConfig"]+e.Message); } //默认存储的路径 diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index f654d9beb..c353ce620 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -954,7 +954,8 @@ namespace IRaCIS.Core.Application.Image.QA } else { - return ResponseOutput.NotOk("项目配置为单审,不满足SubmmitState:已提交 或者 AuditState:待审核/审核中, 不允许领取,请刷新界面"); + // ---项目配置为单审,不满足Submmit State:已提交 或者 Audit State:待审核/审核中, 不允许领取,请刷新界面 + return ResponseOutput.NotOk(_localizer["QCOperation_NoSingleAudit"]); } } else if (trialConfig.QCProcessEnum == TrialQCProcess.DoubleAudit) @@ -2044,8 +2045,8 @@ namespace IRaCIS.Core.Application.Image.QA await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed }); - - return ResponseOutput.NotOk("转发影像失败: " + e.Message); + // --转发影像失败 + return ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"] + e.Message); } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index fd7ba9523..c3863a781 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -330,7 +330,30 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List AnswerList { get; set; } = new List(); } - public class GetTaskAdditionalQuestionInDto + public class GetManualListInDto + { + public Guid TrialId { get; set; } + } + + + public class GetManualListOutDto + { + + public Guid Id { get; set; } + + /// + /// Name + /// + public string Name { get; set; } = string.Empty; + + /// + /// Path + /// + public string Path { get; set; } = string.Empty; + } + + + public class GetTaskAdditionalQuestionInDto { //public Guid TrialReadingCriterionId { get; set; } public Guid VisitTaskId { get; set; } @@ -447,10 +470,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid VisitTaskId { get; set; } - /// - /// TrialId - /// - public Guid TrialId { get; set; } + /// + /// 标记工具 + /// + public string MarkTool { get; set; } = string.Empty; + + /// + /// TrialId + /// + public Guid TrialId { get; set; } /// /// 首次添加任务ID @@ -1181,7 +1209,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List AgreeOrNot { get; set; } public List AfterQuestionList { get; set; } - } + + public List LesionCountList { get; set; } = new List(); + } public class GetGlobalQuestionType { @@ -1357,7 +1387,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string SubjectCode { get; set; }=String.Empty; - public ReadingCategory ReadingCategory { get; set; } + public bool ExistsManual { get; set; } + + public ReadingCategory ReadingCategory { get; set; } public decimal VisitNum { get; set; } @@ -1694,7 +1726,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string FromMark { get; set; } = string.Empty; - public decimal RowIndex { get; set; } + /// + /// 标记工具 + /// + public string MarkTool { get; set; } = string.Empty; + + public decimal RowIndex { get; set; } /// /// 截图地址 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs new file mode 100644 index 000000000..7e85dbd38 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs @@ -0,0 +1,55 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-05-08 15:20:44 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- +using System; +using IRaCIS.Core.Domain.Share; +using System.Collections.Generic; +namespace IRaCIS.Core.Application.ViewModel +{ + /// UserWLTemplateView 列表视图模型 + public class UserWLTemplateView + { + public Guid Id { get; set; } + public string TemplateName { get; set; } + public Guid UserId { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public int WW { get; set; } + public int WL { get; set; } + public int ShowOrder { get; set; } = 0; + public bool IsPitchOn { get; set; } + } + + ///UserWLTemplateQuery 列表查询参数模型 + public class UserWLTemplateQuery + { + /// TemplateName + + + } + + public class SetAutoCutNextTaskInDto + { + public bool AutoCutNextTask { get; set; } + } + + /// UserWLTemplateAddOrEdit 列表查询参数模型 + public class UserWLTemplateAddOrEdit + { + public Guid? Id { get; set; } + public string TemplateName { get; set; } + public Guid UserId { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public int WW { get; set; } + public int WL { get; set; } + //public int ShowOrder { get; set; } + //public bool IsPitchOn { get; set; } + } + + +} + + diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs index e5fd804f4..ba39e9c72 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs @@ -230,8 +230,13 @@ namespace IRaCIS.Application.Services VisitNum = x.SourceSubjectVisit.VisitNum, IsBaseLine = x.SourceSubjectVisit.IsBaseLine, VisitId = x.SourceSubjectVisitId.Value, - //CrterionDictionaryGroup= x.CrterionDictionaryGroup, - BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType!=GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) + LesionCountList=x.LesionList.GroupBy(y=>y.ReadingQuestionTrial.LesionType).Select(x => new LesionDto + { + LesionType = x.Key.Value, + Count = x.ToList().Count() + }).ToList(), + //CrterionDictionaryGroup= x.CrterionDictionaryGroup, + BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType!=GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) .Select(y => new GlobalQuestionInfo() { @@ -345,7 +350,7 @@ namespace IRaCIS.Application.Services result.TaskList.ForEach(x => { - x.AfterQuestionList = x.BeforeQuestionList.Where(x => x.IsJudgeQuestion) + x.AfterQuestionList = x.BeforeQuestionList .GroupJoin( globalReadingQuestion , l => new { a = l.QuestionId, b = x.VisitTaskId } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 85daf0c5a..866c54787 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -42,7 +42,9 @@ namespace IRaCIS.Application.Services private readonly IRepository _readModuleRepository; private readonly IRepository _dicomInstanceRepository; private readonly IRepository _organInfoRepository; - private readonly IRepository _readingCriterionDictionaryRepository; + private readonly IRepository _trialDocumentRepository; + private readonly IRepository _userRepository; + private readonly IRepository _readingCriterionDictionaryRepository; private readonly IRepository _readingTrialCriterionDictionaryRepository; private readonly IRepository _tumorAssessmentRepository; private readonly IRepository _readingTableAnswerRowInfoRepository; @@ -79,7 +81,9 @@ namespace IRaCIS.Application.Services IRepository readModuleRepository, IRepository dicomInstanceRepository, IRepository organInfoRepository, - IMemoryCache cache, + IRepository trialDocumentRepository, + IRepository userRepository, + IMemoryCache cache, IRepository readingCriterionDictionaryRepository, IRepository readingTrialCriterionDictionaryRepository, IRepository tumorAssessmentRepository, @@ -114,7 +118,9 @@ namespace IRaCIS.Application.Services this._readModuleRepository = readModuleRepository; this._dicomInstanceRepository = dicomInstanceRepository; this._organInfoRepository = organInfoRepository; - this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository; + this._trialDocumentRepository = trialDocumentRepository; + this._userRepository = userRepository; + this._readingCriterionDictionaryRepository = readingCriterionDictionaryRepository; this._tumorAssessmentRepository = tumorAssessmentRepository; this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository; this._readingTableQuestionSystemRepository = readingTableQuestionSystemRepository; @@ -132,11 +138,33 @@ namespace IRaCIS.Application.Services } /// - /// 获取任务附加问题 + /// 获取手册 /// /// /// [HttpPost] + public async Task> GetManualList(GetManualListInDto inDto) + { + UserTypeEnum userType = (UserTypeEnum)_userInfo.UserTypeEnumInt; + //_userInfo.UserTypeId + + return await _trialDocumentRepository.Where(x => x.TrialId == inDto.TrialId + &&x.TrialDocConfirmedUserList.Any(y=>y.ConfirmUserId== _userInfo.Id) + && x.NeedConfirmedUserTypeList.Any(y => y.NeedConfirmUserTypeId == _userInfo.UserTypeId)) + .Select(x => new GetManualListOutDto() + { + Id=x.Id, + Name = x.Name, + Path = x.Path + }).ToListAsync(); + } + + /// + /// 获取任务附加问题 + /// + /// + /// + [HttpPost] public async Task<(List, bool)> GetTaskAdditionalQuestion(GetTaskAdditionalQuestionInDto inDto) { @@ -1027,7 +1055,7 @@ namespace IRaCIS.Application.Services var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList(); pageGroupList.ForEach(x => { - this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer); + this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, inDto.TaskId); }); page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); @@ -1044,7 +1072,7 @@ namespace IRaCIS.Application.Services groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList(); groupList.ForEach(x => { - this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer); + this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, inDto.TaskId); }); groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); @@ -1064,7 +1092,7 @@ namespace IRaCIS.Application.Services /// /// /// - private async void FindChildQuestion(TrialReadQuestionData item, List questionlists, List tableQuestionLists, List tableAnswers, List tableAnsweRowInfos, List organInfos, List baseLineTableAnswer,bool isFirstChangeTask, List lastTaskTableAnswer) + private async void FindChildQuestion(TrialReadQuestionData item, List questionlists, List tableQuestionLists, List tableAnswers, List tableAnsweRowInfos, List organInfos, List baseLineTableAnswer,bool isFirstChangeTask, List lastTaskTableAnswer,Guid? TaskId) { item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (x.GroupId == item.Id && x.ParentId == null)).ToList(); item.TableQuestions = new TrialReadTableQuestion(); @@ -1193,16 +1221,20 @@ namespace IRaCIS.Application.Services answers.Add("MeasureData", rowInfo == null ? string.Empty : rowInfo.MeasureData); answers.Add("RowIndex", x.ToString()); answers.Add("RowId", rowInfo.Id.ToString()); - answers.Add("StudyId", rowInfo.StudyId.ToString()); + answers.Add("MarkTool", rowInfo.MarkTool); + answers.Add("StudyId", rowInfo.StudyId.ToString()); answers.Add("OrganInfoId", rowInfo.OrganInfoId.ToString()); - answers.Add("IsCanEditPosition", rowInfo.IsCanEditPosition.ToString()); + answers.Add("IsFristAdd", (rowInfo.FristAddTaskId== TaskId).ToString()); + answers.Add("IsCanEditPosition", rowInfo.IsCanEditPosition.ToString()); answers.Add("InstanceId", rowInfo == null ? string.Empty : rowInfo.InstanceId.ToString()); answers.Add("SeriesId", rowInfo == null ? string.Empty : rowInfo.SeriesId.ToString()); answers.Add("IsCurrentTaskAdd", rowInfo == null ? false.ToString() : rowInfo.IsCurrentTaskAdd.ToString()); answers.Add("SplitOrMergeLesionName", rowInfo.SplitName.IsNullOrEmpty() ? rowInfo.MergeName : rowInfo.SplitName); answers.Add("SplitOrMergeType", rowInfo.SplitOrMergeType == null ? string.Empty : ((int)rowInfo.SplitOrMergeType).ToString()); answers.Add("LastTaskState", lastTaskTableAnswer.Where(n=>n.QuestionId== item.Id&&n.ReadingTableQuestionTrial.QuestionMark==QuestionMark.State&&n.RowIndex==x).Select(n=>n.Answer).FirstOrDefault()??string.Empty); - if (rowInfo.LesionType == LesionType.BaselineLesions) + answers.Add("LastTaskMajorAxis", lastTaskTableAnswer.Where(n => n.QuestionId == item.Id && n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis && n.RowIndex == x).Select(n => n.Answer).FirstOrDefault() ?? string.Empty); + answers.Add("LastTaskShortAxis", lastTaskTableAnswer.Where(n => n.QuestionId == item.Id && n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.ShortAxis && n.RowIndex == x).Select(n => n.Answer).FirstOrDefault() ?? string.Empty); + if (rowInfo.LesionType == LesionType.BaselineLesions) { answers.Add("BaseLineLesionNumber", baseLineTableAnswer.Where(n => n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.LesionNumber && n.RowIndex == rowInfo.RowIndex).Select(x => x.Answer).FirstIsNullReturnEmpty()); } @@ -1215,7 +1247,7 @@ namespace IRaCIS.Application.Services { item.Childrens.ForEach(x => { - this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer); + this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, TaskId); }); } } @@ -1848,7 +1880,8 @@ namespace IRaCIS.Application.Services rowInfo.IsDicomReading = inDto.IsDicomReading; rowInfo.IsCurrentTaskAdd = isCurrentTaskAdd; rowInfo.NumberOfFrames = inDto.NumberOfFrames; - rowInfo.FristAddTaskNum = taskinfo.VisitTaskNum; + rowInfo.MarkTool = inDto.MarkTool; + rowInfo.FristAddTaskNum = taskinfo.VisitTaskNum; rowInfo.FristAddTaskId = inDto.VisitTaskId; rowInfo.PicturePath = inDto.PicturePath; rowInfo.RowIndex = inDto.RowIndex; @@ -1899,6 +1932,7 @@ namespace IRaCIS.Application.Services IsCurrentTaskAdd = isCurrentTaskAdd, WL = rowInfo.WL, WW = rowInfo.WW, + MarkTool = inDto.MarkTool, OrganInfoId = rowInfo.OrganInfoId, PicturePath = rowInfo.PicturePath, NumberOfFrames = rowInfo.NumberOfFrames, @@ -1908,7 +1942,7 @@ namespace IRaCIS.Application.Services VisitTaskId = rowInfo.VisitTaskId, StudyId = rowInfo.StudyId, IsCanEditPosition = rowInfo.IsCanEditPosition, - }); + }) ; foreach (var item in inDto.AnswerList) @@ -2329,7 +2363,9 @@ namespace IRaCIS.Application.Services task.IsConvertedTask = visitTaskInfo.IsConvertedTask; var blindSubjectCode = await _visitTaskRepository.Where(x => x.Id == task.VisitTaskId).Select(x => x.BlindSubjectCode).FirstNotNullAsync(); task.SubjectCode = blindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : blindSubjectCode; - return task; + task.ExistsManual = (await GetManualList(new GetManualListInDto() { TrialId = visitTaskInfo.TrialId })).Count() > 0; + + return task; } /// diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs index 86cd1cffa..555f98125 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs @@ -72,11 +72,13 @@ namespace IRaCIS.Application.Services if (await _readingPeriodSetRepository.AnyAsync(x => x.Id != addOrEditReadingPeriodSet.Id && x.IsTakeEffect != ReadingPeriodStatus.Revocation && x.TrialId == addOrEditReadingPeriodSet.TrialId && x.ReadingPeriodName == addOrEditReadingPeriodSet.ReadingPeriodName && x.TrialReadingCriterionId == addOrEditReadingPeriodSet.TrialReadingCriterionId)) { - return ResponseOutput.NotOk("阅片期名称重复,操作失败"); + //---阅片期名称重复,操作失败 + return ResponseOutput.NotOk(_localizer["ReadingPeriodSet_NameDup"]); } if (addOrEditReadingPeriodSet.ReadingPeriodName == "Global") { - return ResponseOutput.NotOk("阅片期名称不能为Global"); + //---阅片期名称不能为Global + return ResponseOutput.NotOk(_localizer["ReadingPeriodSet_Global"]); } if (addOrEditReadingPeriodSet.Id == null) { diff --git a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/ShortcutKeyService.cs b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/ShortcutKeyService.cs index 1a893150e..dc1592d23 100644 --- a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/ShortcutKeyService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/ShortcutKeyService.cs @@ -281,7 +281,20 @@ namespace IRaCIS.Core.Application.Service MetaKey = false, Text= "Space", Code= "Space" - }, }; + }, + new ShortcutKey (){ + + Keyboardkey= "m", + ShortcutKeyEnum = 19, + ImageToolType= 0, + AltKey = false, + CtrlKey = false, + ShiftKey = false, + MetaKey = false, + Text= "M", + Code= "KeyM" + }, + }; return shortcutKeys; diff --git a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs new file mode 100644 index 000000000..ae00dc0e0 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs @@ -0,0 +1,102 @@ +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-05-08 15:26:52 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +//-------------------------------------------------------------------- + +using IRaCIS.Core.Domain.Models; +using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.ViewModel; +namespace IRaCIS.Core.Application.Service +{ + /// + /// 用户WL模板 + /// + [ApiExplorerSettings(GroupName = "Reading")] + public class UserWLTemplateService : BaseService + { + + private readonly IRepository _userWLTemplateRepository; + private readonly IRepository _userRepository; + + public UserWLTemplateService(IRepository userWLTemplateRepository, + IRepository userRepository + ) + { + _userWLTemplateRepository = userWLTemplateRepository; + this._userRepository = userRepository; + } + + /// + /// 获取模板 + /// + /// + /// + public async Task> GetUserWLTemplateList(UserWLTemplateQuery inQuery) + { + var userWLTemplateQueryable = _userWLTemplateRepository + .Where(x=>x.UserId==_userInfo.Id) + .ProjectTo(_mapper.ConfigurationProvider); + return await userWLTemplateQueryable.ToListAsync(); + } + + /// + /// 新增修改模板 + /// + /// + /// + public async Task AddOrUpdateUserWLTemplate(UserWLTemplateAddOrEdit addOrEditUserWLTemplate) + { + addOrEditUserWLTemplate.UserId = _userInfo.Id; + var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true); + return ResponseOutput.Ok(entity.Id.ToString()); + } + + /// + /// 删除模板 + /// + /// + /// + [HttpDelete("{userWLTemplateId:guid}")] + public async Task DeleteUserWLTemplate(Guid userWLTemplateId) + { + var success = await _userWLTemplateRepository.DeleteFromQueryAsync(t => t.Id == userWLTemplateId, true); + return ResponseOutput.Ok(); + } + + /// + /// 获取自动切换任务配置 + /// + /// + [HttpPost] + public async Task GetAutoCutNextTask() + { + + return await _userRepository.Where(x=>x.Id==_userInfo.Id).Select(x => new + { + AutoCutNextTask = x.AutoCutNextTask + }).FirstNotNullAsync(); + } + + + /// + /// 设置自动切换任务 + /// + /// + /// + [HttpPost] + public async Task SetAutoCutNextTask(SetAutoCutNextTaskInDto inDto) + { + await _userRepository.UpdatePartialNowNoQueryAsync(_userInfo.Id, x => new User() + { + + AutoCutNextTask = inDto.AutoCutNextTask + }); + + await _userRepository.SaveChangesAsync (); + + return ResponseOutput.Ok(); + } + } +} diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 9d481d5a7..6596968c2 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -20,7 +20,11 @@ namespace IRaCIS.Core.Application.Service CreateMap(); CreateMap(); - CreateMap(); + + CreateMap(); + CreateMap().ReverseMap(); + + CreateMap(); CreateMap(); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs index c12a36889..24b4d42cf 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs @@ -535,10 +535,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate //整体肿瘤评估 new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetTumor,IsConvertedTask=false}, - // 转化时整体肿瘤评估 - new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetConvertingTumor,IsConvertedTask=true,IsBeTransforming=true}, - + new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetConvertingTumor,IsConvertedTask=true,IsBeTransforming=true}, //IRECIST整体肿瘤评估 new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetIRECSITTargetLesionEvaluate,IsConvertedTask=true}, @@ -581,7 +579,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate QuestionType.NewLesions, QuestionType.Tumor, QuestionType.ExistDisease, - }; + QuestionType.NewTargetLesion, + QuestionType.NewNoTargetLesion, + QuestionType.OtherNewTargetLesion, + QuestionType.IRECISTNewTargetLesion, + QuestionType.NewLesionEvaluation, + }; // 没有靶病灶就删除其他几个答案的值 var isNeedDeleteTypes = calculateList.Where(x => !questionTypes.Contains(x.QuestionType)).Select(x => x.QuestionType).ToList(); @@ -783,9 +786,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }).ToListAsync(); - var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.Answer == TargetState.UnableEvaluate.GetEnumInt() + var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State - ) + ).Where(x => + (x.ReadingQuestionTrial.LesionType==LesionType.TargetLesion && x.Answer == TargetState.UnableEvaluate.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.NewLesions && x.Answer == NewTargetLesionState.NotEvaluable.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.NonTargetLesions && x.Answer == NoTargetState.UnableEvaluate.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.NewTargetLesion && x.Answer == NewTargetLesionState.NotEvaluable.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.NewNonTargetLesion && x.Answer == NewNoTargetLesionState.NotEvaluable.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.OtherPreviousNewLesion && x.Answer == OtherPreviousNewLesionState.NotEvaluable.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.TriggeringIRECSIT && x.Answer == NewLesionAfterTriggeringiRECSITState.NotEvaluable.GetEnumInt()) + ) .Select(x => x.RowId).Distinct().ToListAsync(); @@ -818,7 +829,6 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (errorMassage != string.Empty) { - errorMassage = _localizer["ReadingCalculate_Questionable"] + errorMassage; throw new BusinessValidationFailedException(errorMassage); } @@ -1807,7 +1817,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// { /// 非靶病灶疗效为 iCPD /// } - /// else if (满足RECIST1.1的PD标准 && 任一非靶病灶状态评估为“显著增大(iUPD)”) + /// else if (任一非靶病灶状态评估为“显著增大(iUPD)”) /// { /// 非靶病灶疗效为 iUPD /// } @@ -1893,8 +1903,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 非靶病灶疗效为 iCPD result = NoTargetAssessment.iCPD; } - // else if (满足RECIST1.1的PD标准 && 任一非靶病灶状态评估为“显著增大(iUPD)”) - else if (data.RECISTPD && data.ExistiUPD) + // else if ( 任一非靶病灶状态评估为“显著增大(iUPD)”) + else if ( data.ExistiUPD) { // 非靶病灶疗效为 iUPD result = NoTargetAssessment.iUPD; @@ -1960,7 +1970,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } var lastVisitTaskId = await GetLastVisitTaskId(inDto); var newTargetLesionQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewTargetLesion).Select(x => x.QuestionId).FirstOrDefault(); - var sodQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SOD).Select(x => x.QuestionId).FirstOrDefault(); + var isodQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ISOD).Select(x => x.QuestionId).FirstOrDefault(); IRECISTNewTargetLesionDto data = new IRECISTNewTargetLesionDto() { // 不存在新靶病灶 @@ -1974,14 +1984,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate .Select(x => x.Answer).FirstOrDefaultAsync()) ?? string.Empty, //SOD增加5mm以上 - ISODAdd5mm = await GetSODData(inDto) - (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastVisitTaskId && x.ReadingQuestionTrialId == sodQuestionId) + ISODAdd5mm = await GetiSODData(inDto) - (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == lastVisitTaskId && x.ReadingQuestionTrialId == isodQuestionId) .Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0() >= 5, //有"存在"状态的新靶病灶 HaveExixtsState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)), // 至少有一个新靶病无法评估 - ExixtsUnevaluableState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)), + ExixtsUnevaluableState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.NotEvaluable)), }; @@ -1991,7 +2001,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate data.AllVanish = data.AllVanish && item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Loss)); } - NewTargetLesionAssessment result = NewTargetLesionAssessment.NE; + NewTargetLesionAssessment result = NewTargetLesionAssessment.ND; // if(所有新靶病灶消失或一直不存在任何新靶病灶) if(data.NotExistsNewTargetLesion||data.AllVanish) @@ -2021,7 +2031,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate else if (data.ExixtsUnevaluableState) { // 疗效为 NE - result = NewTargetLesionAssessment.iUPD; + result = NewTargetLesionAssessment.NE; } return result.GetEnumInt(); @@ -2088,7 +2098,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate ExixtsUnevaluableState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewNoTargetLesionState.NotEvaluable)), }; - NewNoTargetLesionAssessment result = NewNoTargetLesionAssessment.NE; + NewNoTargetLesionAssessment result = NewNoTargetLesionAssessment.ND; // if(所有新非靶病灶消失或一直不存在任何新非靶病灶时评估为该结果) if(data.NotExistsNewNoTargetLesion|| data.AllVanish) @@ -2181,7 +2191,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }; - OtherPreviousNewLesionAssessment result = OtherPreviousNewLesionAssessment.Equivocal; + OtherPreviousNewLesionAssessment result = OtherPreviousNewLesionAssessment.ND; // if(有其它既往新病灶消失或一直不存在任何其它既往新病灶) if (data.NotExistsOtherNewTargetLesion || data.AllVanish) @@ -2403,7 +2413,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.iUPD)) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.iUPD)) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.iUPD)) - || lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Yes)) + || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Yes)) ) { // 疗效为 iUPD diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index c5fb7d69c..a17147ac7 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -110,8 +110,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId && x.ShowQuestion != ShowQuestion.Hide).ToListAsync(); var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync(); var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - - var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); + result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto + { + LesionType = x.Key.Value, + Count = x.ToList().Count() + }).ToList(); + var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index cba0db1e8..09a8225d9 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -442,7 +442,8 @@ namespace IRaCIS.Core.Application.Contracts if (await _trialSiteSurveyRepository.AnyAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.PMCreatedAndLock)) { - return ResponseOutput.NotOk("中心调研表已锁定,不允许操作"); + //---中心调研已锁定,不允许操作。 + return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_Locked"]); } var success = await _trialSiteSurveyRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialSiteSurveyId); @@ -561,7 +562,8 @@ namespace IRaCIS.Core.Application.Contracts if (await _repository.AnyAsync(t => t.State == TrialSiteSurveyEnum.PMCreatedAndLock && t.Id == trialSiteSurveyId)) { - return ResponseOutput.NotOk("中心调研表已锁定,不允许操作。"); + //---中心调研已锁定,不允许操作。 + return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_Locked"]); } if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM) @@ -668,7 +670,8 @@ namespace IRaCIS.Core.Application.Contracts { if (await _repository.AnyAsync(t => t.State == TrialSiteSurveyEnum.PMCreatedAndLock && t.Id == trialSiteSurveyId)) { - return ResponseOutput.NotOk("中心调研表已锁定,不允许操作。"); + //---中心调研已锁定,不允许操作。 + return ResponseOutput.NotOk(_localizer["TrialSiteSurvey_Locked"]); } if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index 84f21d22d..3b0cbc4cf 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -624,7 +624,8 @@ namespace IRaCIS.Core.Application if (inDto.TrialCriterionAdditionalAssessmentTypeList.All(t => t.IsSelected != true)) { - throw new BusinessValidationFailedException("选择了附加评估,必须勾选附加评估类型"); + //---选择了附加评估,必须勾选附加评估类型 + throw new BusinessValidationFailedException(_localizer["TrialConfig_AddEvalReq"]); } var trialId = _readingQuestionTrialRepository.Where(t => t.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).Select(t => t.TrialId).FirstOrDefault(); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs index 2a360d85d..56595de72 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs @@ -184,7 +184,8 @@ namespace IRaCIS.Application.Services { if (await _repository.AnyAsync(t => t.UserId == trialUser.UserId && t.TrialId == trialUser.TrialId)) { - return ResponseOutput.NotOk("Participant has participated in site maintenance"); + // ----人员已加入现场维护 + return ResponseOutput.NotOk(_localizer["TrialMaint_PersonnelJoined"]); } if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC) diff --git a/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs b/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs index 6a868048b..63c55f958 100644 --- a/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs +++ b/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs @@ -111,7 +111,8 @@ namespace IRaCIS.Application.Services if (!await _trialRepository.Where(t => t.Id == visitPlan.TrialId).IgnoreQueryFilters().AnyAsync(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing || t.TrialStatusStr == StaticData.TrialState.TrialInitializing)) { - throw new BusinessValidationFailedException("只有当项目状态为:初始化或进行中时,可以操作。 "); + //---只有当项目状态为:初始化或进行中时,可以操作。 + throw new BusinessValidationFailedException(_localizer["VisitPlan_OnlyInitOrOngoing"]); } var visitPlanList = await _visitStageRepository.Where(t => t.TrialId == visitPlan.TrialId, ignoreQueryFilters: true) diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index d28d6890a..7ed9a7783 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -1241,7 +1241,7 @@ namespace IRaCIS.Core.Domain.Share /// /// 存在 /// - Exist = 1, + Exist = 0, /// /// 增大 diff --git a/IRaCIS.Core.Domain/Document/TrialDocument.cs b/IRaCIS.Core.Domain/Document/TrialDocument.cs index 48b3cca46..b25c5f3a8 100644 --- a/IRaCIS.Core.Domain/Document/TrialDocument.cs +++ b/IRaCIS.Core.Domain/Document/TrialDocument.cs @@ -30,7 +30,6 @@ namespace IRaCIS.Core.Domain.Models public Dictionary FileType { get; set; } - public Guid FileTypeId { get; set; } diff --git a/IRaCIS.Core.Domain/Management/User.cs b/IRaCIS.Core.Domain/Management/User.cs index ede2ff587..ade0229e1 100644 --- a/IRaCIS.Core.Domain/Management/User.cs +++ b/IRaCIS.Core.Domain/Management/User.cs @@ -88,7 +88,12 @@ namespace IRaCIS.Core.Domain.Models public bool IsTestUser { get; set; } - [Projectable] public string FullName => LastName + " / " + FirstName; + /// + /// Զлһ + /// + public bool AutoCutNextTask { get; set; } = false; + + [Projectable] public string FullName => LastName + " / " + FirstName; //[Projectable] public string FullName => $"{LastName} / {FirstName}"; } diff --git a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs index 70b138918..9932ed4f8 100644 --- a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs +++ b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTableAnswerRowInfo.cs @@ -173,8 +173,13 @@ namespace IRaCIS.Core.Domain.Models //病灶编号 public string RowMark { get; set; } = string.Empty; + /// + /// 标记工具 + /// + public string MarkTool { get; set; } = string.Empty; - [JsonIgnore] + + [JsonIgnore] [ForeignKey("VisitTaskId")] public VisitTask VisitTask { get; set; } diff --git a/IRaCIS.Core.Domain/Reading/ShortcutKey/UserWLTemplate.cs b/IRaCIS.Core.Domain/Reading/ShortcutKey/UserWLTemplate.cs new file mode 100644 index 000000000..c89452ee2 --- /dev/null +++ b/IRaCIS.Core.Domain/Reading/ShortcutKey/UserWLTemplate.cs @@ -0,0 +1,66 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-05-08 15:14:38 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + ///UserWLTemplate + /// + [Table("UserWLTemplate")] + public class UserWLTemplate : Entity, IAuditAdd + { + + /// + /// TemplateName + /// + [Required] + public string TemplateName { get; set; } + + /// + /// UserId + /// + [Required] + public Guid UserId { get; set; } + + /// + /// CreateTime + /// + [Required] + public DateTime CreateTime { get; set; } + + /// + /// CreateUserId + /// + [Required] + public Guid CreateUserId { get; set; } + + /// + /// WW + /// + public int WW { get; set; } + + /// + /// WL + /// + public int WL { get; set; } + + /// + /// ShowOrder + /// + public int ShowOrder { get; set; } = 0; + + /// + /// 是否为默认 + /// + public bool IsPitchOn { get; set; } = true; + + } + + +} diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index e9e34e6af..089e70cbb 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -451,7 +451,9 @@ namespace IRaCIS.Core.Infra.EFCore #endregion public virtual DbSet ShortcutKey { get; set; } - public virtual DbSet EmailNoticeConfig { get; set; } + + public virtual DbSet UserWLTemplate { get; set; } + public virtual DbSet EmailNoticeConfig { get; set; } public virtual DbSet SystemBasicData { get; set; } public virtual DbSet TrialSign { get; set; } diff --git a/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs b/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs index 251a746aa..698d295bb 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs @@ -429,7 +429,9 @@ namespace IRaCIS.Core.Infra.EFCore { if (updateFilter == null) { - throw new ArgumentException("更新过滤条件不允许为空", nameof(updateFilter)); + + + throw new ArgumentException("The update filter condition cannot be empty", nameof(updateFilter)); } var query = ignoreQueryFilter ? _dbContext.Set().AsNoTracking().IgnoreQueryFilters() : _dbContext.Set().AsNoTracking(); diff --git a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs index 586e9ea35..1309ce19f 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs @@ -229,7 +229,7 @@ namespace IRaCIS.Core.Infra.EFCore { if (updateFilter == null) { - throw new ArgumentException("更新过滤条件不允许为空", nameof(updateFilter)); + throw new ArgumentException("The update filter condition cannot be empty", nameof(updateFilter)); } var query = ignoreQueryFilter ? _dbSet.AsNoTracking().IgnoreQueryFilters() : _dbSet.AsNoTracking(); diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs index 10bd999ea..bb102cd7d 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs @@ -54,7 +54,7 @@ namespace IRaCIS.Core.Infrastructure.Extention if (isMultiSortFiled&& sortArray==default) { - throw new System.Exception("必须指定排序字段"); + throw new System.Exception("The sort field must be specified"); } if (pageNumber <= 0) diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ResponseOutput.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ResponseOutput.cs index d11078b18..deacf6512 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ResponseOutput.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/Output/ResponseOutput.cs @@ -7,10 +7,10 @@ namespace IRaCIS.Core.Infrastructure.Extention /// public class ResponseOutput : IResponseOutput { - /// - /// 是否成功标记 - /// - public bool IsSuccess { get; private set; } + /// + /// 是否成功标记 + /// + public bool IsSuccess { get; private set; } public ApiResponseCodeEnum Code { get; set; } = ApiResponseCodeEnum.OK; @@ -169,7 +169,7 @@ namespace IRaCIS.Core.Infrastructure.Extention public static IResponseOutput DBNotExistIfNUll(object businessObject) { - return new ResponseOutput().NotOk($"The business object{businessObject.GetType().Name} does not exist in the database, or was deleted by someone else, or an incorrect parameter query caused"); + return new ResponseOutput().NotOk("The business object{businessObject.GetType().Name} does not exist in the database, or was deleted by someone else, or an incorrect parameter query caused"); } diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude index 793d43cb7..798e5963d 100644 --- a/IRaCIS.Core.Test/DbHelper.ttinclude +++ b/IRaCIS.Core.Test/DbHelper.ttinclude @@ -4,7 +4,7 @@ public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"; public static readonly string DbDatabase = "IRaCIS_New_Tet"; //ַ,ƴ - public static readonly string TableName = "ReadingTrialCriterionDictionary"; + public static readonly string TableName = "UserWLTemplate"; //ļ service Ƿҳ } #> diff --git a/ZhiZhunAuthenticationCenter/Controllers/JWTController.cs b/ZhiZhunAuthenticationCenter/Controllers/JWTController.cs index ca69a536d..4f36fcf68 100644 --- a/ZhiZhunAuthenticationCenter/Controllers/JWTController.cs +++ b/ZhiZhunAuthenticationCenter/Controllers/JWTController.cs @@ -77,13 +77,15 @@ namespace Zhaoxi.NET6.AuthenticationCenter.Controllers } else { - return ResponseOutput.NotOk("Token获取失败"); + + + return ResponseOutput.NotOk("Token获取失败"); } } else { - return ResponseOutput.NotOk("验证失败"); + return ResponseOutput.NotOk("验证失败"); } diff --git a/后端提示语.xlsx b/后端提示语.xlsx index 59c5547d3..6b08f7854 100644 Binary files a/后端提示语.xlsx and b/后端提示语.xlsx differ