修改任务查询
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
f6612286d9
commit
988bf0e92c
|
@ -424,11 +424,11 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetOrderReadingIQueryable(IRaCIS.Core.Application.ViewModel.GetOrderReadingIQueryableInDto)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetSubjectReadingIQueryable(IRaCIS.Core.Application.ViewModel.GetReadingIQueryableInDto)">
|
||||
<summary>
|
||||
获取有序阅片IQuery对象
|
||||
获取subject有序 或者无序阅片IQuery对象
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Allocation.VisitTaskService.GetIRHaveReadTaskList(IRaCIS.Core.Application.ViewModel.VisitTaskQuery)">
|
||||
|
|
|
@ -370,7 +370,7 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
}
|
||||
|
||||
|
||||
public class GetOrderReadingIQueryableInDto
|
||||
public class GetReadingIQueryableInDto:PageInput
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
|
@ -380,8 +380,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public string? SubjectCode { get; set; } = null;
|
||||
|
||||
public PageInput? Page { get; set; } = null;
|
||||
|
||||
}
|
||||
|
||||
public class VisitTaskQuery : PageInput
|
||||
|
|
|
@ -16,6 +16,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
Task<IResponseOutput> ConfirmReReading(ConfirmReReadingCommand agreeReReadingCommand, [FromServices] IVisitTaskHelpeService _visitTaskCommonService);
|
||||
|
||||
Task<(int, List<IRUnReadSubjectView>)> GetOrderReadingIQueryable(GetOrderReadingIQueryableInDto inDto);
|
||||
Task<PageOutput<IRUnReadSubjectView>> GetSubjectReadingIQueryable(GetReadingIQueryableInDto inDto);
|
||||
}
|
||||
}
|
|
@ -958,42 +958,22 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
var isReadingTaskViewInOrder = criterionConfig.IsReadingTaskViewInOrder;
|
||||
|
||||
#region 按照Subject 维度
|
||||
if (isReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
if (isReadingTaskViewInOrder == ReadingOrder.InOrder || isReadingTaskViewInOrder == ReadingOrder.SubjectRandom)
|
||||
{
|
||||
|
||||
|
||||
var visitTaskListInfo = await GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto()
|
||||
var result = await GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
|
||||
{
|
||||
TrialId = trialId,
|
||||
TrialReadingCriterionId = trialReadingCriterionId,
|
||||
SubjectCode = inQuery.SubjectCode,
|
||||
Page = new PageInput()
|
||||
{
|
||||
|
||||
PageIndex = inQuery.PageIndex,
|
||||
PageSize = inQuery.PageSize,
|
||||
Asc = inQuery.Asc,
|
||||
SortField = inQuery.SortField,
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
var totalCount = visitTaskListInfo.Item1;
|
||||
var currentPageData = visitTaskListInfo.Item2;
|
||||
|
||||
|
||||
|
||||
var result = new PageOutput<IRUnReadSubjectView>()
|
||||
{
|
||||
PageSize = inQuery.PageSize,
|
||||
PageIndex = inQuery.PageIndex,
|
||||
TotalCount = totalCount,
|
||||
CurrentPageData = currentPageData,
|
||||
};
|
||||
|
||||
// 封装的方法有问题
|
||||
//var result = await visitQuery.ToPagedListAsync(iRUnReadSubjectQuery.PageIndex, iRUnReadSubjectQuery.PageSize, String.IsNullOrEmpty(iRUnReadSubjectQuery.SortField) ? nameof(IRUnReadSubjectView.SubjectId) : iRUnReadSubjectQuery.SortField, iRUnReadSubjectQuery.Asc);
|
||||
return ResponseOutput.Ok(result, new
|
||||
{
|
||||
RandomReadInfo = new IRUnReadOutDto(),
|
||||
|
@ -1006,69 +986,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
CriterionType = criterionConfig.CriterionType,
|
||||
});
|
||||
}
|
||||
else if(isReadingTaskViewInOrder == ReadingOrder.SubjectRandom)
|
||||
{
|
||||
var critrion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
|
||||
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
||||
|
||||
.WhereIf(!string.IsNullOrEmpty(subjectCode), t => (t.Subject.Code.Contains(subjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(subjectCode!) && t.IsAnalysisCreate));
|
||||
|
||||
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
||||
|
||||
var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView()
|
||||
{
|
||||
SubjectId = x.Key.SubjectId,
|
||||
SubjectCode = x.Key.BlindSubjectCode == string.Empty ? x.Key.Code : x.Key.BlindSubjectCode,
|
||||
|
||||
SuggesteFinishedTime = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Min(x => x.SuggesteFinishedTime),
|
||||
|
||||
//未读任务量
|
||||
UnReadCanReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
UrgentCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Where(x => x.IsUrgent).Count(),
|
||||
|
||||
//已读任务量
|
||||
HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
ExistReadingApply = x.Any(y => (y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed && y.TrialReadingCriterionId == trialReadingCriterionId) || y.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed),
|
||||
|
||||
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
.OrderBy(x => x.VisitTaskNum)
|
||||
.Select(u => new IRUnreadTaskView()
|
||||
{
|
||||
Id = u.Id,
|
||||
IsUrgent = u.IsUrgent,
|
||||
VisitNum = u.VisitTaskNum,
|
||||
TaskBlindName = u.TaskBlindName,
|
||||
VisistId = u.SourceSubjectVisitId,
|
||||
SuggesteFinishedTime = u.SuggesteFinishedTime,
|
||||
ReadingCategory = u.ReadingCategory,
|
||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||
ArmEnum = u.ArmEnum,
|
||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
||||
})
|
||||
.ToList()
|
||||
}).Where(x => x.UnReadCanReadTaskCount > 0);
|
||||
|
||||
var pageList = await visitTaskQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField)? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inQuery.SortField, inQuery.Asc );
|
||||
|
||||
|
||||
return ResponseOutput.Ok(pageList, new
|
||||
{
|
||||
RandomReadInfo = new IRUnReadOutDto(),
|
||||
IsReadingTaskViewInOrder = isReadingTaskViewInOrder,
|
||||
ReadingTool = readingTool,
|
||||
IseCRFShowInDicomReading = criterionConfig.IseCRFShowInDicomReading,
|
||||
IsReadingShowSubjectInfo = criterionConfig.IsReadingShowSubjectInfo,
|
||||
IsReadingShowPreviousResults = criterionConfig.IsReadingShowPreviousResults,
|
||||
DigitPlaces = criterionConfig.DigitPlaces,
|
||||
CriterionType = criterionConfig.CriterionType,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId)
|
||||
|
@ -1114,21 +1032,23 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取有序阅片IQuery对象
|
||||
/// 获取subject有序 或者无序阅片IQuery对象
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<(int, List<IRUnReadSubjectView>)> GetOrderReadingIQueryable(GetOrderReadingIQueryableInDto inDto)
|
||||
public async Task<PageOutput<IRUnReadSubjectView>> GetSubjectReadingIQueryable(GetReadingIQueryableInDto inQuery)
|
||||
{
|
||||
var trialReadingCriterionId = inDto.TrialReadingCriterionId;
|
||||
|
||||
var trialReadingCriterionId = inQuery.TrialReadingCriterionId;
|
||||
var subjectCode = inQuery.SubjectCode;
|
||||
var trialId = inQuery.TrialId;
|
||||
|
||||
var critrion = await _trialReadingCriterionRepository.FindAsync(trialReadingCriterionId);
|
||||
|
||||
if (critrion.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
||||
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
||||
|
||||
.WhereIf(inDto.SubjectId!=null,x=>x.SubjectId==inDto.SubjectId)
|
||||
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
||||
//前序 不存在 未生成任务的访视
|
||||
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
||||
|
||||
|
@ -1140,7 +1060,7 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
//满足前序访视不存在 需要签署但是未签署 sql 相当复杂 同时想查询所有未读的统计数字 就无法统计 byzhouhang
|
||||
//但是加字段 IsFrontTaskNeedSignButNotSign 那么签名临床数据的时候,要对该subject 该标准的有效的任务 这个字段需要在签名的时候维护 采取这种方式 统计数字灵活
|
||||
//.Where(t => t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum))
|
||||
.WhereIf(!string.IsNullOrEmpty(inDto.SubjectCode), t => (t.Subject.Code.Contains(inDto.SubjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inDto.SubjectCode!) && t.IsAnalysisCreate));
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode!) && t.IsAnalysisCreate));
|
||||
|
||||
|
||||
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
||||
|
@ -1222,22 +1142,78 @@ namespace IRaCIS.Core.Application.Service.Allocation
|
|||
|
||||
var result = new List<IRUnReadSubjectView>();
|
||||
|
||||
var propName = string.IsNullOrWhiteSpace(inDto.Page!.SortField) ? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inDto.Page.SortField;
|
||||
var propName = string.IsNullOrWhiteSpace(inQuery!.SortField) ? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inQuery.SortField;
|
||||
|
||||
var visitTaskOrderQuery = inQuery.Asc ? visitTaskQuery.OrderBy(propName) : visitTaskQuery.OrderBy(propName + " desc");
|
||||
|
||||
|
||||
|
||||
var visitTaskOrderQuery = inDto.Page.Asc ? visitTaskQuery.OrderBy(propName) : visitTaskQuery.OrderBy(propName + " desc");
|
||||
if (inDto.Page != null)
|
||||
{
|
||||
result = await visitTaskOrderQuery
|
||||
.Skip((inDto.Page.PageIndex - 1) * inDto.Page.PageSize)
|
||||
.Take(inDto.Page.PageSize).ToListAsync();
|
||||
.Skip((inQuery.PageIndex - 1) * inQuery.PageSize)
|
||||
.Take(inQuery.PageSize).ToListAsync();
|
||||
|
||||
|
||||
return new PageOutput<IRUnReadSubjectView>()
|
||||
{
|
||||
PageSize = inQuery.PageSize,
|
||||
PageIndex = inQuery.PageIndex,
|
||||
TotalCount = count,
|
||||
CurrentPageData = result,
|
||||
};
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
result = await visitTaskOrderQuery.ToListAsync();
|
||||
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
||||
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(subjectCode), t => (t.Subject.Code.Contains(subjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(subjectCode!) && t.IsAnalysisCreate));
|
||||
|
||||
var visitGroupQuery = visitQuery.GroupBy(x => new { x.SubjectId, x.Subject.Code, x.BlindSubjectCode });
|
||||
|
||||
var visitTaskQuery = visitGroupQuery.Select(x => new IRUnReadSubjectView()
|
||||
{
|
||||
SubjectId = x.Key.SubjectId,
|
||||
SubjectCode = x.Key.BlindSubjectCode == string.Empty ? x.Key.Code : x.Key.BlindSubjectCode,
|
||||
|
||||
SuggesteFinishedTime = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Min(x => x.SuggesteFinishedTime),
|
||||
|
||||
//未读任务量
|
||||
UnReadCanReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
UrgentCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Where(x => x.IsUrgent).Count(),
|
||||
|
||||
//已读任务量
|
||||
HaveReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||
|
||||
ExistReadingApply = x.Any(y => (y.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed && y.TrialReadingCriterionId == trialReadingCriterionId) || y.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed),
|
||||
|
||||
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
.OrderBy(x => x.VisitTaskNum)
|
||||
.Select(u => new IRUnreadTaskView()
|
||||
{
|
||||
Id = u.Id,
|
||||
IsUrgent = u.IsUrgent,
|
||||
VisitNum = u.VisitTaskNum,
|
||||
TaskBlindName = u.TaskBlindName,
|
||||
VisistId = u.SourceSubjectVisitId,
|
||||
SuggesteFinishedTime = u.SuggesteFinishedTime,
|
||||
ReadingCategory = u.ReadingCategory,
|
||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||
ArmEnum = u.ArmEnum,
|
||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||
IsFrontTaskNeedSignButNotSign = u.IsFrontTaskNeedSignButNotSign
|
||||
})
|
||||
.ToList()
|
||||
}).Where(x => x.UnReadCanReadTaskCount > 0);
|
||||
|
||||
var pageList = await visitTaskQuery.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) : inQuery.SortField, inQuery.Asc);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
return (count, result);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -194,10 +194,10 @@ namespace IRaCIS.Application.Services
|
|||
TaskBlindName = x.VisitTask.TaskBlindName
|
||||
}).ToListAsync();
|
||||
}
|
||||
else if(inDto.VisitTaskId!=null&&inDto.QuestionType!=null)
|
||||
else if (inDto.VisitTaskId != null && inDto.QuestionType != null)
|
||||
{
|
||||
var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(inDto.VisitTaskId.Value);
|
||||
var visitTaskIds = taskInfoList.Where(x=>x.VisitTaskId!= inDto.VisitTaskId.Value).Select(x => x.VisitTaskId).ToList();
|
||||
var visitTaskIds = taskInfoList.Where(x => x.VisitTaskId != inDto.VisitTaskId.Value).Select(x => x.VisitTaskId).ToList();
|
||||
result = await _readingTaskQuestionMarkRepository.Where(x => x.ReadingQuestionTrial.QuestionType == inDto.QuestionType && visitTaskIds.Contains(x.VisitTaskId))
|
||||
|
||||
.OrderBy(x => x.VisitTask.VisitTaskNum).Select(x => new GetPreviousOtherPicturePathOutDto()
|
||||
|
@ -245,7 +245,7 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<List<ReadingCustomTagDto>> GetCustomTag(GetCustomTagInDto inQuery)
|
||||
{
|
||||
var result= await _readingCustomTagRepository.Where(x => x.VisitTaskId == inQuery.VisitTaskId).ProjectTo<ReadingCustomTagDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var result = await _readingCustomTagRepository.Where(x => x.VisitTaskId == inQuery.VisitTaskId).ProjectTo<ReadingCustomTagDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -270,9 +270,9 @@ namespace IRaCIS.Application.Services
|
|||
return await _trialDocumentRepository.Where(x => x.TrialId == inDto.TrialId
|
||||
&& x.TrialDocConfirmedUserList.Any(y => y.ConfirmUserId == _userInfo.Id && y.ConfirmTime != null)
|
||||
&& x.NeedConfirmedUserTypeList.Any(y => y.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.WhereIf(userType== UserTypeEnum.IndependentReviewer, t => t.FileType.Code == "2" || t.FileType.Code == "6")
|
||||
.WhereIf(userType == UserTypeEnum.IndependentReviewer, t => t.FileType.Code == "2" || t.FileType.Code == "6")
|
||||
.WhereIf(userType == UserTypeEnum.IQC, t => t.FileType.Code == "4" || t.FileType.Code == "5")
|
||||
.WhereIf(!canViewUserType.Contains(userType),t=>false)
|
||||
.WhereIf(!canViewUserType.Contains(userType), t => false)
|
||||
.IgnoreQueryFilters()
|
||||
.Select(x => new GetManualListOutDto()
|
||||
{
|
||||
|
@ -590,20 +590,20 @@ namespace IRaCIS.Application.Services
|
|||
taskQuery = _visitTaskRepository.Where(x => taskInfo.RelatedVisitTaskIdList.Contains(x.Id) || x.Id == taskInfo.Id);
|
||||
}
|
||||
|
||||
var result = await taskQuery.Include(x=>x.Subject).OrderBy(x => x.VisitTaskNum).ThenBy(x => x.TaskState)
|
||||
var result = await taskQuery.Include(x => x.Subject).OrderBy(x => x.VisitTaskNum).ThenBy(x => x.TaskState)
|
||||
.Select(x => new GetRelatedVisitTaskOutDto()
|
||||
{
|
||||
TaskBlindName = x.TaskBlindName,
|
||||
TaskName = x.TaskName,
|
||||
ReadingTaskState = x.ReadingTaskState,
|
||||
VisitId = x.SourceSubjectVisitId,
|
||||
SubjectCode=x.Subject.Code,
|
||||
SubjectCode = x.Subject.Code,
|
||||
VisitTaskId = x.Id,
|
||||
VisitTaskNum = x.VisitTaskNum,
|
||||
IsBaseLineTask = x.SourceSubjectVisitId == baselineVisitId,
|
||||
IsCurrentTask = x.Id == inDto.VisitTaskId,
|
||||
IsConvertedTask=x.IsConvertedTask,
|
||||
IsFirstChangeTask=x.BeforeConvertedTaskId!=null,
|
||||
IsConvertedTask = x.IsConvertedTask,
|
||||
IsFirstChangeTask = x.BeforeConvertedTaskId != null,
|
||||
|
||||
}).ToListAsync();
|
||||
|
||||
|
@ -617,7 +617,7 @@ namespace IRaCIS.Application.Services
|
|||
var visitaskIds = result.Select(x => x.VisitTaskId).ToList();
|
||||
|
||||
var otherStudys = await _readingTableAnswerRowInfoRepository.Where(x => visitaskIds.Contains(x.VisitTaskId))
|
||||
.Where(x=>x.CTSeriesId!=null&&x.PTSeriesId!=null)
|
||||
.Where(x => x.CTSeriesId != null && x.PTSeriesId != null)
|
||||
.Select(x => new
|
||||
{
|
||||
x.OtherStudyId,
|
||||
|
@ -693,8 +693,8 @@ namespace IRaCIS.Application.Services
|
|||
VisitTaskId = x.Id,
|
||||
TaskBlindName = x.TaskBlindName,
|
||||
TaskName = x.TaskName,
|
||||
ReadModuleVisitId= x.ReadModule!=null?x.ReadModule.SubjectVisitId:null,
|
||||
VisitName = x.SourceSubjectVisit!=null? x.SourceSubjectVisit.VisitName: x.ReadModule==null?string.Empty: x.ReadModule.SubjectVisit.VisitName,
|
||||
ReadModuleVisitId = x.ReadModule != null ? x.ReadModule.SubjectVisitId : null,
|
||||
VisitName = x.SourceSubjectVisit != null ? x.SourceSubjectVisit.VisitName : x.ReadModule == null ? string.Empty : x.ReadModule.SubjectVisit.VisitName,
|
||||
VisitBlindName = x.TaskBlindName,
|
||||
VisitTaskNum = x.VisitTaskNum,
|
||||
JudgeResultArm = x.JudgeResultTask == null ? null : x.JudgeResultTask.ArmEnum,
|
||||
|
@ -707,7 +707,7 @@ namespace IRaCIS.Application.Services
|
|||
if (item.ReadModuleVisitId != null)
|
||||
{
|
||||
item.VisitBlindName = (await _visitTaskRepository.Where(x => x.SourceSubjectVisitId == item.ReadModuleVisitId && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis &&
|
||||
x.IsAnalysisCreate == taskInfo.IsAnalysisCreate ).Select(x => x.TaskBlindName).FirstOrDefaultAsync())??string.Empty;
|
||||
x.IsAnalysisCreate == taskInfo.IsAnalysisCreate).Select(x => x.TaskBlindName).FirstOrDefaultAsync()) ?? string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -741,7 +741,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
VisitTaskId = visitTask.Id,
|
||||
SubjectId = visitTask.SubjectId,
|
||||
SubjectCode = visitTask.BlindSubjectCode.IsNullOrEmpty() ? subjectCode??string.Empty : visitTask.BlindSubjectCode,
|
||||
SubjectCode = visitTask.BlindSubjectCode.IsNullOrEmpty() ? subjectCode ?? string.Empty : visitTask.BlindSubjectCode,
|
||||
ReadingCategory = visitTask.ReadingCategory,
|
||||
TaskBlindName = visitTask.TaskBlindName,
|
||||
IsReadingShowPreviousResults = criterionInfo.IsReadingShowPreviousResults,
|
||||
|
@ -795,9 +795,9 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
|
||||
if (await _visitTaskRepository.AnyAsync(x => x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
|
||||
&&x.IsAnalysisCreate&&taskInfo.IsAnalysisCreate
|
||||
&&x.SubjectId== taskInfo.SubjectId&&x.TaskState==TaskState.Effect&&
|
||||
((x.ReReadingApplyState==ReReadingApplyState.DocotorHaveApplyed && x.DoctorUserId == taskInfo.DoctorUserId)|| x.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||
&& x.IsAnalysisCreate && taskInfo.IsAnalysisCreate
|
||||
&& x.SubjectId == taskInfo.SubjectId && x.TaskState == TaskState.Effect &&
|
||||
((x.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed && x.DoctorUserId == taskInfo.DoctorUserId) || x.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||
|
||||
))
|
||||
{
|
||||
|
@ -825,7 +825,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
//await AddDefaultValueToTask(inDto.VisitTaskId);
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||
var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id, inDto.QuestionClassify,inDto.GroupClassifyList);
|
||||
var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id, inDto.QuestionClassify, inDto.GroupClassifyList);
|
||||
|
||||
|
||||
|
||||
|
@ -854,7 +854,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
//排除表格问题
|
||||
var questions = await _readingQuestionTrialRepository
|
||||
.WhereIf(questionClassify!=null,x=>x.QuestionClassify== questionClassify)
|
||||
.WhereIf(questionClassify != null, x => x.QuestionClassify == questionClassify)
|
||||
.WhereIf(criterionIdInfo.IseCRFShowInDicomReading, x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table)
|
||||
.WhereIf(!criterionIdInfo.IseCRFShowInDicomReading, x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table)
|
||||
|
||||
|
@ -892,7 +892,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
questions.ForEach(x =>
|
||||
{
|
||||
x.IsFirstChangeTask =true;
|
||||
x.IsFirstChangeTask = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -910,7 +910,7 @@ namespace IRaCIS.Application.Services
|
|||
var groupids = questions.Where(x => x.Type != ReadingQestionType.Group).Select(x => x.GroupId).ToList();
|
||||
|
||||
var result = questions.Where(x => x.Type == ReadingQestionType.Group && groupids.Contains(x.Id))
|
||||
.WhereIf(groupClassifyList!=null,x=>x.GroupClassify!=null&& groupClassifyList!=null&& groupClassifyList.Contains(x.GroupClassify.Value))
|
||||
.WhereIf(groupClassifyList != null, x => x.GroupClassify != null && groupClassifyList != null && groupClassifyList.Contains(x.GroupClassify.Value))
|
||||
.ToList();
|
||||
|
||||
foreach (var item in result)
|
||||
|
@ -972,7 +972,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo<VisitTaskDto>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||
|
||||
if (taskInfo.IsConvertedTask &&taskInfo.BeforeConvertedTaskId!=null)
|
||||
if (taskInfo.IsConvertedTask && taskInfo.BeforeConvertedTaskId != null)
|
||||
{
|
||||
result.ForEach(x =>
|
||||
{
|
||||
|
@ -990,7 +990,8 @@ namespace IRaCIS.Application.Services
|
|||
var questionMark = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ProjectTo<GetTableAnswerRowInfoOutDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
questionMark.ForEach(x => {
|
||||
questionMark.ForEach(x =>
|
||||
{
|
||||
|
||||
x.IsFirstChangeTask = x.VisitTaskId == inDto.VisitTaskId;
|
||||
});
|
||||
|
@ -1040,7 +1041,7 @@ namespace IRaCIS.Application.Services
|
|||
TableAnswers = tableAnswers,
|
||||
TableAnsweRowInfos = tableAnsweRowInfos,
|
||||
OrganInfos = organList,
|
||||
QuestionClassify=inDto.QuestionClassify,
|
||||
QuestionClassify = inDto.QuestionClassify,
|
||||
}
|
||||
|
||||
|
||||
|
@ -1051,7 +1052,7 @@ namespace IRaCIS.Application.Services
|
|||
result.PublicPage = questionPage.PublicPage;
|
||||
result.BlindName = visitTaskInfo.TaskBlindName;
|
||||
result.TaskNum = visitTaskInfo.VisitTaskNum;
|
||||
result.QuestionMarkInfoList=await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ProjectTo<QuestionMarkInfo>(_mapper.ConfigurationProvider)
|
||||
result.QuestionMarkInfoList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ProjectTo<QuestionMarkInfo>(_mapper.ConfigurationProvider)
|
||||
.ToListAsync();
|
||||
var spleenLength = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefaultAsync();
|
||||
|
||||
|
@ -1060,7 +1061,7 @@ namespace IRaCIS.Application.Services
|
|||
readingTaskState = visitTaskInfo.ReadingTaskState,
|
||||
FormType = criterionInfo.FormType,
|
||||
TaskNum = visitTaskInfo.VisitTaskNum,
|
||||
SpleenLength= spleenLength,
|
||||
SpleenLength = spleenLength,
|
||||
|
||||
}); ;
|
||||
}
|
||||
|
@ -1096,7 +1097,7 @@ namespace IRaCIS.Application.Services
|
|||
TableAnsweRowInfos = tableAnsweRowInfos,
|
||||
IsGetallQuestion = true,
|
||||
OrganInfos = organList,
|
||||
QuestionClassify=inDto.QuestionClassify,
|
||||
QuestionClassify = inDto.QuestionClassify,
|
||||
|
||||
}
|
||||
), new
|
||||
|
@ -1118,7 +1119,7 @@ namespace IRaCIS.Application.Services
|
|||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
|
||||
|
||||
var qusetionList = await _readingQuestionTrialRepository
|
||||
.WhereIf(inDto.QuestionClassify!=null,x=>x.QuestionClassify==inDto.QuestionClassify)
|
||||
.WhereIf(inDto.QuestionClassify != null, x => x.QuestionClassify == inDto.QuestionClassify)
|
||||
.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId).ProjectTo<TrialReadQuestionData>(_mapper.ConfigurationProvider, new
|
||||
{
|
||||
|
||||
|
@ -1173,7 +1174,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
|
||||
|
||||
if (inDto.TaskId != null )
|
||||
if (inDto.TaskId != null)
|
||||
{
|
||||
if (taskInfo.IsConvertedTask)
|
||||
{
|
||||
|
@ -1246,18 +1247,18 @@ namespace IRaCIS.Application.Services
|
|||
&& x.VisitTaskNum < taskInfo.VisitTaskNum
|
||||
&& x.ArmEnum == taskInfo.ArmEnum
|
||||
&& x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId
|
||||
&& x.ReadingCategory == ReadingCategory.Visit)||x.Id==taskInfo.BeforeConvertedTaskId
|
||||
).OrderByDescending(x=>x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
&& x.ReadingCategory == ReadingCategory.Visit) || x.Id == taskInfo.BeforeConvertedTaskId
|
||||
).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
|
||||
if (criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.InOrder)
|
||||
{
|
||||
// 无序的话 不要查
|
||||
laskTaskId = Guid.NewGuid();
|
||||
}
|
||||
|
||||
lastTaskTableAnswer= await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == laskTaskId).Include(x => x.ReadingTableQuestionTrial).ToListAsync();
|
||||
lastTaskTableAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == laskTaskId).Include(x => x.ReadingTableQuestionTrial).ToListAsync();
|
||||
|
||||
|
||||
if (taskInfo.BeforeConvertedTaskId!=null )
|
||||
if (taskInfo.BeforeConvertedTaskId != null)
|
||||
{
|
||||
isFirstChangeTask = true;
|
||||
|
||||
|
@ -1326,7 +1327,7 @@ namespace IRaCIS.Application.Services
|
|||
/// <param name="isFirstChangeTask"></param>
|
||||
/// <param name="lastTaskTableAnswer"></param>
|
||||
/// <param name="TaskId"></param>
|
||||
private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos, List<OrganInfo> organInfos, List<ReadingTableQuestionAnswer> baseLineTableAnswer,bool isFirstChangeTask, List<ReadingTableQuestionAnswer> lastTaskTableAnswer,Guid? TaskId)
|
||||
private async void FindChildQuestion(TrialReadQuestionData item, List<TrialReadQuestionData> questionlists, List<TableQuestionTrial> tableQuestionLists, List<ReadingTableQuestionAnswerInfo> tableAnswers, List<TableAnsweRowInfo> tableAnsweRowInfos, List<OrganInfo> organInfos, List<ReadingTableQuestionAnswer> baseLineTableAnswer, bool isFirstChangeTask, List<ReadingTableQuestionAnswer> lastTaskTableAnswer, Guid? TaskId)
|
||||
{
|
||||
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (x.GroupId == item.Id && x.ParentId == null)).ToList();
|
||||
item.TableQuestions = new TrialReadTableQuestion();
|
||||
|
@ -1458,7 +1459,7 @@ namespace IRaCIS.Application.Services
|
|||
answers.Add("FromMark", rowInfo.FromMark);
|
||||
answers.Add("IsDicomReading", rowInfo.IsDicomReading.ToString());
|
||||
answers.Add("MeasureData", rowInfo == null ? string.Empty : rowInfo.MeasureData);
|
||||
answers.Add("OtherMeasureData", rowInfo == null|| rowInfo.OtherMeasureData==null ? string.Empty : rowInfo.OtherMeasureData.ToString());
|
||||
answers.Add("OtherMeasureData", rowInfo == null || rowInfo.OtherMeasureData == null ? string.Empty : rowInfo.OtherMeasureData.ToString());
|
||||
answers.Add("OtherStudyId", rowInfo == null || rowInfo.OtherStudyId == null ? string.Empty : rowInfo.OtherStudyId.ToString());
|
||||
answers.Add("OtherSeriesId", rowInfo == null || rowInfo.OtherSeriesId == null ? string.Empty : rowInfo.OtherSeriesId.ToString());
|
||||
answers.Add("OtherInstanceId", rowInfo == null || rowInfo.OtherInstanceId == null ? string.Empty : rowInfo.OtherInstanceId.ToString());
|
||||
|
@ -1466,11 +1467,11 @@ namespace IRaCIS.Application.Services
|
|||
answers.Add("OtherNumberOfFrames", rowInfo == null || rowInfo.OtherNumberOfFrames == null ? string.Empty : rowInfo.OtherNumberOfFrames.ToString());
|
||||
answers.Add("OtherMarkTool", rowInfo == null || rowInfo.OtherMarkTool == null ? string.Empty : rowInfo.OtherMarkTool.ToString());
|
||||
answers.Add("RowIndex", x.ToString());
|
||||
answers.Add("RowId", rowInfo==null?string.Empty: rowInfo.Id.ToString());
|
||||
answers.Add("RowId", rowInfo == null ? string.Empty : rowInfo.Id.ToString());
|
||||
answers.Add("MarkTool", rowInfo.MarkTool);
|
||||
answers.Add("StudyId", rowInfo.StudyId.ToString());
|
||||
answers.Add("OrganInfoId", rowInfo.OrganInfoId.ToString());
|
||||
answers.Add("IsFristAdd", (rowInfo.FristAddTaskId== TaskId).ToString());
|
||||
answers.Add("IsFristAdd", (rowInfo.FristAddTaskId == TaskId).ToString());
|
||||
answers.Add("IsCanEditPosition", rowInfo.IsCanEditPosition.ToString());
|
||||
answers.Add("InstanceId", rowInfo == null ? string.Empty : rowInfo.InstanceId.ToString());
|
||||
answers.Add("PTSeriesId", rowInfo == null ? string.Empty : rowInfo.PTSeriesId.ToString());
|
||||
|
@ -1479,7 +1480,7 @@ namespace IRaCIS.Application.Services
|
|||
answers.Add("IsCurrentTaskAdd", rowInfo == null ? false.ToString() : rowInfo.IsCurrentTaskAdd.ToString());
|
||||
answers.Add("SplitOrMergeLesionName", rowInfo == null ? string.Empty : rowInfo.SplitName.IsNullOrEmpty() ? rowInfo.MergeName : rowInfo.SplitName);
|
||||
answers.Add("SplitOrMergeType", rowInfo == null ? string.Empty : rowInfo.SplitOrMergeType == null ? string.Empty : ((int)rowInfo.SplitOrMergeType).ToString());
|
||||
answers.Add("LastTaskState", lastTaskTableAnswer.Where(n=>n.QuestionId== item.Id&&n.ReadingTableQuestionTrial.QuestionMark==QuestionMark.State&&n.RowIndex==x).Select(n=>n.Answer).FirstOrDefault()??string.Empty);
|
||||
answers.Add("LastTaskState", lastTaskTableAnswer.Where(n => n.QuestionId == item.Id && n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State && n.RowIndex == x).Select(n => n.Answer).FirstOrDefault() ?? string.Empty);
|
||||
answers.Add("LastTaskMajorAxis", lastTaskTableAnswer.Where(n => n.QuestionId == item.Id && n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis && n.RowIndex == x).Select(n => n.Answer).FirstOrDefault() ?? string.Empty);
|
||||
answers.Add("LastTaskShortAxis", lastTaskTableAnswer.Where(n => n.QuestionId == item.Id && n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.ShortAxis && n.RowIndex == x).Select(n => n.Answer).FirstOrDefault() ?? string.Empty);
|
||||
if (rowInfo.LesionType == LesionType.BaselineLesions)
|
||||
|
@ -1535,7 +1536,7 @@ namespace IRaCIS.Application.Services
|
|||
rowAnswer.SeriesId = null;
|
||||
rowAnswer.IsCurrentTaskAdd = true;
|
||||
rowAnswer.MeasureData = string.Empty;
|
||||
rowAnswer.OtherMeasureData =null;
|
||||
rowAnswer.OtherMeasureData = null;
|
||||
|
||||
List<QuestionMark?> needSaveMark = new List<QuestionMark?>()
|
||||
{
|
||||
|
@ -1596,7 +1597,7 @@ namespace IRaCIS.Application.Services
|
|||
};
|
||||
tableAnswers.ForEach(x =>
|
||||
{
|
||||
x.Answer = needSetNa.Contains(x.QuestionMark) ?"NA" :x.Answer;
|
||||
x.Answer = needSetNa.Contains(x.QuestionMark) ? "NA" : x.Answer;
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
@ -1630,17 +1631,17 @@ namespace IRaCIS.Application.Services
|
|||
Answer = TargetState.Loss.GetEnumInt(),
|
||||
});
|
||||
|
||||
await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => inDto.MergeRowIdList.Contains(x.RowId) &&( x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis || x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.ShortAxis), x => new ReadingTableQuestionAnswer()
|
||||
await _readingTableQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => inDto.MergeRowIdList.Contains(x.RowId) && (x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.MajorAxis || x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.ShortAxis), x => new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = "0",
|
||||
});
|
||||
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x=> inDto.MergeRowIdList.Contains(x.Id), x => new ReadingTableAnswerRowInfo()
|
||||
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x => inDto.MergeRowIdList.Contains(x.Id), x => new ReadingTableAnswerRowInfo()
|
||||
{
|
||||
MergeRowId=inDto.MergeMainRowId,
|
||||
MergeRowId = inDto.MergeMainRowId,
|
||||
SplitOrMergeType = SplitOrMergeType.Merge,
|
||||
}) ;
|
||||
});
|
||||
|
||||
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(inDto.MergeMainRowId, x => new ReadingTableAnswerRowInfo()
|
||||
{
|
||||
|
@ -1677,7 +1678,7 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task<List<GetCanMergeLesionOutDto>> GetCanMergeLesion(GetCanMergeLesionInDto inDto)
|
||||
{
|
||||
var rowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).Include(x=>x.ReadingQuestionTrial).FirstNotNullAsync();
|
||||
var rowinfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).Include(x => x.ReadingQuestionTrial).FirstNotNullAsync();
|
||||
|
||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == rowinfo.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
// 需要排除的状态
|
||||
|
@ -1685,7 +1686,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var query = _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == rowinfo.VisitTaskId && x.QuestionId == rowinfo.QuestionId && x.Id != rowinfo.Id)
|
||||
.Where(x => x.SplitOrMergeType != SplitOrMergeType.Split && x.SplitOrMergeType != SplitOrMergeType.SplitMain
|
||||
&&x.SplitOrMergeType!=SplitOrMergeType.Merge && x.SplitOrMergeType != SplitOrMergeType.MergeMain
|
||||
&& x.SplitOrMergeType != SplitOrMergeType.Merge && x.SplitOrMergeType != SplitOrMergeType.MergeMain
|
||||
&& x.SplitOrMergeType != SplitOrMergeType.Merged);
|
||||
|
||||
switch (taskInfo.TrialReadingCriterion.CriterionType)
|
||||
|
@ -1714,7 +1715,7 @@ namespace IRaCIS.Application.Services
|
|||
RowIndex = x.RowIndex,
|
||||
OrderMarkName = x.ReadingQuestionTrial.OrderMark + x.RowIndex.GetLesionMark(),
|
||||
OrganInfoId = x.OrganInfoId
|
||||
}).OrderBy(x=>x.RowIndex).ToListAsync();
|
||||
}).OrderBy(x => x.RowIndex).ToListAsync();
|
||||
|
||||
var organIds = result.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
|
||||
var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
|
||||
|
@ -1824,10 +1825,11 @@ namespace IRaCIS.Application.Services
|
|||
if (tumorAnswer != null)
|
||||
{
|
||||
var isConvertedTask = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.IsConvertedTask).FirstOrDefaultAsync();
|
||||
var reportVerify = await _readingCalculateService.GetReportVerify(new GetReportVerifyInDto() {
|
||||
BeforeConvertedTaskId= taskInfo.BeforeConvertedTaskId,
|
||||
IsConvertTask= isConvertedTask,
|
||||
VisitTaskId=inDto.VisitTaskId
|
||||
var reportVerify = await _readingCalculateService.GetReportVerify(new GetReportVerifyInDto()
|
||||
{
|
||||
BeforeConvertedTaskId = taskInfo.BeforeConvertedTaskId,
|
||||
IsConvertTask = isConvertedTask,
|
||||
VisitTaskId = inDto.VisitTaskId
|
||||
});
|
||||
|
||||
if (tumorAnswer.Answer == reportVerify.TumorEvaluate)
|
||||
|
@ -1883,14 +1885,14 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
PicturePath = string.Empty,
|
||||
MeasureData = string.Empty,
|
||||
}) ;
|
||||
});
|
||||
|
||||
await _readingTaskQuestionMarkRepository.BatchUpdateNoTrackingAsync(x =>
|
||||
(x.QuestionType == QuestionType.LiverSUVmax || x.QuestionType == QuestionType.MediastinumSUVmax) &&
|
||||
x.VisitTaskId == inDto.VisitTaskId && needDeleteMarkQuestonIds.Contains(x.QuestionId), x => new ReadingTaskQuestionMark()
|
||||
{
|
||||
OtherPicturePath = string.Empty,
|
||||
OtherMeasureData=string.Empty,
|
||||
OtherMeasureData = string.Empty,
|
||||
});
|
||||
|
||||
|
||||
|
@ -1899,7 +1901,8 @@ namespace IRaCIS.Application.Services
|
|||
var datetime = DateTime.Now;
|
||||
|
||||
var markList = _mapper.Map<List<QuestionMarkInfo>, List<ReadingTaskQuestionMark>>(inDto.QuestionMarkInfoList);
|
||||
markList.ForEach(x => {
|
||||
markList.ForEach(x =>
|
||||
{
|
||||
x.Id = NewId.NextGuid();
|
||||
x.VisitTaskId = inDto.VisitTaskId;
|
||||
x.CreateTime = datetime;
|
||||
|
@ -2083,7 +2086,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
IsChangeOtherTask = false,
|
||||
VisitTaskId = inDto.VisitTaskId,
|
||||
ComputationTrigger=ComputationTrigger.RemoveLesion,
|
||||
ComputationTrigger = ComputationTrigger.RemoveLesion,
|
||||
});
|
||||
|
||||
|
||||
|
@ -2444,7 +2447,7 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
else
|
||||
{
|
||||
await _readingTableAnswerRowInfoRepository.UpdateFromDTOAsync(inDto) ;
|
||||
await _readingTableAnswerRowInfoRepository.UpdateFromDTOAsync(inDto);
|
||||
|
||||
|
||||
foreach (var item in inDto.AnswerList)
|
||||
|
@ -2629,9 +2632,9 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
// 转化后的任务不应该有新病灶
|
||||
|
||||
var isConvertedTask = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x=>x.IsConvertedTask).FirstNotNullAsync();
|
||||
var isConvertedTask = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.IsConvertedTask).FirstNotNullAsync();
|
||||
|
||||
if (isConvertedTask&&(await _readingTableAnswerRowInfoRepository.AnyAsync(x => x.ReadingQuestionTrial.LesionType == LesionType.NewLesions && x.VisitTaskId == inDto.VisitTaskId)))
|
||||
if (isConvertedTask && (await _readingTableAnswerRowInfoRepository.AnyAsync(x => x.ReadingQuestionTrial.LesionType == LesionType.NewLesions && x.VisitTaskId == inDto.VisitTaskId)))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NotNewFocus"]);
|
||||
}
|
||||
|
@ -2741,16 +2744,14 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
else if (inDto.SubjectId != null && trialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||
{
|
||||
var subjectTaskList = (await _visitTaskService.GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto()
|
||||
var subjectTaskList = (await _visitTaskService.GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
|
||||
{
|
||||
TrialId = inDto.TrialId,
|
||||
TrialReadingCriterionId = trialReadingCriterionId!.Value,
|
||||
Page = new PageInput()
|
||||
{
|
||||
PageIndex = 1,
|
||||
PageSize = 99999,
|
||||
}
|
||||
})).Item2;
|
||||
|
||||
})).CurrentPageData;
|
||||
|
||||
var index = 0;
|
||||
subjectTaskList.ForEach(x =>
|
||||
|
@ -2786,17 +2787,16 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
else if (inDto.SubjectId != null && trialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom)
|
||||
{
|
||||
var subjectTaskList = (await _visitTaskService.GetOrderReadingIQueryable(new GetOrderReadingIQueryableInDto()
|
||||
var subjectTaskList = (await _visitTaskService.GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
|
||||
{
|
||||
TrialId = inDto.TrialId,
|
||||
SubjectId=inDto.SubjectId,
|
||||
SubjectId = inDto.SubjectId,
|
||||
TrialReadingCriterionId = trialReadingCriterionId!.Value,
|
||||
Page = new PageInput()
|
||||
{
|
||||
|
||||
PageIndex = 1,
|
||||
PageSize = 99999,
|
||||
}
|
||||
})).Item2;
|
||||
|
||||
})).CurrentPageData;
|
||||
|
||||
if (subjectTaskList.Count() == 0)
|
||||
{
|
||||
|
@ -2812,9 +2812,7 @@ namespace IRaCIS.Application.Services
|
|||
skipcount = random.Next(0, count - 1);
|
||||
}
|
||||
|
||||
var visitTaskId= taskList.Skip(skipcount).FirstOrDefault();
|
||||
|
||||
|
||||
var visitTaskId = taskList.Skip(skipcount).FirstOrDefault();
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -2951,7 +2949,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
return;
|
||||
}
|
||||
var startReadingTimeKey = _userInfo.Id.ToString()+ "StartReadingTime";
|
||||
var startReadingTimeKey = _userInfo.Id.ToString() + "StartReadingTime";
|
||||
var startRestTimeKey = _userInfo.Id.ToString() + "StartRestTime";
|
||||
|
||||
int readingMinute = 120; // 为60整数
|
||||
|
@ -2968,7 +2966,7 @@ namespace IRaCIS.Application.Services
|
|||
int timespanMin = (DateTime.Now - cacheStartRestTime).Minutes;
|
||||
if (timespanMin <= restMinute)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", readingMinute/60m, restMinute]);
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", readingMinute / 60m, restMinute]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3003,7 +3001,7 @@ namespace IRaCIS.Application.Services
|
|||
[HttpPost]
|
||||
public async Task ResetReadingRestTime(Guid? userID)
|
||||
{
|
||||
if(userID == null)
|
||||
if (userID == null)
|
||||
{
|
||||
userID = _userInfo.Id;
|
||||
}
|
||||
|
@ -3048,9 +3046,9 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
bool isConverted = false;
|
||||
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x=>x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
|
||||
var isConvertedTask=await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(x=>x.IsConvertedTask).FirstNotNullAsync();
|
||||
var isConvertedTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(x => x.IsConvertedTask).FirstNotNullAsync();
|
||||
switch (taskinfo.TrialReadingCriterion.CriterionType)
|
||||
{
|
||||
case CriterionType.IRECIST1Point1:
|
||||
|
@ -3059,7 +3057,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
if (!isConvertedTask &&
|
||||
(await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == visitTaskId
|
||||
&& x.ReadingQuestionTrial.QuestionType == QuestionType.Tumor && x.Answer==(((int)OverallAssessment.PD)).ToString()))
|
||||
&& x.ReadingQuestionTrial.QuestionType == QuestionType.Tumor && x.Answer == (((int)OverallAssessment.PD)).ToString()))
|
||||
)
|
||||
{
|
||||
|
||||
|
@ -3154,7 +3152,7 @@ namespace IRaCIS.Application.Services
|
|||
x.DoctorUserId == taskInfo.DoctorUserId &&
|
||||
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId &&
|
||||
x.ReadingTaskState == ReadingTaskState.HaveSigned &&
|
||||
(x.TaskState == TaskState.Effect||x.TaskState==TaskState.Freeze) &&
|
||||
(x.TaskState == TaskState.Effect || x.TaskState == TaskState.Freeze) &&
|
||||
x.IsSelfAnalysis == taskInfo.IsSelfAnalysis &&
|
||||
x.IsAnalysisCreate == taskInfo.IsAnalysisCreate &&
|
||||
x.ReadingCategory == taskInfo.ReadingCategory &&
|
||||
|
@ -3257,7 +3255,7 @@ namespace IRaCIS.Application.Services
|
|||
case ReadingCategory.Visit:
|
||||
needReadList = await _readModuleRepository.Where(x => x.SubjectVisitId == taskInfo.SourceSubjectVisitId &&
|
||||
|
||||
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId )
|
||||
x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId)
|
||||
.Select(x => new ReadingGenerataTaskDTO
|
||||
{
|
||||
IsUrgent = x.IsUrgent ?? false,
|
||||
|
@ -3270,7 +3268,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
|
||||
if (needReadList.Any(x => x.ReadingCategory == ReadingCategory.Global)&& taskInfo.TrialReadingCriterion.IsGlobalReading)
|
||||
if (needReadList.Any(x => x.ReadingCategory == ReadingCategory.Global) && taskInfo.TrialReadingCriterion.IsGlobalReading)
|
||||
{
|
||||
needReadList = needReadList.Where(x => x.ReadingCategory != ReadingCategory.Oncology).ToList();
|
||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||
|
@ -3287,7 +3285,7 @@ namespace IRaCIS.Application.Services
|
|||
// 添加肿瘤学
|
||||
if (await _visitTaskRepository.AnyAsync(x => x.Id == visitTaskId && x.JudgeVisitTaskId == null))
|
||||
{
|
||||
await AddOncologyTask(needReadList.Where(x=> x.ReadingCategory == ReadingCategory.Oncology).First().ReadModuleId);
|
||||
await AddOncologyTask(needReadList.Where(x => x.ReadingCategory == ReadingCategory.Oncology).First().ReadModuleId);
|
||||
}
|
||||
}
|
||||
//needReadList = needReadList.Where(x => _visitTaskRepository.Where(y => y.SouceReadModuleId == x.ReadModuleId).Count() == 0).ToList();
|
||||
|
|
Loading…
Reference in New Issue