diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 72832e6d8..97781ccb7 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -1276,6 +1276,13 @@
医生Id
+
+
+ 新增或修改ResearchPublication 传null不修改
+
+
+
+
根据医生Id,获取临床试验经历 界面所有数据
@@ -13013,12 +13020,17 @@
- CRC 回复质控质疑 通知QC
+ CRC 回复质控质疑 通知QC Code012,013
+
+
+
+
+ CRC 回复质控质疑 通知QC Code012,013
- QC回复 质控质疑,通知CRC
+ QC回复 质控质疑,通知CRC
diff --git a/IRaCIS.Core.Application/MassTransit/Consumer/SubjectVisitQCAndCheckConsumer.cs b/IRaCIS.Core.Application/MassTransit/Consumer/SubjectVisitQCAndCheckConsumer.cs
index 4612483f4..840578b7d 100644
--- a/IRaCIS.Core.Application/MassTransit/Consumer/SubjectVisitQCAndCheckConsumer.cs
+++ b/IRaCIS.Core.Application/MassTransit/Consumer/SubjectVisitQCAndCheckConsumer.cs
@@ -115,8 +115,8 @@ public class CRCRepliedQCChallengeEventConsumer(
IRepository _trialUseRepository,
IRepository _subjectVisitRepository,
IRepository _trialRepository,
- IRepository _readingQuestionCriterionTrialRepository,
- IRepository _visitTaskRepository,
+ IRepository _qCChallengeRepository,
+ IRepository _qCChallengeDialogRepository,
IRepository _dictionaryRepository,
IRepository _emailNoticeConfigrepository,
IOptionsMonitor systemEmailConfig) : IConsumer
@@ -125,76 +125,74 @@ public class CRCRepliedQCChallengeEventConsumer(
private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue;
public async Task Consume(ConsumeContext context)
{
- //Console.WriteLine("发送(Code012,013) 【加急项目所有IQC待领取质控任务】邮件!!!");
- //var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
+ Console.WriteLine("发送(Code012,013) 【CRC 回复质控质疑 通知QC】邮件!!!");
+ var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US;
- //var subjectVisitId = context.Message.SubjectVisitId;
+ var subjectVisitId = context.Message.SubjectVisitId;
- //var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstOrDefaultAsync();
-
- //var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
-
- //var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList();
+ var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).Include(x => x.CurrentActionUser).FirstNotNullAsync();
- //var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
-
- //var auditStateCode = "AuditStatePE";
-
- //if (trialInfo.QCProcessEnum == TrialQCProcess.DoubleAudit)
- //{
- // auditStateCode = "AuditStateRC";
- //}
-
- //foreach (var userinfo in userinfoList)
- //{
- // var messageToSend = new MimeMessage();
- // //发件地址
- // messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
- // messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
+ var qCChallengeDialog = await _qCChallengeDialogRepository.Where(x => x.Id == context.Message.QCChallengeDialogId).Include(x => x.QCChallenge).FirstNotNullAsync();
- // var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
+
+ var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync();
+
+ var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList();
+
+ var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId);
- // var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
- // {
+ var userinfo = subjectVisit.CurrentActionUser;
- // DictionaryRepository = _dictionaryRepository,
- // IsEn_US = isEn_US,
- // DictionaryList = new List()
- // {
- // new DictionaryDto (){DictionaryCode= auditStateCode,EnumValue=subjectVisit.AuditState.GetEnumInt(), }, //审核状态
+ var messageToSend = new MimeMessage();
+ //发件地址
+ messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
+ messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail));
- // }
- // });
- // Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
- // {
- // var subjectCode = subjectVisit.Subject.Code;
- // var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
- // var htmlBodyStr = string.Format(
- // CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
- // userinfo.FullName, // 用户名 {0}
- // trialInfo.ExperimentName, // 项目 {1}
- // subjectCode, // 受试者 {2}
- // subjectVisit.VisitName, // 访视 {3}
- // dictionValue[0], // 审核状态 {4}
- // _systemEmailConfig.SiteUrl // 链接 {5}
- // );
+ var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
- // return (topicStr, htmlBodyStr);
- // };
- // await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
+ var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto()
+ {
- // context.Message.IsPd ? EmailBusinessScenario.PDVerification_PendingImageQCClaim : EmailBusinessScenario.EligibilityVerification_PendingClaim,
+ DictionaryRepository = _dictionaryRepository,
+ IsEn_US = isEn_US,
+ DictionaryList = new List()
+ {
+ new DictionaryDto (){DictionaryCode= "YesOrNo",EnumValue=qCChallengeDialog.QCChallenge.IsClosed.ToString(), }, //是否关闭
- // messageToSend, emailConfigFunc);
+ }
+ });
- // await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
-
- }
+ Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
+ {
+ var subjectCode = subjectVisit.Subject.Code;
+ var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName);
+ var htmlBodyStr = string.Format(
+ CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr),
+ userinfo.FullName, // 用户名 {0}
+ trialInfo.ExperimentName, // 项目 {1}
+ subjectCode, // 受试者 {2}
+ subjectVisit.VisitName, // 访视 {3}
+ dictionValue[0], // 是否关闭 {4}
+ qCChallengeDialog.TalkContent, // 质疑内容{5}
+ _systemEmailConfig.SiteUrl // 链接 {6}
+ );
+
+ return (topicStr, htmlBodyStr);
+ };
+
+ await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository,
+
+ context.Message.IsPd ? EmailBusinessScenario.PDVerification_UnderQCQuery : EmailBusinessScenario.EligibilityVerification_Pending,
+
+ messageToSend, emailConfigFunc);
+
+ await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
+ }
}
diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/ResearchPublicationModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/ResearchPublicationModel.cs
index e34b22a11..cc33f5a77 100644
--- a/IRaCIS.Core.Application/Service/Doctor/DTO/ResearchPublicationModel.cs
+++ b/IRaCIS.Core.Application/Service/Doctor/DTO/ResearchPublicationModel.cs
@@ -16,4 +16,20 @@
}
+
+
+ public class ResearchPublicationInfoDTO
+ {
+ public Guid? Id { get; set; }
+ public Guid DoctorId { get; set; }
+ public string? Research { get; set; }
+ public string? Grants { get; set; }
+ public string? Publications { get; set; }
+ public string? AwardsHonors { get; set; }
+
+ public string? ResearchCN { get; set; }
+ public string? GrantsCN { get; set; }
+ public string? PublicationsCN { get; set; }
+ public string? AwardsHonorsCN { get; set; }
+ }
}
\ No newline at end of file
diff --git a/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs b/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs
index 0d4951b79..7ee8382bd 100644
--- a/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs
+++ b/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs
@@ -31,5 +31,18 @@ namespace IRaCIS.Core.Application.Service
return ResponseOutput.Ok(entity.Id);
}
+
+ ///
+ /// 新增或修改ResearchPublication 传null不修改
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task AddOrUpdateResearchPublicationInfo(ResearchPublicationInfoDTO param)
+ {
+ var entity = await _researchPublicationRepository.InsertOrUpdateAsync(param, true);
+
+ return ResponseOutput.Ok(entity.Id);
+ }
}
}
\ No newline at end of file
diff --git a/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs b/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs
index aba729ec3..2a72750f1 100644
--- a/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs
+++ b/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs
@@ -2,6 +2,7 @@
using AutoMapper.EquivalencyExpression;
using IRaCIS.Application.Contracts;
using IRaCIS.Application.Contracts.Pay;
+using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.Application.Service
@@ -38,6 +39,10 @@ namespace IRaCIS.Core.Application.Service
CreateMap().EqualityComparison((odto, o) => odto.Id == o.Id);
CreateMap().EqualityComparison((odto, o) => odto.Id == o.Id);
+ CreateMap()
+ .ForAllMembers(opts => opts.Condition((src, dest, srcMember) => srcMember != null));
+
+
//医生账户
CreateMap();
CreateMap();
diff --git a/IRaCIS.Core.Domain/Visit/SubjectVisit.cs b/IRaCIS.Core.Domain/Visit/SubjectVisit.cs
index 70cfa837a..751ea0be7 100644
--- a/IRaCIS.Core.Domain/Visit/SubjectVisit.cs
+++ b/IRaCIS.Core.Domain/Visit/SubjectVisit.cs
@@ -15,10 +15,17 @@ public class SubjectVisit : BaseFullDeleteAuditEntity
public SubjectVisit OutPlanPreviousVisit { get; set; }
[ForeignKey("ForwardUserId")]
public User ForwardUser { get; set; }
+
+ ///
+ /// 初审
+ ///
[JsonIgnore]
[ForeignKey("PreliminaryAuditUserId")]
public User PreliminaryAuditUser { get; set; }
+ ///
+ /// 复审
+ ///
[JsonIgnore]
[ForeignKey("ReviewAuditUserId")]
public User ReviewAuditUser { get; set; }
@@ -105,6 +112,7 @@ public class SubjectVisit : BaseFullDeleteAuditEntity
[Comment("审核状态")]
public AuditStateEnum AuditState { get; set; }
public ForwardStateEnum ForwardState { get; set; }
+
[Comment("单审通过人")]
public Guid? PreliminaryAuditUserId { get; set; }
@@ -119,6 +127,9 @@ public class SubjectVisit : BaseFullDeleteAuditEntity
public Guid? ForwardUserId { get; set; }
public DateTime? ForwardTime { get; set; }
+ ///
+ /// 当前领取
+ ///
[Comment("当前质控领取人")]
public Guid? CurrentActionUserId { get; set; }
public DateTime? CurrentActionUserExpireTime { get; set; }
diff --git a/IRaCIS.Core.Domain/_DomainEvent/SubjectVisitStateChangedEvent.cs b/IRaCIS.Core.Domain/_DomainEvent/SubjectVisitStateChangedEvent.cs
index bb3e9cb06..ef37d3221 100644
--- a/IRaCIS.Core.Domain/_DomainEvent/SubjectVisitStateChangedEvent.cs
+++ b/IRaCIS.Core.Domain/_DomainEvent/SubjectVisitStateChangedEvent.cs
@@ -24,6 +24,9 @@ public class CRCSubmitedAndQCToAuditEvent : DomainEvent
///
public class CRCRepliedQCChallengeEvent : DomainEvent
{
+
+ public bool IsPd { get; set; }
+
public Guid QCChallengeDialogId { get; set; }
public Guid TrialId { get; set; }
@@ -37,6 +40,9 @@ public class CRCRepliedQCChallengeEvent : DomainEvent
///
public class QCRepliedQCChallengeEvent : DomainEvent
{
+
+ public bool IsPd { get; set; }
+
public Guid QCChallengeDialogId { get; set; }
public Guid TrialId { get; set; }
diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs
index 23f7d88a0..15a6a6de6 100644
--- a/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs
+++ b/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs
@@ -121,12 +121,12 @@ public static class DBContext_Ext
//CRC 针对质控质疑进行回复
if (entry.State == EntityState.Added && qCChallengeDialog.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator)
{
- qCChallengeDialog.AddDomainEvent(new CRCRepliedQCChallengeEvent() { QCChallengeDialogId = qCChallengeDialog.Id, SubjectVisitId = findSubjectVisit.Id, TrialId = findSubjectVisit.TrialId });
+ qCChallengeDialog.AddDomainEvent(new CRCRepliedQCChallengeEvent() { IsPd = findSubjectVisit.PDState == PDStateEnum.PDProgress, QCChallengeDialogId = qCChallengeDialog.Id, SubjectVisitId = findSubjectVisit.Id, TrialId = findSubjectVisit.TrialId });
}
//QC 针对质控质疑进行回复
else if (entry.State == EntityState.Added && qCChallengeDialog.UserTypeEnum == UserTypeEnum.IQC)
{
- qCChallengeDialog.AddDomainEvent(new QCRepliedQCChallengeEvent() { QCChallengeDialogId = qCChallengeDialog.Id, SubjectVisitId = findSubjectVisit.Id, TrialId = findSubjectVisit.TrialId });
+ qCChallengeDialog.AddDomainEvent(new QCRepliedQCChallengeEvent() { IsPd = findSubjectVisit.PDState == PDStateEnum.PDProgress, QCChallengeDialogId = qCChallengeDialog.Id, SubjectVisitId = findSubjectVisit.Id, TrialId = findSubjectVisit.TrialId });
}