修改比例尺
parent
102cf5f6dc
commit
308f5140a1
|
|
@ -2479,6 +2479,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
|
||||||
public string OrderMarkName { get; set; }
|
public string OrderMarkName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 比例
|
||||||
|
/// </summary>
|
||||||
|
public decimal? Proportion { get; set; }
|
||||||
|
|
||||||
public Guid? MarkId { get; set; }
|
public Guid? MarkId { get; set; }
|
||||||
public Guid? NoneDicomFileId { get; set; }
|
public Guid? NoneDicomFileId { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Panda.DynamicWebApi.Attributes;
|
using Panda.DynamicWebApi.Attributes;
|
||||||
|
|
@ -159,6 +160,98 @@ namespace IRaCIS.Core.Application.Service
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改比例修改答案
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="proportion"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task<IResponseOutput> ChangePlottingScale(Guid? id, decimal proportion)
|
||||||
|
{
|
||||||
|
var markInfo = await _readingNoneDicomMarkRepository.Where(x => x.Id == id).Select(x => new
|
||||||
|
{
|
||||||
|
x.NoneDicomFileId,
|
||||||
|
x.VisitTaskId
|
||||||
|
}).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var visitTask = await _visitTaskRepository.Where(x => x.Id == markInfo.VisitTaskId).Include(x=>x.TrialReadingCriterion).FirstNotNullAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var digitPlaces = visitTask.TrialReadingCriterion.DigitPlaces??0;
|
||||||
|
|
||||||
|
if (proportion == -1)
|
||||||
|
{
|
||||||
|
await _readingNoneDicomMarkBindingRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == markInfo.VisitTaskId && x.ReadingNoneDicomMark.NoneDicomFileId == markInfo.NoneDicomFileId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var bindingList= await _readingNoneDicomMarkBindingRepository.Where(x => x.VisitTaskId == markInfo.VisitTaskId && x.ReadingNoneDicomMark.NoneDicomFileId == markInfo.NoneDicomFileId)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
List<string> ImageToolAttributeList = new List<string>()
|
||||||
|
{
|
||||||
|
"length",
|
||||||
|
"perimeter",
|
||||||
|
"area"
|
||||||
|
};
|
||||||
|
|
||||||
|
var questionAnswerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == markInfo.VisitTaskId &&
|
||||||
|
bindingList.Select(b => b.QuestionId).Contains(x.ReadingQuestionTrialId)
|
||||||
|
&& ImageToolAttributeList.Contains(x.ReadingQuestionTrial.ImageToolAttribute)).Include(x=>x.ReadingQuestionTrial)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
foreach (var item in questionAnswerList)
|
||||||
|
{
|
||||||
|
var answerValue = item.Answer.IsNullOrEmptyReturn0();
|
||||||
|
switch (item.ReadingQuestionTrial.ImageToolAttribute)
|
||||||
|
{
|
||||||
|
case "length":
|
||||||
|
case "perimeter":
|
||||||
|
answerValue = answerValue * proportion;
|
||||||
|
break;
|
||||||
|
case "area":
|
||||||
|
answerValue = answerValue * proportion * proportion;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
await _readingTaskQuestionAnswerRepository.UpdatePartialFromQueryAsync(item.Id, x => new ReadingTaskQuestionAnswer()
|
||||||
|
{
|
||||||
|
Answer= decimal.Round(answerValue, digitPlaces).ToString("F" + digitPlaces.ToString())
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var tableQuestionAnswerList = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == markInfo.VisitTaskId &&
|
||||||
|
bindingList.Select(b => b.TableQuestionId).Contains(x.TableQuestionId)
|
||||||
|
&& ImageToolAttributeList.Contains(x.ReadingTableQuestionTrial.ImageToolAttribute)).Include(x => x.ReadingTableQuestionTrial)
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
foreach (var item in tableQuestionAnswerList)
|
||||||
|
{
|
||||||
|
var answerValue = item.Answer.IsNullOrEmptyReturn0();
|
||||||
|
switch (item.ReadingTableQuestionTrial.ImageToolAttribute)
|
||||||
|
{
|
||||||
|
case "length":
|
||||||
|
case "perimeter":
|
||||||
|
answerValue = answerValue * proportion;
|
||||||
|
break;
|
||||||
|
case "area":
|
||||||
|
answerValue = answerValue * proportion * proportion;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
await _readingTableQuestionAnswerRepository.UpdatePartialFromQueryAsync(item.Id, x => new ReadingTableQuestionAnswer()
|
||||||
|
{
|
||||||
|
Answer = decimal.Round(answerValue, digitPlaces).ToString("F" + digitPlaces.ToString())
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 删除绑定关系
|
/// 删除绑定关系
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -197,7 +290,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddNoneDicomMark(AddNoneDicomMarkInDto inDto)
|
public async Task<IResponseOutput> AddNoneDicomMark(AddNoneDicomMarkInDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
var entity = await _readingNoneDicomMarkRepository.InsertOrUpdateAsync(inDto, true);
|
var entity = await _readingNoneDicomMarkRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
|
|
||||||
|
if (inDto.Proportion != null)
|
||||||
|
{
|
||||||
|
await this.ChangePlottingScale(entity.Id, inDto.Proportion.Value);
|
||||||
|
}
|
||||||
return ResponseOutput.Ok(entity.Id);
|
return ResponseOutput.Ok(entity.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
using Org.BouncyCastle.Crypto.Digests;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Domain.Models;
|
namespace IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
[Comment("项目阅片 - 非Dicom标记绑定")]
|
[Comment("项目阅片 - 非Dicom标记绑定")]
|
||||||
|
|
@ -7,7 +9,7 @@ public class ReadingNoneDicomMarkBinding : BaseAddAuditEntity
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[ForeignKey("NoneDicomMarkId")]
|
[ForeignKey("NoneDicomMarkId")]
|
||||||
public NoneDicomStudy NoneDicomStudy { get; set; }
|
public ReadingNoneDicomMark ReadingNoneDicomMark { get; set; }
|
||||||
|
|
||||||
public Guid VisitTaskId { get; set; }
|
public Guid VisitTaskId { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue