功能修改
This commit is contained in:
@@ -5932,6 +5932,82 @@
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.ReadingImport">
|
||||
<summary>
|
||||
阅片导入
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.GetReadingCalculationData(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingCalculationDataInDto)">
|
||||
<summary>
|
||||
获取阅片的计算数据
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.GetDeleteLesionStatrIndex(IRaCIS.Core.Application.Service.Reading.Dto.DeleteReadingRowAnswerInDto)">
|
||||
<summary>
|
||||
删除病灶获取起始病灶序号
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.GetReadingReportEvaluation(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingReportEvaluationInDto)">
|
||||
<summary>
|
||||
获取阅片报告
|
||||
</summary>
|
||||
<param name="indto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.AddTaskLesionAnswerFromLastTask(IRaCIS.Core.Application.ViewModel.AddTaskLesionAnswerFromLastTaskInDto)">
|
||||
<summary>
|
||||
将上一次的访视病灶添加到这一次
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.TestCalculate(System.Guid,IRaCIS.Core.Domain.Share.QuestionType)">
|
||||
<summary>
|
||||
测试计算
|
||||
</summary>
|
||||
<param name="visitTaskId"></param>
|
||||
<param name="type"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.CalculateTask(IRaCIS.Core.Application.Service.Reading.Dto.CalculateTaskInDto)">
|
||||
<summary>
|
||||
计算任务
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.ReadingCalculate(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto,System.Collections.Generic.List{IRaCIS.Core.Domain.Share.QuestionType})">
|
||||
<summary>
|
||||
自动计算
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<param name="calculateType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.GetFatFractionAvg(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
获取脂肪分数平均值
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.GetFattyLiverGrading(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
获取脂肪肝分级
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFAdvanceCalculateService.CalculateAvg(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto)">
|
||||
<summary>
|
||||
计算平均值
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFCalculateService.ReadingImport">
|
||||
<summary>
|
||||
阅片导入
|
||||
@@ -15390,11 +15466,11 @@
|
||||
<param name="addOrEditSegmentation"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.SaveSegmentationVersionAsync(System.Guid)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.SaveSegmentationVersionAsync(IRaCIS.Core.Application.ViewModel.SaveSegmentationVersionAsyncInDto)">
|
||||
<summary>
|
||||
添加新版本
|
||||
</summary>
|
||||
<param name="segmentationId"></param>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.SegmentationService.GetSegmentationVersionList(IRaCIS.Core.Application.ViewModel.SegmentationVersionQuery)">
|
||||
|
||||
@@ -96,6 +96,11 @@ public class SegmentationVersionView
|
||||
public string CreateUserName { get; set; }
|
||||
}
|
||||
|
||||
public class SaveSegmentationVersionAsyncInDto
|
||||
{
|
||||
public Guid SegmentationId { get; set; }
|
||||
}
|
||||
|
||||
public class SegmentationVersionQuery : PageInput
|
||||
{
|
||||
public Guid SegmentationId { get; set; }
|
||||
|
||||
@@ -4,15 +4,17 @@
|
||||
// 生成时间 2026-03-10 06:17:28Z
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Interfaces;
|
||||
using IRaCIS.Core.Application.MassTransit.Command;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using System.Threading.Tasks;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using IRaCIS.Core.Infrastructure.Extention;
|
||||
using MassTransit;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service;
|
||||
|
||||
@@ -72,12 +74,6 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateSegmentation(SegmentationAddOrEdit addOrEditSegmentation)
|
||||
{
|
||||
|
||||
|
||||
if (addOrEditSegmentation.Id != null)
|
||||
{
|
||||
await SaveSegmentationVersionAsync(addOrEditSegmentation.Id.Value);
|
||||
}
|
||||
|
||||
var entity = await _segmentationRepository.InsertOrUpdateAsync(addOrEditSegmentation, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
@@ -86,11 +82,13 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||
/// <summary>
|
||||
/// 添加新版本
|
||||
/// </summary>
|
||||
/// <param name="segmentationId"></param>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
private async Task SaveSegmentationVersionAsync(Guid segmentationId)
|
||||
[HttpPost]
|
||||
public async Task SaveSegmentationVersionAsync(SaveSegmentationVersionAsyncInDto inDto)
|
||||
{
|
||||
var data = await _segmentationRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == segmentationId);
|
||||
var data = await _segmentationRepository.FirstOrDefaultNoTrackingAsync(x => x.Id == inDto.SegmentationId);
|
||||
var segmentList = await _segmentRepository.Where(x => x.SegmentationId == inDto.SegmentationId).OrderBy(x=>x.SegmentNumber).ProjectTo<SegmentVersionData>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
if (data.SEGUrl != string.Empty)
|
||||
{
|
||||
@@ -102,6 +100,7 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
var newVersion = maxVersion + 1;
|
||||
|
||||
var versionEntity = new SegmentationVersion
|
||||
{
|
||||
SegmentationId = data.Id,
|
||||
@@ -109,6 +108,7 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||
SegmentationJson = data.SegmentationJson,
|
||||
SEGUrl = data.SEGUrl,
|
||||
FileSize = data.FileSize,
|
||||
SegmentList= segmentList,
|
||||
};
|
||||
|
||||
await _segmentationVersionRepository.AddAsync(versionEntity);
|
||||
@@ -146,14 +146,22 @@ public class SegmentationService(IRepository<Segmentation> _segmentationReposito
|
||||
{
|
||||
var version = await _segmentationVersionRepository.Where(x => x.Id == inDto.VersionId && x.SegmentationId == inDto.SegmentationId).FirstNotNullAsync();
|
||||
var segmentation = await _segmentationRepository.Where(x => x.Id == inDto.SegmentationId).FirstNotNullAsync();
|
||||
|
||||
await _segmentationRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.SegmentationId, t => new Segmentation
|
||||
{
|
||||
SegmentationJson = version.SegmentationJson,
|
||||
SEGUrl = version.SEGUrl,
|
||||
FileSize = version.FileSize,
|
||||
});
|
||||
|
||||
var segmentList = _mapper.Map<List<Segment>>(version.SegmentList);
|
||||
|
||||
await _segmentRepository.BatchDeleteNoTrackingAsync(x => x.SegmentationId == inDto.SegmentationId);
|
||||
await _segmentRepository.AddRangeAsync(segmentList);
|
||||
|
||||
await _segmentationRepository.SaveChangesAsync();
|
||||
|
||||
await DeleteBindingsAndAnswersAsync(inDto.SegmentationId, null);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,9 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
// 在此处拷贝automapper 映射
|
||||
|
||||
CreateMap<Segment, SegmentVersionData>();
|
||||
CreateMap<SegmentVersionData, Segment>();
|
||||
|
||||
CreateMap<Segment, SegmentView>();
|
||||
CreateMap<Segment, SegmentAddOrEdit>().ReverseMap();
|
||||
|
||||
|
||||
@@ -476,7 +476,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
QuestionMark.FourthMeasurement,
|
||||
};
|
||||
var answers = item.TableQuestionList.Where(x => questionMarks.Contains(x.QuestionMark)).Select(x=>x.Answer).ToList();
|
||||
if (answers.Count() == 3 && !answers.Any(x => x.IsNullOrEmpty()))
|
||||
if (answers.Count() == 4 && !answers.Any(x => x.IsNullOrEmpty()))
|
||||
{
|
||||
var avgAnswernum= answers.Select(x=>x.IsNullOrEmptyReturn0()).Average(x=>x);
|
||||
avgAnswer = decimal.Round(avgAnswernum, inDto.DigitPlaces, MidpointRounding.AwayFromZero).ToString("F" + inDto.DigitPlaces.ToString());
|
||||
|
||||
Reference in New Issue
Block a user