Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
commit
3a996212ed
|
@ -1364,6 +1364,13 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoCalculateService.SaveSplenicCalculate(System.Guid)">
|
||||||
|
<summary>
|
||||||
|
保存脾尖或者脾底进行计算
|
||||||
|
</summary>
|
||||||
|
<param name="visitTaskId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.GetReadingCalculationData(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingCalculationDataInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.IRECIST1Point1CalculateService.GetReadingCalculationData(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingCalculationDataInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取阅片的计算数据
|
获取阅片的计算数据
|
||||||
|
@ -2060,6 +2067,13 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.LuganoCalculateService.SaveSplenicCalculate(System.Guid)">
|
||||||
|
<summary>
|
||||||
|
保存脾尖或者脾底进行计算
|
||||||
|
</summary>
|
||||||
|
<param name="visitTaskId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.LuganoCalculateService.GetSplenicState(System.Guid,System.Decimal)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.LuganoCalculateService.GetSplenicState(System.Guid,System.Decimal)">
|
||||||
<summary>
|
<summary>
|
||||||
获取脾脏状态
|
获取脾脏状态
|
||||||
|
@ -13752,7 +13766,7 @@
|
||||||
<param name="inDto"></param>
|
<param name="inDto"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SaveTaskQuestion(IRaCIS.Core.Application.Service.Reading.Dto.ChangeDicomReadingQuestionAnswerInDto)">
|
<member name="M:IRaCIS.Application.Services.ReadingImageTaskService.SaveTaskQuestion(IRaCIS.Core.Application.Service.Reading.Dto.ChangeDicomReadingQuestionAnswerInDto,System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
保存任务问题 带动态稽查参数
|
保存任务问题 带动态稽查参数
|
||||||
</summary>
|
</summary>
|
||||||
|
|
|
@ -20,6 +20,7 @@ using DocumentFormat.OpenXml.Drawing.Charts;
|
||||||
using IRaCIS.Core.Application.Service.ReadingCalculate.Interface;
|
using IRaCIS.Core.Application.Service.ReadingCalculate.Interface;
|
||||||
using AutoMapper.QueryableExtensions;
|
using AutoMapper.QueryableExtensions;
|
||||||
using IRaCIS.Application.Contracts;
|
using IRaCIS.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
@ -1741,18 +1742,26 @@ namespace IRaCIS.Application.Services
|
||||||
return await ChangeDicomReadingQuestionAnswer(inDto);
|
return await ChangeDicomReadingQuestionAnswer(inDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 保存任务问题 带动态稽查参数
|
/// 保存任务问题 带动态稽查参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[Route("/SaveTaskQuestion/{param}")]
|
[Route("/SaveTaskQuestion/{param}")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
public async Task<IResponseOutput> SaveTaskQuestion(ChangeDicomReadingQuestionAnswerInDto inDto, string param)
|
||||||
public async Task<IResponseOutput> SaveTaskQuestion(ChangeDicomReadingQuestionAnswerInDto inDto)
|
{
|
||||||
{
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
return await this.SaveImageQuality(inDto);
|
var result = await this.SaveImageQuality(inDto);
|
||||||
}
|
// 保存脾尖或者脾底进行计算
|
||||||
|
if (taskinfo.TrialReadingCriterion.CriterionType == CriterionType.Lugano2014 && (param == "4" || param == "5"))
|
||||||
|
{
|
||||||
|
await _luganoCalculateService.SaveSplenicCalculate(inDto.VisitTaskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
///// <summary>
|
///// <summary>
|
||||||
///// 保存ECRF
|
///// 保存ECRF
|
||||||
|
|
|
@ -22,5 +22,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate.Interface
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task CalculateMergeTargetLesionStatus(CalculateTargetLesionStatusInDto inDto);
|
Task CalculateMergeTargetLesionStatus(CalculateTargetLesionStatusInDto inDto);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存脾尖或者脾底进行计算
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="visitTaskId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task SaveSplenicCalculate(Guid visitTaskId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2144,15 +2144,96 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 获取脾脏状态
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取脾脏状态
|
/// 保存脾尖或者脾底进行计算
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="visitTaskId"></param>
|
/// <param name="visitTaskId"></param>
|
||||||
/// <param name="spleenLength"></param>
|
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
public async Task SaveSplenicCalculate(Guid visitTaskId)
|
||||||
|
{
|
||||||
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
List<QuestionType?> questionTypes = new List<QuestionType?>
|
||||||
|
{
|
||||||
|
QuestionType.SplenicTopPosition,
|
||||||
|
QuestionType.SplenicBottomPosition,
|
||||||
|
QuestionType.SpleenLength,
|
||||||
|
QuestionType.SplenicStatus,
|
||||||
|
|
||||||
|
};
|
||||||
|
var questionlist = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId &&
|
||||||
|
questionTypes.Contains(x.QuestionType)).ToListAsync();
|
||||||
|
|
||||||
|
var splenicTopQuestionId = questionlist.Where(x => x.QuestionType == QuestionType.SplenicTopPosition).Select(x => x.Id).FirstOrDefault();
|
||||||
|
var splenicBottomQuestionId = questionlist.Where(x => x.QuestionType == QuestionType.SplenicBottomPosition).Select(x => x.Id).FirstOrDefault();
|
||||||
|
|
||||||
|
decimal? spleenLength = null;
|
||||||
|
string? splenicState = null;
|
||||||
|
|
||||||
|
// 脾尖答案
|
||||||
|
var splenicTopAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == visitTaskId && x.ReadingQuestionTrialId == splenicTopQuestionId).FirstOrDefaultAsync();
|
||||||
|
// 脾底答案
|
||||||
|
var splenicBottomAnswer= await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == visitTaskId && x.ReadingQuestionTrialId == splenicBottomQuestionId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (splenicTopAnswer != null && splenicBottomAnswer != null)
|
||||||
|
{
|
||||||
|
spleenLength = splenicTopAnswer.Answer.IsNullOrEmptyReturn0() - splenicBottomAnswer.Answer.IsNullOrEmptyReturn0();
|
||||||
|
if(spleenLength<0)
|
||||||
|
{
|
||||||
|
spleenLength = 0 - spleenLength;
|
||||||
|
}
|
||||||
|
splenicState =await GetSplenicState(visitTaskId, spleenLength.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
//脾脏垂直径Id
|
||||||
|
var spleenVerticalDiameterQuestionId = questionlist.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Id).FirstOrDefault();
|
||||||
|
// 脾脏状态Id
|
||||||
|
var splenicStatusQuestionId = questionlist.Where(x => x.QuestionType == QuestionType.SplenicStatus).Select(x => x.Id).FirstOrDefault();
|
||||||
|
|
||||||
|
List<ReadingTaskQuestionAnswer> readingTaskQuestionAnswers = new List<ReadingTaskQuestionAnswer>();
|
||||||
|
if (spleenLength != null)
|
||||||
|
{
|
||||||
|
readingTaskQuestionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||||
|
{
|
||||||
|
Answer = spleenLength.Value.ToString(),
|
||||||
|
ReadingQuestionTrialId = spleenVerticalDiameterQuestionId,
|
||||||
|
VisitTaskId = visitTaskId,
|
||||||
|
SubjectId = taskinfo.SubjectId,
|
||||||
|
TrialId = taskinfo.TrialId,
|
||||||
|
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (splenicState != null)
|
||||||
|
{
|
||||||
|
readingTaskQuestionAnswers.Add(new ReadingTaskQuestionAnswer()
|
||||||
|
{
|
||||||
|
Answer = splenicState.ToString(),
|
||||||
|
ReadingQuestionTrialId = splenicStatusQuestionId,
|
||||||
|
VisitTaskId = visitTaskId,
|
||||||
|
SubjectId = taskinfo.SubjectId,
|
||||||
|
TrialId = taskinfo.TrialId,
|
||||||
|
ReadingQuestionCriterionTrialId = taskinfo.TrialReadingCriterionId,
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await _readingTaskQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == visitTaskId && (x.ReadingQuestionTrialId == spleenVerticalDiameterQuestionId || x.ReadingQuestionTrialId == splenicStatusQuestionId));
|
||||||
|
await _readingTaskQuestionAnswerRepository.AddRangeAsync(readingTaskQuestionAnswers);
|
||||||
|
await _readingTaskQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 获取脾脏状态
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取脾脏状态
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="visitTaskId"></param>
|
||||||
|
/// <param name="spleenLength"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
public async Task<string> GetSplenicState(Guid visitTaskId,decimal spleenLength)
|
public async Task<string> GetSplenicState(Guid visitTaskId,decimal spleenLength)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -2285,10 +2285,10 @@ public enum SUVChangeVSBaseline
|
||||||
/// </summary>
|
/// </summary>
|
||||||
LiverState = 47,
|
LiverState = 47,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 脾脏长度
|
/// 脾脏垂直径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SpleenLength = 48,
|
SpleenLength = 48,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 脾脏状态
|
/// 脾脏状态
|
||||||
|
|
|
@ -2707,7 +2707,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
var type = AuditOpt.Add;
|
var type = AuditOpt.Add;
|
||||||
|
|
||||||
var extraIdentification = string.Empty;
|
List<UnitData> unitDataList = (await _dbContext.Dictionary.Where(x => x.Parent.Code == "ValueUnit").Where(x => x.Code != "0").ToListAsync()).Select(x => new UnitData()
|
||||||
|
{
|
||||||
|
|
||||||
|
Unit = (ValueUnit)int.Parse(x.Code),
|
||||||
|
UnitName = x.Value.ToString(),
|
||||||
|
}).ToList();
|
||||||
|
var extraIdentification = string.Empty;
|
||||||
|
|
||||||
//具体的答案
|
//具体的答案
|
||||||
var taskQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(t => t.Entity as ReadingTaskQuestionAnswer).ToList();
|
var taskQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(t => t.Entity as ReadingTaskQuestionAnswer).ToList();
|
||||||
|
@ -2796,7 +2802,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
t => t.ReadingQuestionTrialId,
|
t => t.ReadingQuestionTrialId,
|
||||||
u => u.QuestionId,
|
u => u.QuestionId,
|
||||||
(t, u) =>
|
(t, u) =>
|
||||||
new { Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer, u.DictionaryCode, u.QuestionName, u.QuestionEnName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList()
|
new { Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty()
|
||||||
|
, u.DictionaryCode, u.QuestionName, u.QuestionEnName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList()
|
||||||
,
|
,
|
||||||
TableQuestionAndAnswerList = tableQuesionAndAnswerList
|
TableQuestionAndAnswerList = tableQuesionAndAnswerList
|
||||||
}
|
}
|
||||||
|
@ -2820,8 +2827,15 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
var tableQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(t => t.Entity as ReadingTableQuestionAnswer).Where(t => t.RowId == entity.Id).ToList();
|
var tableQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(t => t.Entity as ReadingTableQuestionAnswer).Where(t => t.RowId == entity.Id).ToList();
|
||||||
|
|
||||||
|
|
||||||
//获取表格问题名称 组合成数组
|
List<UnitData> unitDataList = (await _dbContext.Dictionary.Where(x => x.Parent.Code == "ValueUnit").Where(x => x.Code != "0").ToListAsync()).Select(x => new UnitData()
|
||||||
var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t =>
|
{
|
||||||
|
|
||||||
|
Unit = (ValueUnit)int.Parse(x.Code),
|
||||||
|
UnitName = x.Value.ToString(),
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
//获取表格问题名称 组合成数组
|
||||||
|
var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t =>
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
||||||
|
@ -2886,7 +2900,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
//如果问题类型是附件 特殊处理 方便前端解析
|
//如果问题类型是附件 特殊处理 方便前端解析
|
||||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer,
|
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer+ unitDataList.Where(y=>y.Unit==u.Unit).Select(x=>x.UnitName).FirstIsNullReturnEmpty(),
|
||||||
//t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
|
//t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
|
||||||
u.QuestionName,
|
u.QuestionName,
|
||||||
u.QuestionEnName,
|
u.QuestionEnName,
|
||||||
|
|
|
@ -5,6 +5,7 @@ using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore.Common.Dto
|
namespace IRaCIS.Core.Infra.EFCore.Common.Dto
|
||||||
{
|
{
|
||||||
|
@ -97,6 +98,17 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
|
||||||
public Guid ChildId { get; set; }
|
public Guid ChildId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class UnitData
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 单位
|
||||||
|
/// </summary>
|
||||||
|
public ValueUnit? Unit { get; set; }
|
||||||
|
|
||||||
|
public string UnitName { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 稽查数据
|
/// 稽查数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue