修改Dicom影像上传信息

This commit is contained in:
he
2022-04-26 15:28:40 +08:00
parent 34a5532ee2
commit e395e105cb
4 changed files with 187 additions and 50 deletions
+42 -33
View File
@@ -188,46 +188,55 @@ namespace IRaCIS.Api.Controllers
section = await reader.ReadNextSectionAsync();
}
if (archivedStudyIds.Count > 0) // 上传成功,处理逻辑
try
{
// 同一个访视 多个线程上传处理 批量保存 可能造成死锁 https://www.cnblogs.com/johnblogs/p/9945767.html
await _dicomArchiveService.DicomDBDataSaveChange();
//sw.Stop();
_studyService.UploadOrReUploadNeedTodo(archiveStudyCommand, archivedStudyIds, ref archiveResult, new StudyMonitor()
if (archivedStudyIds.Count > 0) // 上传成功,处理逻辑
{
TrialId = savedInfo.TrialId,
SiteId = savedInfo.SiteId,
SubjectId = savedInfo.SubjectId,
SubjectVisitId = savedInfo.SubjectVisitId,
StudyId = archivedStudyIds[0],
UploadStartTime = startTime,
UploadFinishedTime = DateTime.Now,
//TotalMillisecondsInterval = (DateTime.Now- startTime).TotalMilliseconds,
FileSize = (decimal)HttpContext.Request.ContentLength,
FileCount = archiveResult.ReceivedFileCount,
IsDicom = true,
IsDicomReUpload = archiveStudyCommand.AbandonStudyId!=null,
IP =_userInfo.IP
});
_provider.Remove("StudyUid_" + archiveStudyCommand.StudyInstanceUid);
// 同一个访视 多个线程上传处理 批量保存 可能造成死锁 https://www.cnblogs.com/johnblogs/p/9945767.html
await _dicomArchiveService.DicomDBDataSaveChange();
//sw.Stop();
_studyService.UploadOrReUploadNeedTodo(archiveStudyCommand, archivedStudyIds, ref archiveResult, new StudyMonitor()
{
TrialId = savedInfo.TrialId,
SiteId = savedInfo.SiteId,
SubjectId = savedInfo.SubjectId,
SubjectVisitId = savedInfo.SubjectVisitId,
StudyId = archivedStudyIds[0],
UploadStartTime = startTime,
UploadFinishedTime = DateTime.Now,
//TotalMillisecondsInterval = (DateTime.Now- startTime).TotalMilliseconds,
FileSize = (decimal)HttpContext.Request.ContentLength,
FileCount = archiveResult.ReceivedFileCount,
IsDicom = true,
IsDicomReUpload = archiveStudyCommand.AbandonStudyId != null,
IP = _userInfo.IP
});
_provider.Remove("StudyUid_" + archiveStudyCommand.StudyInstanceUid);
}
else
{
return ResponseOutput.NotOk("未完成该检查的归档", archiveResult);
}
data.GeneralId = archivedStudyIds[0];
Dictionary<string, object> keyValuePairs = new Dictionary<string, object>();
keyValuePairs.Add("StyudCode", studycode);
data.JsonDetail = _inspectionService.AddJsonItem(data.JsonDetail, keyValuePairs);
await _inspectionService.AddInspectionRecordAsync(data);
}
else
catch (Exception)
{
return ResponseOutput.NotOk("未完成该检查的归档", archiveResult);
section = await reader.ReadNextSectionAsync();
}
data.GeneralId = archivedStudyIds[0];
Dictionary<string,object> keyValuePairs = new Dictionary<string,object>();
keyValuePairs.Add("StyudCode", studycode);
data.JsonDetail = _inspectionService.AddJsonItem(data.JsonDetail, keyValuePairs);
await _inspectionService.AddInspectionRecordAsync(data);