This commit is contained in:
he
2022-12-08 15:59:29 +08:00
parent bea0811eb8
commit 422dadad36
8 changed files with 152 additions and 20 deletions
@@ -289,6 +289,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public string CalculateQuestions { get; set; } = "[]";
/// <summary>
/// 限制编辑
/// </summary>
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
/// <summary>
/// 数值类型
/// </summary>
@@ -863,6 +868,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public string CalculateQuestions { get; set; }
/// <summary>
/// 限制编辑
/// </summary>
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
/// <summary>
/// 数据来源
/// </summary>
@@ -1622,8 +1632,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public string CalculateQuestions { get; set; } = "[]";
/// <summary>
/// 限制编辑
/// </summary>
public LimitEdit LimitEdit { get; set; } = LimitEdit.None;
public List<string> ParentTriggerValueList { get; set; }
public List<string> RelevanceValueList { get; set; }
@@ -354,7 +354,7 @@ namespace IRaCIS.Application.Services
[HttpPost]
public async Task<(List<DicomReadingQuestionAnswer>, object)> GetDicomReadingQuestionAnswer(GetDicomReadingQuestionAnswerInDto inDto)
{
await AddDefaultValueToTask(inDto.VisitTaskId);
//await AddDefaultValueToTask(inDto.VisitTaskId);
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
var result = await GetReadingQuestion(taskInfo.TrialReadingCriterionId, taskInfo.Id);
@@ -410,7 +410,9 @@ namespace IRaCIS.Application.Services
private void GetDicomReadingAnswer(DicomReadingQuestionAnswer item, List<DicomReadingQuestionAnswer> questions, List<ReadingTaskQuestionAnswer> answers)
{
item.Answer = answers.Where(x => x.ReadingQuestionTrialId == item.Id).Select(x => x.Answer).FirstIsNullReturnEmpty();
var answer= answers.Where(x => x.ReadingQuestionTrialId == item.Id).Select(x => x.Answer).FirstIsNullReturnEmpty();
item.Answer = answer.IsNullOrEmpty() ? item.DefaultValue : answer;
item.Childrens = questions.Where(x => x.ParentId == item.Id || ((item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName))).ToList();
if (item.Childrens != null && item.Childrens.Count > 0)
@@ -470,7 +472,7 @@ namespace IRaCIS.Application.Services
public async Task<(GetReadingQuestionAndAnswerOutDto, object)> GetReadingQuestionAndAnswer(GetReadingQuestionAndAnswerInDto inDto)
{
await AddDefaultValueToTask(inDto.VisitTaskId);
//await AddDefaultValueToTask(inDto.VisitTaskId);
var result = new GetReadingQuestionAndAnswerOutDto();
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
@@ -568,7 +570,8 @@ namespace IRaCIS.Application.Services
var answers = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == taskId).ToListAsync();
qusetionList.ForEach(x =>
{
x.Answer = answers.Where(y => y.ReadingQuestionTrialId == x.Id).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
var answer= answers.Where(y => y.ReadingQuestionTrialId == x.Id).Select(x => x.Answer).FirstOrDefault() ?? string.Empty;
x.Answer = answer.IsNullOrEmpty() ? x.DefaultValue : answer;
});
}
@@ -911,8 +914,17 @@ namespace IRaCIS.Application.Services
}
var index = await _readingCalculateService.GetDeleteLesionStatrIndex(inDto);
await _readingTableQuestionAnswerRepository.DeleteFromQueryAsync(x => x.RowId == inDto.RowId);
await _readingTableAnswerRowInfoRepository.DeleteFromQueryAsync(x => x.Id == inDto.RowId);
await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(x => x.RowId == inDto.RowId, x => new ReadingTableQuestionAnswer()
{
IsDeleted = true
});
await _readingTableAnswerRowInfoRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.RowId,x=>new ReadingTableAnswerRowInfo() {
IsDeleted=true
});
await _readingTableAnswerRowInfoRepository.SaveChangesAsync();
@@ -1025,7 +1037,9 @@ namespace IRaCIS.Application.Services
public async Task<SubmitTableQuestionOutDto> SubmitTableQuestion(SubmitTableQuestionInDto inDto)
{
SubmitTableQuestionOutDto result = new SubmitTableQuestionOutDto();
await VerifyTaskIsSign(inDto.VisitTaskId);
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.QuestionId).FirstNotNullAsync();
var criterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync();
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == criterionId).FirstNotNullAsync();
var tableQuestionIds = inDto.AnswerList.Select(x => x.TableQuestionId).ToList();
@@ -1043,7 +1057,7 @@ namespace IRaCIS.Application.Services
if (inDto.RowIndex % 1 == 0)
{
var questionInfo = await _readingQuestionTrialRepository.Where(x => x.Id == inDto.QuestionId).FirstNotNullAsync();
if (questionInfo.MaxQuestionCount != null && questionInfo.MaxQuestionCount != 0)
{
if (questionInfo.MaxQuestionCount <
@@ -1116,6 +1130,7 @@ namespace IRaCIS.Application.Services
rowInfo.InstanceId = inDto.InstanceId;
rowInfo.SeriesId = inDto.SeriesId;
rowInfo.VisitTaskId = inDto.VisitTaskId;
rowInfo.OrderMark = questionInfo.OrderMark;
rowInfo.StudyId = inDto.StudyId;
rowInfo.IsCanEditPosition = inDto.IsCanEditPosition;
result.RowId = rowInfo.Id;
@@ -51,7 +51,7 @@ namespace IRaCIS.Application.Services
{
if (inDto.VisitTaskId != null)
{
await AddDefaultValueToTask(inDto.VisitTaskId.Value);
//await AddDefaultValueToTask(inDto.VisitTaskId.Value);
}
var result = new GetTrialReadingQuestionPageDto();