diff --git a/IRaCIS.Core.API/Controllers/InspectionController.cs b/IRaCIS.Core.API/Controllers/InspectionController.cs
index 56187a561..5d0206baa 100644
--- a/IRaCIS.Core.API/Controllers/InspectionController.cs
+++ b/IRaCIS.Core.API/Controllers/InspectionController.cs
@@ -52,7 +52,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingImageTask/SubmitOncologyReadingInfo")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task SetOncologyReadingInfo(DataInspectionDto opt)
@@ -69,7 +69,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingImageTask/SubmitDicomVisitTask")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task SubmitDicomVisitTask(DataInspectionDto opt)
@@ -88,7 +88,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingImageTask/SubmitGlobalReadingInfo")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task SubmitGlobalReadingInfo(DataInspectionDto opt)
@@ -107,7 +107,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/configTrialBasicInfo/TrialReadingInfoSign")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task TrialReadingInfoSign(DataInspectionDto opt)
@@ -126,7 +126,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingMedicalReview/FinishMedicalReview")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task FinishMedicalReview(DataInspectionDto opt)
@@ -143,7 +143,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingMedicineQuestion/ConfirmReadingMedicineQuestion")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task ConfirmReadingMedicineQuestion(DataInspectionDto opt)
@@ -161,7 +161,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingImageTask/SubmitVisitTaskQuestions")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task SubmitVisitTaskQuestions(DataInspectionDto opt)
@@ -179,7 +179,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ClinicalAnswer/CRCSignClinicalData")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task CRCSignClinicalData(DataInspectionDto opt)
@@ -197,7 +197,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ClinicalAnswer/CRCConfirmClinical")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task CRCConfirmClinical(DataInspectionDto opt)
@@ -214,7 +214,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ClinicalAnswer/CRCCancelConfirmClinical")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task CRCCancelConfirmClinical(DataInspectionDto opt)
@@ -232,7 +232,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ClinicalAnswer/PMConfirmClinical")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task PMConfirmClinical(DataInspectionDto opt)
@@ -250,7 +250,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingClinicalData/SignConsistencyAnalysisReadingClinicalData")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task SignConsistencyAnalysisReadingClinicalData(DataInspectionDto opt)
@@ -267,7 +267,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ClinicalAnswer/SubmitClinicalFormAndSign")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task SubmitClinicalFormAndSign(DataInspectionDto opt)
@@ -284,7 +284,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadingImageTask/SubmitJudgeVisitTaskResult")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task SubmitJudgeVisitTaskResult(DataInspectionDto opt)
@@ -303,7 +303,7 @@ namespace IRaCIS.Core.API.Controllers
///
[HttpPost, Route("Inspection/configTrialBasicInfo/ConfigTrialBasicInfoConfirm")]
[UnitOfWork]
- [TrialGlobalLimit( "BeforeOngoingCantOpt" )]
+ [TrialGlobalLimit("BeforeOngoingCantOpt")]
public async Task ConfigTrialBasicInfoConfirm(DataInspectionDto opt)
{
@@ -345,7 +345,7 @@ namespace IRaCIS.Core.API.Controllers
///
[HttpPost, Route("Inspection/configTrialBasicInfo/ConfigTrialUrgentInfoConfirm")]
[UnitOfWork]
- [TrialGlobalLimit( "BeforeOngoingCantOpt" )]
+ [TrialGlobalLimit("BeforeOngoingCantOpt")]
public async Task ConfigTrialUrgentInfoConfirm(DataInspectionDto opt)
{
opt.Data.IsTrialUrgentConfirmed = true;
@@ -358,7 +358,7 @@ namespace IRaCIS.Core.API.Controllers
[HttpPost, Route("Inspection/configTrialBasicInfo/ConfigTrialPACSInfoConfirm")]
[UnitOfWork]
- [TrialGlobalLimit( "BeforeOngoingCantOpt" )]
+ [TrialGlobalLimit("BeforeOngoingCantOpt")]
public async Task ConfigTrialPACSInfoConfirm(DataInspectionDto opt)
{
opt.Data.IsTrialPACSConfirmed = true;
@@ -374,7 +374,7 @@ namespace IRaCIS.Core.API.Controllers
///
[HttpPost, Route("Inspection/configTrialBasicInfo/TrialConfigSignatureConfirm")]
[UnitOfWork]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
public async Task TrialConfigSignatureConfirm(DataInspectionDto opt)
{
@@ -391,7 +391,7 @@ namespace IRaCIS.Core.API.Controllers
///
[HttpPost, Route("Inspection/ReadingCriterion/ResetAndAsyncCriterion")]
[UnitOfWork]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
public async Task ResetAndAsyncCriterion(DataInspectionDto opt)
{
@@ -409,7 +409,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/QCOperation/CRCRequestToQC")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task CRCRequestToQC(DataInspectionDto opt)
{
@@ -424,21 +424,31 @@ namespace IRaCIS.Core.API.Controllers
/// 设置QC 通过或者不通过 7:QC failed 8:QC passed
///
[HttpPost, Route("Inspection/QCOperation/QCPassedOrFailed")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task QCPassedOrFailed(DataInspectionDto opt)
{
var singid = await _inspectionService.RecordSing(opt.SignInfo);
- var result = await _qCOperationService.QCPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, opt.Data.auditState);
- await _inspectionService.CompletedSign(singid, result);
- return result;
+ if (opt.Data.IsSecondPass != null)
+ {
+ var result = await _qCOperationService.QCSecondReviewPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, (bool)opt.Data.IsSecondPass);
+ await _inspectionService.CompletedSign(singid, result);
+ return result;
+ }
+ else
+ {
+ var result = await _qCOperationService.QCPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, opt.Data.auditState);
+ await _inspectionService.CompletedSign(singid, result);
+ return result;
+ }
+
}
///
/// 一致性核查 回退 对话记录不清除 只允许PM回退
///
[HttpPost, Route("Inspection/QCOperation/CheckBack")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task CheckBack(DataInspectionDto opt)
{
@@ -455,7 +465,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/ReadClinicalData/ReadClinicalDataSign")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task ReadClinicalDataSign(DataInspectionDto opt)
{
@@ -470,7 +480,7 @@ namespace IRaCIS.Core.API.Controllers
/// CRC 设置已经重传完成
///
[HttpPost, Route("Inspection/QCOperation/SetReuploadFinished")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
public async Task SetReuploadFinished(DataInspectionDto opt)
{
@@ -486,7 +496,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/TrialConfig/updateTrialState")]
- [TrialGlobalLimit( "BeforeOngoingCantOpt")]
+ [TrialGlobalLimit("BeforeOngoingCantOpt")]
[UnitOfWork]
public async Task UpdateTrialState(DataInspectionDto opt)
{
@@ -502,7 +512,7 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/TrialDocument/userConfirm")]
- [TrialGlobalLimit( "BeforeOngoingCantOpt", "SignSystemDocNoTrialId", "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("BeforeOngoingCantOpt", "SignSystemDocNoTrialId", "AfterStopCannNotOpt")]
[UnitOfWork]
public async Task UserConfirm(DataInspectionDto opt)
{
@@ -519,10 +529,10 @@ namespace IRaCIS.Core.API.Controllers
///
///
[HttpPost, Route("Inspection/VisitTask/ConfirmReReading")]
- [TrialGlobalLimit( "AfterStopCannNotOpt" )]
+ [TrialGlobalLimit("AfterStopCannNotOpt")]
[UnitOfWork]
- public async Task ConfirmReReading(DataInspectionDto opt, [FromServices] IVisitTaskService _visitTaskService)
+ public async Task ConfirmReReading(DataInspectionDto opt, [FromServices] IVisitTaskService _visitTaskService)
{
var singId = await _inspectionService.RecordSing(opt.SignInfo);
var result = await _visitTaskService.ConfirmReReading(opt.Data);
diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
index 21ec662fa..747214ce8 100644
--- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
+++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs
@@ -1118,7 +1118,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
HtmlPath = k.HtmlPath,
Path = k.Path,
InstanceNumber = k.InstanceNumber,
-
+ FileSize=k.FileSize,
}).ToList()
})
});
diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs
index 187c35e81..7d932a84d 100644
--- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs
+++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs
@@ -199,6 +199,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
public Guid subjectVisitId { get; set; }
public AuditStateEnum auditState { get; set; }
+
+ public bool? IsSecondPass { get; set; }
}
public class SetSeriesStateDto
diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs
index 0d341df57..3f34cfa0a 100644
--- a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs
+++ b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs
@@ -251,7 +251,13 @@ namespace IRaCIS.Core.Application.Contracts.DTO
}
-
+ public class SecondReviewDto
+ {
+ public DateTime? SecondReviewTime { get; set; }
+ public string FullName { get; set; }
+ public string UserName { get; set; }
+ public DateTime? SignTime { get; set; }
+ }
public class TrialVisitQADTO
@@ -270,6 +276,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
public QARelationInfo RelationInfo { get; set; } = new QARelationInfo();
+ public List SecondReviewList { get; set; }
}
diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs
index 7d610c408..50e40de83 100644
--- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs
+++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs
@@ -2013,6 +2013,8 @@ namespace IRaCIS.Core.Application.Contracts
// 1代表第一个人QC数据 2 代表第二个人QC数据
public CurrentQC CurrentQCEnum { get; set; }
+
+ public DateTime? SecondReviewTime { get; set; }
}
public class ForwardQuery : PageInput
@@ -2167,6 +2169,7 @@ namespace IRaCIS.Core.Application.Contracts
public class QCVisitBasicListViewModel
{
+ public SecondReviewState SecondReviewState { get; set; }
public bool IsSubjectQuit { get; set; }
public ChallengeStateEnum ChallengeState { get; set; }
public bool? IsConfirmedClinicalData { get; set; }
diff --git a/IRaCIS.Core.Application/Service/QC/DTO/TrialQCQuestionConfigureViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/TrialQCQuestionConfigureViewModel.cs
index 7773d1107..d06e4253f 100644
--- a/IRaCIS.Core.Application/Service/QC/DTO/TrialQCQuestionConfigureViewModel.cs
+++ b/IRaCIS.Core.Application/Service/QC/DTO/TrialQCQuestionConfigureViewModel.cs
@@ -35,6 +35,8 @@ namespace IRaCIS.Core.Application.Contracts
public DateTime UpdateTime { get; set; }
public Guid UpdateUserId { get; set; }
+ public bool IsQuestionQCAuditPassed { get; set; }
+
}
public class QCQuestionFilterSelect
diff --git a/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs b/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs
index 4b9093508..59d99ad3f 100644
--- a/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs
+++ b/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs
@@ -13,7 +13,7 @@ namespace IRaCIS.Core.Application.Image.QA
Task QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState);
Task SetCheckPass(SetCheckPassDt data);
-
+ Task QCSecondReviewPassedOrFailed(Guid trialId, Guid subjectVisitId, bool isSecondPass);
Task AddCheckChallengeReply(CheckChallengeDialogCommand checkDialogCommand);
diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs
index c3720526a..c701f578f 100644
--- a/IRaCIS.Core.Application/Service/QC/QCListService.cs
+++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs
@@ -7,6 +7,7 @@ using IRaCIS.Core.Infrastructure;
using IRaCIS.Core.Infrastructure.Extention;
using MassTransit.Initializers;
using Microsoft.AspNetCore.Mvc;
+using System.Linq;
namespace IRaCIS.Core.Application.Image.QA
{
@@ -409,11 +410,49 @@ namespace IRaCIS.Core.Application.Image.QA
var temp = await GetVisitQCStudyAndSeriesList(subjectVisitId);
- var qacheckList = await GetQCQuestionAnswerList(subjectVisitId, sv.TrialId, trialQCProcess, currentQCType);
+ //var qacheckList = await GetQCQuestionAnswerList(subjectVisitId, sv.TrialId, trialQCProcess, currentQCType);
+
+ List secondReviewList = new List();
+
+
+ if (sv.SecondReviewState != SecondReviewState.None)
+ {
+ var trialConfirmTime = _trialRepository.Where(t => t.Id == sv.TrialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
+
+ secondReviewList = _trialQCQuestionAnswerRepository.Where(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.SecondReview).Where(t => t.SecondReviewTime != null)
+ .Select(t => new SecondReviewDto { SecondReviewTime = t.SecondReviewTime, SignTime = t.UpdateTime, FullName = t.UpdateUserRole.FullName, UserName = t.UpdateUserRole.UserName }).Distinct().ToList();
+
+ var secondReviewTimeList = secondReviewList.Select(t => t.SecondReviewTime).Distinct().ToList();
+
+ //首次加入
+ if (!secondReviewTimeList.Contains(trialConfirmTime))
+ {
+ secondReviewList.Add(new SecondReviewDto() { SecondReviewTime = trialConfirmTime });
+ }
+ else
+ {
+ if (sv.SecondReviewState == SecondReviewState.WaitAudit)
+ {
+ foreach (var item in secondReviewList)
+ {
+ if (item.SecondReviewTime == trialConfirmTime)
+ {
+ item.SignTime = null;
+ item.FullName = "";
+ item.UserName = "";
+ }
+ }
+ }
+ }
+ secondReviewList = secondReviewList.OrderByDescending(t => t.SecondReviewTime).ToList();
+ }
+
return new TrialVisitQADTO
{
- QCQuestionAnswerList = qacheckList,
+ //QCQuestionAnswerList = qacheckList,
+
+ SecondReviewList = secondReviewList,
IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == sv.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study),
StudyList = temp.StudyList,
@@ -434,8 +473,45 @@ namespace IRaCIS.Core.Application.Image.QA
[HttpPost]
public async Task> GetQCQuestionAnswer(GetQCQuestionAnswerInDto inDto)
{
- var questionAnswerlist = await (from data in _trialQCQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.IsEnable)
- join answer in _trialQCQuestionAnswerRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId && x.QCProcessEnum == inDto.QCProcessEnum && x.CurrentQCEnum == inDto.CurrentQCEnum).AsQueryable() on data.Id equals answer.TrialQCQuestionConfigureId into answertemp
+ var subjectVisitId = inDto.SubjectVisitId;
+
+ List questionAnswerlist = new List();
+
+ //判断当前访视质控是否完成,再判断复审是完成查看,还是添加编辑
+
+ var sv = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).FirstNotNullAsync();
+
+ if (sv.SecondReviewState == SecondReviewState.None && sv.AuditState == AuditStateEnum.QCPassed)
+ {
+
+ //现在之前历史质控的展示要从答案为主表取数据,添加和编辑按照之前方式
+
+ questionAnswerlist = await _trialQCQuestionAnswerRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId && x.QCProcessEnum == inDto.QCProcessEnum && x.CurrentQCEnum == inDto.CurrentQCEnum)
+ .Select(data => new QCQuestionAnswer()
+ {
+ Answer = data.Answer,
+ ShowOrder = data.TrialQCQuestionConfigure.ShowOrder,
+ QuestionName = data.TrialQCQuestionConfigure.QuestionName,
+ Id = data.TrialQCQuestionConfigure.Id,
+ IsRequired = data.TrialQCQuestionConfigure.IsRequired,
+ ParentId = data.TrialQCQuestionConfigure.ParentId,
+ ParentTriggerValue = data.TrialQCQuestionConfigure.ParentTriggerValue,
+ Type = data.TrialQCQuestionConfigure.Type,
+ TypeValue = data.TrialQCQuestionConfigure.TypeValue
+ }).OrderBy(t => t.ShowOrder).ToListAsync();
+
+ }
+ else
+ {
+
+ var secondReviewTime = inDto.SecondReviewTime != null ? (DateTime)inDto.SecondReviewTime : DateTime.Now;
+
+ #region 之前编辑和审核通过后展示都是通过这个接口
+
+ questionAnswerlist = await (from data in _trialQCQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.IsEnable)
+ join answer in _trialQCQuestionAnswerRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId && x.QCProcessEnum == inDto.QCProcessEnum && x.CurrentQCEnum == inDto.CurrentQCEnum)
+ .Where(t => inDto.CurrentQCEnum == CurrentQC.SecondReview ? t.SecondReviewTime >= secondReviewTime && t.SecondReviewTime <= secondReviewTime.AddSeconds(1) : true)
+ on data.Id equals answer.TrialQCQuestionConfigureId into answertemp
from leftanswer in answertemp.DefaultIfEmpty()
select new QCQuestionAnswer()
{
@@ -449,6 +525,17 @@ namespace IRaCIS.Core.Application.Image.QA
Type = data.Type,
TypeValue = data.TypeValue
}).OrderBy(t => t.ShowOrder).ToListAsync();
+ #endregion
+ }
+
+
+
+
+
+
+
+
+
var result = questionAnswerlist.Where(x => x.ParentId == null).OrderBy(t => t.ShowOrder).ToList();
result.ForEach(x =>
diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
index 326fa9958..92fc776e0 100644
--- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
+++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs
@@ -727,9 +727,17 @@ namespace IRaCIS.Core.Application.Image.QA
//[Authorize(Policy = IRaCISPolicy.IQC)]
public async Task AddOrUpdateQCQuestionAnswerList(QCQuestionAnswerCommand[] qcQuestionAnswerCommands, Guid trialId, Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
{
+ if (currentQCType == CurrentQC.SecondReview)
+ {
+ //二次复核自动领取,如果有人先领取了,那么后续不能操作
+ await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId && t.CurrentActionUserId == null, u => new SubjectVisit() { CurrentActionUserId = _userInfo.UserRoleId });
+ }
//验证是否能操作
await VerifyIsCanQCAsync(null, subjectVisitId);
+
+ var trialConfirmTime = _trialRepository.Where(t => t.Id == trialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
+
//更新
if (qcQuestionAnswerCommands.Any(t => t.Id != null))
{
@@ -774,7 +782,9 @@ namespace IRaCIS.Core.Application.Image.QA
{
var addlist = _mapper.Map>(qcQuestionAnswerCommands);
- addlist.ForEach(t => { t.TrialId = trialId; t.SubjectVisitId = subjectVisitId; t.CurrentQCEnum = currentQCType; t.QCProcessEnum = trialQCProcess; });
+
+
+ addlist.ForEach(t => { t.TrialId = trialId; t.SubjectVisitId = subjectVisitId; t.CurrentQCEnum = currentQCType; t.QCProcessEnum = trialQCProcess; t.SecondReviewTime = currentQCType == CurrentQC.SecondReview ? trialConfirmTime : null; });
await _trialQCQuestionAnswerRepository.AddRangeAsync(addlist);
@@ -2077,8 +2087,43 @@ namespace IRaCIS.Core.Application.Image.QA
}
+ public async Task QCSecondReviewPassedOrFailed(Guid trialId, Guid subjectVisitId, bool isSecondPass)
+ {
+ if (!await _trialUserRoleRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == _userInfo.UserRoleId))
+ {
+ //---您已经被移出项目,没有操作权限。
+ return ResponseOutput.NotOk(_localizer["QCOperation_RemoveItem"]);
+ }
+ var sv = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId);
+
+ await VerifyIsCanQCAsync(sv);
+
+ var trialConfirmTime = _trialRepository.Where(t => t.Id == sv.TrialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
+
+ if (sv.SecondReviewState == SecondReviewState.WaitAudit)
+ {
+ if (isSecondPass)
+ {
+ sv.SecondReviewState = SecondReviewState.AuditPassed;
+
+ }
+ else
+ {
+ sv.SecondReviewState = SecondReviewState.AuditFailed;
+ }
+
+ await _trialQCQuestionAnswerRepository.BatchUpdateNoTrackingAsync(t => t.SubjectVisitId == sv.Id && t.CurrentQCEnum == CurrentQC.SecondReview && t.SecondReviewTime == trialConfirmTime, u => new TrialQCQuestionAnswer()
+ {
+ UpdateUserId = _userInfo.UserRoleId,
+ UpdateTime = DateTime.Now
+ });
+ }
+ await _subjectVisitRepository.SaveChangesAsync();
+
+ return ResponseOutput.Ok();
+ }
///
/// 设置、取消 访视紧急
diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs
index 226bd8161..3212a2882 100644
--- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs
+++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs
@@ -479,6 +479,7 @@ namespace IRaCIS.Core.Application.Service
CreateMap();
CreateMap()
+ .ForMember(d => d.IsQuestionQCAuditPassed, u => u.MapFrom(s => s.TrialQCQuestionAnswerList.Any(c => c.TrialQCQuestionConfigureId == s.Id && c.SubjectVisit.AuditState == AuditStateEnum.QCPassed)))
.ForMember(d => d.ParentShowOrder, u => u.MapFrom(s => s.ParentQCQuestion.ShowOrder));
CreateMap();
diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs
index 6461ea27c..94bfbd0b3 100644
--- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs
+++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs
@@ -41,6 +41,7 @@ namespace IRaCIS.Core.Application
IRepository _systemBasicDataRepository,
IRepository _subjectVisitRepository,
IRepository _enrollRepository,
+ IRepository _qcQuestionAnswerRepository,
IRepository _trialStateChangeRepository,
IRepository _readingTableQuestionTrialRepository, IRepository _dicomAERepository,
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, ITrialConfigService
@@ -861,9 +862,18 @@ namespace IRaCIS.Core.Application
{
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { IsTrialUrgentConfirmed = true });
}
- else
+ else if (signConfirmDTO.SignCode == ((int)SignEnum.TrialQCQuestionConfirmUpdate).ToString())
+ {
+ await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = null, QCQuestionConfirmedUserId = null, IsQCQuestionConfirmed = false });
+ }
+ else if (signConfirmDTO.SignCode == ((int)SignEnum.SecondReviewConfirm).ToString())
+ {
+ await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == signConfirmDTO.TrialId && t.AuditState == AuditStateEnum.QCPassed, u => new SubjectVisit() { SecondReviewState = SecondReviewState.WaitAudit });
- if (signConfirmDTO.SignCode == ((int)SignEnum.TrialQCQuestionConfirm).ToString())
+ //删除复审中间临时数据
+ await _qcQuestionAnswerRepository.BatchDeleteNoTrackingAsync(t => t.SubjectVisit.TrialId == signConfirmDTO.TrialId && t.SubjectVisit.AuditState != AuditStateEnum.QCPassed && t.CurrentQCEnum == CurrentQC.SecondReview);
+ }
+ else if (signConfirmDTO.SignCode == ((int)SignEnum.TrialQCQuestionConfirm).ToString())
{
var trialConfig = (await _trialRepository
@@ -909,9 +919,9 @@ namespace IRaCIS.Core.Application
IsConfirm = true
});
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = DateTime.Now, QCQuestionConfirmedUserId = _userInfo.UserRoleId, IsQCQuestionConfirmed = true });
- await _trialRepository.SaveChangesAsync();
}
+ await _trialRepository.SaveChangesAsync();
return ResponseOutput.Ok();
diff --git a/IRaCIS.Core.Domain.Share/Common/SignEnum.cs b/IRaCIS.Core.Domain.Share/Common/SignEnum.cs
index 43cbcf9f7..98c3eed27 100644
--- a/IRaCIS.Core.Domain.Share/Common/SignEnum.cs
+++ b/IRaCIS.Core.Domain.Share/Common/SignEnum.cs
@@ -29,6 +29,13 @@ namespace IRaCIS.Core.Domain.Share
TrialQCQuestionConfirm=107,
+
+ //重置质控问题配置
+
+ TrialQCQuestionConfirmUpdate=112,
+
+ SecondReviewConfirm = 219,
+
}
}
diff --git a/IRaCIS.Core.Domain.Share/QC/CheckChanllengeTypeEnum.cs b/IRaCIS.Core.Domain.Share/QC/CheckChanllengeTypeEnum.cs
index d242c1f2b..5c2e94ab8 100644
--- a/IRaCIS.Core.Domain.Share/QC/CheckChanllengeTypeEnum.cs
+++ b/IRaCIS.Core.Domain.Share/QC/CheckChanllengeTypeEnum.cs
@@ -19,4 +19,14 @@ namespace IRaCIS.Core.Domain.Share
}
+ public enum SecondReviewState
+ {
+ None = 0,
+
+ WaitAudit=1,
+
+ AuditPassed=2,
+
+ AuditFailed=3,
+ }
}
diff --git a/IRaCIS.Core.Domain.Share/QC/TrialQCProcess.cs b/IRaCIS.Core.Domain.Share/QC/TrialQCProcess.cs
index bffe7530f..dd5bd63a2 100644
--- a/IRaCIS.Core.Domain.Share/QC/TrialQCProcess.cs
+++ b/IRaCIS.Core.Domain.Share/QC/TrialQCProcess.cs
@@ -14,7 +14,11 @@
First = 1,
- Second = 2
+ Second = 2,
+
+
+ //二次复核,只会一个人
+ SecondReview=3,
}
diff --git a/IRaCIS.Core.Domain/BaseModel/Entity.cs b/IRaCIS.Core.Domain/BaseModel/Entity.cs
index 55847a041..8fc614e3e 100644
--- a/IRaCIS.Core.Domain/BaseModel/Entity.cs
+++ b/IRaCIS.Core.Domain/BaseModel/Entity.cs
@@ -108,6 +108,11 @@ public abstract class BaseFullAuditEntity : Entity, IAuditUpdate, IAuditAdd
[ForeignKey("CreateUserId")]
[JsonIgnore]
public UserRole CreateUserRole { get; set; }
+
+
+ [ForeignKey("CreateUserId")]
+ [JsonIgnore]
+ public UserRole UpdateUserRole { get; set; }
}
public abstract class BaseFullDeleteAuditEntity : Entity, IAuditUpdate, IAuditAdd, ISoftDelete
{
diff --git a/IRaCIS.Core.Domain/QC/TrialQCQuestionAnswer.cs b/IRaCIS.Core.Domain/QC/TrialQCQuestionAnswer.cs
index 24680ec64..822638e74 100644
--- a/IRaCIS.Core.Domain/QC/TrialQCQuestionAnswer.cs
+++ b/IRaCIS.Core.Domain/QC/TrialQCQuestionAnswer.cs
@@ -8,6 +8,9 @@ public class TrialQCQuestionAnswer : BaseFullAuditEntity
#region 导航属性
[JsonIgnore]
public TrialQCQuestion TrialQCQuestionConfigure { get; set; }
+
+ [JsonIgnore]
+ public SubjectVisit SubjectVisit { get; set; }
#endregion
public Guid TrialId { get; set; }
@@ -20,4 +23,7 @@ public class TrialQCQuestionAnswer : BaseFullAuditEntity
public Guid SubjectVisitId { get; set; }
public Guid TrialQCQuestionConfigureId { get; set; }
+
+
+ public DateTime? SecondReviewTime { get; set; }
}
diff --git a/IRaCIS.Core.Domain/Visit/SubjectVisit.cs b/IRaCIS.Core.Domain/Visit/SubjectVisit.cs
index f95d5c47a..862560d79 100644
--- a/IRaCIS.Core.Domain/Visit/SubjectVisit.cs
+++ b/IRaCIS.Core.Domain/Visit/SubjectVisit.cs
@@ -75,7 +75,7 @@ public class SubjectVisit : BaseFullDeleteAuditEntity
public List SubjectCriteriaEvaluationVisitFilterList { get; set; }
[JsonIgnore]
- public List SubjectVisitImageBackRecordList { get; set; }
+ public List SubjectVisitImageBackRecordList { get; set; }
#endregion
public Guid TrialSiteId { get; set; }
@@ -188,7 +188,7 @@ public class SubjectVisit : BaseFullDeleteAuditEntity
public Guid? SubmitUserId { get; set; }
public ReadingStatusEnum ReadingStatus { get; set; }
-
+ public SecondReviewState SecondReviewState { get; set; }
}
[Comment("受试者访视影像回退记录表")]
diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
index 8d5c3ffee..78cdbb791 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
@@ -217,6 +217,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common
extraIdentification = oldentity.IsConfigureEmail ? "/EmailUpdate" : "/EmailSave";
break;
+ case "configTrialBasicInfo/TrialConfigSignatureConfirm":
+
+ if (entity.IsQCQuestionConfirmed == false)
+ {
+ extraIdentification = $"/ConfirmReset";
+ }
+ break;
}
//var trialDicomAE = await _dbContext.TrialDicomAE.Where(t => t.TrialId == entity.Id).FirstOrDefaultAsync();
@@ -1958,7 +1965,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var isDistinctionInterface = true;
- var reason = string.Empty;
+ var reason = entity.ApplyReason;
#region 处理标识
diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/20250715021320_qcSecond.Designer.cs b/IRaCIS.Core.Infra.EFCore/Migrations/20250715021320_qcSecond.Designer.cs
new file mode 100644
index 000000000..0bbb4a687
--- /dev/null
+++ b/IRaCIS.Core.Infra.EFCore/Migrations/20250715021320_qcSecond.Designer.cs
@@ -0,0 +1,19824 @@
+//
+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("20250715021320_qcSecond")]
+ partial class qcSecond
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.15")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.Attachment", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("编码");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DoctorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ExpiryDate")
+ .HasColumnType("datetime2")
+ .HasComment("过期时间");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsAuthorizedView")
+ .HasColumnType("bit");
+
+ b.Property("IsOfficial")
+ .HasColumnType("bit")
+ .HasComment("是否正式简历");
+
+ b.Property("Language")
+ .HasColumnType("int")
+ .HasComment("1 中文 2为英文");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("文件类型名");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("DoctorId");
+
+ b.ToTable("Attachment", t =>
+ {
+ t.HasComment("医生 - 简历|证书 文档表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.AuditDocument", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AuditDocumentTypeEnum")
+ .HasColumnType("int");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileFormat")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FilePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("FileSize")
+ .HasPrecision(18, 2)
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("IsAuthorization")
+ .HasColumnType("bit");
+
+ b.Property("MainFileId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ParentId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("AuditDocument", t =>
+ {
+ t.HasComment("稽查文档管理");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CRO", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CROCode")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CROName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CRONameCN")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsTrialLevel")
+ .HasColumnType("bit")
+ .HasComment("是否是项目级别");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CROCompany", t =>
+ {
+ t.HasComment("机构 - CRO");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CheckChallengeDialog", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsCRCNeedReply")
+ .HasColumnType("bit")
+ .HasComment("CRC是否需要回复 前端使用");
+
+ b.Property("ParamInfo")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasComment("核查的检查信息Json");
+
+ b.Property("SubjectVisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TalkContent")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserTypeEnum")
+ .HasColumnType("int")
+ .HasComment("核查过程中的操作用户类型");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SubjectVisitId");
+
+ b.ToTable("CheckChallengeDialog", t =>
+ {
+ t.HasComment("一致性核查 - 对话记录表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalAnswerRowInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("RowIndex")
+ .HasColumnType("int");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalAnswerRowInfo", t =>
+ {
+ t.HasComment("受试者 - 临床表单表格问题行记录");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalDataSystemSet", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalDataLevel")
+ .HasColumnType("int");
+
+ b.Property("ClinicalDataSetEnName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalDataSetEnum")
+ .HasColumnType("int")
+ .HasComment("枚举(字典里面取的)");
+
+ b.Property("ClinicalDataSetName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalUploadType")
+ .HasColumnType("int")
+ .HasComment("上传方式");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionEnumListStr")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("EnFileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("EnPath")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsApply")
+ .HasColumnType("bit")
+ .HasComment("是否应用");
+
+ b.Property("IsEnable")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("UploadRole")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalDataSystemSet", t =>
+ {
+ t.HasComment("系统 - 临床数据配置");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalDataTrialSet", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalDataLevel")
+ .HasColumnType("int")
+ .HasComment("临床级别");
+
+ b.Property("ClinicalDataSetEnName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalDataSetName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalUploadType")
+ .HasColumnType("int")
+ .HasComment("上传方式");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionEnumListStr")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("EnFileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("EnPath")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsApply")
+ .HasColumnType("bit")
+ .HasComment("是否应用");
+
+ b.Property("IsConfirm")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("SystemClinicalDataSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UploadRole")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SystemClinicalDataSetId");
+
+ b.HasIndex("TrialId");
+
+ b.ToTable("ClinicalDataTrialSet", t =>
+ {
+ t.HasComment("项目 - 临床数据适应标准配置");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalForm", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CheckDate")
+ .HasColumnType("datetime2")
+ .HasComment("检查日期");
+
+ b.Property("ClinicalDataTrialSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PicturePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("截图地址");
+
+ b.Property("ReadingId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("VisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClinicalDataTrialSetId");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("ReadingId");
+
+ b.HasIndex("SubjectId");
+
+ b.ToTable("ClinicalForm", t =>
+ {
+ t.HasComment("受试者 - 临床表单");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Answer")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("ClinicalDataTrialSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClinicalFormId");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalQuestionAnswer", t =>
+ {
+ t.HasComment("受试者 - 临床表单问题答案");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalTableAnswer", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Answer")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("答案");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("RowId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("答案行的Id");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.Property("TableQuestionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("RowId");
+
+ b.ToTable("ClinicalTableAnswer", t =>
+ {
+ t.HasComment("受试者 - 临床表单表格问题答案");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonDocument", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BusinessScenarioEnum")
+ .HasColumnType("int")
+ .HasComment("业务场景");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionTypeEnum")
+ .HasColumnType("int")
+ .HasComment("系统标准枚举");
+
+ b.Property("DeleteUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileTypeEnum")
+ .HasColumnType("int")
+ .HasComment("类型-上传|导出|邮件附件");
+
+ b.Property("IsDeleted")
+ .HasColumnType("bit");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("NameCN")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CommonDocument", t =>
+ {
+ t.HasComment("数据上传 | 数据导出 | 邮件附件 文件记录表 (需要同步)");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionNidusSystem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsSystemCriterion")
+ .HasColumnType("bit");
+
+ b.Property("LesionType")
+ .HasColumnType("int")
+ .HasComment("病灶类型");
+
+ b.Property("OrganType")
+ .HasColumnType("int")
+ .HasComment("器官类型");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("CriterionId");
+
+ b.ToTable("CriterionNidusSystem", t =>
+ {
+ t.HasComment("系统标准 - 病灶器官表 (需要同步)");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionNidusTrial", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LesionType")
+ .HasColumnType("int");
+
+ b.Property("OrganType")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CriterionNidusTrial", t =>
+ {
+ t.HasComment("项目标准 - 病灶器官表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.DataInspection", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BatchId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("批次Id");
+
+ b.Property("ChildrenTypeId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("子类");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateUserName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("创建人姓名");
+
+ b.Property("CreateUserRealName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("DoctorUserId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("阅片医生");
+
+ b.Property("EntityName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("被稽查实体名");
+
+ b.Property("GeneralId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("要稽查对象Id");
+
+ b.Property("IP")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Identification")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("标识");
+
+ b.Property("IsFrontAdd")
+ .HasColumnType("bit")
+ .HasComment("是否是前端添加");
+
+ b.Property("IsSign")
+ .HasColumnType("bit");
+
+ b.Property("JsonDetail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastJsonDetail")
+ .HasColumnType("nvarchar(max)")
+ .HasComment("上一条json");
+
+ b.Property("ModuleTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectRelationParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("被稽查对象外键1");
+
+ b.Property("ObjectRelationParentId2")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectRelationParentId3")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OptTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("父ID");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("RoleName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("角色名称");
+
+ b.Property("SignId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectVisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property