diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index c8397ba82..851e582a9 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -420,7 +420,6 @@ namespace IRaCIS.Core.Application.Service { var newStuty = _mapper.Map(find.SCPStudy); - await _dicomStudyRepository.AddAsync(newStuty); newStuty.SeqId = Guid.Empty; newStuty.Code = currentNextCodeInt; @@ -430,6 +429,9 @@ namespace IRaCIS.Core.Application.Service newStuty.SubjectId = subjectId; newStuty.SubjectVisitId = subjectVisitId; + await _dicomStudyRepository.AddAsync(newStuty); + + var newSeriesList = _mapper.Map>(find.SeriesList); foreach (var series in newSeriesList)