diff --git a/IRaCIS.Core.API/_ServiceExtensions/SerilogSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/SerilogSetup.cs
index 00cef4889..455fcf589 100644
--- a/IRaCIS.Core.API/_ServiceExtensions/SerilogSetup.cs
+++ b/IRaCIS.Core.API/_ServiceExtensions/SerilogSetup.cs
@@ -31,7 +31,7 @@ namespace IRaCIS.Core.API
.Enrich.FromLogContext()
.Filter.ByExcluding(logEvent => logEvent.Properties.ContainsKey("RequestPath") && logEvent.Properties["RequestPath"].ToString().Contains("/health"))
.WriteTo.Console()
- .WriteTo.File($"{AppContext.BaseDirectory}Serilogs/.log", rollingInterval: RollingInterval.Day);
+ .WriteTo.File($"{AppContext.BaseDirectory}Serilogs/.log", rollingInterval: RollingInterval.Day,retainedFileCountLimit:60);
#region 根据环境配置是否打开错误发送邮件通知
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 7ba61d58b..ae3ff7b54 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -603,11 +603,10 @@
-
+
获取子项数组
-
diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs
index 27dcea7f7..d327c712f 100644
--- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs
+++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs
@@ -35,7 +35,7 @@ namespace IRaCIS.Core.Application.Service
IRepository _trialReadingCriterionRepository,
IRepository _trialClinicalDataSetRepository,
IRepository _readingClinicalDataRepository,
- IRepository _readingConsistentClinicalDataRepository,
+ IRepository _readingConsistentClinicalDataRepository,
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment, IFusionCache _fusionCache) : BaseService, IVisitTaskHelpeService
{
@@ -47,16 +47,16 @@ namespace IRaCIS.Core.Application.Service
///
///
- public async Task ExportTemplateAsync(ExportTemplateAsyncDto inDto)
+ public async Task ExportTemplateAsync(ExportTemplateAsyncDto inDto)
{
return await ExcelExportHelper.ExportTemplateAsync(new ExportTemplateServiceDto()
{
- Data=inDto.Data,
- commonDocumentRepository= _commonDocumentRepository,
- TemplateCode=inDto.TemplateCode,
- ExportFileName=inDto.ExportFileName,
- hostEnvironment=_hostEnvironment,
- IsEnglish=_userInfo.IsEn_Us,
+ Data = inDto.Data,
+ commonDocumentRepository = _commonDocumentRepository,
+ TemplateCode = inDto.TemplateCode,
+ ExportFileName = inDto.ExportFileName,
+ hostEnvironment = _hostEnvironment,
+ IsEnglish = _userInfo.IsEn_Us,
});
}
@@ -757,248 +757,30 @@ namespace IRaCIS.Core.Application.Service
if (trialReadingCriterionConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject)
{
- var allocateSubjectArmList = _visitTaskRepository.Where(t => t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TrialId == trialId && t.DoctorUserId != null && t.ArmEnum != Arm.JudgeArm)
- .Select(t => new { t.DoctorUserId, t.ArmEnum }).Distinct().ToList();
- //当前任务没有分配医生,初次分配 不处理 只生成任务,后续根据生成的任务 再进行分配
- if (allocateSubjectArmList.Count == 0)
- {
- }
- else
+ if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
{
- //并且配置了医生
- if (assignConfigList.Count > 0 && trialReadingCriterionConfig.IsFollowVisitAutoAssign)
+ #region 当前访视处理
+
+ //配置了医生
+ if (assignConfigList.Count > 0)
{
+ //之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
- #region 后续访视 未分配的进行再次分配,重置的或者失效的 需要重新生成新的任务 (PM 有序退回 或者PM 有序 申请重阅)
+ var beforeBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum < subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
-
- if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
+ //之前有回退的,那么当前访视任务生成但是不分配
+ if (beforeBackVisitTask != null)
{
- //之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
-
- var beforeBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum < subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
-
- //之前有回退的,那么当前访视任务生成但是不分配
- if (beforeBackVisitTask != null)
- {
- //不用进行额外处理
-
- //访视2 PM 回退 基线回退 访视2先一致性核查通过,生成访视2任务,但是不分配
- }
- else
- {
- #region 当前访视根据配置规则分配出去
-
- var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
-
- if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
- {
- task1.TaskAllocationState = defaultState;
- //分配给对应Arm的人
- task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1)!.DoctorUserId;
- task1.AllocateTime = DateTime.Now;
-
- task1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
- }
-
- if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
- {
- task2.TaskAllocationState = defaultState;
- task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2)!.DoctorUserId;
- task2.AllocateTime = DateTime.Now;
- task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
- }
-
- #endregion
- }
-
- //后续最近的未一致性核查通过的访视任务
- var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
-
- //大于当前访视 同时小于最近的未一致性核查通过的访视任务分配 或者生成
-
- //存在退回访视1 又退回基线 这种情况 生成任务 考虑基线先一致性核查通过,但是访视1还未通过时 生成任务
- var followVisitTaskList = await _visitTaskRepository
- .Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.SourceSubjectVisit.CheckState == CheckStateEnum.CVPassed && t.ReadingCategory == ReadingCategory.Visit && t.IsAnalysisCreate == false, true)
- .WhereIf(followBackVisitTask != null, t => t.VisitTaskNum < followBackVisitTask!.VisitTaskNum)
- .ToListAsync();
-
- var followVisitGroup = followVisitTaskList.GroupBy(t => t.VisitTaskNum);
-
- //每个访视去判断 是分配还是生成(因为影响哪里有些是取消分配,有些是重阅重置需要重新生成)
- foreach (var visitGroup in followVisitGroup)
- {
-
- var visit = await _subjectVisitRepository.Where(x => x.Id == visitGroup.First().SourceSubjectVisitId).Select(x => new
- {
- x.PDState,
- x.IsEnrollmentConfirm,
- x.IsUrgent,
- }).FirstNotNullAsync();
-
-
- TaskUrgentType? urgentType = null;
-
- if (subjectVisitInfo.PDState == PDStateEnum.PDProgress)
- {
- urgentType = TaskUrgentType.PDProgress;
- }
- else if (subjectVisitInfo.IsEnrollmentConfirm)
- {
- urgentType = TaskUrgentType.EnrollmentConfirm;
- }
- else if (subjectVisitInfo.IsUrgent)
- {
- urgentType = TaskUrgentType.VisitUrgent;
- }
-
- bool isCanEdit = urgentType == TaskUrgentType.EnrollmentConfirm || urgentType == TaskUrgentType.PDProgress ? false : true;
-
- //如果后续访视已分配有效 就不用处理
- if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm1))
- {
- //不做处理
- }
- else
- {
- var arm1 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm1);
-
- if (arm1 != null)
- {
-
- //有可能仅仅只分配了一个Subject 未分配 那么
- if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
- {
- arm1.IsUrgent = visit.IsUrgent;
- arm1.TaskUrgentType = urgentType;
- arm1.IsCanEditUrgentState = isCanEdit;
- arm1.TaskAllocationState = TaskAllocationState.Allocated;
- arm1.AllocateTime = DateTime.Now;
- arm1.DoctorUserId = task1.DoctorUserId;
- arm1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
- }
-
- }
- else
- {
- var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
-
-
-
-
- var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
- {
- TrialId = trialId,
- SubjectId = subjectVisit.SubjectId,
- IsUrgent = visit.IsUrgent,
- TaskUrgentType = urgentType,
- IsCanEditUrgentState = isCanEdit,
- ArmEnum = Arm.DoubleReadingArm1,//特殊
- Code = currentMaxCodeInt + 1,
- TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
- ReadingCategory = ReadingCategory.Visit,
-
- SourceSubjectVisitId = latestTask.SourceSubjectVisitId,
- VisitTaskNum = latestTask.VisitTaskNum,
- TaskBlindName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(latestTask.VisitTaskNum),
- TaskName = latestTask.TaskName,
-
- BlindSubjectCode = latestTask.BlindSubjectCode,
- BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
- IsAnalysisCreate = latestTask.IsAnalysisCreate,
- IsSelfAnalysis = latestTask.IsSelfAnalysis,
- TaskAllocationState = TaskAllocationState.Allocated,
- AllocateTime = DateTime.Now,
- DoctorUserId = task1!.DoctorUserId,
- SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
- TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
- IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
- IsClinicalDataSign = latestTask.IsClinicalDataSign
- });
-
- currentMaxCodeInt = currentMaxCodeInt + 1;
-
- _fusionCache.Set(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
- }
-
- }
-
- //如果后续访视已分配有效 就不用处理
- if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm2))
- {
- //不做处理
- }
- else
- {
- var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
- if (arm2 != null)
- {
- //有可能仅仅只分配了一个Subject
- if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
- {
- arm2.IsUrgent = visit.IsUrgent;
- arm2.TaskUrgentType = urgentType;
- arm2.IsCanEditUrgentState = isCanEdit;
- arm2.TaskAllocationState = TaskAllocationState.Allocated;
- arm2.AllocateTime = DateTime.Now;
- arm2.DoctorUserId = task2.DoctorUserId;
- arm2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
- }
-
- }
- else
- {
- var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).OrderByDescending(t => t.CreateTime).First();
-
- var taskTwo = await _visitTaskRepository.AddAsync(new VisitTask()
- {
- TrialId = trialId,
- SubjectId = subjectVisit.SubjectId,
- IsUrgent = visit.IsUrgent,
- TaskUrgentType = urgentType,
- IsCanEditUrgentState = isCanEdit,
-
- //CheckPassedTime = subjectVisit.CheckPassedTime,
- ArmEnum = Arm.DoubleReadingArm2,//特殊
- Code = currentMaxCodeInt + 1,
- TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
- ReadingCategory = ReadingCategory.Visit,
-
- SourceSubjectVisitId = latestTask.SourceSubjectVisitId,
- VisitTaskNum = latestTask.VisitTaskNum,
- TaskBlindName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(latestTask.VisitTaskNum),
- TaskName = latestTask.TaskName,
-
- BlindSubjectCode = latestTask.BlindSubjectCode,
- BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
- IsAnalysisCreate = latestTask.IsAnalysisCreate,
- IsSelfAnalysis = latestTask.IsSelfAnalysis,
- TaskAllocationState = TaskAllocationState.Allocated,
-
- AllocateTime = DateTime.Now,
- DoctorUserId = task2!.DoctorUserId,
- SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
-
- TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
- IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
- IsClinicalDataSign = latestTask.IsClinicalDataSign
- });
-
- currentMaxCodeInt = currentMaxCodeInt + 1;
-
- _fusionCache.Set(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
- }
- }
-
- }
-
+ //不用进行额外处理
+ //访视2 PM 回退 基线回退 访视2先一致性核查通过,生成访视2任务,但是不分配
}
- //无序的时候 生成任务并分配出去
else
{
+ #region 当前访视根据配置规则分配出去
+
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
@@ -1019,21 +801,237 @@ namespace IRaCIS.Core.Application.Service
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
}
+ #endregion
}
-
-
- #endregion
-
}
- else
- //后续访视不自动分配,或者配置的医生数量不足,就不进行分配
+ #endregion
+
+ #region 后续访视处理
+
+
+
+
+ //后续最近的未一致性核查通过的访视任务
+ var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
+
+ //大于当前访视 同时小于最近的未一致性核查通过的访视任务分配 或者生成
+
+ //存在退回访视1 又退回基线 这种情况 生成任务 考虑基线先一致性核查通过,但是访视1还未通过时 生成任务
+ var followVisitTaskList = await _visitTaskRepository
+ .Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.SourceSubjectVisit.CheckState == CheckStateEnum.CVPassed && t.ReadingCategory == ReadingCategory.Visit && t.IsAnalysisCreate == false, true)
+ .WhereIf(followBackVisitTask != null, t => t.VisitTaskNum < followBackVisitTask!.VisitTaskNum)
+ .ToListAsync();
+
+ var followVisitGroup = followVisitTaskList.GroupBy(t => t.VisitTaskNum);
+
+ //每个访视去判断 是分配还是生成(因为影响哪里有些是取消分配,有些是重阅重置需要重新生成)
+ foreach (var visitGroup in followVisitGroup)
{
+ var visit = await _subjectVisitRepository.Where(x => x.Id == visitGroup.First().SourceSubjectVisitId).Select(x => new
+ {
+ x.PDState,
+ x.IsEnrollmentConfirm,
+ x.IsUrgent,
+ }).FirstNotNullAsync();
+
+
+ TaskUrgentType? urgentType = null;
+
+ if (subjectVisitInfo.PDState == PDStateEnum.PDProgress)
+ {
+ urgentType = TaskUrgentType.PDProgress;
+ }
+ else if (subjectVisitInfo.IsEnrollmentConfirm)
+ {
+ urgentType = TaskUrgentType.EnrollmentConfirm;
+ }
+ else if (subjectVisitInfo.IsUrgent)
+ {
+ urgentType = TaskUrgentType.VisitUrgent;
+ }
+
+ bool isCanEdit = urgentType == TaskUrgentType.EnrollmentConfirm || urgentType == TaskUrgentType.PDProgress ? false : true;
+
+ //如果后续访视已分配有效 就不用处理
+ if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm1))
+ {
+ //不做处理
+ }
+ else
+ {
+ var arm1 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm1);
+
+ if (arm1 != null)
+ {
+ arm1.IsUrgent = visit.IsUrgent;
+ arm1.TaskUrgentType = urgentType;
+ arm1.IsCanEditUrgentState = isCanEdit;
+
+ //有可能仅仅只分配了一个Subject 未分配 那么
+ if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
+ {
+ arm1.TaskAllocationState = TaskAllocationState.Allocated;
+ arm1.AllocateTime = DateTime.Now;
+ arm1.DoctorUserId = task1.DoctorUserId;
+ arm1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
+ }
+
+ }
+ else
+ {
+ var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
+
+ var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
+ {
+ TrialId = trialId,
+ SubjectId = subjectVisit.SubjectId,
+ IsUrgent = visit.IsUrgent,
+ TaskUrgentType = urgentType,
+ IsCanEditUrgentState = isCanEdit,
+ ArmEnum = Arm.DoubleReadingArm1,//特殊
+ Code = currentMaxCodeInt + 1,
+ TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
+ ReadingCategory = ReadingCategory.Visit,
+
+ SourceSubjectVisitId = latestTask.SourceSubjectVisitId,
+ VisitTaskNum = latestTask.VisitTaskNum,
+ TaskBlindName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(latestTask.VisitTaskNum),
+ TaskName = latestTask.TaskName,
+
+ BlindSubjectCode = latestTask.BlindSubjectCode,
+ BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
+ IsAnalysisCreate = latestTask.IsAnalysisCreate,
+ IsSelfAnalysis = latestTask.IsSelfAnalysis,
+
+ TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
+ IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
+ IsClinicalDataSign = latestTask.IsClinicalDataSign
+ });
+
+ if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
+ {
+ taskOne.TaskAllocationState = TaskAllocationState.Allocated;
+ taskOne.AllocateTime = DateTime.Now;
+ taskOne. DoctorUserId = task1!.DoctorUserId;
+ taskOne. SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
+ }
+
+
+ currentMaxCodeInt = currentMaxCodeInt + 1;
+
+ _fusionCache.Set(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
+ }
+
+ }
+
+ //如果后续访视已分配有效 就不用处理
+ if (visitGroup.Any(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.ArmEnum == Arm.DoubleReadingArm2))
+ {
+ //不做处理
+ }
+ else
+ {
+ var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
+ if (arm2 != null)
+ {
+ arm2.IsUrgent = visit.IsUrgent;
+ arm2.TaskUrgentType = urgentType;
+ arm2.IsCanEditUrgentState = isCanEdit;
+
+ //有可能仅仅只分配了一个Subject
+ if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
+ {
+ arm2.TaskAllocationState = TaskAllocationState.Allocated;
+ arm2.AllocateTime = DateTime.Now;
+ arm2.DoctorUserId = task2.DoctorUserId;
+ arm2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
+ }
+
+ }
+ else
+ {
+ var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).OrderByDescending(t => t.CreateTime).First();
+
+ var taskTwo = await _visitTaskRepository.AddAsync(new VisitTask()
+ {
+ TrialId = trialId,
+ SubjectId = subjectVisit.SubjectId,
+ IsUrgent = visit.IsUrgent,
+ TaskUrgentType = urgentType,
+ IsCanEditUrgentState = isCanEdit,
+
+ //CheckPassedTime = subjectVisit.CheckPassedTime,
+ ArmEnum = Arm.DoubleReadingArm2,//特殊
+ Code = currentMaxCodeInt + 1,
+ TaskCode = AppSettings.GetCodeStr(currentMaxCodeInt + 1, nameof(VisitTask)),
+ ReadingCategory = ReadingCategory.Visit,
+
+ SourceSubjectVisitId = latestTask.SourceSubjectVisitId,
+ VisitTaskNum = latestTask.VisitTaskNum,
+ TaskBlindName = visitBlindConfig.BlindFollowUpPrefix + " " + visitNumList.IndexOf(latestTask.VisitTaskNum),
+ TaskName = latestTask.TaskName,
+
+ BlindSubjectCode = latestTask.BlindSubjectCode,
+ BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
+ IsAnalysisCreate = latestTask.IsAnalysisCreate,
+ IsSelfAnalysis = latestTask.IsSelfAnalysis,
+
+ TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
+ IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
+ IsClinicalDataSign = latestTask.IsClinicalDataSign
+ });
+
+ if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
+ {
+ taskTwo.TaskAllocationState = TaskAllocationState.Allocated;
+ taskTwo.AllocateTime = DateTime.Now;
+ taskTwo.DoctorUserId = task2!.DoctorUserId;
+ taskTwo.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
+ }
+
+ currentMaxCodeInt = currentMaxCodeInt + 1;
+
+ _fusionCache.Set(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
+ }
+ }
+
}
- }
+ #endregion
+
+ }
+ else
+ {
+ //无序的时候 生成任务并分配出去
+ if (assignConfigList.Count > 0 && trialReadingCriterionConfig.IsFollowVisitAutoAssign)
+ {
+ var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
+
+ if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
+ {
+ task1.TaskAllocationState = defaultState;
+ //分配给对应Arm的人
+ task1.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm1)!.DoctorUserId;
+ task1.AllocateTime = DateTime.Now;
+
+ task1.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
+ }
+
+ if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
+ {
+ task2.TaskAllocationState = defaultState;
+ task2.DoctorUserId = assignConfigList.FirstOrDefault(t => t.ArmEnum == Arm.DoubleReadingArm2)!.DoctorUserId;
+ task2.AllocateTime = DateTime.Now;
+ task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
+ }
+ }
+
+
+ }
+
}
diff --git a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs
index ff0c44c9c..93d8e8424 100644
--- a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs
+++ b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs
@@ -39,6 +39,10 @@ namespace IRaCIS.Application.Contracts
public string ValueCN { get; set; } = string.Empty;
}
+ public class ChildInQuery:SortInput
+ {
+ public Guid ParentId { get; set; }
+ }
public class AddOrEditBasicDic
{
diff --git a/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs
index a6ae722e9..52407a4a6 100644
--- a/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs
@@ -96,9 +96,6 @@ namespace IRaCIS.Core.Application.Contracts
public bool IsDeleted { get; set; }
-
- public CriterionType? CriterionTypeEnum { get; set; }
-
/// 业务模块 ///
public int BusinessModuleEnum { get; set; }
@@ -140,6 +137,13 @@ namespace IRaCIS.Core.Application.Contracts
public int? EmailDelaySeconds { get; set; }
+
+
+ [Comment("邮件配置的多个标准")]
+ public List? CriterionTypeList { get; set; }
+
+ //public CriterionType? CriterionTypeEnum { get; set; }
+
}
diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs
index e3a8e2b9f..61eba7a5f 100644
--- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs
+++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs
@@ -182,13 +182,12 @@ namespace IRaCIS.Core.Application.Service
///
/// 获取子项数组
///
- ///
///
- [HttpGet("{parentId:guid}")]
- public async Task> GetChildList(Guid parentId)
+ [HttpPost]
+ public async Task> GetChildList(ChildInQuery inQuery)
{
- return await _dicRepository.Where(t => t.ParentId == parentId)
- .OrderBy(t => t.ShowOrder).ProjectTo(_mapper.ConfigurationProvider).ToListAsync();
+ return await _dicRepository.Where(t => t.ParentId == inQuery.ParentId)
+ .ProjectTo(_mapper.ConfigurationProvider).SortToListAsync(inQuery);
}
diff --git a/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs
index fc2fa6c3f..8c80d5ff7 100644
--- a/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs
+++ b/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs
@@ -28,7 +28,7 @@ namespace IRaCIS.Core.Application.Contracts
.WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel)
.WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria)
.WhereIf(inQuery.BusinessLevelEnum != null, t => t.BusinessLevelEnum == inQuery.BusinessLevelEnum)
- .WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum)
+ .WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeList.Any(t=>t==inQuery.CriterionTypeEnum))
.WhereIf(inQuery.BusinessModuleEnum != null, t => t.BusinessModuleEnum == inQuery.BusinessModuleEnum)
.WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum)
.WhereIf(inQuery.IsReturnRequired != null, t => t.IsReturnRequired == inQuery.IsReturnRequired)
@@ -82,13 +82,36 @@ namespace IRaCIS.Core.Application.Contracts
public async Task AddOrUpdateEmailNoticeConfig(EmailNoticeConfigAddOrEdit addOrEditEmailNoticeConfig)
{
- var verifyExp1 = new EntityVerifyExp()
+ //var verifyExp1 = new EntityVerifyExp()
+ //{
+ // VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum && t.CriterionTypeEnum == addOrEditEmailNoticeConfig.CriterionTypeEnum,
+
+ // VerifyMsg = _localizer["EmailNoticeConfig_RepeatEmailScenario"]
+
+ //};
+
+ var criterionList = _emailNoticeConfigrepository.Where(t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum && t.IsEnable == true)
+ .Where(t => t.CriterionTypeList != null)
+ .WhereIf(addOrEditEmailNoticeConfig.Id != null, t => t.Id != addOrEditEmailNoticeConfig.Id)
+ .Select(t => t.CriterionTypeList).ToList();//不能使用selectMany 会当成关联对象,不能当成字符串
+
+
+ if (addOrEditEmailNoticeConfig.CriterionTypeList != null)
{
- VerifyExp = t => t.BusinessScenarioEnum == addOrEditEmailNoticeConfig.BusinessScenarioEnum && t.CriterionTypeEnum == addOrEditEmailNoticeConfig.CriterionTypeEnum,
+ foreach (var item in addOrEditEmailNoticeConfig.CriterionTypeList)
+ {
+ foreach (var itemList in criterionList)
+ {
+ if (itemList.Any(t => t == item))
+ {
+ return ResponseOutput.NotOk(_localizer["EmailNoticeConfig_RepeatEmailScenario"]);
+ }
+ }
+
+ }
+ }
- VerifyMsg = _localizer["EmailNoticeConfig_RepeatEmailScenario"]
- };
var verifyExp2 = new EntityVerifyExp()
{
@@ -132,7 +155,7 @@ namespace IRaCIS.Core.Application.Contracts
}
- await _emailNoticeConfigrepository.AddAsync(entity, true, verifyExp1, verifyExp2);
+ await _emailNoticeConfigrepository.AddAsync(entity, true, verifyExp2);
}
@@ -155,7 +178,7 @@ namespace IRaCIS.Core.Application.Contracts
}
- entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false, verifyExp1, verifyExp2);
+ entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false, verifyExp2);
diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs
index 795feb2a4..0faec4dc4 100644
--- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs
+++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs
@@ -409,7 +409,7 @@ namespace IRaCIS.Core.Application.Service.Common
var systemDocQuery =
from sysDoc in _systemDocumentRepository.AsQueryable(false)
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
- from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
+ from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.Status == UserStateEnum.Enable && t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
diff --git a/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs
index 46d3f83f7..c1915fd5a 100644
--- a/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs
@@ -146,9 +146,6 @@ namespace IRaCIS.Core.Application.ViewModel
public Guid TrialId { get; set; }
- public CriterionType? CriterionTypeEnum { get; set; }
-
-
public List ToUserTypeList { get; set; }
public List CopyUserTypeList { get; set; }
@@ -197,6 +194,9 @@ namespace IRaCIS.Core.Application.ViewModel
public int? EmailDelaySeconds { get; set; }
+ [Comment("邮件配置的多个标准")]
+ public List? CriterionTypeList { get; set; }
+
}
diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
index 87cca2508..982f116ed 100644
--- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
+++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
@@ -912,7 +912,7 @@ namespace IRaCIS.Core.Application.Services
var systemDocQuery =
from sysDoc in _systemDocumentRepository.AsQueryable(false)
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
- from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
+ from identityUser in _identityUserRepository.AsQueryable(false).Where(t =>t.Status== UserStateEnum.Enable && t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs
index 54e3367be..f72e57c79 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs
@@ -602,7 +602,7 @@ namespace IRaCIS.Core.Application.Contracts
? $"{TotalImageSize.Value / 1024d / 1024d:F3} MB"
: "0.000 MB";
- public string ImageTypeStr => $"{(IsHaveDicom ? "DICOM," : "")}{(IsHaveNoneDicom ? "Non-DICOM" : "")}";
+ public string ImageTypeStr => $"{(IsHaveDicom ? "DICOM" : "")}{(IsHaveNoneDicom&&IsHaveDicom?" , ":"")}{(IsHaveNoneDicom ? "Non-DICOM" : "")}";
public bool IsHaveDicom { get; set; }
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
index 4a0254850..7695767ee 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
@@ -13,6 +13,7 @@ using MassTransit.Initializers;
using Medallion.Threading;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
+using NPOI.SS.Formula.Functions;
using System.Data;
using System.IO.Compression;
using System.Text;
@@ -901,8 +902,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
}
var query = _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
- && t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect)
- //满足 有序,或者随机只看到当前任务的dicom 非dicom检查
+ && t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId)
+ //满足 有序,或者随机只看到当前任务的dicom 非dicom检查
+ .WhereIf(inQuery.VisitTaskId == null, t => t.TaskState == TaskState.Effect)//从待阅列表进入,要筛选出有效的,任务可能重阅了,也要看到该任务的的
.WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId)
.ProjectTo(_mapper.ConfigurationProvider);
@@ -1258,7 +1260,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
if (inCommand.IsKeyImage)
{
- var downloadInfo = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && t.ReadingCategory == ReadingCategory.Visit && t.IsAnalysisCreate == false)
+ var downloadInfo = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned && t.IsAnalysisCreate == false)
.Where(t => inCommand.SubjectVisitIdList.Contains((Guid)t.SourceSubjectVisitId))
.Select(t => new
{
@@ -1269,11 +1271,11 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
SubjectCode = t.Subject.Code,
VisitName = (string?)t.SourceSubjectVisit.VisitName,
- ArmEnum= t.ArmEnum,
+ ArmEnum = t.ArmEnum,
- QuestionMarkPictureList = t.ReadingTaskQuestionMarkList.Select(c => new { c.PicturePath, c.OtherPicturePath }).ToList(),
+ QuestionMarkPictureList = t.ReadingTaskQuestionMarkList.Select(c => new { c.PicturePath, c.OtherPicturePath }).ToList(),
- TableQuestionRowPictureList = t.LesionList.Select(c => new { c.PicturePath, c.OtherPicturePath }).ToList(),
+ TableQuestionRowPictureList = t.LesionList.Select(c => new { c.PicturePath, c.OtherPicturePath }).ToList(),
IsJudgeSelect = t.JudgeResultTaskId == t.Id
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
index 9dc3e07ea..64bbf13b7 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
@@ -3135,7 +3135,7 @@ namespace IRaCIS.Core.Application.Service
Random random = new Random();
var skipcount = 0;
-
+
var minRandomOrder = query.Where(t => t.RandomOrder != null).Select(t => t.RandomOrder).MinOrDefault();
//以随机序号优先,阅片中优先先给IR
@@ -3189,6 +3189,14 @@ namespace IRaCIS.Core.Application.Service
{
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
}
+ else
+ {
+ //触发任务随机编号
+
+ await _downloadAndUploadService.SubejctRandomReadingTaskNameDeal(task.SubjectId, task.TrialReadingCriterionId);
+
+ task.TaskBlindName = await _visitTaskRepository.Where(t => t.Id == task.VisitTaskId).Select(t => t.TaskBlindName).FirstOrDefaultAsync() ?? "";
+ }
if (task.SubjectCode.IsNullOrEmpty())
{
diff --git a/IRaCIS.Core.Domain/Common/EmailNoticeConfig.cs b/IRaCIS.Core.Domain/Common/EmailNoticeConfig.cs
index a11ad0756..d1963eaa4 100644
--- a/IRaCIS.Core.Domain/Common/EmailNoticeConfig.cs
+++ b/IRaCIS.Core.Domain/Common/EmailNoticeConfig.cs
@@ -33,9 +33,6 @@ public class EmailNoticeConfig : BaseFullDeleteAuditEntity
public string Code { get; set; } = null!;
- [Comment("标准枚举")]
- public CriterionType? CriterionTypeEnum { get; set; }
-
public string Description { get; set; } = null!;
[Comment("发送周期")]
@@ -68,6 +65,12 @@ public class EmailNoticeConfig : BaseFullDeleteAuditEntity
public bool IsReturnRequired { get; set; }
public SysEmailLevel SystemLevel { get; set; }
+
+ [Comment("标准枚举--后续废弃,这里可以选择多个标准")]
+ public CriterionType? CriterionTypeEnum { get; set; }
+
+ [Comment("邮件配置的多个标准")]
+ public List? CriterionTypeList { get; set; }
}
[Comment("后台 - 邮件配置用户类型表(需要同步)")]
[Table("EmailNoticeUserType")]
diff --git a/IRaCIS.Core.Domain/Document/TrialEmailNoticeConfig.cs b/IRaCIS.Core.Domain/Document/TrialEmailNoticeConfig.cs
index 479049efe..06e1da267 100644
--- a/IRaCIS.Core.Domain/Document/TrialEmailNoticeConfig.cs
+++ b/IRaCIS.Core.Domain/Document/TrialEmailNoticeConfig.cs
@@ -42,8 +42,6 @@ public class TrialEmailNoticeConfig : BaseFullDeleteAuditEntity
public string Code { get; set; } = null!;
- public CriterionType? CriterionTypeEnum { get; set; }
-
public string Description { get; set; } = null!;
public string EmailCron { get; set; } = null!;
@@ -86,6 +84,14 @@ public class TrialEmailNoticeConfig : BaseFullDeleteAuditEntity
[Comment("邮件延时秒数,比如一个事件触发,延迟多少s后才发邮件")]
public int? EmailDelaySeconds { get; set; } = null!;
+
+ [Comment("后续删除,需要维护数据")]
+
+ public CriterionType? CriterionTypeEnum { get; set; }
+
+ [Comment("邮件配置的多个标准")]
+ public List? CriterionTypeList { get; set; }
+
}
[Comment("项目 - 项目邮件用户黑名单")]
diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
index 5b8859e06..4f4436c74 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
@@ -3632,6 +3632,15 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
}
+ if(entity.TaskBlindName.Contains("Timepoint Ran"))
+ {
+ if(_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => !t.TaskBlindName.Contains("Timepoint Ran")))
+ {
+ isDistinctionInterface = false;
+ extraIdentification = "/TriggerSystemBlindingName";
+ }
+ }
+
}
diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/20250618084831_emailAddFiled.Designer.cs b/IRaCIS.Core.Infra.EFCore/Migrations/20250618084831_emailAddFiled.Designer.cs
new file mode 100644
index 000000000..1ad5cbe62
--- /dev/null
+++ b/IRaCIS.Core.Infra.EFCore/Migrations/20250618084831_emailAddFiled.Designer.cs
@@ -0,0 +1,19765 @@
+//
+using System;
+using IRaCIS.Core.Infra.EFCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace IRaCIS.Core.Infra.EFCore.Migrations
+{
+ [DbContext(typeof(IRaCISDBContext))]
+ [Migration("20250618084831_emailAddFiled")]
+ partial class emailAddFiled
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.15")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.Attachment", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("编码");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DoctorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ExpiryDate")
+ .HasColumnType("datetime2")
+ .HasComment("过期时间");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsAuthorizedView")
+ .HasColumnType("bit");
+
+ b.Property("IsOfficial")
+ .HasColumnType("bit")
+ .HasComment("是否正式简历");
+
+ b.Property("Language")
+ .HasColumnType("int")
+ .HasComment("1 中文 2为英文");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("文件类型名");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("DoctorId");
+
+ b.ToTable("Attachment", t =>
+ {
+ t.HasComment("医生 - 简历|证书 文档表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditDocument", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditDocumentTypeEnum")
+ .HasColumnType("int");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileFormat")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FilePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("FileSize")
+ .HasPrecision(18, 2)
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("IsAuthorization")
+ .HasColumnType("bit");
+
+ b.Property("MainFileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ParentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("AuditDocument", t =>
+ {
+ t.HasComment("稽查文档管理");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CRO", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CROCode")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CROName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CRONameCN")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsTrialLevel")
+ .HasColumnType("bit")
+ .HasComment("是否是项目级别");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CROCompany", t =>
+ {
+ t.HasComment("机构 - CRO");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CheckChallengeDialog", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsCRCNeedReply")
+ .HasColumnType("bit")
+ .HasComment("CRC是否需要回复 前端使用");
+
+ b.Property("ParamInfo")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasComment("核查的检查信息Json");
+
+ b.Property("SubjectVisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TalkContent")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserTypeEnum")
+ .HasColumnType("int")
+ .HasComment("核查过程中的操作用户类型");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SubjectVisitId");
+
+ b.ToTable("CheckChallengeDialog", t =>
+ {
+ t.HasComment("一致性核查 - 对话记录表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalAnswerRowInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("RowIndex")
+ .HasColumnType("int");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalAnswerRowInfo", t =>
+ {
+ t.HasComment("受试者 - 临床表单表格问题行记录");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalDataSystemSet", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalDataLevel")
+ .HasColumnType("int");
+
+ b.Property("ClinicalDataSetEnName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalDataSetEnum")
+ .HasColumnType("int")
+ .HasComment("枚举(字典里面取的)");
+
+ b.Property("ClinicalDataSetName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalUploadType")
+ .HasColumnType("int")
+ .HasComment("上传方式");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionEnumListStr")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("EnFileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("EnPath")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsApply")
+ .HasColumnType("bit")
+ .HasComment("是否应用");
+
+ b.Property("IsEnable")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("UploadRole")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalDataSystemSet", t =>
+ {
+ t.HasComment("系统 - 临床数据配置");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalDataTrialSet", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalDataLevel")
+ .HasColumnType("int")
+ .HasComment("临床级别");
+
+ b.Property("ClinicalDataSetEnName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalDataSetName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalUploadType")
+ .HasColumnType("int")
+ .HasComment("上传方式");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionEnumListStr")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("EnFileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("EnPath")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsApply")
+ .HasColumnType("bit")
+ .HasComment("是否应用");
+
+ b.Property("IsConfirm")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("SystemClinicalDataSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UploadRole")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SystemClinicalDataSetId");
+
+ b.HasIndex("TrialId");
+
+ b.ToTable("ClinicalDataTrialSet", t =>
+ {
+ t.HasComment("项目 - 临床数据适应标准配置");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalForm", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CheckDate")
+ .HasColumnType("datetime2")
+ .HasComment("检查日期");
+
+ b.Property("ClinicalDataTrialSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PicturePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("截图地址");
+
+ b.Property("ReadingId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("VisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClinicalDataTrialSetId");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("ReadingId");
+
+ b.HasIndex("SubjectId");
+
+ b.ToTable("ClinicalForm", t =>
+ {
+ t.HasComment("受试者 - 临床表单");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Answer")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("ClinicalDataTrialSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClinicalFormId");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalQuestionAnswer", t =>
+ {
+ t.HasComment("受试者 - 临床表单问题答案");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalTableAnswer", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Answer")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("答案");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("RowId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("答案行的Id");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.Property("TableQuestionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("RowId");
+
+ b.ToTable("ClinicalTableAnswer", t =>
+ {
+ t.HasComment("受试者 - 临床表单表格问题答案");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonDocument", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BusinessScenarioEnum")
+ .HasColumnType("int")
+ .HasComment("业务场景");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionTypeEnum")
+ .HasColumnType("int")
+ .HasComment("系统标准枚举");
+
+ b.Property("DeleteUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileTypeEnum")
+ .HasColumnType("int")
+ .HasComment("类型-上传|导出|邮件附件");
+
+ b.Property("IsDeleted")
+ .HasColumnType("bit");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("NameCN")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CommonDocument", t =>
+ {
+ t.HasComment("数据上传 | 数据导出 | 邮件附件 文件记录表 (需要同步)");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionNidusSystem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsSystemCriterion")
+ .HasColumnType("bit");
+
+ b.Property("LesionType")
+ .HasColumnType("int")
+ .HasComment("病灶类型");
+
+ b.Property("OrganType")
+ .HasColumnType("int")
+ .HasComment("器官类型");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("CriterionId");
+
+ b.ToTable("CriterionNidusSystem", t =>
+ {
+ t.HasComment("系统标准 - 病灶器官表 (需要同步)");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionNidusTrial", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LesionType")
+ .HasColumnType("int");
+
+ b.Property("OrganType")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CriterionNidusTrial", t =>
+ {
+ t.HasComment("项目标准 - 病灶器官表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.DataInspection", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BatchId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("批次Id");
+
+ b.Property("ChildrenTypeId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("子类");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateUserName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("创建人姓名");
+
+ b.Property("CreateUserRealName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("DoctorUserId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("阅片医生");
+
+ b.Property("EntityName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("被稽查实体名");
+
+ b.Property("GeneralId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("要稽查对象Id");
+
+ b.Property("IP")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Identification")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("标识");
+
+ b.Property("IsFrontAdd")
+ .HasColumnType("bit")
+ .HasComment("是否是前端添加");
+
+ b.Property("IsSign")
+ .HasColumnType("bit");
+
+ b.Property("JsonDetail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastJsonDetail")
+ .HasColumnType("nvarchar(max)")
+ .HasComment("上一条json");
+
+ b.Property("ModuleTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectRelationParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("被稽查对象外键1");
+
+ b.Property("ObjectRelationParentId2")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectRelationParentId3")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OptTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("父ID");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("RoleName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("角色名称");
+
+ b.Property("SignId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectVisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialReadingCriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialSiteId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("VisitStageId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("访视计划ID");
+
+ b.Property("VisitTaskId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("TrialReadingCriterionId");
+
+ b.HasIndex("VisitTaskId");
+
+ b.ToTable("DataInspection", t =>
+ {
+ t.HasComment("稽查 - 记录表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomInstance", b =>
+ {
+ b.Property("SeqId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Anonymize")
+ .HasColumnType("bit");
+
+ b.Property("CPIStatus")
+ .HasColumnType("bit");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeleteUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("FileSize")
+ .HasColumnType("bigint");
+
+ b.Property("FrameOfReferenceUID")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("HtmlPath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ImageColumns")
+ .HasColumnType("int");
+
+ b.Property("ImageRows")
+ .HasColumnType("int");
+
+ b.Property("ImagerPixelSpacing")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("InstanceNumber")
+ .HasColumnType("int");
+
+ b.Property("InstanceTime")
+ .HasColumnType("datetime2");
+
+ b.Property("IsDeleted")
+ .HasColumnType("bit");
+
+ b.Property("IsReading")
+ .HasColumnType("bit");
+
+ b.Property("NumberOfFrames")
+ .HasColumnType("int");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("PixelSpacing")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SeriesId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SeriesInstanceUid")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SliceLocation")
+ .HasColumnType("int");
+
+ b.Property("SliceThickness")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SopInstanceUid")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("StudyId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("StudyInstanceUid")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectVisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("WindowCenter")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("WindowWidth")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.HasKey("SeqId");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SeriesId");
+
+ b.HasIndex("StudyId");
+
+ b.ToTable("DicomInstance", t =>
+ {
+ t.HasComment("归档 - Instance表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomSeries", b =>
+ {
+ b.Property("SeqId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AcquisitionNumber")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("AcquisitionTime")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("BodyPartExamined")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("BodyPartForEdit")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeleteUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ImageOrientationPatient")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ImagePositionPatient")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ImageResizePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("ImagerPixelSpacing")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property