diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 9a1d69528..e38553142 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -9,6 +9,7 @@ using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Application.Auth; using IRaCIS.Core.Domain.Share.Reading; +using IRaCIS.Core.Infra.EFCore.Common; namespace IRaCIS.Core.Application.Services { @@ -99,20 +100,24 @@ namespace IRaCIS.Core.Application.Services } } - //// 末次访视添加全局阅片 - //if (dbBeforeEntity.IsFinalVisit == false && svCommand.IsFinalVisit == true) - //{ - // if (!await _readModuleRepository.AnyAsync(x => x.SubjectVisitId == svCommand.Id && x.ReadingSetType == ReadingSetType.ImageReading)) - // { - // _readModuleRepository.AddAsync(new ReadModule() - // { - // IsUrgent= dbBeforeEntity.IsUrgent, - // SubjectVisitId= svCommand.Id.Value, - // Status= - - // }); - // } - //} + // 末次访视添加全局阅片 + if (dbBeforeEntity.IsFinalVisit == false && svCommand.IsFinalVisit == true) + { + // 当前访视没有阅片期才添加 + if (!await _readModuleRepository.AnyAsync(x => x.SubjectVisitId == svCommand.Id && x.ReadingSetType == ReadingSetType.ImageReading)) + { + await _readModuleRepository.AddAsync(new ReadModule() + { + IsUrgent = dbBeforeEntity.IsUrgent, + SubjectVisitId = svCommand.Id.Value, + Status = ReadingCommon.GetVisitSubmitStateEnum(dbBeforeEntity), + SubjectId = dbBeforeEntity.SubjectId, + ModuleName="G",// 全局阅片 + ReadingSetType= ReadingSetType.ImageReading, + ModuleType=ModuleTypeEnum.Global, + }); + } + } } diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs index 387ce19cc..87a456412 100644 --- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs +++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs @@ -35,6 +35,11 @@ namespace IRaCIS.Core.Domain.Share.Reading /// 肿瘤学 /// Oncology = 4, + + /// + /// 全局阅片 + /// + Global = 5, } public enum ReadingSetType