diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs
index c5bcdb419..fab8c9ecb 100644
--- a/IRaCIS.Core.API/Progranm.cs
+++ b/IRaCIS.Core.API/Progranm.cs
@@ -35,6 +35,8 @@ using IRaCIS.Core.Application.MassTransit.Command;
using IRaCIS.Core.Application.MassTransit.Consumer;
using DocumentFormat.OpenXml.InkML;
using IRaCIS.Core.Domain;
+using MassTransit.Internals;
+using IRaCIS.Core.Domain.BaseModel;
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
@@ -182,6 +184,10 @@ builder.Services.AddMassTransit(cfg =>
//使用 Hangfire 进行消息调度
cfg.UseHangfireScheduler();
+ cfg.UseConsumeFilter(typeof(CultureInfoFilter<>), context,
+ x => x.Include(type => type.IsAssignableTo(typeof(DomainEvent))));
+
+
// 这里可以进行额外的配置
cfg.ConfigureEndpoints(context); // 自动配置所有消费者的端点
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index a674db29d..a2ef8eae1 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -937,6 +937,20 @@
+
+
+ 邮件事件消息列表
+
+
+
+
+
+
+ 重新发布失败的事件消息
+
+
+
+
ExploreRecommendService
@@ -12727,6 +12741,22 @@
+
+
+ meditor send 的时候,请求流会先到消费者,返回后才会执行后续代码
+ publish 请求流不会先到消费者,发布后,直接执行后续代码
+
+
+
+
+
+
+ meditor send 的时候,请求流会先到消费者,返回后才会执行后续代码
+ publish 请求流不会先到消费者,发布后,直接执行后续代码
+
+
+
+
加急的医学反馈任务 通知MIM
@@ -12739,7 +12769,7 @@
- 加急阅片 IR 申请重阅
+ 加急阅片 IR 申请重阅 或者PM 申请重阅
diff --git a/IRaCIS.Core.Application/MassTransit/Consumer/NeedVerify/TestConsumer.cs b/IRaCIS.Core.Application/MassTransit/Consumer/NeedVerify/TestConsumer.cs
new file mode 100644
index 000000000..133078b51
--- /dev/null
+++ b/IRaCIS.Core.Application/MassTransit/Consumer/NeedVerify/TestConsumer.cs
@@ -0,0 +1,31 @@
+using MassTransit;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using static IRaCIS.Core.Application.Service.TestService;
+
+namespace IRaCIS.Core.Application.MassTransit.Consumer;
+
+///
+/// meditor send 的时候,请求流会先到消费者,返回后才会执行后续代码
+/// publish 请求流不会先到消费者,发布后,直接执行后续代码
+///
+///
+///
+public class MasstransitHangfireTestConsumer(IRepository _userRepository) : IConsumer
+{
+ public async Task Consume(ConsumeContext context)
+ {
+
+ Console.WriteLine(_userRepository._dbContext.GetHashCode());
+ Console.WriteLine("Now is " + DateTime.Now.ToString());
+ Console.WriteLine($"MassTransit.Consumer :{context.Message.value}");
+
+
+ await context.RespondAsync(ResponseOutput.Ok());
+
+ }
+}
+
diff --git a/IRaCIS.Core.Application/MassTransit/Consumer/ReadingRelationEmailConsumer.cs b/IRaCIS.Core.Application/MassTransit/Consumer/ReadingRelationEmailConsumer.cs
index c95da4965..ed884bf8e 100644
--- a/IRaCIS.Core.Application/MassTransit/Consumer/ReadingRelationEmailConsumer.cs
+++ b/IRaCIS.Core.Application/MassTransit/Consumer/ReadingRelationEmailConsumer.cs
@@ -113,11 +113,11 @@ public class UrgentMIMRepliedMedicalReviewConsumer : IConsumer
-/// 加急阅片 IR 申请重阅
+/// 加急阅片 IR 申请重阅 或者PM 申请重阅
///
-public class UrgentIRApplyedReReadingConsumer : IConsumer
+public class UrgentIRApplyedReReadingConsumer : IConsumer
{
- public Task Consume(ConsumeContext context)
+ public Task Consume(ConsumeContext context)
{
throw new NotImplementedException();
}
diff --git a/IRaCIS.Core.Application/MassTransit/Consumer/SiteSurverEmailConsumer.cs b/IRaCIS.Core.Application/MassTransit/Consumer/SiteSurverEmailConsumer.cs
index d5f8d3453..0719184d8 100644
--- a/IRaCIS.Core.Application/MassTransit/Consumer/SiteSurverEmailConsumer.cs
+++ b/IRaCIS.Core.Application/MassTransit/Consumer/SiteSurverEmailConsumer.cs
@@ -13,6 +13,7 @@ using MassTransit;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.Extensions.Options;
using MimeKit;
+using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -45,56 +46,62 @@ public class UserSiteSurveySubmitedEventConsumer(
var trialId = siteSurveyInfo.TrialId;
- var hasSPMOrCPM = await _trialSiteSurveyRepository.AnyAsync(t => t.TrialId == siteSurveyInfo.TrialId && t.Trial.TrialUserList.Any(u => u.User.UserTypeEnum == UserTypeEnum.SPM || u.User.UserTypeEnum == UserTypeEnum.CPM));
+ var trialUserList = await _trialSiteSurveyRepository.Where(t => t.TrialId == siteSurveyInfo.TrialId ).SelectMany(t=>t.Trial.TrialUserList)
+ .Where(t=> t.User.UserTypeEnum == UserTypeEnum.SPM || t.User.UserTypeEnum == UserTypeEnum.CPM || t.User.UserTypeEnum == UserTypeEnum.ProjectManager)
+ .Select(t=>new {t.User.FullName,t.User.EMail,t.User.UserTypeEnum}).ToListAsync();
+ var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
+ var pmList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
var messageToSend = new MimeMessage();
+ var toUserName = string.Empty;
- var userName = siteSurveyInfo.UserName;
- var email = siteSurveyInfo.Email;
- var phone = siteSurveyInfo.Phone;
-
- if (hasSPMOrCPM)
+ //有SPM
+ if (sPMOrCPMList.Count>0)
{
- var user = await _userRepository.FirstOrDefaultAsync(t => t.Id == siteSurveyInfo.PreliminaryUserId);
+ foreach (var user in sPMOrCPMList)
+ {
+ messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
+ }
- userName = user.FullName;
- email = user.EMail;
- phone = user.Phone;
+ toUserName = string.Join('、', sPMOrCPMList.Select(t => t.FullName));
- messageToSend.To.Add(new MailboxAddress(String.Empty, user.EMail));
}
else
{
- messageToSend.To.Add(new MailboxAddress(String.Empty, siteSurveyInfo.Email));
+ foreach (var user in pmList)
+ {
+ messageToSend.To.Add(new MailboxAddress(user.FullName, user.EMail));
+ }
+
+ toUserName = string.Join('、', pmList.Select(t => t.FullName));
}
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.Id == siteSurveyInfo.TrialSiteId, true);
-
var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
-
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
{
- var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
+ var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo);
var htmlBodyStr = string.Format(CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
-
+ toUserName,
siteInfo.TrialSiteCode,
siteInfo.TrialSiteAliasName,
- userName,
- email,
- phone,
+
+ siteSurveyInfo.UserName,
+ siteSurveyInfo.Email,
+ siteSurveyInfo.Phone,
_systemEmailConfig.SiteUrl
);
return (topicStr, htmlBodyStr);
};
- await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, EmailBusinessScenario.SiteSurveyReject, messageToSend, emailConfigFunc);
+ await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, EmailBusinessScenario.Approval_SubmitSiteSurvey, messageToSend, emailConfigFunc);
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
@@ -195,16 +202,14 @@ public class SiteSurverRejectedEventConsumer(
var trialId = siteSurveyInfo.TrialId;
- var hasSPMOrCPM = await _trialSiteSurveyRepository.AnyAsync(t => t.TrialId == siteSurveyInfo.TrialId && t.Trial.TrialUserList.Any(u => u.User.UserTypeEnum == UserTypeEnum.SPM || u.User.UserTypeEnum == UserTypeEnum.CPM));
-
var messageToSend = new MimeMessage();
var name = siteSurveyInfo.UserName;
- if (hasSPMOrCPM)
+ if (context.Message.IsHaveSPMOrCPM)
{
- //PM 驳回
+ //PM 驳回到SPM
if (siteSurveyInfo.State == TrialSiteSurveyEnum.CRCSubmitted)
{
var user = await _userRepository.FirstOrDefaultAsync(t => t.Id == siteSurveyInfo.PreliminaryUserId);
@@ -213,15 +218,16 @@ public class SiteSurverRejectedEventConsumer(
messageToSend.To.Add(new MailboxAddress(String.Empty, user.EMail));
}
- //SPM 驳回
+ //SPM 驳回到CRC
else if (siteSurveyInfo.State == TrialSiteSurveyEnum.ToSubmit)
{
messageToSend.To.Add(new MailboxAddress(String.Empty, siteSurveyInfo.Email));
}
+
}
else
{
- //没有SPM 给填表人发
+ //没有SPM PM驳回到CRC
messageToSend.To.Add(new MailboxAddress(String.Empty, siteSurveyInfo.Email));
}
diff --git a/IRaCIS.Core.Application/MassTransit/Extension/CultureInfoFilter.cs b/IRaCIS.Core.Application/MassTransit/Extension/CultureInfoFilter.cs
new file mode 100644
index 000000000..1079e3d78
--- /dev/null
+++ b/IRaCIS.Core.Application/MassTransit/Extension/CultureInfoFilter.cs
@@ -0,0 +1,34 @@
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using IRaCIS.Core.Domain.BaseModel;
+using IRaCIS.Core.Domain.Share;
+using MassTransit;
+using NPOI.SS.Formula.Functions;
+
+public class CultureInfoFilter (IRepository _eventStoreRecordRepository) : IFilter> where T : DomainEvent
+{
+
+ public async Task Send(ConsumeContext context, IPipe> next)
+ {
+ var cultureInfoName = context.Message.CultureInfoName;
+
+ var eventId = context.Message.EventId;
+
+ if (!string.IsNullOrEmpty(cultureInfoName))
+ {
+ CultureInfo.CurrentCulture = new CultureInfo(cultureInfoName);
+ CultureInfo.CurrentUICulture = new CultureInfo(cultureInfoName);
+ }
+
+
+ await next.Send(context);
+
+ await _eventStoreRecordRepository.BatchUpdateNoTrackingAsync(t => t.Id == eventId, u => new EventStoreRecord() { EventState= EventStateEnum.ConsumeSuccessed } );
+ }
+
+ public void Probe(ProbeContext context)
+ {
+ context.CreateFilterScope("CultureInfoFilter");
+ }
+}
diff --git a/IRaCIS.Core.Application/Service/Common/DTO/EventStoreRecordViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/EventStoreRecordViewModel.cs
index bb8857b47..b8b00b1c0 100644
--- a/IRaCIS.Core.Application/Service/Common/DTO/EventStoreRecordViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Common/DTO/EventStoreRecordViewModel.cs
@@ -15,6 +15,8 @@ public class EventStoreRecordView
public string EventData { get; set; }
+ public string EventTypeName { get; set; }
+
public EventStateEnum EventState { get; set; }
public string EventType { get; set; }
@@ -33,7 +35,7 @@ public class EventStoreRecordQuery : PageInput
public EventStateEnum? EventState { get; set; }
- public string? EventType { get; set; }
+ public string? EventTypeName { get; set; }
}
diff --git a/IRaCIS.Core.Application/Service/Common/EventStoreRecordService.cs b/IRaCIS.Core.Application/Service/Common/EventStoreRecordService.cs
index 67b9b5cdd..d2383ceff 100644
--- a/IRaCIS.Core.Application/Service/Common/EventStoreRecordService.cs
+++ b/IRaCIS.Core.Application/Service/Common/EventStoreRecordService.cs
@@ -15,17 +15,23 @@ using MassTransit.Mediator;
using Newtonsoft.Json;
using MassTransit;
using IRaCIS.Core.Domain;
+using IRaCIS.Core.Domain.Share;
+using System.Globalization;
namespace IRaCIS.Core.Application.Service;
[ApiExplorerSettings(GroupName = "Common")]
-public class EventStoreRecordService(IRepository _eventStoreRecordRepository, IMediator _mediator) : BaseService
+public class EventStoreRecordService(IRepository _eventStoreRecordRepository, IMediator _mediator,IPublishEndpoint _publishEndpoint) : BaseService
{
-
+ ///
+ /// 邮件事件消息列表
+ ///
+ ///
+ ///
[HttpPost]
public async Task> GetEventStoreRecordList(EventStoreRecordQuery inQuery)
{
- var eventStoreRecordQueryable = _eventStoreRecordRepository
+ var eventStoreRecordQueryable = _eventStoreRecordRepository.WhereIf(inQuery.EventTypeName.IsNotNullOrEmpty(),t=>t.EventTypeName.Contains(inQuery.EventTypeName))
.ProjectTo(_mapper.ConfigurationProvider);
var pageList = await eventStoreRecordQueryable.ToPagedListAsync(inQuery);
@@ -33,20 +39,20 @@ public class EventStoreRecordService(IRepository _eventStoreRe
return pageList;
}
-
+ ///
+ /// 重新发布失败的事件消息
+ ///
+ ///
+ ///
public async Task RePublishEvent(Guid eventId)
{
var storedEvent = await _eventStoreRecordRepository.FirstOrDefaultAsync(t => t.Id == eventId);
var domainEvent = storedEvent.EventData.JsonStrToObject(Type.GetType(storedEvent.EventType));
- Console.WriteLine(Type.GetType(storedEvent.EventType));
-
- Console.WriteLine(domainEvent.GetType());
+ //IMediator 发布的时候,设置当前线程的CultureInfo 消费者会与发布线程CultureInfo 一致 分布式的话 _publishEndpoint 会不一致,需要手动设置
- Console.WriteLine(new UserSiteSurveySubmitedEvent().GetType().AssemblyQualifiedName);
-
- await _mediator.Publish(domainEvent.GetType(), domainEvent);
+ await _publishEndpoint.Publish(domainEvent.GetType(), domainEvent);
return ResponseOutput.Ok();
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
index c380c6efc..b37e540ab 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
@@ -763,6 +763,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
TrialId = sv.TrialId,
SubjectId=sv.SubjectId,
SubjectCode = sv.Subject.Code,
+ TrialSiteCode=sv.TrialSite.TrialSiteCode,
VisitName = sv.VisitName,
StudyList = sv.StudyList.Where(t => isQueryDicom ? inQuery.DicomStudyIdList.Contains(t.Id) : false)
@@ -812,6 +813,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
TrialId = result.TrialId,
SubjectId = result.SubjectId,
SubjectCode = result.SubjectCode,
+ TrialSiteCode = result.TrialSiteCode,
IP = _userInfo.IP,
DownloadStartTime = DateTime.Now,
IsSuccess = false,
@@ -969,6 +971,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var subjectVisitIdList = inQuery.SubjectVisitTaskList.Select(t => t.SubjectVisitId).ToList();
+ var trialSiteCode = _visitTaskRepository.Where(t => t.Id == taskIdList.FirstOrDefault()).Select(t => t.IsAnalysisCreate ? t.BlindTrialSiteCode : t.Subject.TrialSite.TrialSiteCode).FirstOrDefault()??string.Empty;
+
var query = from sv in _subjectRepository.Where(t => t.Id == inQuery.SubjectId).SelectMany(t => t.SubjectVisitList.Where(t => subjectVisitIdList.Contains(t.Id)))
//一致性分析,导致查询出来两条数据
join visitTask in _visitTaskRepository.Where(t => taskIdList.Contains(t.Id))
@@ -1030,6 +1034,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
TrialId = info.TrialId,
SubjectId=inQuery.SubjectId,
SubjectCode = inQuery.SubjectCode,
+ TrialSiteCode= trialSiteCode,
IP = _userInfo.IP,
DownloadStartTime = DateTime.Now,
IsSuccess = false,
diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DTO/EnrollViewModel.cs b/IRaCIS.Core.Application/Service/WorkLoad/DTO/EnrollViewModel.cs
index 47d75931a..f89a47307 100644
--- a/IRaCIS.Core.Application/Service/WorkLoad/DTO/EnrollViewModel.cs
+++ b/IRaCIS.Core.Application/Service/WorkLoad/DTO/EnrollViewModel.cs
@@ -4,15 +4,11 @@ namespace IRaCIS.Core.Application.Service.WorkLoad.DTO
{
public class EnrollViewModel
{
- [StringLength(50)]
+
public string ChineseName { get; set; } = string.Empty;
-
- [StringLength(100)]
public string FirstName { get; set; } = string.Empty;
-
- [StringLength(100)]
public string LastName { get; set; } = string.Empty;
public decimal? AdjustmentMultiple { get; set; } = 0;
diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs
index 50aa9433d..c038630d9 100644
--- a/IRaCIS.Core.Application/TestService.cs
+++ b/IRaCIS.Core.Application/TestService.cs
@@ -22,6 +22,7 @@ using Microsoft.Extensions.Options;
using MiniExcelLibs;
using NPOI.SS.Formula.Functions;
using NPOI.XWPF.UserModel;
+using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
using Tea;
@@ -152,7 +153,7 @@ namespace IRaCIS.Core.Application.Service
await _testLengthRepository.AddAsync(new TestLength() { Name = "xxxx" });
// The consumer method will inject the repository and add 3 pieces of data, but the savechanges method of the repository will not be called
- await _mediatorScoped.Send(new AddSubjectTriggerCommand { SubjectId = Guid.Empty });
+ await _mediatorScoped.Publish(new AddSubjectTriggerCommand { SubjectId = Guid.Empty });
await _mediator.Send(new AddSubjectTriggerCommand2 { SubjectId = Guid.Empty });
@@ -167,18 +168,23 @@ namespace IRaCIS.Core.Application.Service
public string value { get; set; }
}
- public class MasstransitHangfireTestConsumer : IConsumer
+ public async Task TestMasstransitHangfireOrRequest([FromServices] IMessageScheduler _scheduler,
+ [FromServices] IRepository _testLengthRepository,
+ [FromServices] IRequestClient _requestClient)
{
- public Task Consume(ConsumeContext context)
- {
- Console.WriteLine("Now is " + DateTime.Now.ToString());
- Console.WriteLine($"MassTransit.Consumer1 :{context.Message.value}");
- return Task.CompletedTask;
- }
- }
- public async Task TestMasstransitHangfire([FromServices] IMessageScheduler _scheduler)
- {
- await _scheduler.SchedulePublish(DateTime.Now.AddSeconds(10), new MasstransitHangfireTest() { value = "message at " + DateTime.Now.ToString() });
+ var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
+
+ var aa = CultureInfo.CurrentCulture.Name;
+
+ CultureInfo.CurrentCulture = new CultureInfo(StaticData.CultureInfo.en_US);
+
+ var bb = CultureInfo.CurrentCulture.Name;
+ var isEn_US2 = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
+
+ //await _scheduler.SchedulePublish(DateTime.Now.AddSeconds(10), new MasstransitHangfireTest() { value = "message at " + DateTime.Now.ToString() });
+
+ Console.WriteLine(_testLengthRepository._dbContext.GetHashCode());
+ await _requestClient.GetResponse(new MasstransitHangfireTest() { value = "message at " + DateTime.Now.ToString() });
return ResponseOutput.Ok();
}
diff --git a/IRaCIS.Core.Domain.Share/Common/EmailScenarioEnum.cs b/IRaCIS.Core.Domain.Share/Common/EmailScenarioEnum.cs
index fca247f42..64594296b 100644
--- a/IRaCIS.Core.Domain.Share/Common/EmailScenarioEnum.cs
+++ b/IRaCIS.Core.Domain.Share/Common/EmailScenarioEnum.cs
@@ -96,6 +96,146 @@ namespace IRaCIS.Core.Domain.Share
TrialSubjectVisitFeedBack = 28,
+ ///
+ /// 入组确认-质控任务待领取
+ ///
+ EligibilityVerification_PendingClaim = 29,
+
+ ///
+ /// 入组确认-质控任务待审核
+ ///
+ EligibilityVerification_PendingImageQC = 30,
+
+ ///
+ /// PD确认-质控任务待领取
+ ///
+ PDVerification_PendingImageQCClaim = 31,
+
+ ///
+ /// PD确认-质控任务待审核
+ ///
+ PDVerification_PendingImageQC = 32,
+
+ ///
+ /// 入组确认-QC质疑待处理
+ ///
+ EligibilityVerification_Pending = 33,
+
+ ///
+ /// 审批(提交调研表)
+ ///
+ Approval_SubmitSiteSurvey = 34,
+
+ ///
+ /// 审批(更新调研表)
+ ///
+ Approval_UpdateSiteSurvey = 35,
+
+ ///
+ /// 中心调研审批
+ ///
+ SiteSurveyApproval = 36,
+
+ ///
+ /// 入组确认-QC质疑待处理
+ ///
+ EligibilityVerification_UnderQCQuery = 37,
+
+ ///
+ /// PD确认-QC质疑待处理
+ ///
+ PDVerification_UnderQCQuery = 38,
+
+ ///
+ /// 入组确认-影像质疑待处理
+ ///
+ EligibilityVerification_ImageQuery = 39,
+
+ ///
+ /// PD确认-影像质疑待处理
+ ///
+ PDVerification_ImageQuery = 40,
+
+ ///
+ /// 入组确认-核查质疑待处理
+ ///
+ EligibilityVerification_UnderDR = 41,
+
+ ///
+ /// PD确认-核查质疑待处理
+ ///
+ PDVerification_UnderDR = 42,
+
+ ///
+ /// 加急阅片
+ ///
+ ExpeditedReading = 43,
+
+ ///
+ /// 加急医学反馈
+ ///
+ ExpeditedMedicalQCToIR = 44,
+
+ ///
+ /// 入组确认-医学审核
+ ///
+ EligibilityVerification_MedicalQC = 45,
+
+ ///
+ /// PD确认-医学审核
+ ///
+ PDVerification_MedicalQC = 46,
+
+ ///
+ /// 入组确认-医学反馈
+ ///
+ EligibilityVerification_MedicalQCFeedback = 47,
+
+ ///
+ /// PD确认-医学反馈
+ ///
+ PDVerification_MedicalQCFeedback = 48,
+
+ ///
+ /// 入组确认-一致性核查
+ ///
+ EligibilityVerification_DR = 49,
+
+ ///
+ /// PD确认-一致性核查
+ ///
+ PDVerification_DR = 50,
+
+ ///
+ /// 入组确认-核查质疑
+ ///
+ EligibilityVerification_UnderDRForPMOrAPM = 51,
+
+ ///
+ /// PD确认-核查质疑
+ ///
+ PDVerification_UnderDRForPMOrAPM = 52,
+
+ ///
+ /// 阅片人重阅审批
+ ///
+ ReReadFromIRApproval = 53,
+
+ ///
+ /// 项目组申请重阅审批
+ ///
+ ReReadFromPMApproval = 54,
+
+ ///
+ /// 入组确认-加急医学反馈回复
+ ///
+ EligibilityVerification_ExpeditedMedicalQCResponse = 55,
+
+ ///
+ /// PD确认-加急医学反馈回复
+ ///
+ PDVerification_ExpeditedMedicalQCResponse = 56
+
}
diff --git a/IRaCIS.Core.Domain/BaseModel/DomainEvent.cs b/IRaCIS.Core.Domain/BaseModel/DomainEvent.cs
index e867ee572..3eac599a3 100644
--- a/IRaCIS.Core.Domain/BaseModel/DomainEvent.cs
+++ b/IRaCIS.Core.Domain/BaseModel/DomainEvent.cs
@@ -1,6 +1,7 @@
using IRaCIS.Core.Domain.Models;
using MassTransit;
using System.ComponentModel;
+using System.Globalization;
namespace IRaCIS.Core.Domain.BaseModel;
@@ -22,6 +23,8 @@ public abstract class DomainEvent
/// 在事件产生多少s后开始消费该事件
///
public int DelaySeconds{ get; set; }
+
+ public string CultureInfoName { get; set; } = CultureInfo.CurrentCulture.Name;
}
///
diff --git a/IRaCIS.Core.Domain/Common/EventStoreRecord.cs b/IRaCIS.Core.Domain/Common/EventStoreRecord.cs
index c2f4c3a1a..dbbd984ed 100644
--- a/IRaCIS.Core.Domain/Common/EventStoreRecord.cs
+++ b/IRaCIS.Core.Domain/Common/EventStoreRecord.cs
@@ -10,6 +10,11 @@ namespace IRaCIS.Core.Domain.Models;
[Table("EventStoreRecord")]
public class EventStoreRecord : BaseFullAuditEntity
{
+
+ [Comment("简单的事件类型名")]
+ public string EventTypeName { get; set; }
+
+ [Comment("完整的事件类型名")]
public string EventType { get; set; }
[MaxLength]
diff --git a/IRaCIS.Core.Domain/Image/TrialImageDownload.cs b/IRaCIS.Core.Domain/Image/TrialImageDownload.cs
index 0be778c5f..3520d93b8 100644
--- a/IRaCIS.Core.Domain/Image/TrialImageDownload.cs
+++ b/IRaCIS.Core.Domain/Image/TrialImageDownload.cs
@@ -17,6 +17,9 @@ public class TrialImageDownload : BaseFullAuditEntity
public Guid SubjectId { get; set; }
+ [Comment("一致性分析的就显示一致性分析的中心")]
+ public string TrialSiteCode { get; set; }
+
public string SubjectCode { get; set; }
public bool IsSuccess { get; set; }
diff --git a/IRaCIS.Core.Domain/_DomainEvent/ReadingEnrollOrPDRelationEvent.cs b/IRaCIS.Core.Domain/_DomainEvent/ReadingEnrollOrPDRelationEvent.cs
index 399ecd34d..c83db2497 100644
--- a/IRaCIS.Core.Domain/_DomainEvent/ReadingEnrollOrPDRelationEvent.cs
+++ b/IRaCIS.Core.Domain/_DomainEvent/ReadingEnrollOrPDRelationEvent.cs
@@ -1,4 +1,5 @@
using IRaCIS.Core.Domain.BaseModel;
+using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Domain.Models;
using System;
using System.Collections.Generic;
@@ -34,9 +35,11 @@ public class UrgentMIMRepliedMedicalReview : DomainEvent
///
-/// 加急阅片 IR 申请重阅
+/// 加急阅片 IR 申请重阅 或者PM 申请重阅
///
-public class UrgentIRApplyedReReading : DomainEvent
+public class UrgentApplyedReReading : DomainEvent
{
public Guid VisitTaskId { get; set; }
+
+ public ReReadingApplyState ReReadingApplyState { get; set; }
}
diff --git a/IRaCIS.Core.Domain/_DomainEvent/UserSiteSurveySubmitedEvent.cs b/IRaCIS.Core.Domain/_DomainEvent/UserSiteSurveySubmitedEvent.cs
index d40050d39..654450733 100644
--- a/IRaCIS.Core.Domain/_DomainEvent/UserSiteSurveySubmitedEvent.cs
+++ b/IRaCIS.Core.Domain/_DomainEvent/UserSiteSurveySubmitedEvent.cs
@@ -22,4 +22,6 @@ public class SiteSurveySPMSubmitedEvent : DomainEvent
public class SiteSurverRejectedEvent : DomainEvent
{
public Guid TrialSiteSurveyId { get; set; }
+
+ public bool IsHaveSPMOrCPM { get; set; }
}
diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs
index 85e70c383..080570706 100644
--- a/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs
+++ b/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs
@@ -43,14 +43,19 @@ public static class DBContext_Ext
trialSiteSurvey.AddDomainEvent(new SiteSurveySPMSubmitedEvent() { TrialSiteSurveyId = trialSiteSurvey.Id });
}
- //PM 驳回 (在消费者中具体判断 是驳回给谁发邮件)
+ //PM 驳回
else if ((trialSiteSurvey.State == TrialSiteSurveyEnum.CRCSubmitted || trialSiteSurvey.State == TrialSiteSurveyEnum.ToSubmit) && originState == TrialSiteSurveyEnum.SPMApproved)
{
- trialSiteSurvey.AddDomainEvent(new SiteSurverRejectedEvent() { TrialSiteSurveyId = trialSiteSurvey.Id });
+ trialSiteSurvey.AddDomainEvent(new SiteSurverRejectedEvent() { TrialSiteSurveyId = trialSiteSurvey.Id, IsHaveSPMOrCPM = trialSiteSurvey.State == TrialSiteSurveyEnum.CRCSubmitted });
+ }
+ //SPM 驳回
+ else if (trialSiteSurvey.State == TrialSiteSurveyEnum.ToSubmit && originState == TrialSiteSurveyEnum.CRCSubmitted)
+ {
+ trialSiteSurvey.AddDomainEvent(new SiteSurverRejectedEvent() { TrialSiteSurveyId = trialSiteSurvey.Id, IsHaveSPMOrCPM = true });
}
//添加进记录
- eventStoreList.AddRange(trialSiteSurvey.DomainEvents.Select(t => new EventStoreRecord() { Id = t.EventId, EventType = t.GetType().AssemblyQualifiedName, EventData = t.ToJsonStr() }));
+ eventStoreList.AddRange(GetStoreEvents(trialSiteSurvey.DomainEvents));
}
@@ -86,10 +91,8 @@ public static class DBContext_Ext
subjectVisit.AddDomainEvent(new CheckStateChangedToAuditEvent() { SubjectVisitId = subjectVisit.Id });
}
-
-
//添加进记录
- eventStoreList.AddRange(subjectVisit.DomainEvents.Select(t => new EventStoreRecord() { Id = t.EventId, EventType = t.GetType().AssemblyQualifiedName, EventData = t.ToJsonStr() }));
+ eventStoreList.AddRange(GetStoreEvents(subjectVisit.DomainEvents));
}
}
@@ -117,7 +120,7 @@ public static class DBContext_Ext
}
//添加进记录
- eventStoreList.AddRange(qCChallengeDialog.DomainEvents.Select(t => new EventStoreRecord() { Id = t.EventId, EventType = t.GetType().AssemblyQualifiedName, EventData = t.ToJsonStr() }));
+ eventStoreList.AddRange(GetStoreEvents(qCChallengeDialog.DomainEvents));
}
}
@@ -143,7 +146,7 @@ public static class DBContext_Ext
}
//添加进记录
- eventStoreList.AddRange(checkChallengeDialog.DomainEvents.Select(t => new EventStoreRecord() { Id = t.EventId, EventType = t.GetType().AssemblyQualifiedName, EventData = t.ToJsonStr() }));
+ eventStoreList.AddRange(GetStoreEvents(checkChallengeDialog.DomainEvents));
}
}
@@ -180,7 +183,7 @@ public static class DBContext_Ext
taskMedicalReview.AddDomainEvent(new UrgentMedicalReviewAddedEvent() { MedicalReviewId = taskMedicalReview.Id, VisitTaskId = taskMedicalReview.VisitTaskId });
//添加进记录
- eventStoreList.AddRange(taskMedicalReview.DomainEvents.Select(t => new EventStoreRecord() { Id = t.EventId, EventType = t.GetType().AssemblyQualifiedName, EventData = t.ToJsonStr() }));
+ eventStoreList.AddRange(GetStoreEvents(taskMedicalReview.DomainEvents));
}
}
}
@@ -221,7 +224,7 @@ public static class DBContext_Ext
}
//添加进记录
- eventStoreList.AddRange(readingMedicalReviewDialog.DomainEvents.Select(t => new EventStoreRecord() { Id = t.EventId, EventType = t.GetType().AssemblyQualifiedName, EventData = t.ToJsonStr() }));
+ eventStoreList.AddRange(GetStoreEvents(readingMedicalReviewDialog.DomainEvents));
}
}
@@ -235,7 +238,7 @@ public static class DBContext_Ext
var originReReadingApplyState = entry.Property(p => p.ReReadingApplyState).OriginalValue;
- if (originReReadingApplyState == ReReadingApplyState.Default && visitTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed)
+ if (originReReadingApplyState == ReReadingApplyState.Default && (visitTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || visitTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed))
{
var findSubjectVisit = new EnrollmentConfirmAndPD();
@@ -256,10 +259,10 @@ public static class DBContext_Ext
if (findSubjectVisit.IsEnrollmentConfirm || findSubjectVisit.PDState == PDStateEnum.PDProgress)
{
- visitTask.AddDomainEvent(new UrgentIRApplyedReReading() { VisitTaskId = visitTask.Id });
+ visitTask.AddDomainEvent(new UrgentApplyedReReading() { VisitTaskId = visitTask.Id, ReReadingApplyState= visitTask.ReReadingApplyState });
//添加进记录
- eventStoreList.AddRange(visitTask.DomainEvents.Select(t => new EventStoreRecord() { Id = t.EventId, EventType = t.GetType().AssemblyQualifiedName, EventData = t.ToJsonStr() }));
+ eventStoreList.AddRange(GetStoreEvents(visitTask.DomainEvents));
}
}
@@ -270,6 +273,10 @@ public static class DBContext_Ext
dbContext.EventStoreRecord.AddRange(eventStoreList);
}
+ private static List GetStoreEvents(IReadOnlyCollection domainEvents)
+ {
+ return domainEvents.Select(t => new EventStoreRecord() { Id = t.EventId, EventType = t.GetType().AssemblyQualifiedName, EventTypeName=t.GetType().Name, EventData = t.ToJsonStr() }).ToList();
+ }
public class EnrollmentConfirmAndPD
{
public bool IsEnrollmentConfirm { get; set; }
diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/DispatchDomainEventsInterceptor.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/DispatchDomainEventsInterceptor.cs
index a89eaacdd..70818ee0e 100644
--- a/IRaCIS.Core.Infra.EFCore/Interceptor/DispatchDomainEventsInterceptor.cs
+++ b/IRaCIS.Core.Infra.EFCore/Interceptor/DispatchDomainEventsInterceptor.cs
@@ -60,6 +60,7 @@ namespace IRaCIS.Core.Infra.EFCore.Interceptor
if (domainEvent.IsScheduleEvent)
{
+ //延迟调度的消息,比如1h后再消费
await _scheduler.SchedulePublish(DateTime.Now.AddSeconds(domainEvent.DelaySeconds), (object)domainEvent);
}
diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/20241012011240_DownloadAddTrialSiteCode.Designer.cs b/IRaCIS.Core.Infra.EFCore/Migrations/20241012011240_DownloadAddTrialSiteCode.Designer.cs
new file mode 100644
index 000000000..abe6e189f
--- /dev/null
+++ b/IRaCIS.Core.Infra.EFCore/Migrations/20241012011240_DownloadAddTrialSiteCode.Designer.cs
@@ -0,0 +1,17793 @@
+//
+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("20241012011240_DownloadAddTrialSiteCode")]
+ partial class DownloadAddTrialSiteCode
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.8")
+ .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("IsOfficial")
+ .HasColumnType("bit")
+ .HasComment("是否正式简历");
+
+ b.Property("Language")
+ .HasColumnType("int")
+ .HasComment("1 中文 2为英文");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("文件类型名");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("DoctorId");
+
+ b.ToTable("Attachment", 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("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("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("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("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("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("InstanceCount")
+ .HasColumnType("int");
+
+ b.Property("IsDeleted")
+ .HasColumnType("bit");
+
+ b.Property("IsReading")
+ .HasColumnType("bit");
+
+ b.Property("Modality")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ProtocolName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SequenceName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SeriesInstanceUid")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SeriesNumber")
+ .HasColumnType("int");
+
+ b.Property("SeriesTime")
+ .HasColumnType("datetime2");
+
+ b.Property("SliceThickness")
+ .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("TriggerTime")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("VisitTaskId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("SeqId");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("StudyId");
+
+ b.ToTable("DicomSeries", t =>
+ {
+ t.HasComment("归档 - 序列表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomStudy", b =>
+ {
+ b.Property("SeqId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier")
+ .HasComment("序列Id 避免内存移动");
+
+ b.Property("AccessionNumber")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("AcquisitionNumber")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("AcquisitionTime")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property