Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-12-30 18:24:24 +08:00
8 changed files with 18670 additions and 3 deletions
@@ -465,6 +465,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public QuestionMark? QuestionMark { get; set; }
/// <summary>
/// 默认值
/// </summary>
public string DefaultValue { get; set; } = string.Empty;
/// <summary>
/// 问题英文名称
/// </summary>
@@ -603,6 +608,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// </summary>
public QuestionMark? QuestionMark { get; set; }
/// <summary>
/// 默认值
/// </summary>
public string DefaultValue { get; set; } = string.Empty;
/// <summary>
/// 问题英文名称
/// </summary>
@@ -1735,6 +1745,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
[Comment("问题标识")]
public QuestionMark? QuestionMark { get; set; }
/// <summary>
/// 默认值
/// </summary>
public string DefaultValue { get; set; } = string.Empty;
[Comment("字典code")]
public string DictionaryCode { get; set; } = string.Empty;
[Comment("数值类型")]
@@ -1,8 +1,10 @@
using DocumentFormat.OpenXml.EMMA;
using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Models;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infra.EFCore.Common;
using IRaCIS.Core.Infrastructure;
using MassTransit;
using Microsoft.AspNetCore.Mvc;
using System.Linq;
@@ -425,7 +427,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
tableAnswerList.Add(new ReadingTableQuestionAnswer()
{
Answer = string.Empty,
Answer = otherQuestion.DefaultValue,
QuestionId = tableQuestion.Id,
TrialId = taskinfo.TrialId,
VisitTaskId = taskinfo.Id,
@@ -591,6 +593,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
public async Task<decimal> GetFatFractionAvg(ReadingCalculateDto inDto)
{
decimal result = 0;
var rowInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction)
.SelectMany(x => x.TableRowInfoList).ToList();
@@ -633,7 +636,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var avgAnswernum= answers.Select(x=>x.IsNullOrEmptyReturn0()).Average(x=>x);
avgAnswer = decimal.Round(avgAnswernum, inDto.DigitPlaces, MidpointRounding.AwayFromZero).ToString("F" + inDto.DigitPlaces.ToString());
}
if(item.TableQuestionList.Where(x => x.QuestionMark== QuestionMark.IsMeasurable).Select(x => x.Answer).FirstOrDefault().EqEnum(YesOrNoOrNa.No))
{
avgAnswer = "NA";
}
tableAnswers.Add(new ReadingTableQuestionAnswer()
{
Answer = avgAnswer,
@@ -666,7 +672,31 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
{
ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
var markList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
var rowInfo = readingData.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction)
.SelectMany(x => x.TableRowInfoList).ToList();
var tableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsMeasurable && x.Answer.IsNotNullOrEmpty())).ToList();
if (tableQuestionList.Count() != 8)
{
throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]);
}
var notableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsMeasurable && x.Answer.EqEnum(YesOrNoOrNa.No))).ToList();
foreach (var item in notableQuestionList)
{
if (markList.Any(x => x.RowId == item.RowId))
{
throw new BusinessValidationFailedException(_localizer["MRIPDFF_NeedClearMark"]);
}
}
}
}
}