diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index db671c87b..6cb54063d 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -1102,105 +1102,6 @@
-
-
- 删除病灶获取起始病灶序号
-
-
-
-
-
- 获取阅片报告
-
-
-
-
-
-
- 将上一次的病灶信息添加到这一次
-
-
-
-
-
-
- 测试计算
-
-
-
-
-
-
-
- 计算任务
-
-
-
-
-
-
- 自动计算
-
-
-
-
-
-
-
- 基线病灶计数
-
-
-
-
-
-
- 获取新病灶计数
-
-
-
-
-
-
- 既往新病灶计数
-
-
-
-
-
-
- 自治疗后第二个访视点以来持续的新骨病变数量
-
-
-
-
-
-
- 获取
-
-
-
-
-
-
- 访视点肿瘤评估
-
-
-
-
-
-
- 修改上一次访视结果
-
-
-
-
-
-
- 获取访视日期信息
-
-
-
-
标准和服务对应
@@ -1498,6 +1399,349 @@
+
+
+ 删除病灶获取起始病灶序号
+
+
+
+
+
+ 获取阅片报告
+
+
+
+
+
+
+ 将上一次的病灶信息添加到这一次
+
+
+
+
+
+
+ 测试计算
+
+
+
+
+
+
+
+ 计算任务
+
+
+
+
+
+
+ 自动计算
+
+
+
+
+
+
+
+ 基线病灶计数
+
+
+
+
+
+
+ 获取新病灶计数
+
+
+
+
+
+
+ 既往新病灶计数
+
+
+
+
+
+
+ 自治疗后第二个访视点以来持续的新骨病变数量
+
+
+
+
+
+
+ 获取
+
+
+
+
+
+
+ 访视点肿瘤评估
+
+
+
+
+
+
+ 修改上一次访视结果
+
+
+
+
+
+
+ 获取访视日期信息
+
+
+
+
+
+
+ 获取Sod的值
+
+
+
+
+ 删除病灶获取起始病灶序号(RECIST1Point1 固定是1)
+
+
+
+
+
+ 获取阅片报告
+
+
+
+
+
+
+ 测试计算
+
+
+
+
+
+
+
+ 计算任务
+
+
+
+
+
+
+ 获取报告验证的信息(这里每个标准可能不一样 返回用object)
+
+
+
+
+
+
+ 自动计算
+
+
+
+
+
+
+
+ 获取报告整体整体评估
+
+
+
+
+
+
+ 获取报告是否存在疾病
+
+
+
+
+
+
+ 验证访视提交
+
+
+
+
+
+
+ 将上一次的访视病灶添加到这一次
+
+
+
+
+
+
+ 获取SOD
+
+
+ 靶病灶径线之和(SOD)
+ 非淋巴结的长径 和淋巴结的短径
+
+
+
+
+
+ 非淋巴结靶病灶长径之和
+
+
+
+
+
+
+ 与基线SOD相比变化量(mm)
+
+
+
+
+
+
+ 与基线访视相比SOD变化百分比
+
+
+
+
+
+
+ 与整个访视期间SOD最低点相比增加的值(mm)
+
+
+
+ 要更新之前的
+
+
+
+
+
+ 与整个访视期间SOD最低点相比增加的百分比
+
+
+
+ 要更新之前的
+
+
+
+
+
+ 整个访视期间SOD最低点访视名称
+
+
+
+ 要更新之前的
+
+
+
+
+
+ 是否存在非淋巴结靶病灶
+
+
+
+
+
+
+ 是否存在淋巴结靶病灶且该病灶比上一访视短径增加5MM以上
+
+
+
+
+
+
+ 获取存在淋巴结靶病灶且该病灶比上一访视短径增加5MM以上的病灶
+
+
+
+
+
+
+ 被评估为NE的单个靶病灶
+
+
+
+
+
+
+ 整体肿瘤评估
+
+
+
+
+
+
+ 是否存在疾病
+
+
+
+
+
+
+ 修改与整个访视期间SOD最低点相比增加的值(mm)
+
+
+
+
+
+
+ 修改最低方式点名称
+
+
+
+
+
+
+ 修改所有访视任务的答案
+
+
+
+
+
+
+
+
+ 获取基线SOD
+
+
+
+
+
+
+ 获取最低方式
+
+
+
+
+
+
+ 获取访视任务信息
+
+
+
+
+
+
+ 获取上一个访视任务Id
+
+
+
+
+
+
+ 获取非靶病灶评估
+
+
+
+
+
+
+ 获取新病灶评估
+
+
+
+
获取Sod的值
diff --git a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs
index 395493195..1c72b5ed9 100644
--- a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs
+++ b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs
@@ -82,7 +82,10 @@ namespace IRaCIS.Application.Contracts
{
public Guid? ReadingCriterionId { get; set; }
- public string DictionaryCode { get; set; }
+ public string DictionaryCode { get; set; } = string.Empty;
+
+
+ public List DictionaryCodeList { get; set; } = new List();
}
public class GetBasicDataAllSelectInDto
diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs
index 11e02a510..0ebb9b0d9 100644
--- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs
+++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs
@@ -195,6 +195,11 @@ namespace IRaCIS.Application.Services
return ResponseOutput.NotOk("当前条目已经在项目信息中被引用。");
}
+ if (await _readingCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id))
+ {
+ return ResponseOutput.NotOk("当前条目已经在阅片标准中被引用。");
+ }
+
var success = await _dicRepository.BatchDeleteNoTrackingAsync(t => t.Id == id);
return ResponseOutput.Result(success);
}
@@ -311,6 +316,7 @@ namespace IRaCIS.Application.Services
{
var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable)
.WhereIf(!inDto.DictionaryCode.IsNullOrEmpty(), x =>x.Parent.Code==inDto.DictionaryCode)
+ .WhereIf(inDto.DictionaryCodeList.Count()>0, x => inDto.DictionaryCodeList.Contains(x.Parent.Code))
.ProjectTo(_mapper.ConfigurationProvider).ToListAsync();
var result = searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList());
diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs
index 2b13297b3..beb3863ed 100644
--- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs
+++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs
@@ -1274,7 +1274,7 @@ namespace IRaCIS.Core.Application.Service
case CriterionType.PERCIST:
case CriterionType.Forrest:
case CriterionType.Lugano2014:
- case CriterionType.iRECIST:
+ case CriterionType.IRECIST1Point1:
case CriterionType.RANO_BM:
case CriterionType.RANO:
case CriterionType.IWCLL2018:
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs
index e77c2d59f..b729029dd 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs
@@ -82,11 +82,11 @@ namespace IRaCIS.Core.Application.Service.RC
public async Task AddSystemCriterionDictionaryCode(AddSystemCriterionDictionaryCodeInDto inDto)
{
- var codes= await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).Select(x => x.Code).ToListAsync();
+ //var codes= await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).Select(x => x.Code).ToListAsync();
- inDto.CodeList= inDto.CodeList.Except(codes).ToList();
+ //inDto.CodeList= inDto.CodeList.Except(codes).ToList();
-
+ await _systemCriterionDictionaryCodeRepository.BatchDeleteNoTrackingAsync(x => x.SystemCriterionId == inDto.SystemCriterionId);
await _systemCriterionDictionaryCodeRepository.AddRangeAsync(inDto.CodeList.Select(x=> new SystemCriterionDictionaryCode()
{
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/TumorAssessmentService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/TumorAssessmentService.cs
index ddbf1e8fa..9aac2d762 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/TumorAssessmentService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/TumorAssessmentService.cs
@@ -16,13 +16,16 @@ namespace IRaCIS.Core.Application.Service.TA
public class ReadingQuestionService : BaseService
{
private readonly IRepository _tumorAssessmentRepository1Point1;
+ private readonly IRepository _tumorAssessmentIRepository1Point1;
private readonly IRepository _tumorAssessmentRepository1Point1BM;
public ReadingQuestionService( IRepository tumorAssessmentRepository1Point1,
+ IRepository tumorAssessmentIRepository1Point1,
IRepository tumorAssessmentRepository1Point1BM
)
{
this._tumorAssessmentRepository1Point1 = tumorAssessmentRepository1Point1;
+ this._tumorAssessmentIRepository1Point1 = tumorAssessmentIRepository1Point1;
this._tumorAssessmentRepository1Point1BM = tumorAssessmentRepository1Point1BM;
}
@@ -75,6 +78,16 @@ namespace IRaCIS.Core.Application.Service.TA
new ColumnInfo(){ ColumnName="整体疗效",ColumnKey=nameof(TumorAssessment_RECIST1Point1.OverallEfficacy),DictionaryKey=typeof(OverallAssessment).Name },
};
break;
+ case CriterionType.IRECIST1Point1:
+ result = await _tumorAssessmentIRepository1Point1.AsQueryable().ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? nameof(TumorAssessmentView.Id) : inQuery.SortField, inQuery.Asc);
+ columnList = new List()
+ {
+ new ColumnInfo(){ ColumnName="靶病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.TargetLesion),DictionaryKey=typeof(TargetAssessment).Name },
+ new ColumnInfo(){ ColumnName="非靶病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.NonTargetLesions),DictionaryKey=typeof(NoTargetAssessment).Name },
+ new ColumnInfo(){ ColumnName="新病灶",ColumnKey=nameof(TumorAssessment_RECIST1Point1.NewLesion),DictionaryKey=typeof(NewLesionAssessment).Name },
+ new ColumnInfo(){ ColumnName="整体疗效",ColumnKey=nameof(TumorAssessment_RECIST1Point1.OverallEfficacy),DictionaryKey=typeof(OverallAssessment).Name },
+ };
+ break;
}
return (result, columnList);
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
index f4792ca6b..7e8824cb8 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs
@@ -1426,7 +1426,7 @@ namespace IRaCIS.Application.Services
await VerifyTaskIsSign(inDto.VisitTaskId);
- if (inDto.InstanceId != null)
+ if (inDto.InstanceId != null&&inDto.IsDicomReading)
{
if (!(await _dicomInstanceRepository.AnyAsync(x => x.Id == inDto.InstanceId && x.SeriesId == inDto.SeriesId)))
{
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
similarity index 100%
rename from IRaCIS.Core.Application/Service/ReadingCalculate/GeneralCalculateService.cs
rename to IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/ReadingCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs
similarity index 98%
rename from IRaCIS.Core.Application/Service/ReadingCalculate/ReadingCalculateService.cs
rename to IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs
index aef0adb7e..3085837da 100644
--- a/IRaCIS.Core.Application/Service/ReadingCalculate/ReadingCalculateService.cs
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs
@@ -19,7 +19,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
{CriterionType.RECIST1Point1,typeof(RECIST1Point1CalculateService) }, //RECIST1.1
{CriterionType.PCWG3,typeof(PCWG3CalculateService) },
{CriterionType.SelfDefine,typeof(SelfDefineCalculateService) },
- {CriterionType.RECIST1Pointt1_MB,typeof(RECIST1Point1_BMCalculateService) }
+ {CriterionType.RECIST1Pointt1_MB,typeof(RECIST1Point1_BMCalculateService) },
+ {CriterionType.IRECIST1Point1,typeof(IRECIST1Point1CalculateService) }
};
diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs
new file mode 100644
index 000000000..440d36e51
--- /dev/null
+++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs
@@ -0,0 +1,1813 @@
+using IRaCIS.Core.Application.Service.Reading.Dto;
+using IRaCIS.Core.Domain.Share;
+using Microsoft.AspNetCore.Mvc;
+using IRaCIS.Core.Domain.Models;
+using Microsoft.AspNetCore.Mvc;
+using IRaCIS.Core.Application.Interfaces;
+using IRaCIS.Core.Application.ViewModel;
+using Panda.DynamicWebApi.Attributes;
+using IRaCIS.Core.Infra.EFCore.Common;
+using Microsoft.Extensions.Caching.Memory;
+
+using IRaCIS.Core.Infrastructure;
+using MassTransit;
+
+namespace IRaCIS.Core.Application.Service.ReadingCalculate
+{
+
+ [ApiExplorerSettings(GroupName = "Reading")]
+ public class RECIST1Point1CalculateService : BaseService, ICriterionCalculateService
+ {
+ private readonly IRepository _readingTableQuestionAnswerRepository;
+ private readonly IRepository _visitTaskRepository;
+ private readonly IRepository _readingQuestionCriterionTrialRepository;
+ private readonly IRepository _readingTableQuestionTrialRepository;
+ private readonly IRepository _readingTableAnswerRowInfoRepository;
+ private readonly IRepository _readingQuestionTrialRepository;
+ private readonly IRepository _organInfoRepository;
+ private readonly IRepository _subjectVisitRepository;
+ private readonly IRepository _tumorAssessmentRepository;
+ private readonly IGeneralCalculateService _generalCalculateService;
+ private readonly IRepository _readingTaskQuestionAnswerRepository;
+
+ public RECIST1Point1CalculateService(
+ IRepository readingTableQuestionAnswerRepository,
+ IRepository visitTaskRepository,
+ IRepository readingQuestionCriterionTrialRepository,
+ IRepository readingTableQuestionTrialRepository,
+ IRepository readingTableAnswerRowInfoRepository,
+ IRepository readingQuestionTrialRepository,
+ IRepository organInfoRepository,
+ IRepository subjectVisitRepository,
+ IRepository tumorAssessmentRepository,
+ IGeneralCalculateService generalCalculateService,
+ IRepository readingTaskQuestionAnswerRepository
+ )
+ {
+ this._readingTableQuestionAnswerRepository = readingTableQuestionAnswerRepository;
+ this._visitTaskRepository = visitTaskRepository;
+ this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
+ this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
+ this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
+ this._readingQuestionTrialRepository = readingQuestionTrialRepository;
+ this._organInfoRepository = organInfoRepository;
+ this._subjectVisitRepository = subjectVisitRepository;
+ this._tumorAssessmentRepository = tumorAssessmentRepository;
+ this._generalCalculateService = generalCalculateService;
+ this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
+ }
+
+ #region 临时对象 单个请求的生命周期 避免重复查询数据库
+
+ private List visitTaskAnswerList;
+
+ ///
+ /// 获取Sod的值
+ ///
+ private decimal? sODData;
+
+ private string nAString = "NA";
+ #endregion
+
+ #region 删除病灶获取起始病灶序号
+ ///
+ /// 删除病灶获取起始病灶序号(RECIST1Point1 固定是1)
+ ///
+ ///
+ public async Task GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto)
+ {
+ return 1;
+ }
+ #endregion
+
+ #region 获取阅片报告
+ ///
+ /// 获取阅片报告
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task GetReadingReportEvaluation(GetReadingReportEvaluationInDto indto)
+ {
+ GetReadingReportEvaluationOutDto result = new GetReadingReportEvaluationOutDto();
+
+ result.CalculateResult = await this.GetReportVerify(new GetReportVerifyInDto()
+ {
+ VisitTaskId = indto.VisitTaskId
+ });
+
+
+ var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).FirstNotNullAsync();
+
+ result.ReadingTaskState = visitTaskInfo.ReadingTaskState;
+ var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(indto.VisitTaskId);
+
+ result.VisitTaskList = taskInfoList;
+
+ var visitTaskIds = taskInfoList.Select(x => x.VisitTaskId).ToList();
+
+ var criterionId = visitTaskInfo.TrialReadingCriterionId;
+ var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId).ToListAsync();
+ var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync();
+ var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync();
+
+ var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
+ var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
+
+ var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync();
+ var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
+ var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
+
+ var needChangeType = new List() {
+ QuestionMark.Organ,
+ QuestionMark.Location,
+ QuestionMark.Part,
+ };
+
+ // 第一级
+
+ #region 构造问题
+ List questions = questionList.Where(x => x.Type == ReadingQestionType.Group).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
+ {
+ QuestionId = x.Id,
+ GroupName = x.GroupName,
+ GroupEnName=x.GroupEnName,
+ IsShowInDicom = x.IsShowInDicom,
+ Type = x.Type,
+ GroupId=x.GroupId,
+ QuestionType = x.QuestionType,
+ LesionType = x.LesionType,
+ QuestionGenre = x.QuestionGenre,
+ DataSource = x.DataSource,
+ DictionaryCode = x.DictionaryCode,
+ TypeValue = x.TypeValue,
+ QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
+ ShowOrder = x.ShowOrder,
+ ValueType = x.ValueType,
+ Unit = x.Unit,
+ CustomUnit=x.CustomUnit,
+ ReportLayType= ReportLayType.Group,
+ }).ToList();
+
+ // 分组
+ foreach (var item in questions)
+ {
+ item.Childrens = questionList.Where(x => x.GroupId==item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
+ {
+ GroupName = x.GroupName,
+ QuestionId = x.Id,
+ IsShowInDicom = x.IsShowInDicom,
+ GroupEnName=x.GroupEnName,
+ QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
+ LesionType = x.LesionType,
+ QuestionGenre = x.QuestionGenre,
+ DataSource = x.DataSource,
+ DictionaryCode = x.DictionaryCode,
+ Type = x.Type,
+ QuestionType = x.QuestionType,
+ TypeValue = x.TypeValue,
+ ShowOrder = x.ShowOrder,
+ OrderMark = x.OrderMark,
+ ValueType = x.ValueType,
+ Unit = x.Unit,
+ CustomUnit=x.CustomUnit,
+ ReportLayType = ReportLayType.Question,
+ }).ToList();
+
+ // 问题
+ foreach (var question in item.Childrens)
+ {
+
+ foreach (var task in taskInfoList)
+ {
+
+ var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault();
+ question.Answer.Add(new TaskQuestionAnswer()
+ {
+ Answer = answer==null?string.Empty:answer.Answer,
+ IsGlobalChange = answer == null ? false : answer.IsGlobalChange,
+ GlobalChangeAnswer = answer == null ? string.Empty : answer.GlobalChangeAnswer,
+ TaskName = task.TaskName,
+ VisitTaskId = task.VisitTaskId,
+
+ });
+ }
+
+ // 构造表格行数据
+
+
+ var rowlist = tableAnsweRowInfos.Where(x => x.QuestionId == question.QuestionId).OrderBy(x => x.RowIndex).ToList();
+
+
+ question.Childrens = rowlist.Select(x => new ReadingReportDto()
+ {
+ QuestionName = question.OrderMark + x.RowIndex.GetLesionMark(),
+ SplitOrMergeLesionName = x.MergeName.IsNullOrEmpty() ? x.SplitName : x.MergeName,
+ SplitOrMergeType = x.SplitOrMergeType,
+ LesionType = question.LesionType,
+ IsShowInDicom = question.IsShowInDicom,
+ IsCanEditPosition = x.IsCanEditPosition,
+ RowIndex = x.RowIndex,
+ BlindName = x.BlindName,
+ ReportLayType = ReportLayType.Lesions,
+ }).ToList();
+
+
+ foreach (var row in question.Childrens)
+ {
+ // tableQuestion
+ row.Childrens = tableQuestionList.Where(x => x.ReadingQuestionId == question.QuestionId).Select(x => new ReadingReportDto()
+ {
+ QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
+ QuestionId = x.ReadingQuestionId,
+ TableQuestionId = x.Id,
+ Type = x.Type,
+ LesionType = question.LesionType,
+ TableQuestionType = x.TableQuestionType,
+ RowId=row.RowId,
+ IsShowInDicom = question.IsShowInDicom,
+ DataSource = x.DataSource,
+ DictionaryCode = x.DictionaryCode,
+ QuestionMark = x.QuestionMark,
+ TypeValue = x.TypeValue,
+ RowIndex = row.RowIndex,
+ ShowOrder = x.ShowOrder,
+ ValueType = x.ValueType,
+ Unit = x.Unit,
+ ReportLayType = ReportLayType.TableQuestion,
+ }).ToList();
+
+
+ foreach (var tableQuestion in row.Childrens)
+ {
+ foreach (var task in taskInfoList)
+ {
+ var rowinfo = alltableAnsweRowInfos.Where(x => x.VisitTaskId == task.VisitTaskId && x.QuestionId == tableQuestion.QuestionId && x.RowIndex == tableQuestion.RowIndex).FirstOrDefault();
+ var taskQuestionAnswer = new TaskQuestionAnswer()
+ {
+ Answer = tableAnswers.Where(x => x.VisitTaskId == task.VisitTaskId && x.QuestionId == tableQuestion.QuestionId && x.RowIndex == tableQuestion.RowIndex && x.TableQuestionId == tableQuestion.TableQuestionId).Select(x => x.Answer).FirstIsNullReturnEmpty(),
+ TaskName = task.TaskName,
+ VisitTaskId = task.VisitTaskId,
+ };
+ if (rowinfo != null && rowinfo.OrganInfoId != null)
+ {
+ var organInfo = organInfos.Where(x => x.Id == rowinfo.OrganInfoId).FirstOrDefault();
+
+
+ if (organInfo != null && needChangeType.Contains(tableQuestion.QuestionMark))
+ {
+ if (_userInfo.IsEn_Us)
+ {
+ switch (tableQuestion.QuestionMark)
+ {
+ case QuestionMark.Organ:
+ taskQuestionAnswer.Answer= organInfo.TULOCEN;
+
+ break;
+ case QuestionMark.Location:
+ if (organInfo.IsCanEditPosition)
+ {
+
+ }
+ else
+ {
+ taskQuestionAnswer.Answer = organInfo.TULATEN;
+
+ }
+ break;
+ case QuestionMark.Part:
+
+ taskQuestionAnswer.Answer = organInfo.PartEN;
+
+ break;
+
+ }
+
+ }
+ else
+ {
+ switch (tableQuestion.QuestionMark)
+ {
+ case QuestionMark.Organ:
+ taskQuestionAnswer.Answer = organInfo.TULOC;
+ break;
+ case QuestionMark.Location:
+ if (organInfo.IsCanEditPosition)
+ {
+
+ }
+ else
+ {
+ taskQuestionAnswer.Answer = organInfo.TULAT;
+
+ }
+ break;
+ case QuestionMark.Part:
+ taskQuestionAnswer.Answer = organInfo.Part;
+ break;
+
+ }
+ }
+
+ }
+ }
+ tableQuestion.Answer.Add(taskQuestionAnswer);
+ }
+ }
+
+
+ }
+
+
+ };
+ }
+ #endregion
+
+
+
+ result.TaskQuestions = questions;
+
+
+
+ return result;
+
+ }
+ #endregion
+
+ ///
+ /// 测试计算
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task TestCalculate(Guid visitTaskId, QuestionType type)
+ {
+ ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(visitTaskId);
+ await ReadingCalculate(readingData,new List() { type});
+ }
+
+
+
+ ///
+ /// 计算任务
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task CalculateTask(CalculateTaskInDto inDto)
+ {
+ ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
+ readingData.IsChangeOtherTask = inDto.IsChangeOtherTask;
+ await ReadingCalculate(readingData);
+ }
+
+ ///
+ /// 获取报告验证的信息(这里每个标准可能不一样 返回用object)
+ ///
+ ///
+ ///
+ public async Task