Uat_Study
parent
712ed21783
commit
bf703be85c
|
@ -105,6 +105,15 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class DoctorSelectQuery
|
||||||
|
{
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
public ReadingCategory? ReadingCategory { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public class AssignDoctorStatView : TaskAllocationRuleDTO
|
public class AssignDoctorStatView : TaskAllocationRuleDTO
|
||||||
{
|
{
|
||||||
public int? AssignedSubjectCount { get; set; }
|
public int? AssignedSubjectCount { get; set; }
|
||||||
|
|
|
@ -135,5 +135,27 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<List<TrialDoctorUserSelectView>> GetDoctorSelectList(DoctorSelectQuery selectQuery, [FromServices] IRepository<Enroll> _enrollRepository)
|
||||||
|
{
|
||||||
|
var query = from enroll in _enrollRepository.Where(t => t.TrialId == selectQuery.TrialId && t.EnrollStatus >= (int)EnrollStatus.ConfirmIntoGroup && t.DoctorUserId !=null)
|
||||||
|
.WhereIf(selectQuery.ReadingCategory !=null,t=>t.EnrollReadingCategoryList.Any(u=>u.ReadingCategory==selectQuery.ReadingCategory))
|
||||||
|
join user in _userRepository.AsQueryable() on enroll.DoctorId equals user.DoctorId
|
||||||
|
select new TrialDoctorUserSelectView()
|
||||||
|
{
|
||||||
|
TrialId = enroll.TrialId,
|
||||||
|
ReadingType = enroll.Trial.ReadingType,
|
||||||
|
EnrollId = enroll.Id,
|
||||||
|
DoctorUserId = user.Id,
|
||||||
|
FullName = user.FullName,
|
||||||
|
UserCode = user.UserCode,
|
||||||
|
UserName = user.UserName,
|
||||||
|
UserTypeEnum = user.UserTypeRole.UserTypeEnum
|
||||||
|
};
|
||||||
|
|
||||||
|
return await query.ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue