Compare commits
7 Commits
2ce8edde80
...
28360861aa
| Author | SHA1 | Date |
|---|---|---|
|
|
28360861aa | |
|
|
3e097fa42b | |
|
|
b8a7cd6ebc | |
|
|
a9aefaf240 | |
|
|
266a0c5dd5 | |
|
|
54822ae038 | |
|
|
05203d6716 |
|
|
@ -81,7 +81,7 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
|||
|
||||
public bool IsReading { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
public long? FileSize { get; set; }
|
||||
|
||||
|
||||
public Guid? StudyId { get; set; }
|
||||
|
|
|
|||
|
|
@ -107,8 +107,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
|||
public string Modalities { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public int SeriesCount { get; set; }
|
||||
public int InstanceCount { get; set; }
|
||||
|
||||
public int ReadingSeriesCount { get; set; }
|
||||
|
||||
public int ReadingInstanceCount { get; set; }
|
||||
}
|
||||
|
||||
public class NoneDicomStudyBasicInfo
|
||||
|
|
@ -128,6 +133,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
|||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public int ReadingFileCount { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -882,6 +882,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
subjectCode = inQuery.SubjectCode;
|
||||
}
|
||||
|
||||
TaskState? taskState = null;
|
||||
if (inQuery.VisitTaskId != null)
|
||||
{
|
||||
//考虑到一致性分析,必须要这个编号进行过滤
|
||||
|
|
@ -892,20 +893,25 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
SubjectCode = t.IsAnalysisCreate ? t.BlindSubjectCode : t.Subject.Code,
|
||||
SubjectId = t.SubjectId,
|
||||
t.DoctorUserId,
|
||||
t.IsAnalysisCreate
|
||||
t.IsAnalysisCreate,
|
||||
t.TaskState
|
||||
}).FirstNotNullAsync();
|
||||
|
||||
subjectId = taskInfo.SubjectId;
|
||||
subjectCode = taskInfo.SubjectCode;
|
||||
doctorUserId = (Guid)taskInfo.DoctorUserId!;
|
||||
isAnalysisCreate = taskInfo.IsAnalysisCreate;
|
||||
|
||||
taskState = taskInfo.TaskState;
|
||||
}
|
||||
|
||||
var query = _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId)
|
||||
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
|
||||
.WhereIf(inQuery.VisitTaskId == null, t => t.TaskState == TaskState.Effect)//从待阅列表进入,要筛选出有效的,任务可能重阅了,也要看到该任务的的
|
||||
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
|
||||
.WhereIf(inQuery.VisitTaskId == null, t => t.TaskState == TaskState.Effect)//从待阅列表进入,要筛选出有效的,任务可能重阅了,也要看到该任务的
|
||||
.WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId)
|
||||
.WhereIf(taskState == TaskState.Effect || taskState == TaskState.Freeze, t => t.TaskState == TaskState.Effect)//subject 随机可能当前阅片人有退回任务,此时传递了任务Id,但是要看整个subject得,要只留生效的
|
||||
.WhereIf(taskState != null && taskState != TaskState.Effect && taskState != TaskState.Freeze, t => t.Id == inQuery.VisitTaskId) //非生效只查当前任务
|
||||
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
//这里过滤是否是一致性分析的
|
||||
|
|
@ -1006,11 +1012,11 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
u.StudyTime,
|
||||
u.StudyCode,
|
||||
|
||||
SeriesList = u.SeriesList.Select(z => new
|
||||
SeriesList = u.SeriesList.Where(t => t.IsReading).Select(z => new
|
||||
{
|
||||
z.Modality,
|
||||
|
||||
InstancePathList = z.DicomInstanceList.Select(k => new
|
||||
InstancePathList = z.DicomInstanceList.Where(t => t.IsReading).Select(k => new
|
||||
{
|
||||
k.Path,
|
||||
k.FileSize
|
||||
|
|
@ -1021,13 +1027,14 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
NoneDicomStudyList = sv.NoneDicomStudyList.Where(t => isQueryNoneDicom ? inQuery.NoneDicomStudyIdList.Contains(t.Id) : false)
|
||||
.Where(t => info.IsImageFilter ? ("|" + info.CriterionModalitys + "|").Contains("|" + t.Modality + "|") : true)
|
||||
.Where(t => t.IsReading)
|
||||
.Select(nd => new
|
||||
{
|
||||
nd.Modality,
|
||||
nd.StudyCode,
|
||||
nd.ImageDate,
|
||||
|
||||
FileList = nd.NoneDicomFileList.Select(file => new
|
||||
FileList = nd.NoneDicomFileList.Where(t => t.IsReading).Select(file => new
|
||||
{
|
||||
file.FileName,
|
||||
file.Path,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
|
@ -19,8 +20,9 @@ namespace IRaCIS.Core.Application.Services
|
|||
//医生读片那一块有耦合,关键序列 这里暂时留存
|
||||
/// <summary> 指定资源Id,获取Dicom检查所属序列信息列表 </summary>
|
||||
/// <param name="studyId"> Dicom检查的Id </param>
|
||||
/// <param name="isReading"></param>
|
||||
[HttpGet, Route("{studyId:guid}")]
|
||||
public async Task<IResponseOutput<List<DicomSeriesDTO>>> List(Guid studyId)
|
||||
public async Task<IResponseOutput<List<DicomSeriesDTO>>> List(Guid studyId, bool? isReading)
|
||||
{
|
||||
//质控的时候,要标记序列,和instance 删除 ,所以要返回全部,但是 质控通过后,pm 进去看的时候要看过滤后的
|
||||
|
||||
|
|
@ -32,14 +34,16 @@ namespace IRaCIS.Core.Application.Services
|
|||
//断点
|
||||
var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters()
|
||||
.WhereIf(isQCFinished, t => t.IsDeleted == false)
|
||||
.WhereIf(isReading == true, t => t.IsReading == true)
|
||||
.OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime)
|
||||
.ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters()
|
||||
.WhereIf(isQCFinished, t => t.IsDeleted == false)
|
||||
.WhereIf(isReading == true, t => t.IsReading == true)
|
||||
.OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber)
|
||||
.ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
||||
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath, t.IsReading, t.IsDeleted }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
||||
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath, t.IsReading, t.IsDeleted, t.FileSize }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
||||
|
||||
|
||||
foreach (var series in seriesList)
|
||||
|
|
@ -54,7 +58,8 @@ namespace IRaCIS.Core.Application.Services
|
|||
Path = k.Path,
|
||||
InstanceNumber = k.InstanceNumber,
|
||||
IsReading = k.IsReading,
|
||||
IsDeleted = k.IsDeleted
|
||||
IsDeleted = k.IsDeleted,
|
||||
FileSize = k.FileSize
|
||||
|
||||
}).ToList();
|
||||
|
||||
|
|
|
|||
|
|
@ -130,16 +130,20 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.CriterionModalitys, u => u.MapFrom(s => s.TrialReadingCriterion.CriterionModalitys))
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code));
|
||||
|
||||
CreateMap<DicomStudy, DicomStudyBasicInfo>();
|
||||
CreateMap<NoneDicomStudy, NoneDicomStudyBasicInfo>();
|
||||
CreateMap<DicomStudy, DicomStudyBasicInfo>()
|
||||
.ForMember(d => d.ReadingSeriesCount, u => u.MapFrom(s => s.SeriesList.Where(t => t.IsReading).Count()))
|
||||
.ForMember(d => d.ReadingInstanceCount, u => u.MapFrom(s => s.InstanceList.Where(t => t.IsReading && t.DicomSerie.IsReading).Count()));
|
||||
|
||||
CreateMap<NoneDicomStudy, NoneDicomStudyBasicInfo>()
|
||||
.ForMember(d => d.ReadingFileCount, u => u.MapFrom(s => s.NoneDicomFileList.Where(t => t.IsReading).Count()));
|
||||
|
||||
CreateMap<VisitTask, SubjectCRCImageUploadedDto>()
|
||||
.ForMember(d => d.VisitTaskId, u => u.MapFrom(s => s.Id))
|
||||
.ForMember(d => d.IsImageFilter, u => u.MapFrom(s => s.TrialReadingCriterion.IsImageFilter))
|
||||
.ForMember(d => d.CriterionModalitys, u => u.MapFrom(s => s.TrialReadingCriterion.CriterionModalitys))
|
||||
.ForMember(d => d.SubjectCode, u => u.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code))
|
||||
.ForMember(d => d.DicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.StudyList))
|
||||
.ForMember(d => d.NoneDicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.NoneDicomStudyList))
|
||||
;
|
||||
.ForMember(d => d.NoneDicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.NoneDicomStudyList.Where(t => t.IsReading)));
|
||||
|
||||
CreateMap<TrialImageDownload, TrialImageDownloadView>()
|
||||
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
||||
|
|
|
|||
|
|
@ -961,6 +961,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
var noneDicomStudyFile = (await _noneDicomStudyFileRepository.Where(t => t.Id == noneDicomStudyFileId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
|
||||
var noneDicomStudy = (await _noneDicomStudyRepository.Where(t => t.Id == noneDicomStudyFile.NoneDicomStudyId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
|
||||
if (state == 1)
|
||||
{
|
||||
noneDicomStudyFile.IsReading = false;
|
||||
|
|
@ -972,10 +975,15 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
else if (state == 4)
|
||||
{
|
||||
noneDicomStudyFile.IsDeleted = true;
|
||||
|
||||
noneDicomStudy.FileCount = noneDicomStudy.FileCount - 1;
|
||||
|
||||
}
|
||||
else if (state == 5)
|
||||
{
|
||||
noneDicomStudyFile.IsDeleted = false;
|
||||
|
||||
noneDicomStudy.FileCount = noneDicomStudy.FileCount + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue