修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
40c3ea65ff
commit
1617de2fc1
|
|
@ -79,8 +79,59 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public Guid ReadingPeriodSetId { get; set; }
|
||||
}
|
||||
|
||||
public class IsChangeReadingPlanInDto
|
||||
{
|
||||
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 阅片范围
|
||||
/// </summary>
|
||||
public ReadingScopeEnum ReadingScope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 中心ID
|
||||
/// </summary>
|
||||
public List<Guid> SiteIds { get; set; } = new List<Guid>();
|
||||
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 截止日期
|
||||
/// </summary>
|
||||
public DateTime? ExpirationDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 截止访视
|
||||
/// </summary>
|
||||
public decimal? ExpirationVisitNum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 访视计划ID
|
||||
/// </summary>
|
||||
public Guid? VisitStageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 阅片期名称
|
||||
/// </summary>
|
||||
public string ReadingPeriodName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public ReadingSetType ReadingSetType { get; set; }
|
||||
|
||||
public Guid? TrialReadingCriterionId { get; set; }
|
||||
}
|
||||
|
||||
public class PreviewTheReadingListInDto : PageInput
|
||||
{
|
||||
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 阅片范围
|
||||
/// </summary>
|
||||
|
|
@ -123,7 +174,25 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
|
||||
public Guid? TrialReadingCriterionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 中心Id
|
||||
/// </summary>
|
||||
public Guid? SiteId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 受试者Code
|
||||
/// </summary>
|
||||
public string SubjectCode { get; set; }=string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 是否加入阅片计划
|
||||
/// </summary>
|
||||
public bool? IsJoin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成阅片计划
|
||||
/// </summary>
|
||||
public bool? IsGenerate { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -185,6 +254,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public DateTime? EffectOfTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否加入阅片计划
|
||||
/// </summary>
|
||||
public bool? IsJoin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否生成阅片计划
|
||||
/// </summary>
|
||||
public bool? IsGenerate { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ReadingPeriodSetView
|
||||
|
|
|
|||
|
|
@ -466,8 +466,38 @@ namespace IRaCIS.Core.Application.Service
|
|||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否修改了阅片期计划的参数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> IsChangeReadingPlan(IsChangeReadingPlanInDto inDto)
|
||||
{
|
||||
if (inDto.Id == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
var periodSet = await _readingPeriodSetRepository.Where(x => x.Id == inDto.Id).Include(x => x.ReadingPeriodSites).FirstNotNullAsync();
|
||||
|
||||
|
||||
var notChange = inDto.ExpirationDate == periodSet.ExpirationDate &&
|
||||
inDto.ReadingScope == periodSet.ReadingScope &&
|
||||
inDto.TrialId == periodSet.TrialId &&
|
||||
inDto.ExpirationDate == periodSet.ExpirationDate &&
|
||||
inDto.ExpirationVisitNum == periodSet.ExpirationVisitNum &&
|
||||
inDto.VisitStageId == inDto.VisitStageId &&
|
||||
inDto.ReadingSetType == inDto.ReadingSetType &&
|
||||
inDto.TrialReadingCriterionId == inDto.TrialReadingCriterionId &&
|
||||
inDto.SiteIds.Count == periodSet.ReadingPeriodSites.Count(x => inDto.SiteIds.Contains(x.TrialSiteId));
|
||||
|
||||
return !notChange;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取影像阅片的预览 // 需要清除之前已经选中的 (增加标准搜索,已修改)
|
||||
/// </summary>
|
||||
|
|
@ -475,6 +505,29 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<PageOutput<PreviewTheReadingListOutDto>> GetPreviewTheReadingList(PreviewTheReadingListInDto inDto)
|
||||
{
|
||||
|
||||
// 这里还需要获取到之前已经添加的
|
||||
var isChangeReadingPlan = await IsChangeReadingPlan(new IsChangeReadingPlanInDto()
|
||||
{
|
||||
Id = inDto.Id,
|
||||
ExpirationDate = inDto.ExpirationDate,
|
||||
ReadingScope = inDto.ReadingScope,
|
||||
TrialId = inDto.TrialId,
|
||||
ExpirationVisitNum = inDto.ExpirationVisitNum,
|
||||
VisitStageId = inDto.VisitStageId,
|
||||
ReadingSetType = inDto.ReadingSetType,
|
||||
TrialReadingCriterionId = inDto.TrialReadingCriterionId,
|
||||
SiteIds = inDto.SiteIds,
|
||||
});
|
||||
|
||||
List<Guid> isChooseVisitIds = new List<Guid>();
|
||||
|
||||
if (isChangeReadingPlan)
|
||||
{
|
||||
isChooseVisitIds= await _readingPeriodPlanRepository.Where(x => x.ReadingPeriodSetId == inDto.Id).Select(x => x.SubjectVisitId).ToListAsync();
|
||||
}
|
||||
|
||||
var isTakeEffect = await _readingPeriodSetRepository.Where(x => x.Id == inDto.Id).Select(x => x.IsTakeEffect).FirstOrDefaultAsync();
|
||||
var readModulequery = _readModuleRepository.AsQueryable();
|
||||
|
||||
// 当前项目 最晚拍片日期不为null 中心筛选
|
||||
|
|
@ -485,10 +538,20 @@ namespace IRaCIS.Core.Application.Service
|
|||
// 已经存在的访视 需要排除
|
||||
var existsBubjectVisitsQuery = _readModuleRepository.Where(y => y.ReadingSetType == inDto.ReadingSetType && y.TrialId == inDto.TrialId && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId).Select(x => x.SubjectVisitId);
|
||||
|
||||
visitQuery = visitQuery.Where(x => !existsBubjectVisitsQuery.Contains(x.Id))
|
||||
visitQuery = visitQuery
|
||||
|
||||
.Where(x => !existsBubjectVisitsQuery.Contains(x.Id))
|
||||
.WhereIf(inDto.ExpirationDate != null, x => x.LatestScanDate < inDto.ExpirationDate.Value.AddDays(1))
|
||||
.WhereIf(inDto.ExpirationVisitNum != null, x => x.VisitNum == inDto.ExpirationVisitNum)
|
||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0);
|
||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
||||
.WhereIf(inDto.SiteId != null,x=> x.Subject.TrialSiteId==inDto.SiteId)
|
||||
.WhereIf(inDto.SubjectCode.IsNotNullOrEmpty(), x =>x.Subject.Code.Contains(inDto.SubjectCode))
|
||||
.WhereIf(inDto.IsJoin != null && inDto.IsJoin.Value, x => isChooseVisitIds.Contains(x.Id))
|
||||
.WhereIf(inDto.IsGenerate != null && inDto.IsGenerate.Value, x => isChooseVisitIds.Contains(x.Id)&& isTakeEffect== ReadingPeriodStatus.TakeEffect)
|
||||
;
|
||||
|
||||
//.Where(x => isChooseVisitIds.Contains(x.Id));
|
||||
|
||||
|
||||
var subjectIdlist = await visitQuery.OrderBy(x => x.SubjectId).Select(x => x.SubjectId).Distinct().Skip((inDto.PageIndex - 1) * inDto.PageSize).Take(inDto.PageSize).ToListAsync();
|
||||
|
||||
|
|
@ -526,6 +589,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
SubjectCode = x.Subject.Code,
|
||||
SubjectId = x.SubjectId,
|
||||
SubjectVisitName = x.VisitName,
|
||||
IsJoin= isChooseVisitIds.Contains(x.Id),
|
||||
IsGenerate= isChooseVisitIds.Contains(x.Id)&& isTakeEffect== ReadingPeriodStatus.TakeEffect,
|
||||
}).ToList(),
|
||||
PageSize = inDto.PageSize,
|
||||
PageIndex = inDto.PageIndex,
|
||||
|
|
|
|||
Loading…
Reference in New Issue