Compare commits
No commits in common. "3fab377454fc8464a3b96f18f27f6c8a7757bf97" and "63530b7847fd592c3dbe4504d6768228b2965bad" have entirely different histories.
3fab377454
...
63530b7847
|
|
@ -17,7 +17,6 @@ using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Application.Service;
|
using IRaCIS.Core.Application.Service;
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
using DocumentFormat.OpenXml.Office2010.Excel;
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Image.QA
|
namespace IRaCIS.Core.Application.Image.QA
|
||||||
{
|
{
|
||||||
|
|
@ -803,45 +802,27 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
var succeess2 = await _repository.BatchDeleteAsync<DicomInstance>(t => t.StudyId == id);
|
var succeess2 = await _repository.BatchDeleteAsync<DicomInstance>(t => t.StudyId == id);
|
||||||
var success3 = await _dicomSeriesrepository.BatchDeleteNoTrackingAsync(t => t.StudyId == id);
|
var success3 = await _dicomSeriesrepository.BatchDeleteNoTrackingAsync(t => t.StudyId == id);
|
||||||
|
|
||||||
await _repository.BatchUpdateAsync<SCPStudy>(t => t.Id == id,u=>new SCPStudy() { SubjectVisitId=null});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//var success3 = await _dicomSeriesrepository.DeleteFromQueryAsync(t => t.StudyId == id, true);
|
//var success3 = await _dicomSeriesrepository.DeleteFromQueryAsync(t => t.StudyId == id, true);
|
||||||
//var success4 = await _repository.BatchDeleteAsync<StudyMonitor>(t => t.StudyId == id);
|
//var success4 = await _repository.BatchDeleteAsync<StudyMonitor>(t => t.StudyId == id);
|
||||||
|
|
||||||
//删除 物理文件
|
//删除 物理文件
|
||||||
|
|
||||||
//var instancePathList = await _repository.Where<DicomInstance>(t => t.StudyId == id)
|
var instancePathList = await _repository.Where<DicomInstance>(t => t.StudyId == id)
|
||||||
// .Select(t => t.Path).ToListAsync();
|
.Select(t => t.Path).ToListAsync();
|
||||||
|
|
||||||
//instancePathList.ForEach(path =>
|
instancePathList.ForEach(path =>
|
||||||
//{
|
|
||||||
|
|
||||||
// var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
|
|
||||||
|
|
||||||
// if (System.IO.File.Exists(physicalPath))
|
|
||||||
// {
|
|
||||||
// File.Delete(physicalPath);
|
|
||||||
// }
|
|
||||||
//});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
var subjectId=waitDeleteStudyList.Select(t=>t.SubjectId).FirstOrDefault();
|
|
||||||
|
|
||||||
var patientList = _repository.Where<SCPPatient>(t => t.SubjectId == subjectId).Select(t => t.Id).ToList();
|
|
||||||
|
|
||||||
foreach (var patientId in patientList)
|
|
||||||
{
|
|
||||||
if (_repository.Where<SCPPatient>(t=>t.Id== patientId).Any(t => t.SCPStudyList.Count() == t.SCPStudyList.Where(t => t.SubjectVisitId == null).Count()))
|
|
||||||
{
|
{
|
||||||
await _repository.BatchUpdateAsync<SCPPatient>(t => t.Id == patientId, u => new SCPPatient() { SubjectId = null });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path);
|
||||||
|
|
||||||
|
if (System.IO.File.Exists(physicalPath))
|
||||||
|
{
|
||||||
|
File.Delete(physicalPath);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
await _subjectVisitRepository.SaveChangesAsync();
|
await _subjectVisitRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ namespace IRaCIS.Application.Services
|
||||||
SCPStudyId = scpStudy.Id,
|
SCPStudyId = scpStudy.Id,
|
||||||
SeriesCount = scpStudy.SeriesCount,
|
SeriesCount = scpStudy.SeriesCount,
|
||||||
StudyTime = scpStudy.StudyTime,
|
StudyTime = scpStudy.StudyTime,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -229,7 +229,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
public async Task<List<string>> GetDicomModalityList(Guid trialId)
|
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;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
@ -265,10 +265,10 @@ namespace IRaCIS.Application.Services
|
||||||
SCPStudyId = scpStudy.Id,
|
SCPStudyId = scpStudy.Id,
|
||||||
SeriesCount = scpStudy.SeriesCount,
|
SeriesCount = scpStudy.SeriesCount,
|
||||||
StudyTime = scpStudy.StudyTime,
|
StudyTime = scpStudy.StudyTime,
|
||||||
BodyPartExamined = scpStudy.BodyPartExamined,
|
BodyPartExamined=scpStudy.BodyPartExamined,
|
||||||
AccessionNumber = scpStudy.AccessionNumber,
|
AccessionNumber=scpStudy.AccessionNumber,
|
||||||
|
|
||||||
PatientBirthDate = scpStudy.PatientBirthDate,
|
PatientBirthDate=scpStudy.PatientBirthDate,
|
||||||
PatientAge = scpStudy.PatientAge,
|
PatientAge = scpStudy.PatientAge,
|
||||||
PatientIdStr = scpStudy.PatientIdStr,
|
PatientIdStr = scpStudy.PatientIdStr,
|
||||||
PatientName = scpStudy.PatientName,
|
PatientName = scpStudy.PatientName,
|
||||||
|
|
@ -311,12 +311,12 @@ namespace IRaCIS.Application.Services
|
||||||
foreach (var scpStudyId in inCommand.SCPStudyIdList)
|
foreach (var scpStudyId in inCommand.SCPStudyIdList)
|
||||||
{
|
{
|
||||||
|
|
||||||
var find = _scpStudyRepository.Where(t => t.Id == scpStudyId).Select(t => new { SCPStudy = t, t.SeriesList, t.InstanceList }).FirstOrDefault();
|
var find = _scpStudyRepository.Where(t => t.Id == scpStudyId).Include(t => t.SeriesList).Include(t => t.InstanceList).FirstOrDefault();
|
||||||
|
|
||||||
if (find != null)
|
if (find != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
var newStuty = _mapper.Map<DicomStudy>(find.SCPStudy);
|
var newStuty = _mapper.Map<DicomStudy>(find);
|
||||||
|
|
||||||
await _repository.AddAsync(newStuty);
|
await _repository.AddAsync(newStuty);
|
||||||
|
|
||||||
|
|
@ -345,6 +345,8 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
foreach (var instance in newInstanceList)
|
foreach (var instance in newInstanceList)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
instance.SeqId = Guid.Empty;
|
instance.SeqId = Guid.Empty;
|
||||||
instance.TrialId = trialId;
|
instance.TrialId = trialId;
|
||||||
instance.SubjectId = subjectId;
|
instance.SubjectId = subjectId;
|
||||||
|
|
@ -356,10 +358,6 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
currentNextCodeInt++;
|
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 });
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -369,7 +367,6 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
await _repository.SaveChangesAsync();
|
await _repository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,5 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public TrialSite TrialSite { get; set; }
|
public TrialSite TrialSite { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue