修改
This commit is contained in:
@@ -108,10 +108,10 @@ namespace IRaCIS.Application.Services
|
||||
var query = _tumorAssessmentRepository
|
||||
.Where(x => x.CriterionId == inQuery.CriterionId)
|
||||
.WhereIf(inQuery.OverallEfficacy != null, x => x.OverallEfficacy == inQuery.OverallEfficacy)
|
||||
.WhereIf(inQuery.TargetLesion != null, x => x.TargetLesion == inQuery.TargetLesion)
|
||||
.WhereIf(inQuery.NonTargetLesions != null, x => x.NonTargetLesions == inQuery.NonTargetLesions)
|
||||
.WhereIf(inQuery.NewLesion != null, x => x.NewLesion == inQuery.NewLesion)
|
||||
.ProjectTo<TumorAssessmentView>(_mapper.ConfigurationProvider);
|
||||
.WhereIf(inQuery.TargetLesion != null, x => x.TargetLesion == inQuery.TargetLesion)
|
||||
.WhereIf(inQuery.NonTargetLesions != null, x => x.NonTargetLesions == inQuery.NonTargetLesions)
|
||||
.WhereIf(inQuery.NewLesion != null, x => x.NewLesion == inQuery.NewLesion)
|
||||
.ProjectTo<TumorAssessmentView>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc);
|
||||
}
|
||||
|
||||
@@ -150,6 +150,20 @@ namespace IRaCIS.Application.Contracts
|
||||
|
||||
public List<ReadingCategory> ReadingCategorys { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class SetEnrollEnableCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid EnrollId { get; set; }
|
||||
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public bool IsEnable { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class WorkLoadDoctorQueryDTO : PageInput
|
||||
{
|
||||
public Guid TrialId { get; set; } = Guid.Empty;
|
||||
@@ -228,6 +242,8 @@ namespace IRaCIS.Application.Contracts
|
||||
|
||||
public class WorkLoadAndAgreementDTO : WorkLoadAndTrainingDTO
|
||||
{
|
||||
public bool IsEnable { get; set; }
|
||||
|
||||
public Guid EnrollId { get; set; }
|
||||
public DateTime? OutEnrollTime { get; set; }
|
||||
public Guid AgreementId { get; set; }
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace IRaCIS.Application.Services
|
||||
private readonly IRepository<TrialRevenuesPrice> _trialRevenuesPriceRepository;
|
||||
private readonly IRepository<TrialRevenuesPriceVerification> _trialRevenuesPriceVerificationRepository;
|
||||
|
||||
|
||||
private readonly IRepository<TaskAllocationRule> _taskAllocationRuleRepository;
|
||||
public DoctorWorkloadService(IRepository<Trial> clinicalTrialProjectRepository,
|
||||
IRepository<Enroll> intoGroupRepository,
|
||||
IRepository<Doctor> doctorInfoRepository,
|
||||
@@ -32,9 +32,11 @@ namespace IRaCIS.Application.Services
|
||||
IRepository<Attachment> attachmentRepository,
|
||||
IRepository<Payment> costStatisticsRepository,
|
||||
IRepository<TrialRevenuesPrice> trialRevenuesPriceRepository,
|
||||
IRepository<TaskAllocationRule> taskAllocationRuleRepository,
|
||||
IRepository<TrialRevenuesPriceVerification> trialRevenuesPriceVerificationRepository,
|
||||
IMapper mapper)
|
||||
{
|
||||
_taskAllocationRuleRepository = taskAllocationRuleRepository;
|
||||
_trialRepository = clinicalTrialProjectRepository;
|
||||
_enrollRepository = intoGroupRepository;
|
||||
_doctorRepository = doctorInfoRepository;
|
||||
@@ -70,7 +72,7 @@ namespace IRaCIS.Application.Services
|
||||
var attachment = await _attachmentRepository.InsertFromDTOAsync(attachmentViewModel);
|
||||
|
||||
//intoGroupItem.AttachmentId = attachment.Id;
|
||||
await _enrollRepository.UpdatePartialFromQueryAsync(intoGroupItem.Id,u=>new Enroll(){AttachmentId = attachment.Id});
|
||||
await _enrollRepository.UpdatePartialFromQueryAsync(intoGroupItem.Id, u => new Enroll() { AttachmentId = attachment.Id });
|
||||
|
||||
|
||||
var success = await _enrollRepository.SaveChangesAsync();
|
||||
@@ -88,12 +90,12 @@ namespace IRaCIS.Application.Services
|
||||
public async Task<IResponseOutput> DeleteReviewerAckSOW(Guid trialId, Guid doctorId, Guid attachmentId)
|
||||
{
|
||||
var success1 = await _attachmentRepository.BatchDeleteNoTrackingAsync(a => a.Id == attachmentId);
|
||||
await _enrollRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.DoctorId == doctorId, u =>
|
||||
new Enroll()
|
||||
{
|
||||
AttachmentId = Guid.Empty
|
||||
},true);
|
||||
return ResponseOutput.Ok(success1 );
|
||||
await _enrollRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.DoctorId == doctorId, u =>
|
||||
new Enroll()
|
||||
{
|
||||
AttachmentId = Guid.Empty
|
||||
}, true);
|
||||
return ResponseOutput.Ok(success1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -105,15 +107,15 @@ namespace IRaCIS.Application.Services
|
||||
public async Task<IResponseOutput> SetEnrollReadingCategory(SetEnrollReadingCategoryInDto inDto)
|
||||
{
|
||||
|
||||
var enroll = await _enrollRepository.FirstAsync(t => t.Id == inDto.EnrollId);
|
||||
var enroll = await _enrollRepository.FirstAsync(t => t.Id == inDto.EnrollId);
|
||||
|
||||
|
||||
if (_repository.Where<VisitTask>(t=>t.TrialId==enroll.TrialId && t.DoctorUserId==enroll.DoctorUserId && t.TaskAllocationState==TaskAllocationState.Allocated).Any())
|
||||
if (_repository.Where<VisitTask>(t => t.TrialId == enroll.TrialId && t.DoctorUserId == enroll.DoctorUserId && t.TaskAllocationState == TaskAllocationState.Allocated).Any())
|
||||
{
|
||||
|
||||
var readingCategoryList = await _enrollReadingCategoryRepository.Where(t => t.EnrollId == inDto.EnrollId).Select(t => t.ReadingCategory).ToListAsync();
|
||||
|
||||
if(readingCategoryList.Except(inDto.ReadingCategorys).Count() > 0)
|
||||
if (readingCategoryList.Except(inDto.ReadingCategorys).Count() > 0)
|
||||
{
|
||||
return ResponseOutput.NotOk("已分配任务,不允许减少阅片类型");
|
||||
|
||||
@@ -147,6 +149,19 @@ namespace IRaCIS.Application.Services
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改项目医生启用禁用状态
|
||||
/// </summary>
|
||||
/// <param name="inCommand"></param>
|
||||
/// <returns></returns>
|
||||
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||
public async Task<IResponseOutput> UpdateTrialReviewerState(SetEnrollEnableCommand inCommand)
|
||||
{
|
||||
await _taskAllocationRuleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == inCommand.TrialId && t.EnrollId == inCommand.EnrollId, u => new TaskAllocationRule() { IsEnable = inCommand.IsEnable },true);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 0代表裁判和Tp 都可以 1、代表Tp 2 代表裁判
|
||||
@@ -178,6 +193,7 @@ namespace IRaCIS.Application.Services
|
||||
var doctorIntoGroupQueryable =
|
||||
|
||||
from intoGroup in _enrollRepository.Where(x => x.TrialId == trialId && x.EnrollStatus >= EnrollStatus.ConfirmIntoGroup)
|
||||
join allocateRule in _taskAllocationRuleRepository.AsQueryable() on intoGroup.Id equals allocateRule.EnrollId
|
||||
join doctor in _doctorRepository.AsQueryable() on intoGroup.DoctorId equals doctor.Id
|
||||
join attachmentItem in _attachmentRepository.AsQueryable() on intoGroup.AttachmentId equals attachmentItem.Id into cc
|
||||
from attachment in cc.DefaultIfEmpty()
|
||||
@@ -203,13 +219,15 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
select new WorkLoadAndAgreementDTO()
|
||||
{
|
||||
EnrollId= intoGroup.Id,
|
||||
ReadingCategorys = intoGroup.EnrollReadingCategoryList.Select(x=>x.ReadingCategory).OrderBy(x=>x).ToList(),
|
||||
EnrollId = intoGroup.Id,
|
||||
IsEnable = allocateRule.IsEnable,
|
||||
|
||||
ReadingCategorys = intoGroup.EnrollReadingCategoryList.Select(x => x.ReadingCategory).OrderBy(x => x).ToList(),
|
||||
DoctorId = doctor.Id,
|
||||
Code = doctor.ReviewerCode,
|
||||
FirstName = doctor.FirstName,
|
||||
LastName = doctor.LastName,
|
||||
FullName=doctor.FullName,
|
||||
FullName = doctor.FullName,
|
||||
|
||||
ChineseName = doctor.ChineseName,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user