Compare commits
No commits in common. "a79aebe77221f55db709c65111c34fad6ebc94bd" and "50a45e226078f6d505f92546357b98032857b149" have entirely different histories.
a79aebe772
...
50a45e2260
|
|
@ -6450,31 +6450,6 @@
|
||||||
不等于
|
不等于
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue">
|
|
||||||
<summary>
|
|
||||||
IVUS测量值导入
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.PlaqueNum">
|
|
||||||
<summary>
|
|
||||||
斑块编号
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.Emm">
|
|
||||||
<summary>
|
|
||||||
外弹力膜面积Emm
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.Lumen">
|
|
||||||
<summary>
|
|
||||||
管腔面积Lumen
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.IVUSMeasuredValue.EmmSubtractionLumen">
|
|
||||||
<summary>
|
|
||||||
外弹力膜面积- 管腔面积
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="T:IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto">
|
<member name="T:IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto">
|
||||||
<summary>
|
<summary>
|
||||||
阅片计算Dto
|
阅片计算Dto
|
||||||
|
|
|
||||||
|
|
@ -201,39 +201,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
public Guid VisitTaskId { get; set; }
|
public Guid VisitTaskId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// IVUS测量值导入
|
|
||||||
/// </summary>
|
|
||||||
public class IVUSMeasuredValue
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 斑块编号
|
|
||||||
/// </summary>
|
|
||||||
public int PlaqueNum { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 外弹力膜面积Emm
|
|
||||||
/// </summary>
|
|
||||||
public decimal Emm { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 管腔面积Lumen
|
|
||||||
/// </summary>
|
|
||||||
public decimal Lumen { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 外弹力膜面积- 管腔面积
|
|
||||||
/// </summary>
|
|
||||||
public decimal EmmSubtractionLumen
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.Emm - this.Lumen;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 阅片计算Dto
|
/// 阅片计算Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
using DocumentFormat.OpenXml.EMMA;
|
using DocumentFormat.OpenXml.Presentation;
|
||||||
using DocumentFormat.OpenXml.Presentation;
|
|
||||||
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 IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using IRaCIS.Core.Infrastructure;
|
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
@ -601,113 +599,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
var request = httpContext.HttpContext!.Request;
|
var request = httpContext.HttpContext!.Request;
|
||||||
var file = request.Form.Files[0];
|
var file = request.Form.Files[0];
|
||||||
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
||||||
var dataTable =await _generalCalculateService.GetDataTableFromUpload(file);
|
var dataTable = _generalCalculateService.GetDataTableFromUpload(file);
|
||||||
|
|
||||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).FirstNotNullAsync();
|
|
||||||
|
|
||||||
var values = new
|
|
||||||
{
|
|
||||||
SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode,
|
|
||||||
TaskBlindName = taskinfo.TaskBlindName,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (values.SubjectID != dataTable.Rows[0]["B"].ToString() || values.TaskBlindName != dataTable.Rows[1]["B"].ToString())
|
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException(_localizer["IVUS_UploadVisitTaskError"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<IVUSMeasuredValue> measuredValueList = new List<IVUSMeasuredValue>();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for (int i = 3; i < dataTable.Rows.Count; i++)
|
|
||||||
{
|
|
||||||
measuredValueList.Add(new IVUSMeasuredValue()
|
|
||||||
{
|
|
||||||
PlaqueNum = int.Parse(dataTable.Rows[i]["A"].ToString()),
|
|
||||||
Emm = decimal.Parse(dataTable.Rows[i]["B"].ToString()),
|
|
||||||
Lumen = decimal.Parse(dataTable.Rows[i]["C"].ToString()),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException(_localizer["IVUS_UplpadDataError"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var questionInfo = await _readingQuestionTrialRepository.Where(x =>x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId&& x.LesionType == LesionType.MatchValues).FirstNotNullAsync();
|
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.Id).ToListAsync();
|
|
||||||
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
|
||||||
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
|
||||||
|
|
||||||
var maxnum = _readingTableAnswerRowInfoRepository.Where(x => x.QuestionId == questionInfo.Id && x.VisitTaskId == taskinfo.Id).MaxOrDefault(x => x.RowIndex);
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var item in measuredValueList)
|
|
||||||
{
|
|
||||||
maxnum = maxnum + 1;
|
|
||||||
var newRowId = NewId.NextGuid();
|
|
||||||
// 斑块数据统计
|
|
||||||
tableAnsweRowInfos.Add(new ReadingTableAnswerRowInfo()
|
|
||||||
{
|
|
||||||
Id = newRowId,
|
|
||||||
QuestionId = questionInfo.Id,
|
|
||||||
VisitTaskId = taskinfo.Id,
|
|
||||||
TrialId = taskinfo.TrialId,
|
|
||||||
RowIndex = maxnum,
|
|
||||||
IsCurrentTaskAdd = true,
|
|
||||||
BlindName = taskinfo.TaskBlindName,
|
|
||||||
OrderMark = questionInfo.OrderMark,
|
|
||||||
FristAddTaskNum = taskinfo.VisitTaskNum,
|
|
||||||
FristAddTaskId = taskinfo.Id,
|
|
||||||
RowMark = questionInfo.OrderMark + decimal.Parse(maxnum.ToString()).GetLesionMark()
|
|
||||||
});
|
|
||||||
|
|
||||||
// EMM
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
|
||||||
{
|
|
||||||
Answer = item.Emm.ToString(),
|
|
||||||
QuestionId = questionInfo.Id,
|
|
||||||
TrialId = taskinfo.TrialId,
|
|
||||||
VisitTaskId = taskinfo.Id,
|
|
||||||
RowId = newRowId,
|
|
||||||
RowIndex = maxnum,
|
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.ElasticArea).Select(x => x.Id).FirstOrDefault(),
|
|
||||||
});
|
|
||||||
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
|
||||||
{
|
|
||||||
Answer = item.Lumen.ToString(),
|
|
||||||
QuestionId = questionInfo.Id,
|
|
||||||
TrialId = taskinfo.TrialId,
|
|
||||||
VisitTaskId = taskinfo.Id,
|
|
||||||
RowId = newRowId,
|
|
||||||
RowIndex = maxnum,
|
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.LumenArea).Select(x => x.Id).FirstOrDefault(),
|
|
||||||
});
|
|
||||||
|
|
||||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
|
||||||
{
|
|
||||||
Answer = item.EmmSubtractionLumen.ToString(),
|
|
||||||
QuestionId = questionInfo.Id,
|
|
||||||
TrialId = taskinfo.TrialId,
|
|
||||||
VisitTaskId = taskinfo.Id,
|
|
||||||
RowId = newRowId,
|
|
||||||
RowIndex = maxnum,
|
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.ReadingQuestionId == questionInfo.Id && x.QuestionMark == QuestionMark.ElasticAreaDiffValue).Select(x => x.Id).FirstOrDefault(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
await _readingTableAnswerRowInfoRepository.AddRangeAsync(tableAnsweRowInfos);
|
|
||||||
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
|
|
||||||
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
await this.CalculateTask(new CalculateTaskInDto()
|
|
||||||
{
|
|
||||||
|
|
||||||
VisitTaskId = taskinfo.Id,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -729,13 +621,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
// 获取编号
|
// 获取编号
|
||||||
var nums = matchValuesAnswerList.SelectMany(x => x.TableQuestionList).Where(x => x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => int.Parse(x.Answer)).Distinct().OrderBy(x => x).ToList();
|
var nums = matchValuesAnswerList.SelectMany(x => x.TableQuestionList).Where(x => x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => int.Parse(x.Answer)).Distinct().OrderBy(x => x).ToList();
|
||||||
|
|
||||||
// 斑块的表格问题集合
|
List<ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
||||||
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.QuestionId).ToListAsync();
|
|
||||||
|
|
||||||
// pAV表格问题
|
|
||||||
var pAvTableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == pAVquestionInfo.QuestionId).ToListAsync();
|
|
||||||
|
|
||||||
List <ReadingTableAnswerRowInfo> tableAnsweRowInfos = new List<ReadingTableAnswerRowInfo>();
|
|
||||||
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
List<ReadingTableQuestionAnswer> tableAnswers = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
||||||
foreach (var item in nums)
|
foreach (var item in nums)
|
||||||
|
|
@ -770,7 +656,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
RowId = newRowId,
|
RowId = newRowId,
|
||||||
RowIndex = item,
|
RowIndex = item,
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.QuestionId && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefaultAsync(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -833,7 +719,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
RowId = newPAVRowId,
|
RowId = newPAVRowId,
|
||||||
RowIndex = item,
|
RowIndex = item,
|
||||||
TableQuestionId = pAvTableQuestionList.Where(x => x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == pAVquestionInfo.QuestionId && x.QuestionMark == QuestionMark.PlaqueNumber).Select(x => x.Id).FirstOrDefaultAsync(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -848,7 +734,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
RowId = newPAVRowId,
|
RowId = newPAVRowId,
|
||||||
RowIndex = item,
|
RowIndex = item,
|
||||||
TableQuestionId = pAvTableQuestionList.Where(x => x.QuestionMark == QuestionMark.PAV).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == pAVquestionInfo.QuestionId && x.QuestionMark == QuestionMark.PAV).Select(x => x.Id).FirstOrDefaultAsync(),
|
||||||
});
|
});
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -863,7 +749,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
RowId = newRowId,
|
RowId = newRowId,
|
||||||
RowIndex = item,
|
RowIndex = item,
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.EEMSum).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.QuestionId && x.QuestionMark == QuestionMark.EEMSum).Select(x => x.Id).FirstOrDefaultAsync(),
|
||||||
});
|
});
|
||||||
|
|
||||||
// (EEM-Lumen)求和
|
// (EEM-Lumen)求和
|
||||||
|
|
@ -876,7 +762,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
VisitTaskId = inDto.VisitTaskId,
|
VisitTaskId = inDto.VisitTaskId,
|
||||||
RowId = newRowId,
|
RowId = newRowId,
|
||||||
RowIndex = item,
|
RowIndex = item,
|
||||||
TableQuestionId = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.EEMSubtractLumenSum).Select(x => x.Id).FirstOrDefault(),
|
TableQuestionId = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == questionInfo.QuestionId && x.QuestionMark == QuestionMark.EEMSubtractLumenSum).Select(x => x.Id).FirstOrDefaultAsync(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue