diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index b61c5f48a..139b6bb2f 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -20,6 +20,7 @@ using WinSCP; using Magicodes.ExporterAndImporter.Excel; using Newtonsoft.Json; using Magicodes.ExporterAndImporter.Csv; +using IRaCIS.Core.Application.Service.Inspection.Interface; namespace IRaCIS.Core.Application.Image.QA { @@ -30,16 +31,19 @@ namespace IRaCIS.Core.Application.Image.QA private readonly DicomFileStoreHelper _dicomFileStoreHelper; private readonly IRepository _subjectVisitRepository; private readonly IRepository _trialRepository; + private readonly IInspectionService _sinspectionService; private object _locker = new object(); public QCOperationService(DicomFileStoreHelper dicomFileStoreHelper, IRepository subjectVisitRepository, IRepository trialRepository, + IInspectionService sinspectionService, IRepository _trialRepository ) { _dicomFileStoreHelper = dicomFileStoreHelper; _subjectVisitRepository = subjectVisitRepository; this._trialRepository = trialRepository; + this._sinspectionService = sinspectionService; } #region QC质疑 以及回复 关闭 @@ -935,7 +939,7 @@ namespace IRaCIS.Core.Application.Image.QA /// /// /// - /// + /// SeriesCount [HttpPost, Route("{trialId:guid}/{subjectVisitId:guid}")] [TypeFilter(typeof(TrialResourceFilter))] public async Task DeleteStudyList(Guid[] ids, Guid subjectVisitId, Guid trialId) @@ -946,8 +950,32 @@ namespace IRaCIS.Core.Application.Image.QA { return ResponseOutput.NotOk("CRC Has Submited Image,can not delete"); } + var DicomStudys = await _repository.GetQueryable().Where(x => ids.Contains(x.Id)).ToListAsync(); + + List datas = new List(); + + DicomStudys.ForEach(x => + { + datas.Add(new DataInspection() + { + + SiteId = x.SiteId, + SubjectId = x.SubjectId, + TrialId = x.TrialId, + SubjectVisitId=x.SubjectVisitId, + JsonDetail = JsonConvert.SerializeObject(new + { + studyUid=x.StudyCode, + modality=x.Modalities, + bodyPart=x.BodyPartForEdit, + seriesNum=x.SeriesCount, + fileNum = x.InstanceCount, + studyTime=x.StudyTime.ToString("yyyy-MM-dd") + + }) + }); + }); - var DicomStudys= #region will calls error wried //ids.ToList().ForEach(async id => @@ -1015,7 +1043,7 @@ namespace IRaCIS.Core.Application.Image.QA LatestScanDate = maxArray.Max() }); - + await _sinspectionService.AddListInspectionRecordAsync(datas); return ResponseOutput.Ok(); }