diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 1cab85629..bd7d507aa 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -4245,6 +4245,12 @@
+
+
+ 计算平均值
+
+
+
获取阅片的计算数据
@@ -7584,6 +7590,11 @@
任务Id
+
+
+ 保存表格问题标记
+
+
问题类型
@@ -12015,6 +12026,13 @@
+
+
+ 保存表格问题标记
+
+
+
+
获取既往病灶的OtherPicture
@@ -12188,7 +12206,7 @@
-
+
获取子元素
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs
index 00e20b823..96578b54e 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs
@@ -394,6 +394,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public class TableRowInfo
{
+ public Guid RowId { get; set; }
+
public decimal RowIndex { get; set; }
public decimal FristAddTaskNum { get; set; }
diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
index e165d3563..1d43a80b9 100644
--- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
+++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs
@@ -446,6 +446,65 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
}
+ ///
+ /// 保存表格问题标记
+ ///
+ public class SaveTableQuestionMarkInDto
+ {
+ public string Answer { get; set; }
+
+ public Guid VisitTaskId { get; set; }
+
+ public Guid QuestionId { get; set; }
+
+ public Guid? InstanceId { get; set; }
+
+ public Guid? SeriesId { get; set; }
+ public Guid? StudyId { get; set; }
+
+ public string MarkTool { get; set; } = string.Empty;
+
+ public string PicturePath { get; set; } = string.Empty;
+
+ public int? NumberOfFrames { get; set; }
+
+ public string MeasureData { get; set; } = string.Empty;
+ public Guid? FirstAddTaskId { get; set; }
+
+ public QuestionType? QuestionType { get; set; }
+ public string OrderMarkName { get; set; } = string.Empty;
+
+ public Guid? OtherInstanceId { get; set; }
+
+ public Guid? OtherSeriesId { get; set; }
+
+ public Guid? OtherStudyId { get; set; }
+
+ public Guid? RowId { get; set; }
+ [NotDefault]
+ public Guid TableQuestionId { get; set; }
+ [NotDefault]
+ public decimal RowIndex { get; set; }
+
+ public string OtherMarkTool { get; set; } = string.Empty;
+
+ public string OtherPicturePath { get; set; } = string.Empty;
+
+ public int? OtherNumberOfFrames { get; set; }
+
+ public string OtherMeasureData { get; set; } = string.Empty;
+ }
+
+
+ public class TableQuestionMark: SaveTableQuestionMarkInDto
+ {
+
+ public new Guid? TableQuestionId { get; set; }
+
+ public new decimal? RowIndex { get; set; }
+ }
+
+
public class GetPreviousOtherPicturePathInDto
{
@@ -991,6 +1050,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
{
public Guid Id { get; set; }
+ public Guid? TableQuestionId { get; set; }
+
///
/// 序号标记
///
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
index fd836bbd6..5c7b08042 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
@@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
+using Newtonsoft.Json.Serialization;
using NPOI.POIFS.Properties;
using NPOI.SS.Formula.Functions;
using Panda.DynamicWebApi.Attributes;
@@ -83,6 +84,48 @@ namespace IRaCIS.Core.Application.Service
}
#endregion
+ ///
+ /// 保存表格问题标记
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task SaveTableQuestionMark(SaveTableQuestionMarkInDto inDto)
+ {
+
+ inDto.FirstAddTaskId = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.TableQuestionId == inDto.TableQuestionId && x.RowId == inDto.RowId).Select(x => x.FirstAddTaskId).FirstOrDefaultAsync();
+ inDto.FirstAddTaskId=inDto.FirstAddTaskId==null?inDto.VisitTaskId:inDto.FirstAddTaskId;
+ var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
+ await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x =>x.VisitTaskId==inDto.VisitTaskId&&x.QuestionId==inDto.QuestionId&& x.RowId == inDto.RowId.Value && x.TableQuestionId == inDto.TableQuestionId);
+ await _readingTableQuestionAnswerRepository.AddAsync(new ReadingTableQuestionAnswer()
+ {
+ Answer = inDto.Answer,
+ QuestionId = inDto.QuestionId,
+ TableQuestionId = inDto.TableQuestionId,
+ VisitTaskId = inDto.VisitTaskId,
+ TrialId = visitTaskInfo.TrialId,
+ RowIndex = inDto.RowIndex,
+ RowId = inDto.RowId.Value,
+
+ });
+
+ await _readingTaskQuestionMarkRepository.BatchDeleteNoTrackingAsync(x=>x.VisitTaskId == inDto.VisitTaskId && x.QuestionId == inDto.QuestionId && x.RowId == inDto.RowId.Value && x.TableQuestionId == inDto.TableQuestionId);
+
+ var readingTaskQuestionMark = _mapper.Map(inDto);
+
+ await _readingTaskQuestionMarkRepository.AddAsync(readingTaskQuestionMark);
+ await _readingTaskQuestionMarkRepository.SaveChangesAsync();
+
+ await _readingCalculateService.CalculateTask(new CalculateTaskInDto()
+ {
+ IsChangeOtherTask = false,
+ VisitTaskId = inDto.VisitTaskId,
+ ComputationTrigger = ComputationTrigger.SaveTableQuestionMark,
+ });
+
+ return inDto;
+ }
+
///
/// 获取既往病灶的OtherPicture
///
@@ -934,7 +977,12 @@ namespace IRaCIS.Core.Application.Service
.ToListAsync();
+ //var tableQuestionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId).ToListAsync();
+ //result.ForEach(x =>
+ //{
+ // x.TableQuestionMarkList = tableQuestionMarkList.Where(y => y.RowId == x.RowId).ToList();
+ //});
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).FirstNotNullAsync();
@@ -963,6 +1011,7 @@ namespace IRaCIS.Core.Application.Service
x.IsFirstChangeTask = x.VisitTaskId == inDto.VisitTaskId;
});
result.AddRange(questionMark);
+ result= result.OrderBy(x=>x.RowIndex).ThenBy(x => x.OrderMarkName).ToList();
return result;
}
@@ -1085,6 +1134,7 @@ namespace IRaCIS.Core.Application.Service
{
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
+ var tableQuestionMarkList = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == inDto.TaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync();
var qusetionList = await _readingQuestionTrialRepository
.Where(x => x.IsShowInDicom)
.WhereIf(inDto.QuestionClassify != null, x => x.QuestionClassify == inDto.QuestionClassify)
@@ -1260,7 +1310,7 @@ namespace IRaCIS.Core.Application.Service
var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
pageGroupList.ForEach(x =>
{
- FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, inDto.TaskId);
+ FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, tableQuestionMarkList, inDto.TaskId);
});
page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count == 0)).ToList();
@@ -1277,7 +1327,7 @@ namespace IRaCIS.Core.Application.Service
groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList();
groupList.ForEach(x =>
{
- FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, inDto.TaskId);
+ FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, tableQuestionMarkList, inDto.TaskId);
});
groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count == 0)).ToList();
@@ -1304,7 +1354,7 @@ namespace IRaCIS.Core.Application.Service
///
///
///
- private async void FindChildQuestion(TrialReadQuestionData item, List questionlists, List tableQuestionLists, List tableAnswers, List tableAnsweRowInfos, List organInfos, List baseLineTableAnswer, bool isFirstChangeTask, List lastTaskTableAnswer, Guid? TaskId)
+ private async void FindChildQuestion(TrialReadQuestionData item, List questionlists, List tableQuestionLists, List tableAnswers, List tableAnsweRowInfos, List organInfos, List baseLineTableAnswer, bool isFirstChangeTask, List lastTaskTableAnswer, List TableQuestionMarkList, Guid? TaskId)
{
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (x.GroupId == item.Id && x.ParentId == null)).ToList();
item.TableQuestions = new TrialReadTableQuestion();
@@ -1428,6 +1478,12 @@ namespace IRaCIS.Core.Application.Service
answers.Add("OtherNumberOfFrames", rowInfo == null || rowInfo.OtherNumberOfFrames == null ? string.Empty : rowInfo.OtherNumberOfFrames.ToString());
answers.Add("OtherMarkTool", rowInfo == null || rowInfo.OtherMarkTool == null ? string.Empty : rowInfo.OtherMarkTool.ToString());
answers.Add("RowIndex", x.ToString());
+
+ JsonSerializerSettings settings = new JsonSerializerSettings
+ {
+ FloatParseHandling = FloatParseHandling.Double,
+ };
+ answers.Add("TableQuestionMarkList", rowInfo == null ? "[]" : JsonConvert.SerializeObject(TableQuestionMarkList.Where(x=>x.RowId== rowInfo.Id).ToList(), settings));
answers.Add("RowId", rowInfo == null ? string.Empty : rowInfo.Id.ToString());
answers.Add("MarkTool", rowInfo.MarkTool);
answers.Add("StudyId", rowInfo.StudyId.ToString());
@@ -1459,7 +1515,7 @@ namespace IRaCIS.Core.Application.Service
{
item.Childrens.ForEach(x =>
{
- FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, TaskId);
+ FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer, TableQuestionMarkList, TaskId);
});
}
}
diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs
index ad7e72069..92413e56b 100644
--- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs
+++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs
@@ -64,8 +64,11 @@ namespace IRaCIS.Core.Application.Service
CreateMap();
CreateMap();
#endregion
-
+ CreateMap();
+ CreateMap();
CreateMap();
+ CreateMap();
+ CreateMap();
CreateMap()
.ForMember(dest => dest.CreateUserRole, opt => opt.Ignore())
.ForAllMembers(opts => opts.Condition((src, dest, srcMember) => srcMember != null));
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/Dto/CriterionCalculateDto.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/Dto/CriterionCalculateDto.cs
index 269533c15..02b308b7d 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/Dto/CriterionCalculateDto.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/Dto/CriterionCalculateDto.cs
@@ -106,6 +106,30 @@ namespace IRaCIS.Core.Application.ViewModel
}
+ public class TableMarkInfo
+ {
+
+ public Guid VisitTaskId { get; set; }
+
+ public Guid TrialId { get; set; }
+
+ public Guid QuestionId { get; set; }
+
+ public Guid? FirstAddTaskId { get; set; }
+
+ public QuestionType? QuestionType { get; set; }
+ public string OrderMarkName { get; set; } = string.Empty;
+ ///
+ /// 表格问题标记
+ ///
+ public Guid? RowId { get; set; }
+
+ public Guid? TableQuestionId { get; set; }
+
+ public decimal? RowIndex { get; set; }
+
+ }
+
public class AddTaskLesionAnswerFromLastTaskOutDto
{
public bool IsBaseLine { get; set; }
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
index 5333bcaed..2f3023504 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
@@ -224,6 +224,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
item.TableRowInfoList = thisItemRowInfo.Select(x => new TableRowInfo()
{
+ RowId = x.Id,
RowIndex = x.RowIndex,
MeasureData = x.MeasureData,
OtherMeasureData = x.OtherMeasureData,
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFCalculateService.cs
index 3667ada44..1fc132da2 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/MRIPDFFCalculateService.cs
@@ -1,9 +1,11 @@
-using IRaCIS.Core.Application.Service.Reading.Dto;
+using DocumentFormat.OpenXml.EMMA;
+using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Domain.Share;
using IRaCIS.Core.Infra.EFCore.Common;
using MassTransit;
using Microsoft.AspNetCore.Mvc;
+using System.Linq;
namespace IRaCIS.Core.Application.Service.ReadingCalculate
{
@@ -18,6 +20,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
IRepository _subjectVisitRepository,
IRepository _organInfoRepository,
IRepository _dictionaryRepository,
+ IRepository _readingTaskQuestionMarkRepository,
IRepository _dicomStudyRepository,
IRepository _noneDicomStudyRepository,
IRepository _tumorAssessmentRepository,
@@ -366,8 +369,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
var tableQuestion = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId && x.LesionType == LesionType.FatFraction).FirstNotNullAsync();
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == tableQuestion.Id).ToListAsync();
+ var LastVisitTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit &&
+ x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId &&
+ x.IsAnalysisCreate == taskinfo.IsAnalysisCreate &&
+ x.DoctorUserId == taskinfo.DoctorUserId &&
+ x.IsSelfAnalysis == taskinfo.IsSelfAnalysis &&
+ x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTaskNum < taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect && x.ArmEnum == taskinfo.ArmEnum
+ ).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync();
+ List marks = await _readingTaskQuestionMarkRepository.Where(x => x.VisitTaskId == LastVisitTaskId && x.RowId != null).ProjectTo(_mapper.ConfigurationProvider).ToListAsync();
+
+
+ marks.ForEach(x => {
+
+ x.VisitTaskId = visitTaskId;
+ });
+
List rowlist = new List();
List tableAnswerList = new List();
@@ -375,6 +393,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
foreach (var item in dictionList)
{
var guid = NewId.NextGuid();
+ marks.ForEach(x => {
+ x.RowId = x.RowIndex == num ? guid : x.RowId;
+ });
rowlist.Add(new ReadingTableAnswerRowInfo()
{
FristAddTaskId= visitTaskId,
@@ -415,10 +436,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
}
- num = num++;
+ num++;
}
await _readingTableAnswerRowInfoRepository.AddRangeAsync(rowlist);
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswerList);
+
+ await _readingTaskQuestionMarkRepository.AddRangeAsync(_mapper.Map>(marks));
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
return new AddTaskLesionAnswerFromLastTaskOutDto()
@@ -455,6 +478,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
}
+
+
///
/// 自动计算
///
@@ -463,18 +488,166 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
///
public async Task ReadingCalculate(ReadingCalculateDto inDto, List? calculateType = null)
{
- //var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.CriterionId && x.CustomCalculateMark != null).ToListAsync();
- //var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == inDto.CriterionId && x.CustomCalculateMark != null).ToListAsync();
+
+ await this.CalculateAvg(inDto);
+ inDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
+ var needAddList = new List();
+ List calculateList = new List()
+ {
+ // 脂肪平均
+ new ReadingCalculateData (){QuestionType=QuestionType.TotalMeanFraction,GetDecimalFun=GetFatFractionAvg},
+ };
+
+
+ if (calculateType != null)
+ {
+ calculateList = calculateList.Where(x => calculateType.Contains(x.QuestionType)).ToList();
+ }
+ foreach (var calculate in calculateList)
+ {
+ var item = inDto.QuestionInfo.FirstOrDefault(x => x.QuestionType == calculate.QuestionType);
+ if (item != null)
+ {
+ //计算答案
+
+
+ #region 计算答案
+ if (calculate.GetDecimalFun != null)
+ {
+ item.Answer = (await calculate.GetDecimalFun(inDto)).ToString();
+
+ }
+ else if (calculate.GetDecimalNullFun != null)
+ {
+ var value = await calculate.GetDecimalNullFun(inDto);
+ item.Answer = value == null ? "NA" : value.Value.ToString();
+ }
+ else if (calculate.GetStringFun != null)
+ {
+ item.Answer = await calculate.GetStringFun(inDto);
+ }
+ #endregion
+ // 修改修约小数位数
+
+ List valueOfTypes = new List() {
+
+ ValueOfType.Decimals,
+ ValueOfType.Percentage
+ };
+
+ if (inDto.DigitPlaces != -1)
+ {
+ try
+ {
+
+ if (valueOfTypes.Contains(item.ValueType))
+ {
+ item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces, MidpointRounding.AwayFromZero).ToString("F" + inDto.DigitPlaces.ToString());
+ }
+ }
+ catch (Exception)
+ {
+
+ }
+ }
+
+ needAddList.Add(new ReadingTaskQuestionAnswer()
+ {
+ Answer = item.Answer,
+ ReadingQuestionTrialId = item.QuestionId,
+ });
+ }
+ }
+
+
+
+ var questionIds = needAddList.Select(x => x.ReadingQuestionTrialId).ToList();
+
+ await _readingTaskQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => questionIds.Contains(x.ReadingQuestionTrialId) && x.VisitTaskId == inDto.VisitTaskId);
+ needAddList.ForEach(x =>
+ {
+ x.SubjectId = inDto.SubjectId;
+ x.ReadingQuestionCriterionTrialId = inDto.CriterionId;
+ x.VisitTaskId = inDto.VisitTaskId;
+ x.TrialId = inDto.TrialId;
+ x.SubjectId = inDto.SubjectId;
+ });
+
+ await _readingTaskQuestionAnswerRepository.AddRangeAsync(needAddList);
+
+ await _readingTaskQuestionAnswerRepository.SaveChangesAsync();
}
+ ///
+ /// 获取脂肪分数平均值
+ ///
+ ///
+ ///
+ public async Task GetFatFractionAvg(ReadingCalculateDto inDto)
+ {
+ decimal result = 0;
+ var rowInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction).SelectMany(x => x.TableRowInfoList).ToList();
+
+ var tableQuestionList = rowInfo.SelectMany(x => x.TableQuestionList).ToList();
+
+ result = tableQuestionList.Where(x => x.QuestionMark == QuestionMark.AverageValue).Average(x => x.Answer.IsNullOrEmptyReturn0());
+ return result;
+
+ }
+
+ ///
+ /// 计算平均值
+ ///
+ ///
+ public async Task CalculateAvg(ReadingCalculateDto inDto)
+ {
+ // 脂肪分数的表格问题Id
+ var questionInfo = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FatFraction).FirstOrDefault();
+
+ List tableAnswers = new List();
+ foreach (var item in questionInfo.TableRowInfoList)
+ {
+ var avg = item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.AverageValue).FirstOrDefault();
+ var avgAnswer = string.Empty;
+ List questionMarks = new List()
+ {
+ QuestionMark.FirstMeasurement,
+ QuestionMark.SecondMeasurement,
+ QuestionMark.ThirdMeasurement,
+ };
+ var answers = item.TableQuestionList.Where(x => questionMarks.Contains(x.QuestionMark)).Select(x=>x.Answer).ToList();
+ if (answers.Count() == 3 && !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());
+ }
+ tableAnswers.Add(new ReadingTableQuestionAnswer()
+ {
+ Answer = avgAnswer,
+ VisitTaskId = inDto.VisitTaskId,
+ QuestionId = avg.QuestionId,
+ TableQuestionId = avg.TableQuestionId,
+ TrialId = inDto.TrialId,
+ RowIndex = avg.RowIndex,
+ RowId = avg.RowId,
+
+ });
+
+ await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && x.RowId == item.RowId && x.TableQuestionId == avg.TableQuestionId);
+ }
+
+ await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers);
+ await _readingTableQuestionAnswerRepository.SaveChangesAsync();
+
+ }
diff --git a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs
index 40ec97e0c..6af51816a 100644
--- a/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs
+++ b/IRaCIS.Core.Domain.Share/Reading/ReadEnum.cs
@@ -2272,6 +2272,31 @@ public enum SUVChangeVSBaseline
///
Undetermined = 1021,
+ ///
+ /// 第一次测量
+ ///
+ FirstMeasurement = 1101,
+
+ ///
+ /// 第二次测量
+ ///
+ SecondMeasurement = 1102,
+
+ ///
+ /// 第三次测量
+ ///
+ ThirdMeasurement = 1103,
+
+ ///
+ /// 平均值
+ ///
+ AverageValue = 1104,
+
+ ///
+ /// 是否可测量
+ ///
+ IsMeasurable = 1105,
+
///
/// 肝脏分段
///
@@ -2666,6 +2691,11 @@ public enum SUVChangeVSBaseline
/// 斑块3-匹配动脉段最小FCT
///
Plaque3MinFCT = 1008,
+
+ ///
+ /// 脂肪分数总平均值
+ ///
+ TotalMeanFraction = 1101,
}
@@ -2795,8 +2825,12 @@ public enum PET5PSScore
///
/// 斑块数据统计
///
-
PatchDataStatistics = 9,
+
+ ///
+ /// 保存表格问题标记
+ ///
+ SaveTableQuestionMark = 10,
}
///
diff --git a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionMark.cs b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionMark.cs
index 56528e210..10db31925 100644
--- a/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionMark.cs
+++ b/IRaCIS.Core.Domain/Reading/ReadingFormAnswer/ReadingTaskQuestionMark.cs
@@ -44,6 +44,15 @@ public class ReadingTaskQuestionMark : BaseAddAuditEntity
public Guid? OtherStudyId { get; set; }
+ ///
+ /// 表格问题标记
+ ///
+ public Guid? RowId { get; set; }
+
+ public Guid? TableQuestionId { get; set; }
+
+ public decimal? RowIndex { get; set; }
+
[MaxLength]
public string OtherMarkTool { get; set; } = string.Empty;
diff --git a/IRaCIS.Core.Infra.EFCore/Migrations/20241223094453_tablemark.Designer.cs b/IRaCIS.Core.Infra.EFCore/Migrations/20241223094453_tablemark.Designer.cs
new file mode 100644
index 000000000..6537dadad
--- /dev/null
+++ b/IRaCIS.Core.Infra.EFCore/Migrations/20241223094453_tablemark.Designer.cs
@@ -0,0 +1,18252 @@
+//
+using System;
+using IRaCIS.Core.Infra.EFCore;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace IRaCIS.Core.Infra.EFCore.Migrations
+{
+ [DbContext(typeof(IRaCISDBContext))]
+ [Migration("20241223094453_tablemark")]
+ partial class tablemark
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.10")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.Attachment", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("编码");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DoctorId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ExpiryDate")
+ .HasColumnType("datetime2")
+ .HasComment("过期时间");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsOfficial")
+ .HasColumnType("bit")
+ .HasComment("是否正式简历");
+
+ b.Property("Language")
+ .HasColumnType("int")
+ .HasComment("1 中文 2为英文");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("文件类型名");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("DoctorId");
+
+ b.ToTable("Attachment", t =>
+ {
+ t.HasComment("医生 - 简历|证书 文档表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CRO", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CROCode")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CROName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CRONameCN")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsTrialLevel")
+ .HasColumnType("bit")
+ .HasComment("是否是项目级别");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CROCompany", t =>
+ {
+ t.HasComment("机构 - CRO");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CheckChallengeDialog", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsCRCNeedReply")
+ .HasColumnType("bit")
+ .HasComment("CRC是否需要回复 前端使用");
+
+ b.Property("ParamInfo")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasComment("核查的检查信息Json");
+
+ b.Property("SubjectVisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TalkContent")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserTypeEnum")
+ .HasColumnType("int")
+ .HasComment("核查过程中的操作用户类型");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SubjectVisitId");
+
+ b.ToTable("CheckChallengeDialog", t =>
+ {
+ t.HasComment("一致性核查 - 对话记录表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalAnswerRowInfo", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("RowIndex")
+ .HasColumnType("int");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalAnswerRowInfo", t =>
+ {
+ t.HasComment("受试者 - 临床表单表格问题行记录");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalDataSystemSet", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalDataLevel")
+ .HasColumnType("int");
+
+ b.Property("ClinicalDataSetEnName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalDataSetEnum")
+ .HasColumnType("int")
+ .HasComment("枚举(字典里面取的)");
+
+ b.Property("ClinicalDataSetName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalUploadType")
+ .HasColumnType("int")
+ .HasComment("上传方式");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionEnumListStr")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsApply")
+ .HasColumnType("bit")
+ .HasComment("是否应用");
+
+ b.Property("IsEnable")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("UploadRole")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalDataSystemSet", t =>
+ {
+ t.HasComment("系统 - 临床数据配置");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalDataTrialSet", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalDataLevel")
+ .HasColumnType("int")
+ .HasComment("临床级别");
+
+ b.Property("ClinicalDataSetEnName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalDataSetName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ClinicalUploadType")
+ .HasColumnType("int")
+ .HasComment("上传方式");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionEnumListStr")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("FileName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("IsApply")
+ .HasColumnType("bit")
+ .HasComment("是否应用");
+
+ b.Property("IsConfirm")
+ .HasColumnType("bit");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("SystemClinicalDataSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UploadRole")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SystemClinicalDataSetId");
+
+ b.HasIndex("TrialId");
+
+ b.ToTable("ClinicalDataTrialSet", t =>
+ {
+ t.HasComment("项目 - 临床数据适应标准配置");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalForm", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CheckDate")
+ .HasColumnType("datetime2")
+ .HasComment("检查日期");
+
+ b.Property("ClinicalDataTrialSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("PicturePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("截图地址");
+
+ b.Property("ReadingId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("VisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClinicalDataTrialSetId");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SubjectId");
+
+ b.ToTable("ClinicalForm", t =>
+ {
+ t.HasComment("受试者 - 临床表单");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Answer")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("ClinicalDataTrialSetId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ClinicalFormId");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("ClinicalQuestionAnswer", t =>
+ {
+ t.HasComment("受试者 - 临床表单问题答案");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalTableAnswer", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Answer")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)")
+ .HasComment("答案");
+
+ b.Property("ClinicalFormId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("表单Id");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("QuestionId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("问题Id");
+
+ b.Property("RowId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("答案行的Id");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("受试者Id");
+
+ b.Property("TableQuestionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("RowId");
+
+ b.ToTable("ClinicalTableAnswer", t =>
+ {
+ t.HasComment("受试者 - 临床表单表格问题答案");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CommonDocument", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BusinessScenarioEnum")
+ .HasColumnType("int")
+ .HasComment("业务场景");
+
+ b.Property("Code")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionTypeEnum")
+ .HasColumnType("int")
+ .HasComment("系统标准枚举");
+
+ b.Property("DeleteUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("FileTypeEnum")
+ .HasColumnType("int")
+ .HasComment("类型-上传|导出|邮件附件");
+
+ b.Property("IsDeleted")
+ .HasColumnType("bit");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("NameCN")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CommonDocument", t =>
+ {
+ t.HasComment("数据上传 | 数据导出 | 邮件附件 文件记录表 (需要同步)");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionNidusSystem", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("IsSystemCriterion")
+ .HasColumnType("bit");
+
+ b.Property("LesionType")
+ .HasColumnType("int")
+ .HasComment("病灶类型");
+
+ b.Property("OrganType")
+ .HasColumnType("int")
+ .HasComment("器官类型");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("CriterionId");
+
+ b.ToTable("CriterionNidusSystem", t =>
+ {
+ t.HasComment("系统标准 - 病灶器官表 (需要同步)");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.CriterionNidusTrial", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LesionType")
+ .HasColumnType("int");
+
+ b.Property("OrganType")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.ToTable("CriterionNidusTrial", t =>
+ {
+ t.HasComment("项目标准 - 病灶器官表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.DataInspection", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BatchId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("批次Id");
+
+ b.Property("ChildrenTypeId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("子类");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("CreateUserName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("创建人姓名");
+
+ b.Property("CreateUserRealName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("DoctorUserId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("阅片医生");
+
+ b.Property("EntityName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("被稽查实体名");
+
+ b.Property("GeneralId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("要稽查对象Id");
+
+ b.Property("IP")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Identification")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("标识");
+
+ b.Property("IsFrontAdd")
+ .HasColumnType("bit")
+ .HasComment("是否是前端添加");
+
+ b.Property("IsSign")
+ .HasColumnType("bit");
+
+ b.Property("JsonDetail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastJsonDetail")
+ .HasColumnType("nvarchar(max)")
+ .HasComment("上一条json");
+
+ b.Property("ModuleTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectRelationParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("被稽查对象外键1");
+
+ b.Property("ObjectRelationParentId2")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectRelationParentId3")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OptTypeId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ParentId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("父ID");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("RoleName")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)")
+ .HasComment("角色名称");
+
+ b.Property("SignId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectVisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialReadingCriterionId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialSiteId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("VisitStageId")
+ .HasColumnType("uniqueidentifier")
+ .HasComment("访视计划ID");
+
+ b.Property("VisitTaskId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("TrialReadingCriterionId");
+
+ b.HasIndex("VisitTaskId");
+
+ b.ToTable("DataInspection", t =>
+ {
+ t.HasComment("稽查 - 记录表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomInstance", b =>
+ {
+ b.Property("SeqId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Anonymize")
+ .HasColumnType("bit");
+
+ b.Property("CPIStatus")
+ .HasColumnType("bit");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FileSize")
+ .HasColumnType("bigint");
+
+ b.Property("FrameOfReferenceUID")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("HtmlPath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ImageColumns")
+ .HasColumnType("int");
+
+ b.Property("ImageRows")
+ .HasColumnType("int");
+
+ b.Property("ImagerPixelSpacing")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("InstanceNumber")
+ .HasColumnType("int");
+
+ b.Property("InstanceTime")
+ .HasColumnType("datetime2");
+
+ b.Property("NumberOfFrames")
+ .HasColumnType("int");
+
+ b.Property("Path")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("PixelSpacing")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SeriesId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SeriesInstanceUid")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SliceLocation")
+ .HasColumnType("int");
+
+ b.Property("SliceThickness")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SopInstanceUid")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("StudyId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("StudyInstanceUid")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("SubjectId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("SubjectVisitId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("TrialId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UpdateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("UpdateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("WindowCenter")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("WindowWidth")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.HasKey("SeqId");
+
+ b.HasIndex("CreateUserId");
+
+ b.HasIndex("SeriesId");
+
+ b.HasIndex("StudyId");
+
+ b.ToTable("DicomInstance", t =>
+ {
+ t.HasComment("归档 - Instance表");
+ });
+ });
+
+ modelBuilder.Entity("IRaCIS.Core.Domain.Models.DicomSeries", b =>
+ {
+ b.Property("SeqId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AcquisitionNumber")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("AcquisitionTime")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("BodyPartExamined")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("BodyPartForEdit")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreateUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeleteUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("DeletedTime")
+ .HasColumnType("datetime2");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("Id")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ImageOrientationPatient")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ImagePositionPatient")
+ .IsRequired()
+ .HasMaxLength(400)
+ .HasColumnType("nvarchar(400)");
+
+ b.Property("ImageResizePath")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property