处理检查删除、添加、维护绑定关系
This commit is contained in:
@@ -192,7 +192,7 @@ namespace IRaCIS.Application.Services
|
||||
SCPStudyId = scpStudy.Id,
|
||||
SeriesCount = scpStudy.SeriesCount,
|
||||
StudyTime = scpStudy.StudyTime,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
public async Task<List<string>> GetDicomModalityList(Guid trialId)
|
||||
{
|
||||
var list = await _scpStudyRepository.Where(t => t.TrialId == trialId).SelectMany(t => t.SeriesList).Select(t=>t.Modality).Distinct().ToListAsync();
|
||||
var list = await _scpStudyRepository.Where(t => t.TrialId == trialId).SelectMany(t => t.SeriesList).Select(t => t.Modality).Distinct().ToListAsync();
|
||||
|
||||
return list;
|
||||
}
|
||||
@@ -265,10 +265,10 @@ namespace IRaCIS.Application.Services
|
||||
SCPStudyId = scpStudy.Id,
|
||||
SeriesCount = scpStudy.SeriesCount,
|
||||
StudyTime = scpStudy.StudyTime,
|
||||
BodyPartExamined=scpStudy.BodyPartExamined,
|
||||
AccessionNumber=scpStudy.AccessionNumber,
|
||||
BodyPartExamined = scpStudy.BodyPartExamined,
|
||||
AccessionNumber = scpStudy.AccessionNumber,
|
||||
|
||||
PatientBirthDate=scpStudy.PatientBirthDate,
|
||||
PatientBirthDate = scpStudy.PatientBirthDate,
|
||||
PatientAge = scpStudy.PatientAge,
|
||||
PatientIdStr = scpStudy.PatientIdStr,
|
||||
PatientName = scpStudy.PatientName,
|
||||
@@ -311,12 +311,12 @@ namespace IRaCIS.Application.Services
|
||||
foreach (var scpStudyId in inCommand.SCPStudyIdList)
|
||||
{
|
||||
|
||||
var find = _scpStudyRepository.Where(t => t.Id == scpStudyId).Include(t => t.SeriesList).Include(t => t.InstanceList).FirstOrDefault();
|
||||
var find = _scpStudyRepository.Where(t => t.Id == scpStudyId).Select(t => new { SCPStudy = t, t.SeriesList, t.InstanceList }).FirstOrDefault();
|
||||
|
||||
if (find != null)
|
||||
{
|
||||
|
||||
var newStuty = _mapper.Map<DicomStudy>(find);
|
||||
var newStuty = _mapper.Map<DicomStudy>(find.SCPStudy);
|
||||
|
||||
await _repository.AddAsync(newStuty);
|
||||
|
||||
@@ -345,8 +345,6 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
foreach (var instance in newInstanceList)
|
||||
{
|
||||
|
||||
|
||||
instance.SeqId = Guid.Empty;
|
||||
instance.TrialId = trialId;
|
||||
instance.SubjectId = subjectId;
|
||||
@@ -358,6 +356,10 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
currentNextCodeInt++;
|
||||
|
||||
await _repository.BatchUpdateAsync<SCPPatient>(t => t.Id == find.SCPStudy.PatientId, u => new SCPPatient() { SubjectId = subjectId });
|
||||
await _repository.BatchUpdateAsync<SCPStudy>(t => t.Id == scpStudyId, u => new SCPStudy() { SubjectVisitId = subjectVisitId });
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -367,6 +369,7 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user