修改获取医生标准接口

Uat_Study
hang 2022-10-13 15:13:21 +08:00
parent 268d965cb5
commit 5b38464286
6 changed files with 61 additions and 53 deletions

View File

@ -54,12 +54,6 @@
<param name="trialId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.TaskAllocationRuleService.GetSubjectApplyDoctorTaskStatList(IRaCIS.Core.Application.ViewModel.ApplySubjectCommand)">
<summary>
获取访视任务 应用Subject后 医生比率情况
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.TaskAllocationRuleService.GetDoctorUserSelectList(System.Guid,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Enroll})">
<summary>
获取项目下 医生账户信息下拉
@ -68,6 +62,12 @@
<param name="_enrollRepository"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.TaskAllocationRuleService.GetSubjectApplyDoctorTaskStatList(IRaCIS.Core.Application.ViewModel.ApplySubjectCommand)">
<summary>
获取访视任务 应用Subject后 医生比率情况
</summary>
<returns></returns>
</member>
<member name="T:IRaCIS.Core.Application.Service.TaskConsistentRuleService">
<summary>
一致性分析配置表

View File

@ -101,20 +101,20 @@ namespace IRaCIS.Core.Application.ViewModel
public UserSimpleInfo DoctorUser { get; set; }
//public List<ReadingCategory> ReadingCategoryList { get; set; }
public List<ReadingCategory> ReadingCategoryList { get; set; }
public List<TrialReadingCriterionDto> TrialReadingCriterionList { get; set; }
//public List<TrialReadingCriterionDto> TrialReadingCriterionList { get; set; }
public List<TrialCriterionReadingCategory> CriterionReadingCategoryList { get; set; }
//public List<TrialCriterionReadingCategory> CriterionReadingCategoryList { get; set; }
public List<CriterionReadingCategory> CriterionCategoryList =>
//public List<CriterionReadingCategory> CriterionCategoryList =>
TrialReadingCriterionList.Select(t =>
new CriterionReadingCategory() {
EnrollId = EnrollId,
TrialReadingCriterionId = t.TrialReadingCriterionId,
ReadingCategorys = CriterionReadingCategoryList.Where(c => c.TrialReadingCriterionId == t.TrialReadingCriterionId).Select(t => t.ReadingCategory).OrderBy(c => c).ToList()
}).ToList();
// TrialReadingCriterionList.Select(t =>
// new CriterionReadingCategory() {
// EnrollId = EnrollId,
// TrialReadingCriterionId = t.TrialReadingCriterionId,
// ReadingCategorys = CriterionReadingCategoryList.Where(c => c.TrialReadingCriterionId == t.TrialReadingCriterionId).Select(t => t.ReadingCategory).OrderBy(c => c).ToList()
// }).ToList();
@ -131,7 +131,9 @@ namespace IRaCIS.Core.Application.ViewModel
[NotDefault]
public Guid TrialId { get; set; }
public ReadingCategory? ReadingCategory { get; set; }
public ReadingCategory? ReadingCategory { get; set; }
public Guid? TrialReadingCriterionId { get; set; }
}

View File

@ -120,34 +120,6 @@ namespace IRaCIS.Core.Application.Service
/// <summary>
/// 获取访视任务 应用Subject后 医生比率情况
/// </summary>
/// <returns></returns>
[HttpPost]
[Obsolete]
public async Task<List<DoctorVisitTaskStatView>> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand)
{
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId && t.IsJudgeDoctor == assignConfirmCommand.IsJudgeDoctor)
.ProjectTo<DoctorVisitTaskStatView>(_mapper.ConfigurationProvider, new { subjectIdList = assignConfirmCommand.SubjectIdList, isJudgeDoctor = assignConfirmCommand.IsJudgeDoctor });
return await taskAllocationRuleQueryable.ToListAsync();
}
[HttpPost]
[Obsolete]
public async Task<List<DoctorVisitTaskStatView>> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule)
{
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == queryTaskAllocationRule.TrialId /*&& t.IsJudgeDoctor == queryTaskAllocationRule.IsJudgeDoctor*/)
.ProjectTo<DoctorVisitTaskStatView>(_mapper.ConfigurationProvider);
//var trialTaskConfig = _trialRepository.Where(t => t.Id == queryTaskAllocationRule.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider, new { isJudgeDoctor = queryTaskAllocationRule.IsJudgeDoctor }).FirstOrDefault();
return await taskAllocationRuleQueryable.ToListAsync();
}
/// <summary>
@ -183,11 +155,11 @@ namespace IRaCIS.Core.Application.Service
{
var query = from allocationRule in _taskAllocationRuleRepository.Where(t => t.TrialId == selectQuery.TrialId && t.IsEnable)
.WhereIf(selectQuery.ReadingCategory != null, t => t.Enroll.EnrollReadingCategoryList.Any(t => t.ReadingCategory == selectQuery.ReadingCategory))
.WhereIf(selectQuery.TrialReadingCriterionId != null, t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId))
join user in _userRepository.AsQueryable() on allocationRule.DoctorUserId equals user.Id
select new TrialDoctorUserSelectView()
{
TrialId = allocationRule.TrialId,
//ReadingType = allocationRule.Trial.ReadingType,
DoctorUserId = user.Id,
FullName = user.FullName,
UserCode = user.UserCode,
@ -200,5 +172,36 @@ namespace IRaCIS.Core.Application.Service
}
/// <summary>
/// 获取访视任务 应用Subject后 医生比率情况
/// </summary>
/// <returns></returns>
[HttpPost]
[Obsolete]
public async Task<List<DoctorVisitTaskStatView>> GetSubjectApplyDoctorTaskStatList(ApplySubjectCommand assignConfirmCommand)
{
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == assignConfirmCommand.TrialId && t.IsJudgeDoctor == assignConfirmCommand.IsJudgeDoctor)
.ProjectTo<DoctorVisitTaskStatView>(_mapper.ConfigurationProvider, new { subjectIdList = assignConfirmCommand.SubjectIdList, isJudgeDoctor = assignConfirmCommand.IsJudgeDoctor });
return await taskAllocationRuleQueryable.ToListAsync();
}
[HttpPost]
[Obsolete]
public async Task<List<DoctorVisitTaskStatView>> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule)
{
var taskAllocationRuleQueryable = _taskAllocationRuleRepository.Where(t => t.TrialId == queryTaskAllocationRule.TrialId /*&& t.IsJudgeDoctor == queryTaskAllocationRule.IsJudgeDoctor*/)
.ProjectTo<DoctorVisitTaskStatView>(_mapper.ConfigurationProvider);
//var trialTaskConfig = _trialRepository.Where(t => t.Id == queryTaskAllocationRule.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider, new { isJudgeDoctor = queryTaskAllocationRule.IsJudgeDoctor }).FirstOrDefault();
return await taskAllocationRuleQueryable.ToListAsync();
}
}
}

View File

@ -176,7 +176,9 @@ namespace IRaCIS.Core.Application.Service.Allocation
/// <returns></returns>
public async Task<(List<AssignDoctorStatView>,object)> GetDoctorSubjectStat(Guid trialId, Guid trialReadingCriterionId )
{
var list = await _taskAllocationRuleRepository.Where(t => t.TrialId == trialId).ProjectTo<AssignDoctorStatView>(_mapper.ConfigurationProvider).ToListAsync();
var list = await _taskAllocationRuleRepository.Where(t => t.TrialId == trialId)
.Where( t => t.Enroll.EnrollReadingCategoryList.Any(t => t.TrialReadingCriterionId == trialReadingCriterionId))
.ProjectTo<AssignDoctorStatView>(_mapper.ConfigurationProvider,new { trialReadingCriterionId= trialReadingCriterionId }).ToListAsync();
var criterionConfig = (await _trialReadingCriterionRepository.Where(x => x.Id == trialReadingCriterionId).Select(x => new { x.ReadingTool, x.IsReadingTaskViewInOrder,x.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException();

View File

@ -65,11 +65,12 @@ namespace IRaCIS.Core.Application.Service
;
var trialReadingCriterionId = Guid.Empty;
CreateMap<TaskAllocationRule, TaskAllocationRuleDTO>()
.ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.Enroll.DoctorUser))
.ForMember(o => o.CriterionReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId })))
.ForMember(o => o.TrialReadingCriterionList, t => t.MapFrom(u => u.Trial.ReadingQuestionCriterionTrialList.Where(t => t.IsConfirm).Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, TrialReadingCriterionName = t.CriterionName })))
//.ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.OrderBy(t => t.ReadingCategory).Select(t => t.ReadingCategory).ToList()))
//.ForMember(o => o.CriterionReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId })))
//.ForMember(o => o.TrialReadingCriterionList, t => t.MapFrom(u => u.Trial.ReadingQuestionCriterionTrialList.Where(t => t.IsConfirm).Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, TrialReadingCriterionName = t.CriterionName })))
.ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Where(t=>t.TrialReadingCriterionId== trialReadingCriterionId).OrderBy(t => t.ReadingCategory).Select(t => t.ReadingCategory).ToList()))
;
CreateMap<TaskAllocationRule, AssignDoctorStatView>().IncludeBase<TaskAllocationRule, TaskAllocationRuleDTO>()
@ -78,7 +79,6 @@ namespace IRaCIS.Core.Application.Service
.ForMember(o => o.WaitDealAllTaskCount, t => t.MapFrom(u => u.DoctorUser.VisitTaskList.Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect).Count()));
Guid trialReadingCriterionId = Guid.Empty;
CreateMap<Subject, SubjectAssignStat>()
.ForMember(o => o.SubjectId, t => t.MapFrom(u => u.Id))

View File

@ -164,6 +164,7 @@ namespace IRaCIS.Application.Services
var stakeholderIds = new List<Guid>();
var subjectVisit =await _subjectVisitRepository.FirstOrDefaultAsync(x => x.Id == readModule.SubjectVisitId);
switch (readModule.Status)
{
case ReadingStatusEnum.ImageNotSubmit:
@ -211,10 +212,10 @@ namespace IRaCIS.Application.Services
public async Task<List<GetSubjectReadVisitsOutDto>> GetSubjectReadVisitList(GetSubjectReadVisitsInDto inDto)
{
//增加标准
var maxReadVisit = await _readModuleRepository.Where(x => x.SubjectId == inDto.SubjectId&&x.ReadingSetType==inDto.ReadingSetType && x.TrialReadingCriterionId==inDto.TrialReadingCriterionId).OrderByDescending(x=>x.VisitNum).FirstOrDefaultAsync();
var maxReadVisit = await _readModuleRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ReadingSetType==inDto.ReadingSetType && x.TrialReadingCriterionId==inDto.TrialReadingCriterionId).OrderByDescending(x=>x.VisitNum).FirstOrDefaultAsync();
var maxReadVisitNum= maxReadVisit==null?-1:maxReadVisit.VisitNum;
var visitQuery = _subjectVisitRepository.Where(x => x.SubjectId == inDto.SubjectId && x.LatestScanDate != null&&!x.IsLostVisit);
var visitQuery = _subjectVisitRepository.Where(x => x.SubjectId == inDto.SubjectId && x.LatestScanDate != null && !x.IsLostVisit);
var finalVisitNum = await visitQuery.Where(x => x.IsFinalVisit).Select(x => x.VisitNum).FirstOrDefaultAsync();
//增加标准