修改一版
parent
f47978bca2
commit
6f97e6051b
|
@ -965,6 +965,11 @@
|
||||||
创建时间
|
创建时间
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingPeriodSetView.EffectOfTime">
|
||||||
|
<summary>
|
||||||
|
生效时间
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingPeriodSetView.CreateUserId">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ReadingPeriodSetView.CreateUserId">
|
||||||
<summary>
|
<summary>
|
||||||
创建人
|
创建人
|
||||||
|
|
|
@ -260,6 +260,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int PlanCount { get; set; }
|
public int PlanCount { get; set; }
|
||||||
|
|
||||||
|
public bool IsGlobal { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SetReadingPeriodSetEffect
|
public class SetReadingPeriodSetEffect
|
||||||
|
|
|
@ -233,7 +233,7 @@ namespace IRaCIS.Application.Services
|
||||||
SubjectCode = x.SubjectVisit.Subject.Code,
|
SubjectCode = x.SubjectVisit.Subject.Code,
|
||||||
SubjectId = x.SubjectVisit.SubjectId,
|
SubjectId = x.SubjectVisit.SubjectId,
|
||||||
SubjectVisitName = x.SubjectVisit.VisitName,
|
SubjectVisitName = x.SubjectVisit.VisitName,
|
||||||
EffectOfTime=x.ReadingPeriodSet.EffectOfTime,
|
EffectOfTime=x.ReadingPeriodSet.EffectOfTime,
|
||||||
});
|
});
|
||||||
|
|
||||||
return await plans.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? "SubjectId" : inDto.SortField,
|
return await plans.ToPagedListAsync(inDto.PageIndex, inDto.PageSize, inDto.SortField == null ? "SubjectId" : inDto.SortField,
|
||||||
|
|
|
@ -19,18 +19,21 @@ namespace IRaCIS.Core.Application.Services
|
||||||
{
|
{
|
||||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
private readonly IRepository<ReadModule> _readModuleRepository;
|
private readonly IRepository<ReadModule> _readModuleRepository;
|
||||||
|
private readonly IRepository<Trial> _trialRepository;
|
||||||
private readonly IRepository<ReadingPeriodSet> _readingPeriodSetRepository;
|
private readonly IRepository<ReadingPeriodSet> _readingPeriodSetRepository;
|
||||||
private readonly IRepository<ReadingPeriodPlan> _readingPeriodPlanRepository;
|
private readonly IRepository<ReadingPeriodPlan> _readingPeriodPlanRepository;
|
||||||
private readonly IRepository<Subject> _subjectRepository;
|
private readonly IRepository<Subject> _subjectRepository;
|
||||||
|
|
||||||
public SubjectVisitService(IRepository<SubjectVisit> subjectVisitRepository,
|
public SubjectVisitService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IRepository<ReadModule> readModuleRepository,
|
IRepository<ReadModule> readModuleRepository,
|
||||||
|
IRepository<Trial> trialRepository,
|
||||||
IRepository<ReadingPeriodSet> readingPeriodSetRepository,
|
IRepository<ReadingPeriodSet> readingPeriodSetRepository,
|
||||||
IRepository<ReadingPeriodPlan> readingPeriodPlanRepository,
|
IRepository<ReadingPeriodPlan> readingPeriodPlanRepository,
|
||||||
IRepository<Subject> subjectRepository)
|
IRepository<Subject> subjectRepository)
|
||||||
{
|
{
|
||||||
_subjectVisitRepository = subjectVisitRepository;
|
_subjectVisitRepository = subjectVisitRepository;
|
||||||
this._readModuleRepository = readModuleRepository;
|
this._readModuleRepository = readModuleRepository;
|
||||||
|
this._trialRepository = trialRepository;
|
||||||
this._readingPeriodSetRepository = readingPeriodSetRepository;
|
this._readingPeriodSetRepository = readingPeriodSetRepository;
|
||||||
this._readingPeriodPlanRepository = readingPeriodPlanRepository;
|
this._readingPeriodPlanRepository = readingPeriodPlanRepository;
|
||||||
_subjectRepository = subjectRepository;
|
_subjectRepository = subjectRepository;
|
||||||
|
@ -107,48 +110,56 @@ namespace IRaCIS.Core.Application.Services
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 末次访视添加全局阅片
|
// 是否全局阅片
|
||||||
if (dbBeforeEntity.IsFinalVisit == false && svCommand.IsFinalVisit == true)
|
var isGlobalReading = await _trialRepository.Where(x => x.Id == dbBeforeEntity.TrialId).Select(x => x.IsGlobalReading).FirstOrDefaultAsync();
|
||||||
|
if (isGlobalReading)
|
||||||
{
|
{
|
||||||
|
// 末次访视添加全局阅片
|
||||||
ReadingPeriodSet? readingPeriodSet =await _readingPeriodSetRepository.FirstOrDefaultNoTrackingAsync(x => x.TrialId == dbBeforeEntity.TrialId && x.ReadingPeriodName == "Global");
|
if (dbBeforeEntity.IsFinalVisit == false && svCommand.IsFinalVisit == true)
|
||||||
|
|
||||||
if (readingPeriodSet == null)
|
|
||||||
{
|
{
|
||||||
readingPeriodSet = new ReadingPeriodSet()
|
|
||||||
|
ReadingPeriodSet? readingPeriodSet = await _readingPeriodSetRepository.FirstOrDefaultNoTrackingAsync(x => x.TrialId == dbBeforeEntity.TrialId && x.ReadingPeriodName == "Global");
|
||||||
|
|
||||||
|
if (readingPeriodSet == null)
|
||||||
{
|
{
|
||||||
Id = NewId.NextGuid(),
|
readingPeriodSet = new ReadingPeriodSet()
|
||||||
ReadingScope = ReadingScopeEnum.All,
|
{
|
||||||
ReadingSetType = ReadingSetType.ImageReading,
|
Id = NewId.NextGuid(),
|
||||||
IsTakeEffect = ReadingPeriodStatus.TakeEffect,
|
ReadingScope = ReadingScopeEnum.All,
|
||||||
ReadingPeriodName = "Global",
|
ReadingSetType = ReadingSetType.ImageReading,
|
||||||
TrialId = dbBeforeEntity.TrialId,
|
IsTakeEffect = ReadingPeriodStatus.TakeEffect,
|
||||||
};
|
ReadingPeriodName = "Global",
|
||||||
|
TrialId = dbBeforeEntity.TrialId,
|
||||||
|
EffectOfTime = DateTime.Now,
|
||||||
|
IsGlobal = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
await _readingPeriodSetRepository.AddAsync(readingPeriodSet);
|
await _readingPeriodSetRepository.AddAsync(readingPeriodSet);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await _readingPeriodPlanRepository.AddAsync(new ReadingPeriodPlan()
|
await _readingPeriodPlanRepository.AddAsync(new ReadingPeriodPlan()
|
||||||
{
|
|
||||||
SubjectVisitId = dbBeforeEntity.Id,
|
|
||||||
ReadingPeriodSetId = readingPeriodSet.Id,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 当前访视没有阅片期才添加
|
|
||||||
if (!await _readModuleRepository.AnyAsync(x => x.SubjectVisitId == svCommand.Id && x.ReadingSetType == ReadingSetType.ImageReading))
|
|
||||||
{
|
|
||||||
await _readModuleRepository.AddAsync(new ReadModule()
|
|
||||||
{
|
{
|
||||||
IsUrgent = dbBeforeEntity.IsUrgent,
|
SubjectVisitId = dbBeforeEntity.Id,
|
||||||
SubjectVisitId = svCommand.Id.Value,
|
ReadingPeriodSetId = readingPeriodSet.Id,
|
||||||
Status = ReadModuleEnum.TaskAllocation,
|
|
||||||
SubjectId = dbBeforeEntity.SubjectId,
|
|
||||||
ModuleName= "Global",// 全局阅片
|
|
||||||
ReadingSetType= ReadingSetType.ImageReading,
|
|
||||||
ModuleType=ModuleTypeEnum.Global,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 当前访视没有阅片期才添加
|
||||||
|
if (!await _readModuleRepository.AnyAsync(x => x.SubjectVisitId == svCommand.Id && x.ReadingSetType == ReadingSetType.ImageReading))
|
||||||
|
{
|
||||||
|
await _readModuleRepository.AddAsync(new ReadModule()
|
||||||
|
{
|
||||||
|
ReadingPeriodSetId = readingPeriodSet.Id,
|
||||||
|
IsUrgent = dbBeforeEntity.IsUrgent,
|
||||||
|
SubjectVisitId = svCommand.Id.Value,
|
||||||
|
Status = ReadModuleEnum.TaskAllocation,
|
||||||
|
SubjectId = dbBeforeEntity.SubjectId,
|
||||||
|
ModuleName = "Global",// 全局阅片
|
||||||
|
ReadingSetType = ReadingSetType.ImageReading,
|
||||||
|
ModuleType = ModuleTypeEnum.Global,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,11 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为全局阅片
|
||||||
|
/// </summary>
|
||||||
|
public bool IsGlobal { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 阅片配置的类型
|
/// 阅片配置的类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue