Test.EIImageViewer
he 2022-11-04 10:55:01 +08:00
parent b28a88824f
commit fd02bc2dd5
8 changed files with 94 additions and 13 deletions

View File

@ -829,6 +829,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public GlobalAnswerType GlobalAnswerType { get; set; }
/// <summary>
/// 是否是裁判问题
/// </summary>
public bool IsJudgeQuestion { get; set; } = true;
}
public class GetReadingImgOutDto

View File

@ -111,7 +111,8 @@ namespace IRaCIS.Application.Services
VisitNum = x.SourceSubjectVisit.VisitNum,
IsBaseLine=x.SourceSubjectVisit.IsBaseLine,
VisitId = x.SourceSubjectVisitId.Value,
BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(y => y.ReadingQuestionTrial.ShowOrder)
BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType!=GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder)
.Select(y => new GlobalQuestionInfo()
{
QuestionId = y.ReadingQuestionTrialId,
@ -121,11 +122,11 @@ namespace IRaCIS.Application.Services
QuestionGenre = y.ReadingQuestionTrial.QuestionGenre,
DictionaryCode = y.ReadingQuestionTrial.DictionaryCode,
GlobalReadingShowType=y.ReadingQuestionTrial.GlobalReadingShowType,
AnswerCombination = y.ReadingQuestionTrial.AnswerCombination,
JudgeType = y.ReadingQuestionTrial.JudgeType,
Type = y.ReadingQuestionTrial.Type,
TypeValue = y.ReadingQuestionTrial.TypeValue,
IsJudgeQuestion=y.ReadingQuestionTrial.IsJudgeQuestion,
Answer = y.Answer
}).ToList()
}).ToListAsync();
@ -144,7 +145,6 @@ namespace IRaCIS.Application.Services
{
Answer = lr.global == null || lr.global.Count() == 0 ?
(inDto.UsingOriginalData ? lr.question.Answer : string.Empty) :
(lr.global.Select(x => x.Answer).FirstOrDefault().IsNullOrEmpty() && inDto.UsingOriginalData ?
lr.question.Answer : lr.global.Select(x => x.Answer).FirstOrDefault()
),
@ -159,6 +159,7 @@ namespace IRaCIS.Application.Services
GlobalAnswerType = GlobalAnswerType.Question,
AnswerGroup = lr.question.AnswerGroup,
AnswerCombination = lr.question.AnswerCombination,
IsJudgeQuestion=lr.question.IsJudgeQuestion,
JudgeType = lr.question.JudgeType,
TypeValue = lr.question.TypeValue,

View File

@ -884,10 +884,9 @@ namespace IRaCIS.Application.Services
if (rowCount > item.MaxRowCount.Value - 1)
{
//throw new BusinessValidationFailedException($"问题{item.QuestionName}最大相同问题数为{item.MaxRowCount.Value},当前已存在{rowCount}条!");
throw new BusinessValidationFailedException($"当前器官上已有{rowCount}个靶病灶");
throw new BusinessValidationFailedException($"按照RECIST1.1的相关规则,同一器官的靶病灶数量不超过{item.MaxRowCount.Value}个,请确认!");
}
}
}
}
var isCurrentTaskAddList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && x.TrialId == inDto.TrialId && x.RowIndex == inDto.RowIndex).Select(x => x.IsCurrentTaskAdd).ToListAsync();

View File

@ -422,8 +422,8 @@ namespace IRaCIS.Application.Services
}
else
{
var newlist = item.AfterQuestionList.Where(x => x.QuestionId != null).ToList().Union(
twoItem.AfterQuestionList.Where(x => x.QuestionId != null).ToList()
var newlist = item.AfterQuestionList.Where(x => x.QuestionId != null&&x.IsJudgeQuestion).ToList().Union(
twoItem.AfterQuestionList.Where(x => x.QuestionId != null&&x.IsJudgeQuestion).ToList()
).ToList();
List<GroupTaskAnswerDto> globalGroupTasks = newlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto

View File

@ -1487,6 +1487,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
result = NewLesionAssessment.Yes;
}
//只要有任何一个新病灶状态为“无法评估”
else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.UnableEvaluate)))
{
result = NewLesionAssessment.NE;
}
//当前访视不存在明确新病灶且存在至少一个疑似新病灶
else if (!tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Exist)) &&
tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.Suspected))
@ -1495,11 +1500,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
result = NewLesionAssessment.Suspected;
}
//只要有任何一个新病灶状态为“无法评估”
else if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionState.UnableEvaluate)))
{
result = NewLesionAssessment.NE;
}
else
{
result = NewLesionAssessment.No;

View File

@ -192,6 +192,8 @@ namespace IRaCIS.Core.Application.Contracts
public int SeriesCount { get; set; }
public int InstanceCount { get; set; }
public bool IsDicom { get; set; } = true;
public List<DicomSeriesDTO> SeriesList { get; set; } = new List<DicomSeriesDTO>();
}

View File

@ -20,6 +20,7 @@ namespace IRaCIS.Core.Application.Services
private readonly IRepository<ReadModule> _readModuleRepository;
private readonly IRepository<Trial> _trialRepository;
private readonly IRepository<ReadingPeriodSet> _readingPeriodSetRepository;
private readonly IRepository<NoneDicomStudy> _noneDicomStudyRepository;
private readonly IRepository<ReadingPeriodPlan> _readingPeriodPlanRepository;
private readonly IRepository<Subject> _subjectRepository;
@ -27,6 +28,7 @@ namespace IRaCIS.Core.Application.Services
IRepository<ReadModule> readModuleRepository,
IRepository<Trial> trialRepository,
IRepository<ReadingPeriodSet> readingPeriodSetRepository,
IRepository<NoneDicomStudy> noneDicomStudyRepository,
IRepository<ReadingPeriodPlan> readingPeriodPlanRepository,
IRepository<Subject> subjectRepository)
{
@ -34,6 +36,7 @@ namespace IRaCIS.Core.Application.Services
this._readModuleRepository = readModuleRepository;
this._trialRepository = trialRepository;
this._readingPeriodSetRepository = readingPeriodSetRepository;
this._noneDicomStudyRepository = noneDicomStudyRepository;
this._readingPeriodPlanRepository = readingPeriodPlanRepository;
_subjectRepository = subjectRepository;
}
@ -219,6 +222,66 @@ namespace IRaCIS.Core.Application.Services
}
/// <summary>
/// 获取访视下的Dicom 检查信息 分所有的, 阅片的 不阅片 isReading : 0 查询所有 1 查询仅仅阅片的
/// </summary>
/// <param name="trialId"></param>
/// <param name="sujectVisitId"></param>
/// <param name="isReading"></param>
/// <returns></returns>
[HttpGet, Route("{trialId:guid}/{sujectVisitId:guid}/{isReading}")]
[AllowAnonymous]
public async Task<List<VisitStudyDTO>> GetReadingVisitStudyList(Guid trialId, Guid sujectVisitId, int isReading)
{
var studyList = await _repository.Where<DicomStudy>(t => t.TrialId == trialId && t.SubjectVisitId == sujectVisitId).Select(k => new VisitStudyDTO()
{
InstanceCount = k.InstanceCount,
Modalities = k.Modalities,
SeriesCount = k.SeriesCount,
StudyCode = k.StudyCode,
StudyId = k.Id,
IsDicom=true,
}).ToListAsync();
var studyIds = studyList.Select(t => t.StudyId).ToList();
var instanceList = await _repository.Where<DicomInstance>(t => studyIds.Contains(t.StudyId))
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber }).ToListAsync();
foreach (var t in studyList)
{
t.SeriesList = await _repository.Where<DicomSeries>(s => s.StudyId == t.StudyId)
.WhereIf(isReading == 1, s => s.IsReading).OrderBy(s => s.SeriesNumber).
ThenBy(s => s.SeriesTime)
.ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).ToListAsync();
t.SeriesList.ForEach(series => series.InstanceList = instanceList.Where(t => t.SeriesId == series.Id).OrderBy(t => t.InstanceNumber).Select(k => k.Id).ToList());
//设置为阅片与否 不更改数据库检查 的instance数量 和 SeriesCount 所以这里要实时统计
t.SeriesCount = t.SeriesList.Count();
t.InstanceCount = t.SeriesList.SelectMany(t => t.InstanceList).Count();
}
// 非Dicom
//var noDicomStudyList = _noneDicomStudyRepository.Where(x => x.TrialId == trialId && x.SubjectVisitId == sujectVisitId).Select(x => new VisitStudyDTO()
//{
// InstanceCount = x.FileCount,
// Modalities = x.Modalities,
// SeriesCount = x.SeriesCount,
// StudyCode = x.StudyCode,
// StudyId = x.Id,
// IsDicom = false,
//}).ToListAsync();
return studyList;
//return ResponseOutput.Ok(studyList.Where(t => t.SeriesList.Count > 0).ToList());
}
/// <summary>

View File

@ -649,7 +649,12 @@ namespace IRaCIS.Core.Domain.Share
/// <summary>
/// 随访显示
/// </summary>
FollowVisitShow = 2
FollowVisitShow = 2,
/// <summary>
/// 不显示
/// </summary>
NotShow =3
}
@ -1005,6 +1010,11 @@ namespace IRaCIS.Core.Domain.Share
/// 访视点肿瘤评估
/// </summary>
SiteVisitForTumorEvaluation = 21,
/// <summary>
/// 间隔天数
/// </summary>
DaysBetween = 21,
}
/// <summary>