修改后处理上传验证

This commit is contained in:
2024-09-10 13:29:37 +08:00
parent 360bcd6bfe
commit 08edc735e9
9 changed files with 115 additions and 13 deletions
@@ -256,18 +256,28 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
/// 在调用预归档前验证 这些检查是否可以全新上传还是已存在补充 目前前端允许 IsAllowUpload==true 全新、IsAllowReUpload==true 补充的study ,全部丢到后端,后端判断存在,就删除之前的检查,全新插入
/// </summary>
/// <param name="inCommand"></param>
/// <param name="_dicomStudyRepository"></param>
/// <returns></returns>
public async Task<List<TaskStudyArchiveConfirmResult>> VerifyIRStudyAllowUpload(TaskStudyAchivePreConfirmCommand inCommand)
public async Task<List<TaskStudyArchiveConfirmResult>> VerifyIRStudyAllowUpload(TaskStudyAchivePreConfirmCommand inCommand, [FromServices] IRepository<DicomStudy> _dicomStudyRepository)
{
var notAllowedUidList = _taskStudyRepository.Where(t => t.TrialId == inCommand.TrialId && inCommand.StudyInstanceUidList.Contains(t.StudyInstanceUid)).Select(t => new
var notAllowedUidList1 = _taskStudyRepository.Where(t => t.TrialId == inCommand.TrialId && inCommand.StudyInstanceUidList.Contains(t.StudyInstanceUid)).Select(t => new
{
t.StudyInstanceUid,
t.SubjectId,
SubejectCode = t.VisitTask.IsAnalysisCreate ? t.VisitTask.BlindSubjectCode : t.Subject.Code
}).ToList();
var notAllowedUidList2 = _dicomStudyRepository.Where(t => t.TrialId == inCommand.TrialId && inCommand.StudyInstanceUidList.Contains(t.StudyInstanceUid)).Select(t => new
{
t.StudyInstanceUid,
t.SubjectId,
SubejectCode = t.Subject.Code
}).ToList();
var notAllowedUidList = notAllowedUidList1.Union(notAllowedUidList2);
var result = new List<TaskStudyArchiveConfirmResult>();
foreach (var studyUid in inCommand.StudyInstanceUidList)
@@ -275,6 +285,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var findStudy = notAllowedUidList.Where(t => t.StudyInstanceUid == studyUid).FirstOrDefault();
if (findStudy != null)
{
//同一个subject 同一份影响
if (findStudy.SubejectCode == inCommand.SubjectCode && findStudy.SubjectId == inCommand.SubjectId)
{