diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index 0198ca97b..fa96cd2e1 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -892,7 +892,7 @@ namespace IRaCIS.Core.Application.Image.QA - var success3 = await _dicomSeriesrepository.DeleteFromQueryAsync(t => t.StudyId == id); + var success3 = await _dicomSeriesrepository.DeleteFromQueryAsync(t => t.StudyId == id,true); var success4 = await _repository.BatchDeleteAsync(t => t.StudyId == id); //删除 物理文件 diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 4381e573e..7b7ad8b36 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -125,7 +125,15 @@ namespace IRaCIS.Core.Infra.EFCore.Common // 访视 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SubjectVisit))) { - var subjectCode = (item.Entity as SubjectVisit).Subject?.Code; + var entity = item.Entity as SubjectVisit; + switch (GetRequestUrl()) + { + case "QCOperation/ObtainOrCancelQCTask": + type = type +"/"+ entity.IsTake.ToString(); + break; + } + + var subjectCode = entity.Subject?.Code; await InsertInspection(item, type, x => new DataInspection() { SubjectCode= subjectCode, @@ -158,6 +166,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common // 其他治疗史 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(PreviousOther))) { + await InsertInspection(item, type, x => new DataInspection() { GeneralId = x.Id, @@ -180,14 +189,17 @@ namespace IRaCIS.Core.Infra.EFCore.Common foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomSeries))) { var entity = item.Entity as DicomSeries; - + if (entity.DicomStudy == null) + { + entity.DicomStudy =await _dbContext.DicomStudys.FirstOrDefaultAsync(x=>x.Id== entity.StudyId); + } await InsertInspection(item, type, x => new DataInspection() { GeneralId = x.Id, }, new { - StudyCode = entity.DicomStudy.StudyCode, - Modalities = entity.DicomStudy.Modalities, + StudyCode = entity.DicomStudy?.StudyCode, + Modalities = entity.DicomStudy?.Modalities, }); } @@ -215,6 +227,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common //质疑 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(QCChallenge))) { + type = _userInfo.UserTypeShortName +"/"+ type; await InsertInspection(item, type, x => new DataInspection() { GeneralId = x.Id, @@ -224,6 +237,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common //一致性核查 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(CheckChallengeDialog))) { + type = _userInfo.UserTypeShortName + "/" + type; await InsertInspection(item, type, x => new DataInspection() { GeneralId = x.Id,