@@ -602,9 +602,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
[JsonIgnore]
|
||||
public List<SubjectUserView> DoctorUserList { get; set; }
|
||||
|
||||
public List<SubjectUserView> PreviousDoctorUserList => DoctorUserList.Where(t => t.OrignalSubjectUserId != null).ToList();
|
||||
public List<SubjectUserView> PreviousDoctorUserList => DoctorUserList.Where(t => t.ReplacedSubjectUserId != null).ToList();
|
||||
|
||||
public List<SubjectUserView> NowDoctorUserList => DoctorUserList.Where(t => t.OrignalSubjectUserId == null).ToList();
|
||||
public List<SubjectUserView> NowDoctorUserList => DoctorUserList.Where(t => t.ReplacedSubjectUserId == null).ToList();
|
||||
|
||||
|
||||
|
||||
@@ -622,7 +622,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||
public bool IsConfirmed { get; set; }
|
||||
|
||||
//该属性有值 说明该医生被替换了 分配的时候 要过滤掉
|
||||
public Guid? OrignalSubjectUserId { get; set; }
|
||||
public Guid? ReplacedSubjectUserId { get; set; }
|
||||
|
||||
public UserSimpleInfo DoctorUser { get; set; }
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
foreach (var subjectGroup in needGenerateVisit.GroupBy(t => t.SubjectId).Select(g => new { SubjectId = g.Key, SubjectVisitList = g.ToList() }))
|
||||
{
|
||||
var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectGroup.SubjectId && t.OrignalSubjectUserId == null && t.IsConfirmed).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync();
|
||||
var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectGroup.SubjectId && t.ReplacedSubjectUserId == null && t.IsConfirmed).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync();
|
||||
|
||||
|
||||
|
||||
@@ -632,7 +632,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
{
|
||||
|
||||
var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.OrignalSubjectUserId == null && t.IsConfirmed).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync();
|
||||
var assignConfigList = await _subjectUserRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.ReplacedSubjectUserId == null && t.IsConfirmed).Select(u => new { u.DoctorUserId, u.ArmEnum }).ToListAsync();
|
||||
|
||||
var isNeedClinicalDataSign = IsNeedClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionConfig.TrialReadingCriterionId, clinicalDataConfirmList);
|
||||
var isClinicalDataSign = IsClinicalDataSign(ReadingCategory.Visit, subjectVisit.IsBaseLine, trialReadingCriterionConfig.TrialReadingCriterionId, clinicalDataConfirmList, subjectVisit.Id, trialId);
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
{
|
||||
foreach (var doctorArm in command.DoctorArmList)
|
||||
{
|
||||
if (!await _subjectUserRepository.Where(t => t.TrialReadingCriterionId == command.TrialReadingCriterionId).AnyAsync(t => t.SubjectId == subjectId && t.DoctorUserId == doctorArm.DoctorUserId && t.ArmEnum == doctorArm.ArmEnum && t.IsConfirmed && t.OrignalSubjectUserId == null))
|
||||
if (!await _subjectUserRepository.Where(t => t.TrialReadingCriterionId == command.TrialReadingCriterionId).AnyAsync(t => t.SubjectId == subjectId && t.DoctorUserId == doctorArm.DoctorUserId && t.ArmEnum == doctorArm.ArmEnum && t.IsConfirmed && t.ReplacedSubjectUserId == null))
|
||||
{
|
||||
await _subjectUserRepository.AddAsync(new SubjectUser() { TrialId = command.TrialId, TrialReadingCriterionId = command.TrialReadingCriterionId, ArmEnum = doctorArm.ArmEnum, DoctorUserId = doctorArm.DoctorUserId, SubjectId = subjectId, AssignTime = DateTime.Now });
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
/// <returns></returns>
|
||||
public async Task<(List<SubjectUserDTO>, object)> GetSubjectAssignedDoctorList(Guid subjectId, Guid trialReadingCriterionId)
|
||||
{
|
||||
var list = await _subjectUserRepository.Where(t => t.SubjectId == subjectId && t.OrignalSubjectUserId == null && t.IsConfirmed && t.TrialReadingCriterionId == trialReadingCriterionId).ProjectTo<SubjectUserDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var list = await _subjectUserRepository.Where(t => t.SubjectId == subjectId && t.ReplacedSubjectUserId == null && t.IsConfirmed && t.TrialReadingCriterionId == trialReadingCriterionId).ProjectTo<SubjectUserDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == trialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsReadingTaskViewInOrder, x.ReadingType, x.IsGlobalReading, x.IsOncologyReading, x.IsArbitrationReading }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
@@ -479,13 +479,13 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
var armEnum = assginSubjectDoctorCommand.DoctorUserIdArmList.Where(t => t.DoctorUserId == doctorUserId).First().ArmEnum;
|
||||
|
||||
|
||||
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum != armEnum && t.OrignalSubjectUserId == null))
|
||||
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum != armEnum && t.ReplacedSubjectUserId == null))
|
||||
{
|
||||
//---有Subject 在其他Arm组已有该医生,不允许在新的组添加该医生
|
||||
throw new BusinessValidationFailedException(_localizer["VisitTask_InconsistentSubjectStatus"]);
|
||||
}
|
||||
|
||||
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum == armEnum && t.OrignalSubjectUserId == null))
|
||||
if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum == armEnum && t.ReplacedSubjectUserId == null))
|
||||
{
|
||||
//---有Subject 已有该Arm组的医生,不允许继续分配,请刷新页面,确认页面数据是否过期
|
||||
throw new BusinessValidationFailedException(_localizer["VisitTask_DuplicateDoctorInArm"]);
|
||||
@@ -568,11 +568,11 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
//将关系确认
|
||||
if (assignConfirmCommand.SubjectDoctorUserList.Count == 0)
|
||||
{
|
||||
await _subjectUserRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.IsConfirmed == false && t.OrignalSubjectUserId == null, u => new SubjectUser() { IsConfirmed = true });
|
||||
await _subjectUserRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.IsConfirmed == false && t.ReplacedSubjectUserId == null, u => new SubjectUser() { IsConfirmed = true });
|
||||
}
|
||||
else
|
||||
{
|
||||
await _subjectUserRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.IsConfirmed == false && t.OrignalSubjectUserId == null
|
||||
await _subjectUserRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == trialId && t.IsConfirmed == false && t.ReplacedSubjectUserId == null
|
||||
&& subjectIdList.Contains(t.SubjectId), u => new SubjectUser() { IsConfirmed = true });
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
||||
|
||||
if (assignConfirmCommand.SubjectDoctorUserList.Count == 0)
|
||||
{
|
||||
subjectDoctorIdArmList = _subjectUserRepository.Where(t => t.SubjectId == subjectId && t.OrignalSubjectUserId == null).Select(t => new DoctorArm() { DoctorUserId = t.DoctorUserId, ArmEnum = t.ArmEnum }).ToList();
|
||||
subjectDoctorIdArmList = _subjectUserRepository.Where(t => t.SubjectId == subjectId && t.ReplacedSubjectUserId == null).Select(t => new DoctorArm() { DoctorUserId = t.DoctorUserId, ArmEnum = t.ArmEnum }).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user