From 27711f4184ae25a9ebcd8daaeea624b48f825df9 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 2 Jul 2024 09:33:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=BA=8F=E5=88=97=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ImageAndDoc/DTO/DicomSeriesModel.cs | 13 ++++++++ .../Service/Visit/SubjectVisitService.cs | 30 ++++++++++++++----- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs index e6f2443cb..ceca4a370 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs @@ -52,6 +52,19 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO public string ImageResizePath { get; set; } } + public class StudyInstanceInfo + { + + public int ShowOrder { get; set; } + + + public decimal RowIndex { get; set; } + + public Guid? SeriesId { get; set; } + + public Guid? StudyId { get; set; } + public Guid? InstanceId { get; set; } + } public class InstanceBasicInfo { public Guid Id { get; set; } diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 221bd30a9..5d435d1e2 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -32,6 +32,7 @@ namespace IRaCIS.Core.Application.Services private readonly IRepository _dicomInstanceRepository; private readonly IRepository _visitTaskRepository; private readonly IRepository _readingTableAnswerRowInfoRepository; + private readonly IRepository _readingCustomTagRepository; private readonly IRepository _noneDicomStudyFileRepository; private readonly IRepository _readingPeriodPlanRepository; private readonly IRepository _subjectRepository; @@ -50,6 +51,7 @@ namespace IRaCIS.Core.Application.Services IRepository dicomInstanceRepository, IRepository visitTaskRepository, IRepository readingTableAnswerRowInfoRepository, + IRepository readingCustomTagRepository, IRepository noneDicomStudyFileRepository, IRepository readingPeriodPlanRepository, IRepository subjectRepository, @@ -70,6 +72,7 @@ namespace IRaCIS.Core.Application.Services this._dicomInstanceRepository = dicomInstanceRepository; this._visitTaskRepository = visitTaskRepository; this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository; + this._readingCustomTagRepository = readingCustomTagRepository; this._noneDicomStudyFileRepository = noneDicomStudyFileRepository; this._readingPeriodPlanRepository = readingPeriodPlanRepository; _subjectRepository = subjectRepository; @@ -574,15 +577,28 @@ namespace IRaCIS.Core.Application.Services //已经签名的任务,加关键序列 if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned) { - var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).OrderBy(x => x.ReadingQuestionTrial.ShowOrder).ThenBy(x => x.RowIndex).Select(x => new + var rowInfoList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).OrderBy(x => x.ReadingQuestionTrial.ShowOrder).ThenBy(x => x.RowIndex).Select(x => new StudyInstanceInfo() { - x.ReadingQuestionTrial.ShowOrder, - x.RowIndex, - x.SeriesId, - x.StudyId, - x.InstanceId, + ShowOrder = x.ReadingQuestionTrial.ShowOrder, + RowIndex = x.RowIndex, + SeriesId = x.SeriesId, + StudyId = x.StudyId, + InstanceId = x.InstanceId, }).ToListAsync(); + + + var customoList = await _readingCustomTagRepository.Where(x => x.VisitTaskId == indto.VisitTaskId && x.StudyId != null).Select(x => new StudyInstanceInfo() + { + ShowOrder = 0, + RowIndex = 0m, + SeriesId = x.SeriesId, + StudyId = x.StudyId, + InstanceId = x.InstanceId, + }).ToListAsync(); + + rowInfoList.AddRange(customoList); + var thisStudyIds = rowInfoList.OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.StudyId).Distinct().ToList(); var thisSeriesIdIds = rowInfoList.Where(x => x.SeriesId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(x => x.SeriesId).Distinct().ToList(); if (rowInfoList.Count > 0) @@ -649,7 +665,7 @@ namespace IRaCIS.Core.Application.Services - studyList.Add(thisVisitTaskStudy); + studyList.Insert(0,thisVisitTaskStudy); }