修改一版
This commit is contained in:
@@ -842,7 +842,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
|
||||
var DicomSeriesdata = await _repository.GetQueryable<DicomSeries>().Where(x => x.StudyId == id).ToListAsync();
|
||||
var study = await _repository.FirstOrDefaultAsync<DicomStudy>(t => t.Id == id);
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
||||
DateTime time = DateTime.Now.AddMilliseconds(500);
|
||||
if (type == 1)
|
||||
{
|
||||
@@ -852,33 +852,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
study.BodyPartForEdit = bodyPart;
|
||||
study.Modalities = modality;
|
||||
await _repository.BatchUpdateAsync<DicomSeries>(t => t.StudyId == id, r => new DicomSeries() { BodyPartForEdit = bodyPart, Modality = modality });
|
||||
|
||||
DicomSeriesdata.ForEach(x =>
|
||||
{
|
||||
//datas.Add(new DataInspection()
|
||||
//{
|
||||
// TrialId = x.TrialId,
|
||||
// SiteId = x.SiteId,
|
||||
// SubjectId = x.SubjectId,
|
||||
// SubjectVisitId = x.SubjectVisitId,
|
||||
// GeneralId = x.Id,
|
||||
// CreateTime = time,
|
||||
// Identification = "Edit|DICOM Series|Info|Visit-Image Quanlity Control",
|
||||
// JsonDetail = JsonConvert.SerializeObject(new
|
||||
// {
|
||||
// StudyCode = study.StudyCode,
|
||||
// Modalities = study.Modalities,
|
||||
// SeriesNumber = x.SeriesNumber,
|
||||
// InstanceCount = x.InstanceCount,
|
||||
// SeriesTime = x.SeriesTime,
|
||||
// BodyPartForEdit = bodyPart,
|
||||
// Modality = modality
|
||||
// })
|
||||
|
||||
//});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else if (type == 2)
|
||||
{
|
||||
@@ -886,30 +859,6 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
if (series == null) return Null404NotFound(series);
|
||||
series.BodyPartForEdit = bodyPart;
|
||||
|
||||
//DicomSeriesdata.ForEach(x =>
|
||||
//{
|
||||
// datas.Add(new DataInspection()
|
||||
// {
|
||||
// TrialId = x.TrialId,
|
||||
// SiteId = x.SiteId,
|
||||
// SubjectId = x.SubjectId,
|
||||
// SubjectVisitId = x.SubjectVisitId,
|
||||
// GeneralId = x.Id,
|
||||
// CreateTime = time,
|
||||
// Identification = "Edit|DICOM Series|Info|Visit-Image Quanlity Control",
|
||||
// JsonDetail = JsonConvert.SerializeObject(new
|
||||
// {
|
||||
// StudyCode = study.StudyCode,
|
||||
// Modalities = study.Modalities,
|
||||
// SeriesNumber = x.SeriesNumber,
|
||||
// InstanceCount = x.InstanceCount,
|
||||
// SeriesTime = x.SeriesTime,
|
||||
// BodyPartForEdit = bodyPart,
|
||||
// })
|
||||
|
||||
// });
|
||||
|
||||
//});
|
||||
}
|
||||
else if (type == 3)
|
||||
{
|
||||
@@ -1869,28 +1818,15 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
{
|
||||
|
||||
bool isSuccess = false;
|
||||
List<DataInspection> datas = new List<DataInspection>();
|
||||
|
||||
|
||||
foreach (var subjectVisitId in subjectVisitIdList)
|
||||
{
|
||||
|
||||
|
||||
var info = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).ProjectTo<DicomTrialSiteSubjectInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
Dictionary<string, object> keyValuePairs = new Dictionary<string, object>() {
|
||||
{"SubmitState",info.SubmitState },
|
||||
{ "AuditState",info.AuditState},
|
||||
{ "CheckState",info.CheckState},
|
||||
{ "ForwardState",info.ForwardState}
|
||||
|
||||
};
|
||||
DataInspection data = new DataInspection()
|
||||
{
|
||||
TrialId = info.TrialId,
|
||||
SiteId = info.SiteId,
|
||||
SubjectId = info.SubjectId,
|
||||
SubjectVisitId = subjectVisitId,
|
||||
Identification = "Edit|Visit|Status|Visit-Image Forward"
|
||||
};
|
||||
|
||||
|
||||
var targetPath = "/IMPORT-IMAGES/" + info.TrialCode + "_" + info.SubjectCode + "_" + info.VisitName;
|
||||
|
||||
var path = _dicomFileStoreHelper.GetSubjectVisitPath(info.TrialId, info.SiteId, info.SubjectId, info.SubjectVisitId);
|
||||
@@ -1953,26 +1889,22 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.Forwarded, ForwardUserId = _userInfo.Id, ForwardTime = DateTime.Now });
|
||||
|
||||
isSuccess = true;
|
||||
keyValuePairs["ForwardState"] = ForwardStateEnum.Forwarded;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId,
|
||||
u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed });
|
||||
keyValuePairs["ForwardState"] = ForwardStateEnum.ForwardFailed;
|
||||
|
||||
|
||||
return ResponseOutput.NotOk("转发失败 " + e.Message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
data.JsonDetail = JsonConvert.SerializeObject(keyValuePairs);
|
||||
datas.Add(data);
|
||||
}
|
||||
|
||||
// 这里使用的是批量更新
|
||||
await _subjectVisitRepository.AddListInspectionRecordAsync(datas);
|
||||
|
||||
|
||||
await _subjectVisitRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user