From 510dfcac306b8105657118683656ac0c56ebdb01 Mon Sep 17 00:00:00 2001
From: he <109787524@qq.com>
Date: Mon, 3 Nov 2025 14:22:41 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=98=85=E7=89=87=E6=9C=9F?=
=?UTF-8?q?=E8=AE=A1=E5=88=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../IRaCIS.Core.Application.xml | 14 +
.../Reading/Dto/ReadingPeriodSetViewModel.cs | 32 +
.../ReadingPeriod/ReadingPeriodSetService.cs | 436 +-
.../ReadingPeriod/ReadingPeriodPlan.cs | 10 +
...251103062214_ReadingPeriodPlan.Designer.cs | 20973 ++++++++++++++++
.../20251103062214_ReadingPeriodPlan.cs | 40 +
.../IRaCISDBContextModelSnapshot.cs | 6 +
7 files changed, 21341 insertions(+), 170 deletions(-)
create mode 100644 IRaCIS.Core.Infra.EFCore/Migrations/20251103062214_ReadingPeriodPlan.Designer.cs
create mode 100644 IRaCIS.Core.Infra.EFCore/Migrations/20251103062214_ReadingPeriodPlan.cs
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 9d3c20474..15c79198d 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -14011,6 +14011,13 @@
+
+
+ 生效或者新增访视的时候添加阅片期
+
+
+
+
获取选中的计划 (增加标准不影响 因为阅片期设置关联了标准)
@@ -14052,6 +14059,13 @@
+
+
+ 添加阅片计划并生成阅片期(在阅片期已经生效的情况下添加)
+
+
+
+
设置加入或者移除阅片计划
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs
index 675055cbb..7cdc0eb58 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs
@@ -127,6 +127,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid? TrialReadingCriterionId { get; set; }
}
+ public class AddReadingPlanAndGenerateReadModuleInDto
+ {
+ public Guid ReadingPeriodSetId { get; set; }
+
+ public List SubjectVisitIdList { get; set; } = new List();
+ }
+
public class SetBatchAddOrRemoveReadingPlanInDto
{
public List SubjectVisitIdList { get; set; } = new List();
@@ -404,6 +411,31 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public ReadingPeriodStatus IsTakeEffect { get; set; }
}
+ public class AddReadModuleInDto
+ {
+ public Guid TrialReadingCriterionId { get; set; }
+
+ public Guid ReadingPeriodSetId { get; set; }
+
+ public Guid TrialId { get; set; }
+
+ public string ReadingPeriodName { get; set; }
+
+ public ReadingSetType ReadingSetType { get; set; }
+
+ public List VisitInfoList { get; set; } = new List();
+
+
+ }
+
+ public class AddReadModuleVisitInfo
+ {
+ public Guid SubjectId { get; set; }
+ public bool IsUrgent { get; set; }
+ public Guid SubjectVisitId { get; set; }
+
+ }
+
public class ReadingPeriodSetQuery : PageInput
{
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs
index ad8e28930..e944c024c 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs
@@ -2,10 +2,12 @@
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Application.ViewModel;
+using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infrastructure;
using MassTransit;
using Microsoft.AspNetCore.Mvc;
+using NPOI.Util;
namespace IRaCIS.Core.Application.Service
{
@@ -74,53 +76,67 @@ namespace IRaCIS.Core.Application.Service
else
{
var entity = (await _readingPeriodSetRepository.Where(t => t.Id == addOrEditReadingPeriodSet.Id, true).Include(t => t.ReadingPeriodSites).Include(x => x.ReadingPeriodPlanList).FirstOrDefaultAsync()).IfNullThrowException();
- _mapper.Map(addOrEditReadingPeriodSet, entity);
- entity.ReadingPeriodSites = addOrEditReadingPeriodSet.SiteIds.Select(x => new ReadingPeriodSite()
+ // 已生效的时候就不可能修改 只能是添加计划和生成模块
+ if (entity.IsTakeEffect == ReadingPeriodStatus.TakeEffect)
{
- ReadingPeriodSetId = entity.Id,
- TrialId = entity.TrialId,
- TrialSiteId = x,
- }).ToList();
-
- // 修改了就是重新生成计划
- if (await IsChangeReadingPlan(new IsChangeReadingPlanInDto()
- {
-
- Id = addOrEditReadingPeriodSet.Id,
- ExpirationDate = addOrEditReadingPeriodSet.ExpirationDate,
- ReadingScope = addOrEditReadingPeriodSet.ReadingScope.Value,
- TrialId = addOrEditReadingPeriodSet.TrialId,
- ExpirationVisitNum = addOrEditReadingPeriodSet.ExpirationVisitNum,
- VisitStageId = addOrEditReadingPeriodSet.VisitStageId,
- ReadingSetType = addOrEditReadingPeriodSet.ReadingSetType,
- TrialReadingCriterionId = addOrEditReadingPeriodSet.TrialReadingCriterionId,
- SiteIds = addOrEditReadingPeriodSet.SiteIds,
- }))
- {
-
- entity.ReadingPeriodPlanList = addOrEditReadingPeriodSet.SubjectVisitIds.Select(x => new ReadingPeriodPlan
+ await AddReadingPlanAndGenerateReadModule(new AddReadingPlanAndGenerateReadModuleInDto()
{
- ReadingPeriodSetId = entity.Id,
- SubjectVisitId = x,
- }).ToList();
+ ReadingPeriodSetId = addOrEditReadingPeriodSet.Id.Value,
+ SubjectVisitIdList = addOrEditReadingPeriodSet.SubjectVisitIds
+ });
}
else
{
- var existsVisitIds = await _readingPeriodPlanRepository.Where(x => x.ReadingPeriodSetId == addOrEditReadingPeriodSet.Id).Select(x => x.SubjectVisitId).ToListAsync();
+ _mapper.Map(addOrEditReadingPeriodSet, entity);
- var needaddIds = addOrEditReadingPeriodSet.SubjectVisitIds.Where(x => !existsVisitIds.Contains(x)).ToList();
-
- entity.ReadingPeriodPlanList.AddRange(needaddIds.Select(x => new ReadingPeriodPlan()
+ entity.ReadingPeriodSites = addOrEditReadingPeriodSet.SiteIds.Select(x => new ReadingPeriodSite()
{
ReadingPeriodSetId = entity.Id,
- SubjectVisitId = x,
- }));
+ TrialId = entity.TrialId,
+ TrialSiteId = x,
+ }).ToList();
+
+ // 修改了就是重新生成计划
+ if (await IsChangeReadingPlan(new IsChangeReadingPlanInDto()
+ {
+
+ Id = addOrEditReadingPeriodSet.Id,
+ ExpirationDate = addOrEditReadingPeriodSet.ExpirationDate,
+ ReadingScope = addOrEditReadingPeriodSet.ReadingScope.Value,
+ TrialId = addOrEditReadingPeriodSet.TrialId,
+ ExpirationVisitNum = addOrEditReadingPeriodSet.ExpirationVisitNum,
+ VisitStageId = addOrEditReadingPeriodSet.VisitStageId,
+ ReadingSetType = addOrEditReadingPeriodSet.ReadingSetType,
+ TrialReadingCriterionId = addOrEditReadingPeriodSet.TrialReadingCriterionId,
+ SiteIds = addOrEditReadingPeriodSet.SiteIds,
+ }))
+ {
+
+ entity.ReadingPeriodPlanList = addOrEditReadingPeriodSet.SubjectVisitIds.Select(x => new ReadingPeriodPlan
+ {
+ ReadingPeriodSetId = entity.Id,
+ SubjectVisitId = x,
+ }).ToList();
+ }
+ else
+ {
+ var existsVisitIds = await _readingPeriodPlanRepository.Where(x => x.ReadingPeriodSetId == addOrEditReadingPeriodSet.Id).Select(x => x.SubjectVisitId).ToListAsync();
+
+ var needaddIds = addOrEditReadingPeriodSet.SubjectVisitIds.Where(x => !existsVisitIds.Contains(x)).ToList();
+
+ entity.ReadingPeriodPlanList.AddRange(needaddIds.Select(x => new ReadingPeriodPlan()
+ {
+ ReadingPeriodSetId = entity.Id,
+ SubjectVisitId = x,
+ }));
+ }
+
+
+
+ var success = await _readingPeriodSetRepository.SaveChangesAsync();
}
-
-
-
- var success = await _readingPeriodSetRepository.SaveChangesAsync();
+
return ResponseOutput.Ok(entity.Id);
}
@@ -178,146 +194,26 @@ namespace IRaCIS.Core.Application.Service
- List readModules = new List();
- foreach (var item in plans)
+ await AddReadModule(new AddReadModuleInDto()
{
- readModules.Add(new ReadModule()
+ ReadingPeriodName = readingPeriodSet.ReadingPeriodName,
+ ReadingSetType = readingPeriodSet.ReadingSetType,
+ TrialId = readingPeriodSet.TrialId,
+ ReadingPeriodSetId= readingPeriodSet.Id,
+ TrialReadingCriterionId = readingPeriodSet.TrialReadingCriterionId,
+ VisitInfoList = plans.Select(x => new AddReadModuleVisitInfo()
{
- Id = NewId.NextGuid(),
- SubjectId = item.SubjectVisit.SubjectId,
- ModuleType = item.ReadingPeriodSet.ReadingSetType == ReadingSetType.ImageReading ? ModuleTypeEnum.Global : ModuleTypeEnum.Oncology,
- IsUrgent = item.SubjectVisit.IsUrgent,
- ReadModuleAddTypeEnum = ReadModuleAddType.ReadingPlan,
- ModuleName = item.ReadingPeriodSet.ReadingPeriodName,
- SubjectVisitId = item.SubjectVisitId,
- ReadingSetType = item.ReadingPeriodSet.ReadingSetType,
- ReadingPeriodSetId = item.ReadingPeriodSet.Id,
- ReadingStatus = ReadingStatusEnum.TaskAllocate,
- TrialId = readingPeriodSet.TrialId,
- //VisitNum = item.SubjectVisit.VisitNum,
+ SubjectId = x.SubjectVisit.SubjectId,
+ SubjectVisitId = x.SubjectVisitId,
+
+ IsUrgent = false
+ }).ToList()
- //增加标准
- TrialReadingCriterionId = readingPeriodSet.TrialReadingCriterionId
- });
- };
-
- await _readModuleRepository.AddRangeAsync(readModules);
-
- await _readModuleRepository.SaveChangesAsync();
-
- // 判断是否要添加肿瘤学或者全局阅片任务
- var subjectVisitIds = readModules.Select(x => x.SubjectVisitId).ToList();
- switch (readingPeriodSet.ReadingSetType)
- {
- case ReadingSetType.ImageReading:
- //增加标准
- var taskInfoList = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId && subjectVisitIds.Contains(x.SourceSubjectVisitId ?? default(Guid)) &&
-
- x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId &&
- x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate).ToListAsync();
-
- foreach (var item in taskInfoList)
- {
-
- var readModule = readModules.Where(x => x.SubjectVisitId == item.SourceSubjectVisitId).FirstOrDefault();
- if (readModule != null)
- {
- await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
- {
- OriginalVisitId = item.Id,
- ReadingCategory = GenerateTaskCategory.Global,
- TrialId = item.TrialId,
- ReadingGenerataTaskList = new List() {
- new ReadingGenerataTaskDTO()
- {
- IsUrgent = readModule.IsUrgent??false,
- SubjectId = readModule.SubjectId,
- ReadingName = readModule.ModuleName,
- ReadModuleId =readModule.Id,
- ReadingCategory = ReadingCategory.Global,
- }
- }
- });
- }
- }
-
- // 根据SourceSubjectVisitId 分组
- var visitTaskid = taskInfoList.GroupBy(x => x.SourceSubjectVisitId).Select(x => x.Max(y => y.Id)).ToList();
- // 生成裁判任务 是否需要生成函数里面有逻辑判断
- foreach (var item in visitTaskid)
- {
- await _readingImageTaskService.TriggerJudgeQuestion(item);
- }
- break;
-
- case ReadingSetType.TumorReading:
+ });
- var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readingPeriodSet.TrialReadingCriterionId).Select(x => new
- {
- x.ReadingType,
-
- }).FirstNotNullAsync();
-
- //增加标准
- var globalModuleIds = await _readModuleRepository.Where(x => x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId && subjectVisitIds.Contains(x.SubjectVisitId) && x.ModuleType == ModuleTypeEnum.Global).Select(x => x.Id).ToListAsync();
-
- //增加标准
- var globalTaskInfo = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == readingPeriodSet.TrialReadingCriterionId && globalModuleIds.Contains(x.SouceReadModuleId ?? default(Guid))
-
- && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate).GroupBy(x => new { x.SouceReadModuleId }).Select(x =>
- new
- {
- SouceReadModuleId = x.Key.SouceReadModuleId,
- Count = x.ToList().Count,
- TaskId = x.Select(x => x.Id).FirstOrDefault(),
- ReadModuleId = x.Select(x => x.SouceReadModuleId).FirstOrDefault(),
- JudgeTaskId = x.Select(x => x.JudgeVisitTaskId).FirstOrDefault(),
- JudgeTaskResultId = x.Select(x => x.JudgeVisitTask.JudgeResultTaskId).FirstOrDefault(),
- }).ToListAsync();
-
- foreach (var item in globalTaskInfo)
- {
-
- if (item.Count == (int)criterionInfo.ReadingType)
- {
- //没有裁判 或者有裁判,并且裁判任务做完了
- if (item.JudgeTaskId == null || item.JudgeTaskResultId != null)
- {
- var readModule = readModules.Where(x => x.Id == item.ReadModuleId).FirstOrDefault();
-
- await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
- {
- OriginalVisitId = item.TaskId,
- ReadingCategory = GenerateTaskCategory.Oncology,
- TrialId = readingPeriodSet.TrialId,
- ReadingGenerataTaskList = new List() {
- new ReadingGenerataTaskDTO()
- {
- IsUrgent = readModule.IsUrgent ?? false,
- SubjectId = readModule.SubjectId,
-
- ReadingName = readModule.ModuleName,
- ReadModuleId =readModule.Id,
- ReadingCategory = ReadingCategory.Oncology,
- }
- }
- });
- }
-
- }
-
-
-
- }
-
- break;
- }
-
-
-
}
@@ -353,12 +249,167 @@ namespace IRaCIS.Core.Application.Service
EffectOfTime = indto.IsTakeEffect == ReadingPeriodStatus.TakeEffect ? DateTime.Now : null,
});
+ if (indto.IsTakeEffect == ReadingPeriodStatus.TakeEffect)
+ {
+ await _readingPeriodPlanRepository.UpdatePartialFromQueryAsync(x => x.ReadingPeriodSetId == indto.Id, x => new ReadingPeriodPlan()
+ {
+ IsGenerate = true,
+ GeneratedTime = DateTime.Now
+ });
+ }
+
+
var result = await _readingPeriodSetRepository.SaveChangesAsync();
return ResponseOutput.Result(result);
}
+ ///
+ /// 生效或者新增访视的时候添加阅片期
+ ///
+ ///
+ ///
+ public async Task AddReadModule(AddReadModuleInDto inDto)
+ {
+ List readModules = new List();
+ foreach (var item in inDto.VisitInfoList)
+ {
+ readModules.Add(new ReadModule()
+ {
+ Id = NewId.NextGuid(),
+ SubjectId = item.SubjectId,
+ ModuleType = inDto.ReadingSetType == ReadingSetType.ImageReading ? ModuleTypeEnum.Global : ModuleTypeEnum.Oncology,
+ IsUrgent = item.IsUrgent,
+ ReadModuleAddTypeEnum = ReadModuleAddType.ReadingPlan,
+ ModuleName = inDto.ReadingPeriodName,
+ SubjectVisitId = item.SubjectVisitId,
+ ReadingSetType = inDto.ReadingSetType,
+ ReadingPeriodSetId = inDto.ReadingPeriodSetId,
+ ReadingStatus = ReadingStatusEnum.TaskAllocate,
+ TrialId = inDto.TrialId,
+ //VisitNum = item.SubjectVisit.VisitNum,
+ //增加标准
+ TrialReadingCriterionId = inDto.TrialReadingCriterionId
+ });
+ }
+ ;
+
+ await _readModuleRepository.AddRangeAsync(readModules);
+
+ await _readModuleRepository.SaveChangesAsync();
+
+ // 判断是否要添加肿瘤学或者全局阅片任务
+ var subjectVisitIds = readModules.Select(x => x.SubjectVisitId).ToList();
+ switch (inDto.ReadingSetType)
+ {
+ case ReadingSetType.ImageReading:
+ //增加标准
+ var taskInfoList = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && subjectVisitIds.Contains(x.SourceSubjectVisitId ?? default(Guid)) &&
+
+ x.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
+ x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate).ToListAsync();
+
+ foreach (var item in taskInfoList)
+ {
+
+ var readModule = readModules.Where(x => x.SubjectVisitId == item.SourceSubjectVisitId).FirstOrDefault();
+ if (readModule != null)
+ {
+ await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
+ {
+ OriginalVisitId = item.Id,
+ ReadingCategory = GenerateTaskCategory.Global,
+ TrialId = item.TrialId,
+ ReadingGenerataTaskList = new List() {
+ new ReadingGenerataTaskDTO()
+ {
+ IsUrgent = readModule.IsUrgent??false,
+ SubjectId = readModule.SubjectId,
+ ReadingName = readModule.ModuleName,
+ ReadModuleId =readModule.Id,
+ ReadingCategory = ReadingCategory.Global,
+ }
+ }
+ });
+ }
+ }
+
+ // 根据SourceSubjectVisitId 分组
+ var visitTaskid = taskInfoList.GroupBy(x => x.SourceSubjectVisitId).Select(x => x.Max(y => y.Id)).ToList();
+ // 生成裁判任务 是否需要生成函数里面有逻辑判断
+ foreach (var item in visitTaskid)
+ {
+ await _readingImageTaskService.TriggerJudgeQuestion(item);
+ }
+ break;
+
+ case ReadingSetType.TumorReading:
+
+
+
+
+ var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => new
+ {
+ x.ReadingType,
+
+ }).FirstNotNullAsync();
+
+ //增加标准
+ var globalModuleIds = await _readModuleRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && subjectVisitIds.Contains(x.SubjectVisitId) && x.ModuleType == ModuleTypeEnum.Global).Select(x => x.Id).ToListAsync();
+
+ //增加标准
+ var globalTaskInfo = await _visitTaskRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && globalModuleIds.Contains(x.SouceReadModuleId ?? default(Guid))
+
+ && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate).GroupBy(x => new { x.SouceReadModuleId }).Select(x =>
+ new
+ {
+ SouceReadModuleId = x.Key.SouceReadModuleId,
+ Count = x.ToList().Count,
+ TaskId = x.Select(x => x.Id).FirstOrDefault(),
+ ReadModuleId = x.Select(x => x.SouceReadModuleId).FirstOrDefault(),
+ JudgeTaskId = x.Select(x => x.JudgeVisitTaskId).FirstOrDefault(),
+ JudgeTaskResultId = x.Select(x => x.JudgeVisitTask.JudgeResultTaskId).FirstOrDefault(),
+ }).ToListAsync();
+
+ foreach (var item in globalTaskInfo)
+ {
+
+ if (item.Count == (int)criterionInfo.ReadingType)
+ {
+ //没有裁判 或者有裁判,并且裁判任务做完了
+ if (item.JudgeTaskId == null || item.JudgeTaskResultId != null)
+ {
+ var readModule = readModules.Where(x => x.Id == item.ReadModuleId).FirstOrDefault();
+
+ await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
+ {
+ OriginalVisitId = item.TaskId,
+ ReadingCategory = GenerateTaskCategory.Oncology,
+ TrialId = inDto.TrialId,
+ ReadingGenerataTaskList = new List() {
+ new ReadingGenerataTaskDTO()
+ {
+ IsUrgent = readModule.IsUrgent ?? false,
+ SubjectId = readModule.SubjectId,
+
+ ReadingName = readModule.ModuleName,
+ ReadModuleId =readModule.Id,
+ ReadingCategory = ReadingCategory.Oncology,
+ }
+ }
+ });
+ }
+
+ }
+
+
+
+ }
+
+ break;
+ }
+ }
#endregion
@@ -532,6 +583,51 @@ namespace IRaCIS.Core.Application.Service
}
}
+ ///
+ /// 添加阅片计划并生成阅片期(在阅片期已经生效的情况下添加)
+ ///
+ ///
+ ///
+ public async Task AddReadingPlanAndGenerateReadModule(AddReadingPlanAndGenerateReadModuleInDto inDto)
+ {
+ var readingPeriodSet = await _readingPeriodSetRepository.Where(x => x.Id == inDto.ReadingPeriodSetId).FirstNotNullAsync();
+ List plans = inDto.SubjectVisitIdList.Select(x => new ReadingPeriodPlan()
+ {
+ Id = NewId.NextGuid(),
+ SubjectVisitId = x,
+ ReadingPeriodSetId = inDto.ReadingPeriodSetId,
+ IsGenerate=true,
+ GeneratedTime=DateTime.Now
+ }).ToList();
+
+ await _readingPeriodPlanRepository.AddRangeAsync(plans);
+
+ await _readingPeriodPlanRepository.SaveChangesAsync();
+
+
+
+ var subejctVisits = await _subjectVisitRepository.Where(x => inDto.SubjectVisitIdList.Contains(x.Id)).ToListAsync();
+
+ await AddReadModule(new AddReadModuleInDto()
+ {
+ ReadingPeriodName = readingPeriodSet.ReadingPeriodName,
+ ReadingSetType = readingPeriodSet.ReadingSetType,
+ TrialId = readingPeriodSet.TrialId,
+ ReadingPeriodSetId = readingPeriodSet.Id,
+ TrialReadingCriterionId = readingPeriodSet.TrialReadingCriterionId,
+ VisitInfoList = subejctVisits.Select(x => new AddReadModuleVisitInfo()
+ {
+ SubjectId = x.SubjectId,
+ SubjectVisitId = x.Id,
+ IsUrgent = x.IsUrgent,
+
+ }).ToList()
+
+ });
+
+ return ResponseOutput.Ok();
+ }
+
///
/// 设置加入或者移除阅片计划
///
diff --git a/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadingPeriodPlan.cs b/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadingPeriodPlan.cs
index a767552d6..5f250024c 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadingPeriodPlan.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingPeriod/ReadingPeriodPlan.cs
@@ -19,4 +19,14 @@ public class ReadingPeriodPlan : BaseFullDeleteAuditEntity
[Comment("访视")]
public Guid SubjectVisitId { get; set; }
+
+ ///
+ /// 是否生成
+ ///
+ public bool IsGenerate { get; set; } = false;
+
+ ///
+ /// 生效时间
+ ///
+ public DateTime? GeneratedTime { get; set; }
}
diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/20251103062214_ReadingPeriodPlan.Designer.cs b/IRaCIS.Core.Infra.EFCore/Migrations/20251103062214_ReadingPeriodPlan.Designer.cs
new file mode 100644
index 000000000..51949be37
--- /dev/null
+++ b/IRaCIS.Core.Infra.EFCore/Migrations/20251103062214_ReadingPeriodPlan.Designer.cs
@@ -0,0 +1,20973 @@
+//
+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("20251103062214_ReadingPeriodPlan")]
+ partial class ReadingPeriodPlan
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.19")
+ .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.HasIndex("MainFileId");
+
+ b.ToTable("AuditDocument", t =>
+ {
+ t.HasComment("稽查文档管理");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditDocumentClosure", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AncestorId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("祖先");
+
+ b.Property("Depth")
+ .HasColumnType("int");
+
+ b.Property("DescendantId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("后代");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AncestorId");
+
+ b.HasIndex("DescendantId");
+
+ b.ToTable("AuditDocumentClosure");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditRecord", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditContent")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("AuditState")
+ .HasColumnType("int")
+ .HasComment("稽查状态");
+
+ b.Property("AuditTime")
+ .HasColumnType("date")
+ .HasComment("稽查日期");
+
+ b.Property("AuditType")
+ .HasColumnType("int")
+ .HasComment("稽查形式");
+
+ b.Property("BeginTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CompanyName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("EndTime")
+ .HasColumnType("datetime2");
+
+ b.Property("IsViewTrainingRecord")
+ .HasColumnType("bit");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("AuditRecord");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditRecordIdentityUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditRecordId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IdentityUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuditRecordId");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("IdentityUserId");
+
+ b.ToTable("AuditRecordIdentityUser");
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditRecordPermission", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditDocumentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditRecordId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AuditDocumentId");
+
+ b.HasIndex("AuditRecordId");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("AuditRecordPermission");
+ });
+
+ 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("BitsAllocated")
+ .HasColumnType("int");
+
+ b.Property("CPIStatus")
+ .HasColumnType("bit");
+
+ b.Property("CorrectedImage")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DecayCorrection")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("DeleteUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("EncapsulatedDocument")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileSize")
+ .HasColumnType("bigint");
+
+ b.Property("FrameOfReferenceUID")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FrameTime")
+ .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("ImageOrientationPatient")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ImagePositionPatient")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ 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("IsEncapsulated")
+ .HasColumnType("bit");
+
+ b.Property("IsReading")
+ .HasColumnType("bit");
+
+ b.Property("MediaStorageSOPClassUID")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("MediaStorageSOPInstanceUID")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("NumberOfFrames")
+ .HasColumnType("int");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("PhotometricInterpretation")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("PixelRepresentation")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("PixelSpacing")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property