修改影像key 显示标注
parent
328a8549c6
commit
af988e7276
|
@ -514,14 +514,12 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
public class IRReadingDownloadQuery : SortInput
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid SubjectId { get; set; }
|
||||
public Guid? SubjectId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialReadingCriterionId { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public string SubjectCode { get; set; }
|
||||
public string? SubjectCode { get; set; }
|
||||
|
||||
public Guid? VisitTaskId { get; set; }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FellowOakDicom;
|
||||
using DocumentFormat.OpenXml.EMMA;
|
||||
using FellowOakDicom;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
|
@ -806,32 +807,62 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
[HttpPost]
|
||||
public async Task<List<SubjectCRCImageUploadedStudyDto>> GetSubjectImageDownloadSelectList(IRReadingDownloadQuery inQuery)
|
||||
{
|
||||
|
||||
var doctorUserId = _userInfo.Id;
|
||||
var isAnalysisCreate = false;
|
||||
|
||||
//要根据标准阅片顺序,确定是否查询单个任务的,还是查询所有的
|
||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId)
|
||||
.Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync();
|
||||
|
||||
var subjectCode = string.Empty;
|
||||
var subjectId = inQuery.SubjectId;
|
||||
|
||||
var doctorUserId = _userInfo.Id;
|
||||
if (criterionInfo.IsReadingTaskViewInOrder == ReadingOrder.Random)
|
||||
{
|
||||
if (inQuery.VisitTaskId == null)
|
||||
{
|
||||
throw new Exception("无序阅片,前端参数传递错误");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (inQuery.SubjectId == null || inQuery.SubjectCode == null)
|
||||
{
|
||||
throw new Exception("有序阅片,前端参数传递错误");
|
||||
}
|
||||
|
||||
var isAnalysisCreate = false;
|
||||
|
||||
//医学审核查看下载按钮,这个时候需要知道医生
|
||||
//考虑到一致性分析,必须要这个编号进行过滤
|
||||
subjectCode = inQuery.SubjectCode;
|
||||
}
|
||||
|
||||
if (inQuery.VisitTaskId != null)
|
||||
{
|
||||
var info = await _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId).Select(t => new { t.DoctorUserId, t.IsAnalysisCreate }).FirstNotNullAsync();
|
||||
//考虑到一致性分析,必须要这个编号进行过滤
|
||||
//医学审核查看下载按钮,这个时候需要知道医生
|
||||
|
||||
doctorUserId = (Guid)info.DoctorUserId!;
|
||||
isAnalysisCreate = info.IsAnalysisCreate;
|
||||
var taskInfo = await _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId).Select(t => new {
|
||||
SubjectCode = t.IsAnalysisCreate ? t.BlindSubjectCode : t.Subject.Code,
|
||||
SubjectId = t.SubjectId,
|
||||
t.DoctorUserId,
|
||||
t.IsAnalysisCreate
|
||||
}).FirstNotNullAsync();
|
||||
|
||||
subjectId = taskInfo.SubjectId;
|
||||
subjectCode = taskInfo.SubjectCode;
|
||||
doctorUserId = (Guid)taskInfo.DoctorUserId!;
|
||||
isAnalysisCreate = taskInfo.IsAnalysisCreate;
|
||||
}
|
||||
|
||||
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||
var query = _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect)
|
||||
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
|
||||
.WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId)
|
||||
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
//这里过滤是否是一致性分析的
|
||||
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).ToListAsync();
|
||||
var list = await query.Where(t => t.SubjectCode == subjectCode).ToListAsync();
|
||||
|
||||
foreach (var item in list)
|
||||
{
|
||||
|
|
|
@ -19,6 +19,7 @@ public abstract class Entity : IEntity<Guid>
|
|||
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
#region 领域事件 仅仅允许通过提供的方法进行操作
|
||||
[JsonIgnore]
|
||||
private readonly List<DomainEvent> _domainEvents = [];
|
||||
|
|
|
@ -12,8 +12,6 @@ public class SubjectCriteriaEvaluation : BaseFullAuditEntity
|
|||
[ForeignKey("TrialReadingCriterionId")]
|
||||
public ReadingQuestionCriterionTrial TrialReadingCriterion { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<SubjectCriteriaEvaluationVisitFilter> SubjectCriteriaEvaluationVisitFilterList { get; set; }
|
||||
#endregion
|
||||
public Guid SubjectId { get; set; }
|
||||
|
||||
|
|
|
@ -10,8 +10,6 @@ public class SubjectCriteriaEvaluationVisitFilter : BaseFullAuditEntity
|
|||
[JsonIgnore]
|
||||
[ForeignKey("TrialReadingCriterionId")]
|
||||
public ReadingQuestionCriterionTrial TrialReadingCriterion { get; set; }
|
||||
[JsonIgnore]
|
||||
public SubjectCriteriaEvaluation SubjectCriteriaEvaluation { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration;
|
||||
|
||||
/// <summary>
|
||||
/// 医学影像 数据量大,主键是 SeqId ,Id 是自己算的,也可以作为Id,但是不是有序的,数据量大,会导致性能很差,所以是逻辑主键
|
||||
/// </summary>
|
||||
|
||||
public class DicomStudyConfigration : IEntityTypeConfiguration<DicomStudy>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<DicomStudy> builder)
|
||||
{
|
||||
builder.HasKey(e => e.SeqId);
|
||||
}
|
||||
}
|
||||
|
||||
public class DicomSeriesConfigration : IEntityTypeConfiguration<DicomSeries>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<DicomSeries> builder)
|
||||
{
|
||||
builder.HasKey(e => e.SeqId);
|
||||
}
|
||||
}
|
||||
|
||||
public class DicomInstanceConfigration : IEntityTypeConfiguration<DicomInstance>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<DicomInstance> builder)
|
||||
{
|
||||
builder.HasKey(e => e.SeqId);
|
||||
}
|
||||
}
|
||||
|
||||
public class TaskStudyConfigration : IEntityTypeConfiguration<TaskStudy>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<TaskStudy> builder)
|
||||
{
|
||||
builder.HasKey(e => e.SeqId);
|
||||
}
|
||||
}
|
||||
|
||||
public class TaskSeriesConfigration : IEntityTypeConfiguration<TaskSeries>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<TaskSeries> builder)
|
||||
{
|
||||
builder.HasKey(e => e.SeqId);
|
||||
}
|
||||
}
|
||||
|
||||
public class TaskInstanceConfigration : IEntityTypeConfiguration<TaskInstance>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<TaskInstance> builder)
|
||||
{
|
||||
builder.HasKey(e => e.SeqId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class SCPStudyConfigration : IEntityTypeConfiguration<SCPStudy>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<SCPStudy> builder)
|
||||
{
|
||||
builder.HasKey(e => e.SeqId);
|
||||
}
|
||||
}
|
||||
|
||||
public class SCPSeriesConfigration : IEntityTypeConfiguration<SCPSeries>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<SCPSeries> builder)
|
||||
{
|
||||
builder.HasKey(e => e.SeqId);
|
||||
}
|
||||
}
|
||||
|
||||
public class SCPInstanceConfigration : IEntityTypeConfiguration<SCPInstance>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<SCPInstance> builder)
|
||||
{
|
||||
builder.HasKey(e => e.SeqId);
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
||||
{
|
||||
|
||||
public class SubjectCriteriaEvaluationConfigration : IEntityTypeConfiguration<SubjectCriteriaEvaluation>
|
||||
{
|
||||
|
||||
public void Configure(EntityTypeBuilder<SubjectCriteriaEvaluation> builder)
|
||||
{
|
||||
builder
|
||||
.HasMany(s => s.SubjectCriteriaEvaluationVisitFilterList)
|
||||
.WithOne(c => c.SubjectCriteriaEvaluation)
|
||||
.HasForeignKey(s => new { s.SubjectId, s.TrialReadingCriterionId })
|
||||
.HasPrincipalKey(c => new { c.SubjectId, c.TrialReadingCriterionId });
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue