IR读片列表

Uat_Study
hang 2022-06-15 16:02:07 +08:00
parent fa8f338910
commit 7dadafdb0d
3 changed files with 104 additions and 7 deletions

View File

@ -86,6 +86,12 @@
<param name="queryVisitTask"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.VisitTaskService.GetIRUnReadSubjectTaskList(System.Guid)">
<summary>
IR 待阅片任务列表Subject 维度统计)
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.VisitTaskService.GetIRHaveReadTaskList(IRaCIS.Core.Application.ViewModel.VisitTaskQuery)">
<summary>
IR 已阅片任务
@ -93,6 +99,13 @@
<param name="queryVisitTask"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.VisitTaskService.GetIRReReadingTaskList(IRaCIS.Core.Application.ViewModel.VisitTaskQuery)">
<summary>
获取IR 重阅影像阅片列表
</summary>
<param name="queryVisitTask"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.VisitTaskService.GetSubjectAssignList(IRaCIS.Core.Application.ViewModel.SubjectAssignQuery)">
<summary>
获取手动分配 未分配的Subject列表(IsHaveAssigned 传递false)

View File

@ -48,9 +48,9 @@ namespace IRaCIS.Core.Application.ViewModel
/// <summary> VisitTaskView 列表视图模型 </summary>
public class VisitTaskView: VisitTaskViewBasic
public class VisitTaskView : VisitTaskViewBasic
{
public string UserCode { get; set; }
@ -69,7 +69,7 @@ namespace IRaCIS.Core.Application.ViewModel
}
public class ReadingTaskView: VisitTaskView
public class ReadingTaskView : VisitTaskView
{
public ReadingTaskState ReadingTaskState { get; set; }
@ -112,11 +112,38 @@ namespace IRaCIS.Core.Application.ViewModel
}
public class IRHaveReadView: VisitTaskViewBasic
public class IRHaveReadView : VisitTaskViewBasic
{
}
public class IRUnReadSubjectView
{
//public Guid SiteId { get; set; }
//public String TrialSiteCode { get; set; } = String.Empty;
//public Guid TrialId { get; set; }
public Guid SubjectId { get; set; }
public string SubjectCode { get; set; } = String.Empty;
public bool IsUrgent => UnReadTaskList.Any(t=>t.IsUrgent);
public int? UnReadTaskCount { get; set; }
public DateTime? SuggesteFinishedTime => UnReadTaskList.Max(t => t.SuggesteFinishedTime);
public List<IRUnreadTaskView> UnReadTaskList { get; set; } = new List<IRUnreadTaskView>();
}
public class IRUnreadTaskView
{
public Guid Id { get; set; }
public bool IsUrgent { get; set; }
public DateTime? SuggesteFinishedTime { get; set; }
}
public class HistoryReadingDoctorUser
{
@ -260,7 +287,7 @@ namespace IRaCIS.Core.Application.ViewModel
{
public Guid SubjectId { get; set; }
public List<Guid> DoctorUserIdList { get; set; }=new List<Guid> ();
public List<Guid> DoctorUserIdList { get; set; } = new List<Guid>();
}
public class AutoSubjectAssignCommand

View File

@ -188,6 +188,28 @@ namespace IRaCIS.Core.Application.Service
}
/// <summary>
/// IR 待阅片任务列表Subject 维度统计)
/// </summary>
/// <returns></returns>
[HttpGet("{trialId:guid}")]
public async Task<List<IRUnReadSubjectView>> GetIRUnReadSubjectTaskList(Guid trialId)
{
var query = _visitTaskRepository.Where(t => t.TrialId == trialId)
.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned)
.GroupBy(t => new { t.SubjectId, t.Subject.Code })
.Select(g => new IRUnReadSubjectView()
{
SubjectCode = g.Key.Code,
SubjectId = g.Key.SubjectId,
UnReadTaskCount = g.Count(),
UnReadTaskList = g.AsQueryable().Select(c => new IRUnreadTaskView() { Id = c.Id, SuggesteFinishedTime = c.SuggesteFinishedTime, IsUrgent = c.IsUrgent }).ToList()
});
return query.ToList();
}
/// <summary>
/// IR 已阅片任务
@ -224,6 +246,42 @@ namespace IRaCIS.Core.Application.Service
/// <summary>
/// 获取IR 重阅影像阅片列表
/// </summary>
/// <param name="queryVisitTask"></param>
/// <returns></returns>
[HttpPost]
public async Task<PageOutput<ReReadingTaskView>> GetIRReReadingTaskList(VisitTaskQuery queryVisitTask)
{
var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == queryVisitTask.TrialId)
.Where(t => t.DoctorUserId == _userInfo.Id)
.WhereIf(queryVisitTask.OriginalReReadingId != null, t => t.OriginalReReadingId == queryVisitTask.OriginalReReadingId)
.WhereIf(queryVisitTask.OriginalReReadingId == null, t => t.OriginalReReadingId != null)
.WhereIf(queryVisitTask.SiteId != null, t => t.Subject.SiteId == queryVisitTask.SiteId)
.WhereIf(queryVisitTask.SubjectId != null, t => t.SubjectId == queryVisitTask.SubjectId)
.WhereIf(queryVisitTask.IsUrgent != null, t => t.IsUrgent == queryVisitTask.IsUrgent)
.WhereIf(queryVisitTask.ReadingTaskState != null, t => t.ReadingTaskState == queryVisitTask.ReadingTaskState)
.WhereIf(queryVisitTask.TaskState != null, t => t.TaskState == queryVisitTask.TaskState)
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.TaskName), t => t.TaskName.Contains(queryVisitTask.TaskName) || t.TaskBlindName.Contains(queryVisitTask.TaskName))
.WhereIf(!string.IsNullOrEmpty(queryVisitTask.SubjectCode), t => t.Subject.Code.Contains(queryVisitTask.SubjectCode))
.WhereIf(queryVisitTask.BeginAllocateDate != null, t => t.AllocateTime > queryVisitTask.BeginAllocateDate)
.WhereIf(queryVisitTask.EndAllocateDate != null, t => t.AllocateTime < queryVisitTask.EndAllocateDate.Value.AddDays(1))
.ProjectTo<ReReadingTaskView>(_mapper.ConfigurationProvider);
var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId) };
var pageList = await visitTaskQueryable.ToPagedListAsync(queryVisitTask.PageIndex, queryVisitTask.PageSize, queryVisitTask.SortField, queryVisitTask.Asc, string.IsNullOrWhiteSpace(queryVisitTask.SortField), defalutSortArray);
return pageList;
}
/// <summary>
/// 获取手动分配 未分配的Subject列表(IsHaveAssigned 传递false)
/// </summary>
@ -316,12 +374,11 @@ namespace IRaCIS.Core.Application.Service
//var trialConfig = (await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.ReadingType, t.IsFollowVisitAutoAssign, t.IsFollowGlobalVisitAutoAssign, t.FollowGlobalVisitAutoAssignDefaultState, t.TaskAllocateObjEnum }).FirstOrDefaultAsync()).IfNullThrowException();
//需要确认的Subject
var subjectIdList = assignConfirmCommand.SubjectDoctorUserList.Select(t => t.SubjectId).ToList();
var taskList = _visitTaskRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId && t.DoctorUserId == null, true)
.WhereIf(subjectIdList.Count() > 0 /*&& trialConfig.ReadingType==ReadingMethod.Double*/, t => subjectIdList.Contains(t.SubjectId) && t.Subject.SubjectDoctorList.Any())
.WhereIf(subjectIdList.Count() > 0 , t => subjectIdList.Contains(t.SubjectId) && t.Subject.SubjectDoctorList.Any())
.ToList();