修改一版
parent
0f9c391f28
commit
d1064cce02
|
@ -495,6 +495,11 @@
|
||||||
是否来自于系统数据
|
是否来自于系统数据
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataTrialSetView.IsUsed">
|
||||||
|
<summary>
|
||||||
|
是否使用
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSystemSetView.ClinicalDataSetName">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSystemSetView.ClinicalDataSetName">
|
||||||
<summary>
|
<summary>
|
||||||
名称
|
名称
|
||||||
|
|
|
@ -107,29 +107,23 @@ namespace IRaCIS.Application.Services
|
||||||
public async Task<IResponseOutput> SetClinicalDataCheckd(SetClinicalDataCheckdIndto setClinicalData)
|
public async Task<IResponseOutput> SetClinicalDataCheckd(SetClinicalDataCheckdIndto setClinicalData)
|
||||||
{
|
{
|
||||||
// 为了后面稽查这样写
|
// 为了后面稽查这样写
|
||||||
|
|
||||||
var nocheckids =await _clinicalDataTrialSetRepository.Where(x => x.TrialId == setClinicalData.TrialId && setClinicalData.ClinicalDataTrialIds.Contains(x.Id)).Select(x => x.Id).ToListAsync();
|
var nocheckids =await _clinicalDataTrialSetRepository.Where(x => x.TrialId == setClinicalData.TrialId && setClinicalData.ClinicalDataTrialIds.Contains(x.Id)).Select(x => x.Id).ToListAsync();
|
||||||
|
|
||||||
foreach (var item in setClinicalData.ClinicalDataTrialIds)
|
foreach (var item in setClinicalData.ClinicalDataTrialIds)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
await _clinicalDataTrialSetRepository.UpdatePartialFromQueryAsync(item, x => new ClinicalDataTrialSet()
|
await _clinicalDataTrialSetRepository.UpdatePartialFromQueryAsync(item, x => new ClinicalDataTrialSet()
|
||||||
{
|
{
|
||||||
IsCheck = true
|
IsCheck = true
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in nocheckids)
|
foreach (var item in nocheckids)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
await _clinicalDataTrialSetRepository.UpdatePartialFromQueryAsync(item, x => new ClinicalDataTrialSet()
|
await _clinicalDataTrialSetRepository.UpdatePartialFromQueryAsync(item, x => new ClinicalDataTrialSet()
|
||||||
{
|
{
|
||||||
IsCheck = false
|
IsCheck = false
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await _clinicalDataTrialSetRepository.SaveChangesAsync();
|
await _clinicalDataTrialSetRepository.SaveChangesAsync();
|
||||||
|
@ -157,7 +151,7 @@ namespace IRaCIS.Application.Services
|
||||||
ClinicalDataLevel=x.ClinicalDataLevel,
|
ClinicalDataLevel=x.ClinicalDataLevel,
|
||||||
ClinicalUploadType=x.ClinicalUploadType,
|
ClinicalUploadType=x.ClinicalUploadType,
|
||||||
TrialId= trialId,
|
TrialId= trialId,
|
||||||
IsEnable=x.IsEnable,
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
await _clinicalDataTrialSetRepository.AddRangeAsync(dataSets);
|
await _clinicalDataTrialSetRepository.AddRangeAsync(dataSets);
|
||||||
var result= await _clinicalDataTrialSetRepository.SaveChangesAsync();
|
var result= await _clinicalDataTrialSetRepository.SaveChangesAsync();
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 项目ID
|
/// 项目ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统的ClinicalDataSetId
|
/// 系统的ClinicalDataSetId
|
||||||
|
@ -89,6 +89,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
return this.SystemClinicalDataSetId == null ? false : true;
|
return this.SystemClinicalDataSetId == null ? false : true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否使用
|
||||||
|
/// </summary>
|
||||||
|
public bool IsUsed { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -199,6 +199,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public List<Guid> CriterionIds { get; set; } = new List<Guid>();
|
public List<Guid> CriterionIds { get; set; } = new List<Guid>();
|
||||||
|
|
||||||
|
public List<string> ClinicalDataSetNames { get; set; } = new List<string>();
|
||||||
|
|
||||||
public bool IsTrialProcessConfirmed { get; set; }
|
public bool IsTrialProcessConfirmed { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<AssginSiteCRCCommand, TrialSiteUser>();
|
CreateMap<AssginSiteCRCCommand, TrialSiteUser>();
|
||||||
CreateMap<Domain.Models.Trial, TrialConfigDTO>().ForMember(t => t.TrialId, u => u.MapFrom(c => c.Id))
|
CreateMap<Domain.Models.Trial, TrialConfigDTO>().ForMember(t => t.TrialId, u => u.MapFrom(c => c.Id))
|
||||||
|
.ForMember(t => t.ClinicalDataSetNames, u => u.MapFrom(c => c.clinicalDataTrialSets.Where(v => v.IsCheck).Select(r => r.ClinicalDataSetName)))
|
||||||
.ForMember(t => t.CriterionIds, u => u.MapFrom(c => c.TrialDicList.Where(v => v.KeyName == StaticData.Criterion).Select(r => r.DictionaryId)));
|
.ForMember(t => t.CriterionIds, u => u.MapFrom(c => c.TrialDicList.Where(v => v.KeyName == StaticData.Criterion).Select(r => r.DictionaryId)));
|
||||||
CreateMap<Domain.Models.Trial, TrialSubjectConfig>();
|
CreateMap<Domain.Models.Trial, TrialSubjectConfig>();
|
||||||
CreateMap<Domain.Models.Trial, TrialSubjectAndSVConfig>();
|
CreateMap<Domain.Models.Trial, TrialSubjectAndSVConfig>();
|
||||||
|
|
|
@ -12,12 +12,23 @@ namespace IRaCIS.Core.Application.Triggers
|
||||||
public class SubjectVisitFinalVisitTrigger : IAfterSaveTrigger<SubjectVisit>
|
public class SubjectVisitFinalVisitTrigger : IAfterSaveTrigger<SubjectVisit>
|
||||||
{
|
{
|
||||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
|
private readonly IRepository<ReadingPeriodSet> _readingPeriodSetRepository;
|
||||||
|
private readonly IRepository<ReadingPeriodPlan> _readingPeriodPlanRepository;
|
||||||
|
private readonly IRepository<ReadModule> _readModuleRepository;
|
||||||
private readonly IRepository<Subject> _subjectRepository;
|
private readonly IRepository<Subject> _subjectRepository;
|
||||||
private readonly IRepository _repository;
|
private readonly IRepository _repository;
|
||||||
|
|
||||||
public SubjectVisitFinalVisitTrigger(IRepository<SubjectVisit> subjectVisitRepository, IRepository<Subject> subjectRepository, IRepository repository)
|
public SubjectVisitFinalVisitTrigger(IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
|
|
||||||
|
IRepository<ReadingPeriodSet> readingPeriodSetRepository,
|
||||||
|
IRepository<ReadingPeriodPlan> readingPeriodPlanRepository,
|
||||||
|
IRepository<ReadModule> readModuleRepository,
|
||||||
|
IRepository<Subject> subjectRepository, IRepository repository)
|
||||||
{
|
{
|
||||||
_subjectVisitRepository = subjectVisitRepository;
|
_subjectVisitRepository = subjectVisitRepository;
|
||||||
|
this._readingPeriodSetRepository = readingPeriodSetRepository;
|
||||||
|
this._readingPeriodPlanRepository = readingPeriodPlanRepository;
|
||||||
|
this._readModuleRepository = readModuleRepository;
|
||||||
_subjectRepository = subjectRepository;
|
_subjectRepository = subjectRepository;
|
||||||
_repository = repository;
|
_repository = repository;
|
||||||
}
|
}
|
||||||
|
@ -46,6 +57,20 @@ namespace IRaCIS.Core.Application.Triggers
|
||||||
u => new Subject() { Status = SubjectStatus.OnVisit, FinalSubjectVisitId = null });
|
u => new Subject() { Status = SubjectStatus.OnVisit, FinalSubjectVisitId = null });
|
||||||
|
|
||||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == subjectVisit.SubjectId && t.VisitExecuted == VisitExecutedEnum.Unavailable, u => new SubjectVisit() { VisitExecuted = VisitExecutedEnum.UnExecuted });
|
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.SubjectId == subjectVisit.SubjectId && t.VisitExecuted == VisitExecutedEnum.Unavailable, u => new SubjectVisit() { VisitExecuted = VisitExecutedEnum.UnExecuted });
|
||||||
|
|
||||||
|
var readingPeriodSet =await _readingPeriodSetRepository.Where(x => x.TrialId == subjectVisit.TrialId && x.IsGlobal).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (readingPeriodSet != null)
|
||||||
|
{
|
||||||
|
await _readingPeriodPlanRepository.DeleteFromQueryAsync(x => x.ReadingPeriodSetId == readingPeriodSet.Id && x.SubjectVisitId == subjectVisit.Id);
|
||||||
|
await _readModuleRepository.DeleteFromQueryAsync(x => x.SubjectVisitId == subjectVisit.Id && x.ReadingPeriodSetId == readingPeriodSet.Id);
|
||||||
|
|
||||||
|
await _readModuleRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,12 +79,8 @@ namespace IRaCIS.Core.Application.Triggers
|
||||||
{
|
{
|
||||||
await VerifyDealFinalVisitAsync(subjectVisit);
|
await VerifyDealFinalVisitAsync(subjectVisit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private async Task VerifyDealFinalVisitAsync(SubjectVisit subjectVisit)
|
private async Task VerifyDealFinalVisitAsync(SubjectVisit subjectVisit)
|
||||||
{
|
{
|
||||||
if (await _subjectVisitRepository.AnyAsync(t => t.SubjectId == subjectVisit.SubjectId && t.VisitNum > subjectVisit.VisitNum &&
|
if (await _subjectVisitRepository.AnyAsync(t => t.SubjectId == subjectVisit.SubjectId && t.VisitNum > subjectVisit.VisitNum &&
|
||||||
|
@ -86,9 +107,11 @@ namespace IRaCIS.Core.Application.Triggers
|
||||||
if (isGlobalReading)
|
if (isGlobalReading)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!await _repository.AnyAsync<ReadingPeriodSet>(x => x.TrialId == trialId && x.IsGlobal))
|
ReadingPeriodSet? readingPeriodSet =await _readingPeriodSetRepository.FirstOrDefaultNoTrackingAsync(x => x.TrialId == trialId && x.IsGlobal);
|
||||||
|
|
||||||
|
if (readingPeriodSet==null)
|
||||||
{
|
{
|
||||||
var readingPeriodSet = new ReadingPeriodSet()
|
readingPeriodSet = new ReadingPeriodSet()
|
||||||
{
|
{
|
||||||
Id = NewId.NextGuid(),
|
Id = NewId.NextGuid(),
|
||||||
ReadingScope = ReadingScopeEnum.All,
|
ReadingScope = ReadingScopeEnum.All,
|
||||||
|
@ -96,50 +119,42 @@ namespace IRaCIS.Core.Application.Triggers
|
||||||
IsTakeEffect = ReadingPeriodStatus.TakeEffect,
|
IsTakeEffect = ReadingPeriodStatus.TakeEffect,
|
||||||
ReadingPeriodName = "Global",
|
ReadingPeriodName = "Global",
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
|
|
||||||
EffectOfTime = DateTime.Now,
|
EffectOfTime = DateTime.Now,
|
||||||
IsGlobal = true,
|
IsGlobal = true,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
readingPeriodSet.ReadingPeriodPlanList.Add(new ReadingPeriodPlan()
|
await _readingPeriodSetRepository.AddAsync(readingPeriodSet);
|
||||||
{
|
|
||||||
SubjectVisitId = subjectVisitId,
|
|
||||||
ReadingPeriodSetId = readingPeriodSet.Id,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// 当前访视没有阅片期才添加
|
|
||||||
if (!await _repository.AnyAsync<ReadModule>(x => x.SubjectVisitId == subjectVisitId && x.ReadingSetType == ReadingSetType.ImageReading))
|
|
||||||
{
|
|
||||||
await _repository.AddAsync(new ReadModule()
|
|
||||||
{
|
|
||||||
ReadingPeriodSetId = readingPeriodSet.Id,
|
|
||||||
IsUrgent = subjectVisit.IsUrgent,
|
|
||||||
SubjectVisitId = subjectVisitId,
|
|
||||||
Status = ReadModuleEnum.TaskAllocation,
|
|
||||||
SubjectId = subjectVisit.SubjectId,
|
|
||||||
ModuleName = "Global",// 全局阅片
|
|
||||||
ReadingSetType = ReadingSetType.ImageReading,
|
|
||||||
ModuleType = ModuleTypeEnum.Global,
|
|
||||||
TrialId = subjectVisit.TrialId,
|
|
||||||
VisitNum = subjectVisit.VisitNum,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
await _repository.AddAsync(readingPeriodSet);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await _readingPeriodPlanRepository.AddAsync(new ReadingPeriodPlan()
|
||||||
|
{
|
||||||
|
SubjectVisitId = subjectVisitId,
|
||||||
|
ReadingPeriodSetId = readingPeriodSet.Id,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 当前访视没有阅片期才添加
|
||||||
|
if (!await _readModuleRepository.AnyAsync(x => x.SubjectVisitId == subjectVisitId && x.ReadingSetType == ReadingSetType.ImageReading))
|
||||||
|
{
|
||||||
|
await _readModuleRepository.AddAsync(new ReadModule()
|
||||||
|
{
|
||||||
|
ReadingPeriodSetId = readingPeriodSet.Id,
|
||||||
|
IsUrgent = subjectVisit.IsUrgent,
|
||||||
|
SubjectVisitId = subjectVisitId,
|
||||||
|
Status = ReadModuleEnum.TaskAllocation,
|
||||||
|
SubjectId = subjectVisit.SubjectId,
|
||||||
|
ModuleName = "Global",// 全局阅片
|
||||||
|
ReadingSetType = ReadingSetType.ImageReading,
|
||||||
|
ModuleType = ModuleTypeEnum.Global,
|
||||||
|
TrialId = subjectVisit.TrialId,
|
||||||
|
VisitNum = subjectVisit.VisitNum,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await _readModuleRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
|
@ -20,7 +20,6 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -53,16 +52,16 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否启用
|
|
||||||
/// </summary>
|
|
||||||
public bool IsEnable { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否勾选
|
/// 是否勾选
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsCheck { get; set; }
|
public bool IsCheck { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[ForeignKey("TrialId")]
|
||||||
|
public Trial Trial { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public List<ClinicalDataTrialSet> clinicalDataTrialSets { get; set; }=new List<ClinicalDataTrialSet> { };
|
||||||
|
|
||||||
public virtual ICollection<TrialStatusDetail> ClinicalTrialProjectDetails { get; set; }
|
public virtual ICollection<TrialStatusDetail> ClinicalTrialProjectDetails { get; set; }
|
||||||
public virtual ICollection<TrialDictionary> TrialDicList { get; set; }
|
public virtual ICollection<TrialDictionary> TrialDicList { get; set; }
|
||||||
|
|
Loading…
Reference in New Issue