影像下载和上传入口增加
parent
f14d4bf373
commit
9f4e43e20a
|
@ -33,7 +33,40 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class StudyBasicInfo
|
|
||||||
|
|
||||||
|
|
||||||
|
public class StudyBasicInfo : DicomStudyBasicInfo
|
||||||
|
{
|
||||||
|
|
||||||
|
public List<string> SopInstanceUidList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SubjectCRCImageUploadedDto
|
||||||
|
{
|
||||||
|
public Guid VisitTaskId { get; set; }
|
||||||
|
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
public string SubjectCode { get; set; }
|
||||||
|
|
||||||
|
public string TaskBlindName { get; set; }
|
||||||
|
|
||||||
|
public string TaskName { get; set; }
|
||||||
|
|
||||||
|
public bool IsImageFilter { get; set; }
|
||||||
|
public string CriterionModalitys { get; set; }
|
||||||
|
|
||||||
|
public Guid? SourceSubjectVisitId { get; set; }
|
||||||
|
|
||||||
|
public List<DicomStudyBasicInfo> DicomStudyList { get; set; }
|
||||||
|
|
||||||
|
public List<NoneDicomStudyBasicInfo> NoneDicomStudyList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class DicomStudyBasicInfo
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string StudyInstanceUid { get; set; }
|
public string StudyInstanceUid { get; set; }
|
||||||
|
@ -54,8 +87,26 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public int SeriesCount { get; set; }
|
public int SeriesCount { get; set; }
|
||||||
public int InstanceCount { get; set; }
|
public int InstanceCount { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NoneDicomStudyBasicInfo
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public string StudyCode { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public int FileCount { get; set; }
|
||||||
|
|
||||||
|
public string BodyPart { get; set; }
|
||||||
|
|
||||||
|
public string Modality { get; set; }
|
||||||
|
|
||||||
|
public DateTime ImageDate { get; set; }
|
||||||
|
|
||||||
|
public string Description { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<string> SopInstanceUidList { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -377,7 +377,30 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public class IRReadingDownloadQuery
|
public class IRReadingDownloadQuery
|
||||||
{
|
{
|
||||||
[NotDefault]
|
[NotDefault]
|
||||||
public Guid VisitTaskId { get; set; }
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialReadingCriterionId { get; set; }
|
||||||
|
|
||||||
|
public string SubjectCode { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class IRDownloadQuery
|
||||||
|
{
|
||||||
|
[NotDefault]
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialReadingCriterionId { get; set; }
|
||||||
|
|
||||||
|
public string SubjectCode { get; set; }
|
||||||
|
|
||||||
|
public List<Guid> SubjectVisitIdList { get; set; }
|
||||||
|
|
||||||
|
public List<Guid> DicomStudyIdList { get; set; }
|
||||||
|
|
||||||
|
public List<Guid> NoneDicomStudyIdList { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -952,44 +952,53 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
}).ToList()
|
}).ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = query.ToList();
|
var result = query.FirstOrDefault();
|
||||||
|
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// IR 阅片页面获取下载检查的信息 会根据标准进行过滤检查,(后端要考虑到一致性分析 subjectCode的问题)
|
/// IR 阅片页面 和IR 任务列表页面下载 勾选下载列表(后端要考虑到一致性分析 subjectCode的问题)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inQuery"></param>
|
/// <param name="inQuery"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
public async Task<List<SubjectCRCImageUploadedDto>> GetSubjectImageDownloadSelectList(IRReadingDownloadQuery inQuery)
|
||||||
public async Task<IResponseOutput> GetIRReadingDownloadStudyInfo(IRReadingDownloadQuery inQuery)
|
|
||||||
{
|
{
|
||||||
var taskInfo = await _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId)
|
|
||||||
.Select(t => new
|
|
||||||
{
|
|
||||||
t.BlindSubjectCode,
|
|
||||||
t.IsAnalysisCreate,
|
|
||||||
t.SourceSubjectVisitId,
|
|
||||||
t.TrialReadingCriterion.IsImageFilter,
|
|
||||||
t.TrialReadingCriterion.CriterionModalitys
|
|
||||||
})
|
|
||||||
.FirstNotNullAsync();
|
|
||||||
|
|
||||||
if (taskInfo.SourceSubjectVisitId == null)
|
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||||
{
|
&& t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
||||||
return ResponseOutput.NotOk("请开发核实传递的参数,该查询任务关联访视Id没有值");
|
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
|
||||||
|
var list = await query.Where(t=>t.SubjectCode==inQuery.SubjectCode).ToListAsync();
|
||||||
|
|
||||||
|
return list;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = from sv in _subjectVisitRepository.Where(t => t.Id == taskInfo.SourceSubjectVisitId)
|
/// <summary>
|
||||||
|
/// IR 阅片页面获取下载检查的信息 会根据标准进行过滤检查,(后端要考虑到一致性分析 subjectCode的问题)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inQuery"></param>
|
||||||
|
/// <param name="_subjectRepository"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput> GetIRReadingDownloadStudyInfo(IRDownloadQuery inQuery, [FromServices] IRepository<Subject> _subjectRepository)
|
||||||
|
{
|
||||||
|
var info = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
|
||||||
|
.Select(t => new { t.IsImageFilter, t.CriterionModalitys }).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var isQueryDicom = inQuery.DicomStudyIdList.Count > 0;
|
||||||
|
var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0;
|
||||||
|
|
||||||
|
var query = from sv in _subjectRepository.Where(t => t.Id == inQuery.SubjectId).SelectMany(t => t.SubjectVisitList.Where(t=>inQuery.SubjectVisitIdList.Contains(t.Id)))
|
||||||
|
|
||||||
select new
|
select new
|
||||||
{
|
{
|
||||||
SubjectCode = sv.Subject.Code,
|
SubjectCode = sv.Subject.Code,
|
||||||
VisitName = sv.VisitName,
|
VisitName = sv.VisitName,
|
||||||
StudyList = sv.StudyList.AsQueryable().WhereIf(taskInfo.IsImageFilter, t => ("|" + taskInfo.CriterionModalitys + "|").Contains("|" + t.ModalityForEdit + "|"))
|
StudyList = sv.StudyList.Where(t => isQueryDicom ? inQuery.DicomStudyIdList.Contains(t.Id) : false)
|
||||||
.Select(u => new
|
.Select(u => new
|
||||||
{
|
{
|
||||||
u.PatientId,
|
u.PatientId,
|
||||||
|
@ -1008,7 +1017,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
NoneDicomStudyList = sv.NoneDicomStudyList.AsQueryable().WhereIf(taskInfo.IsImageFilter, t => ("|" + taskInfo.CriterionModalitys + "|").Contains("|" + t.Modality + "|"))
|
NoneDicomStudyList = sv.NoneDicomStudyList.Where(t => isQueryNoneDicom ? inQuery.NoneDicomStudyIdList.Contains(t.Id) : false)
|
||||||
.Select(nd => new
|
.Select(nd => new
|
||||||
{
|
{
|
||||||
nd.Modality,
|
nd.Modality,
|
||||||
|
@ -1024,7 +1033,11 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
|
||||||
|
|
||||||
|
var result = await query.FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ using IRaCIS.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
||||||
using IRaCIS.Core.Application.Contracts.DTO;
|
using IRaCIS.Core.Application.Contracts.DTO;
|
||||||
|
using IRaCIS.Core.Application.Service.ImageAndDoc.DTO;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
|
@ -124,7 +125,16 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(d => d.VisitNum, u => u.MapFrom(s => s.SubjectVisit.VisitNum))
|
.ForMember(d => d.VisitNum, u => u.MapFrom(s => s.SubjectVisit.VisitNum))
|
||||||
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName));
|
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName));
|
||||||
|
|
||||||
|
CreateMap<DicomStudy, DicomStudyBasicInfo>();
|
||||||
|
CreateMap<NoneDicomStudy, NoneDicomStudyBasicInfo>();
|
||||||
|
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.IsSelfAnalysis == 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))
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,10 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public List<NoneDicomStudyFile> NoneDicomFileList { get; set; }
|
public List<NoneDicomStudyFile> NoneDicomFileList { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public List<NoneDicomStudyFile> TaskNoneDicomFileList { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public SubjectVisit SubjectVisit { get; set; }
|
public SubjectVisit SubjectVisit { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
|
|
@ -8,9 +8,7 @@ using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
namespace IRaCIS.Core.Domain.Models
|
namespace IRaCIS.Core.Domain.Models
|
||||||
{
|
{
|
||||||
///<summary>
|
|
||||||
///NoneDicomStudyFile
|
|
||||||
///</summary>
|
|
||||||
[Table("NoneDicomStudyFile")]
|
[Table("NoneDicomStudyFile")]
|
||||||
public class NoneDicomStudyFile : BaseAddAuditEntity
|
public class NoneDicomStudyFile : BaseAddAuditEntity
|
||||||
{
|
{
|
||||||
|
@ -23,9 +21,9 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public VisitTask VisitTask { get; set; }
|
public VisitTask VisitTask { get; set; }
|
||||||
|
|
||||||
//[ForeignKey("OriginNoneDicomStudyId")]
|
[ForeignKey("OriginNoneDicomStudyId")]
|
||||||
//[JsonIgnore]
|
[JsonIgnore]
|
||||||
//public NoneDicomStudy OriginNoneDicomStudy { get; set; }
|
public NoneDicomStudy OriginNoneDicomStudy { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,8 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
builder.HasNoKey();
|
builder.HasNoKey();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<NoneDicomStudy>().HasMany(t => t.NoneDicomFileList).WithOne(s => s.NoneDicomStudy).HasForeignKey(t => t.NoneDicomStudyId);
|
||||||
|
modelBuilder.Entity<NoneDicomStudy>().HasMany(t => t.TaskNoneDicomFileList).WithOne(s => s.OriginNoneDicomStudy).HasForeignKey(t => t.OriginNoneDicomStudyId);
|
||||||
|
|
||||||
modelBuilder.Entity<ReadingQuestionTrial>().HasQueryFilter(p => p.IsAdditional == false);
|
modelBuilder.Entity<ReadingQuestionTrial>().HasQueryFilter(p => p.IsAdditional == false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue