Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
d165632cc8
|
@ -4195,6 +4195,56 @@
|
||||||
<param name="digitPlaces"></param>
|
<param name="digitPlaces"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFCalculateService.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.MRIPDFFCalculateService.GetDeleteLesionStatrIndex(IRaCIS.Core.Application.Service.Reading.Dto.DeleteReadingRowAnswerInDto)">
|
||||||
|
<summary>
|
||||||
|
删除病灶获取起始病灶序号
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFCalculateService.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.MRIPDFFCalculateService.AddTaskLesionAnswerFromLastTask(IRaCIS.Core.Application.ViewModel.AddTaskLesionAnswerFromLastTaskInDto)">
|
||||||
|
<summary>
|
||||||
|
将上一次的访视病灶添加到这一次
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.MRIPDFFCalculateService.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.MRIPDFFCalculateService.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.MRIPDFFCalculateService.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.OCTCalculateService.GetReadingCalculationData(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingCalculationDataInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.OCTCalculateService.GetReadingCalculationData(IRaCIS.Core.Application.Service.Reading.Dto.GetReadingCalculationDataInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
获取阅片的计算数据
|
获取阅片的计算数据
|
||||||
|
|
|
@ -637,6 +637,8 @@ namespace IRaCIS.Application.Contracts
|
||||||
public class EmploymentInfo
|
public class EmploymentInfo
|
||||||
{
|
{
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public string HospitalName { get; set; } = string.Empty;
|
||||||
//部门
|
//部门
|
||||||
public Guid? DepartmentId { get; set; }
|
public Guid? DepartmentId { get; set; }
|
||||||
public string DepartmentOther { get; set; } = string.Empty;
|
public string DepartmentOther { get; set; } = string.Empty;
|
||||||
|
|
|
@ -17,6 +17,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IRepository<DoctorDictionary> _doctorDictionaryRepository,
|
IRepository<DoctorDictionary> _doctorDictionaryRepository,
|
||||||
IRepository<DoctorSummarize> _doctorSummarizeRepository,
|
IRepository<DoctorSummarize> _doctorSummarizeRepository,
|
||||||
IRepository<Enroll> _enrollRepository,
|
IRepository<Enroll> _enrollRepository,
|
||||||
|
IRepository<Hospital> _hospitalRepository,
|
||||||
IRepository<Dictionary> _dictionaryRepository,
|
IRepository<Dictionary> _dictionaryRepository,
|
||||||
IRepository<Attachment> _attachmentRepository,
|
IRepository<Attachment> _attachmentRepository,
|
||||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||||
|
@ -581,7 +582,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
|
||||||
public async Task<IResponseOutput> UpdateEmploymentInfo(EmploymentCommand doctorWorkInfoModel)
|
public async Task<IResponseOutput> UpdateEmploymentInfo(EmploymentCommand inDto)
|
||||||
{
|
{
|
||||||
#region 废弃
|
#region 废弃
|
||||||
//var success = _doctorRepository.Update(d => d.Id == doctorWorkInfoModel.Id, u => new Doctor()
|
//var success = _doctorRepository.Update(d => d.Id == doctorWorkInfoModel.Id, u => new Doctor()
|
||||||
|
@ -611,8 +612,25 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//var success = _doctorRepository.SaveChanges();
|
//var success = _doctorRepository.SaveChanges();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
if (inDto.HospitalName != string.Empty)
|
||||||
|
{
|
||||||
|
var hospital = await _hospitalRepository.Where(x => x.HospitalName == inDto.HospitalName && x.SiteId == null).FirstOrDefaultAsync();
|
||||||
|
if (hospital != null)
|
||||||
|
{
|
||||||
|
inDto.HospitalId = hospital.Id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var newHospital = await _hospitalRepository.AddAsync(new Hospital()
|
||||||
|
{
|
||||||
|
HospitalName = inDto.HospitalName,
|
||||||
|
IsConfirm=false,
|
||||||
|
}, true);
|
||||||
|
inDto.HospitalId = newHospital.Id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var entity = await _doctorRepository.InsertOrUpdateAsync(doctorWorkInfoModel, true);
|
var entity = await _doctorRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
|
|
|
@ -32,6 +32,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{CriterionType.Lugano2014,typeof(LuganoCalculateService) },
|
{CriterionType.Lugano2014,typeof(LuganoCalculateService) },
|
||||||
{CriterionType.IVUS,typeof(IVUSCalculateService) },
|
{CriterionType.IVUS,typeof(IVUSCalculateService) },
|
||||||
{CriterionType.OCT,typeof(OCTCalculateService) },
|
{CriterionType.OCT,typeof(OCTCalculateService) },
|
||||||
|
{CriterionType.MRIPDFF,typeof(MRIPDFFCalculateService) },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,494 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
{
|
||||||
|
[ApiExplorerSettings(GroupName = "Reading")]
|
||||||
|
public class MRIPDFFCalculateService(IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository,
|
||||||
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
|
IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository,
|
||||||
|
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
|
||||||
|
IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository,
|
||||||
|
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
|
||||||
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
|
IRepository<OrganInfo> _organInfoRepository,
|
||||||
|
IRepository<Dictionary> _dictionaryRepository,
|
||||||
|
IRepository<DicomStudy> _dicomStudyRepository,
|
||||||
|
IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
||||||
|
IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository,
|
||||||
|
IGeneralCalculateService _generalCalculateService,
|
||||||
|
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ICriterionCalculateService
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
private List<SiteVisitForTumor> siteVisitForTumorList = new List<SiteVisitForTumor>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取阅片的计算数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<object> GetReadingCalculationData(GetReadingCalculationDataInDto inDto)
|
||||||
|
{
|
||||||
|
return new
|
||||||
|
{
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 删除病灶获取起始病灶序号
|
||||||
|
/// <summary>
|
||||||
|
/// 删除病灶获取起始病灶序号
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<int> GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 获取阅片报告
|
||||||
|
/// <summary>
|
||||||
|
/// 获取阅片报告
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="indto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<GetReadingReportEvaluationOutDto> 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 && x.ShowQuestion != ShowQuestion.Hide).ToListAsync();
|
||||||
|
var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
var lesionsIndexs = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).GroupBy(x => new { x.QuestionId }).Select(x => new lesionsIndexDto()
|
||||||
|
{
|
||||||
|
QuestionId = x.Key.QuestionId,
|
||||||
|
Rowindexs = x.Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList()
|
||||||
|
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo<TableAnsweRowInfo>(_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 globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new
|
||||||
|
{
|
||||||
|
x.TaskId,
|
||||||
|
x.GlobalVisitTask.VisitTaskNum,
|
||||||
|
x.QuestionId,
|
||||||
|
x.Answer
|
||||||
|
}).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?>() {
|
||||||
|
QuestionMark.Organ,
|
||||||
|
QuestionMark.Location,
|
||||||
|
QuestionMark.Part,
|
||||||
|
};
|
||||||
|
|
||||||
|
// 第一级
|
||||||
|
|
||||||
|
#region 构造问题
|
||||||
|
List<ReadingReportDto> questions = questionList.Where(x => x.Type == ReadingQestionType.Group).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto()
|
||||||
|
{
|
||||||
|
QuestionId = x.Id,
|
||||||
|
GroupName = x.GroupName.LanguageName(x.GroupEnName, _userInfo.IsEn_Us),
|
||||||
|
IsShowInDicom = x.IsShowInDicom,
|
||||||
|
Type = x.Type,
|
||||||
|
GroupId = x.GroupId,
|
||||||
|
GroupEnName = x.GroupEnName,
|
||||||
|
QuestionType = x.QuestionType,
|
||||||
|
DataSource = x.DataSource,
|
||||||
|
LesionType = x.LesionType,
|
||||||
|
QuestionGenre = x.QuestionGenre,
|
||||||
|
DictionaryCode = x.DictionaryCode,
|
||||||
|
LimitEdit = x.LimitEdit,
|
||||||
|
MaxAnswerLength = x.MaxAnswerLength,
|
||||||
|
FileType = x.FileType,
|
||||||
|
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,
|
||||||
|
HighlightAnswer = x.HighlightAnswer,
|
||||||
|
HighlightAnswerList = x.HighlightAnswerList,
|
||||||
|
}).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.LanguageName(x.GroupEnName, _userInfo.IsEn_Us),
|
||||||
|
QuestionId = x.Id,
|
||||||
|
IsShowInDicom = x.IsShowInDicom,
|
||||||
|
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us),
|
||||||
|
LesionType = x.LesionType,
|
||||||
|
DataSource = x.DataSource,
|
||||||
|
QuestionGenre = x.QuestionGenre,
|
||||||
|
GroupEnName = x.GroupEnName,
|
||||||
|
LimitEdit = x.LimitEdit,
|
||||||
|
MaxAnswerLength = x.MaxAnswerLength,
|
||||||
|
FileType = x.FileType,
|
||||||
|
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,
|
||||||
|
HighlightAnswer = x.HighlightAnswer,
|
||||||
|
HighlightAnswerList = x.HighlightAnswerList,
|
||||||
|
}).ToList();
|
||||||
|
|
||||||
|
// 问题
|
||||||
|
foreach (var question in item.Childrens)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach (var task in taskInfoList)
|
||||||
|
{
|
||||||
|
var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault();
|
||||||
|
|
||||||
|
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 = globalAnswer == null ? false : true,
|
||||||
|
GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer,
|
||||||
|
TaskName = task.TaskName,
|
||||||
|
VisitTaskId = task.VisitTaskId,
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构造表格行数据
|
||||||
|
|
||||||
|
|
||||||
|
var rowlist = tableAnsweRowInfos.Where(x => x.QuestionId == question.QuestionId).OrderBy(x => x.RowIndex).ToList();
|
||||||
|
|
||||||
|
question.Childrens = new List<ReadingReportDto>();
|
||||||
|
|
||||||
|
var rowoindexs = lesionsIndexs.Where(x => x.QuestionId == question.QuestionId).Select(x => x.Rowindexs.OrderBy(y => y).ToList()).FirstOrDefault();
|
||||||
|
rowoindexs = rowoindexs == null ? new List<decimal>() : rowoindexs;
|
||||||
|
foreach (var rowoindex in rowoindexs)
|
||||||
|
{
|
||||||
|
var rowinfo = rowlist.Where(x => x.RowIndex == rowoindex).FirstOrDefault();
|
||||||
|
question.Childrens.Add(new ReadingReportDto()
|
||||||
|
{
|
||||||
|
QuestionName = question.OrderMark + rowoindex.GetLesionMark(),
|
||||||
|
RowId = rowinfo?.Id,
|
||||||
|
IsShowInDicom = question.IsShowInDicom,
|
||||||
|
SplitOrMergeLesionName = rowinfo != null ? (rowinfo.MergeName.IsNullOrEmpty() ? rowinfo.SplitName : rowinfo.MergeName) : string.Empty,
|
||||||
|
SplitOrMergeType = rowinfo != null ? (rowinfo.SplitOrMergeType) : null,
|
||||||
|
LesionType = question.LesionType,
|
||||||
|
IsCanEditPosition = rowinfo != null ? (rowinfo.IsCanEditPosition) : false,
|
||||||
|
RowIndex = rowoindex,
|
||||||
|
BlindName = rowinfo != null ? rowinfo.BlindName : string.Empty,
|
||||||
|
ReportLayType = ReportLayType.Lesions,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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,
|
||||||
|
IsShowInDicom = question.IsShowInDicom,
|
||||||
|
DataSource = x.DataSource,
|
||||||
|
LimitEdit = x.LimitEdit,
|
||||||
|
MaxAnswerLength = x.MaxAnswerLength,
|
||||||
|
FileType = x.FileType,
|
||||||
|
LesionType = question.LesionType,
|
||||||
|
TableQuestionType = x.TableQuestionType,
|
||||||
|
DictionaryCode = x.DictionaryCode,
|
||||||
|
QuestionMark = x.QuestionMark,
|
||||||
|
TypeValue = x.TypeValue,
|
||||||
|
RowIndex = row.RowIndex,
|
||||||
|
RowId = row.RowId,
|
||||||
|
ShowOrder = x.ShowOrder,
|
||||||
|
ValueType = x.ValueType,
|
||||||
|
CustomUnit = x.CustomUnit,
|
||||||
|
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
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 将上一次的访视病灶添加到这一次
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<AddTaskLesionAnswerFromLastTaskOutDto> AddTaskLesionAnswerFromLastTask(AddTaskLesionAnswerFromLastTaskInDto inDto)
|
||||||
|
{
|
||||||
|
var visitTaskId = inDto.VisitTaskId;
|
||||||
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync();
|
||||||
|
var isReadingTaskViewInOrder = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).Select(x => x.IsReadingTaskViewInOrder).FirstOrDefaultAsync();
|
||||||
|
var baseLineVisitId = await _subjectVisitRepository.Where(x => x.SubjectId == taskinfo.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var dictionList = await _dictionaryRepository.Where(x => x.Parent.Code == "LiverSegmentation").OrderBy(x => x.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
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();
|
||||||
|
|
||||||
|
|
||||||
|
List<ReadingTableAnswerRowInfo> rowlist = new List<ReadingTableAnswerRowInfo>();
|
||||||
|
List<ReadingTableQuestionAnswer> tableAnswerList = new List<ReadingTableQuestionAnswer>();
|
||||||
|
|
||||||
|
decimal num = 1;
|
||||||
|
foreach (var item in dictionList)
|
||||||
|
{
|
||||||
|
var guid = NewId.NextGuid();
|
||||||
|
rowlist.Add(new ReadingTableAnswerRowInfo()
|
||||||
|
{
|
||||||
|
FristAddTaskId= visitTaskId,
|
||||||
|
FristAddTaskNum= taskinfo.VisitTaskNum,
|
||||||
|
IsCurrentTaskAdd=true,
|
||||||
|
BlindName= taskinfo.TaskBlindName,
|
||||||
|
OrderMark= tableQuestion.OrderMark+ num.GetLesionMark(),
|
||||||
|
VisitTaskId= visitTaskId,
|
||||||
|
TrialId= taskinfo.TrialId,
|
||||||
|
QuestionId= tableQuestion.Id,
|
||||||
|
RowIndex= num,
|
||||||
|
Id= guid,
|
||||||
|
});
|
||||||
|
|
||||||
|
tableAnswerList.Add(new ReadingTableQuestionAnswer()
|
||||||
|
{
|
||||||
|
QuestionId= tableQuestion.Id,
|
||||||
|
Answer= item.Code,
|
||||||
|
TableQuestionId= tableQuestionList.Where(x=>x.QuestionMark==QuestionMark.liverSegmentation).Select(x=>x.Id).FirstOrDefault(),
|
||||||
|
VisitTaskId= visitTaskId,
|
||||||
|
TrialId= taskinfo.TrialId,
|
||||||
|
RowIndex= num,
|
||||||
|
RowId= guid,
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var otherQuestion in tableQuestionList.Where(x => !tableAnswerList.Any(y=>y.RowId== guid&&y.TableQuestionId==x.Id)))
|
||||||
|
{
|
||||||
|
tableAnswerList.Add(new ReadingTableQuestionAnswer()
|
||||||
|
{
|
||||||
|
Answer = string.Empty,
|
||||||
|
QuestionId = tableQuestion.Id,
|
||||||
|
TrialId = taskinfo.TrialId,
|
||||||
|
VisitTaskId = taskinfo.Id,
|
||||||
|
RowId = guid,
|
||||||
|
RowIndex = num,
|
||||||
|
TableQuestionId = otherQuestion.Id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
num = num++;
|
||||||
|
}
|
||||||
|
await _readingTableAnswerRowInfoRepository.AddRangeAsync(rowlist);
|
||||||
|
await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswerList);
|
||||||
|
await _readingTableQuestionAnswerRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
return new AddTaskLesionAnswerFromLastTaskOutDto()
|
||||||
|
{
|
||||||
|
IsBaseLine = taskinfo.SourceSubjectVisitId == baseLineVisitId,
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 测试计算
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="visitTaskId"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task TestCalculate(Guid visitTaskId, QuestionType type)
|
||||||
|
{
|
||||||
|
ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(visitTaskId);
|
||||||
|
await ReadingCalculate(readingData, new List<QuestionType>() { type });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 计算任务
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task CalculateTask(CalculateTaskInDto inDto)
|
||||||
|
{
|
||||||
|
ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId);
|
||||||
|
readingData.IsChangeOtherTask = inDto.IsChangeOtherTask;
|
||||||
|
await ReadingCalculate(readingData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自动计算
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <param name="calculateType"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task ReadingCalculate(ReadingCalculateDto inDto, List<QuestionType>? 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();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<GetReportVerifyOutDto> GetReportVerify(GetReportVerifyInDto inDto)
|
||||||
|
{
|
||||||
|
return new GetReportVerifyOutDto()
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -784,6 +784,11 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
/// OCT定量评估
|
/// OCT定量评估
|
||||||
/// </summary>
|
/// </summary>
|
||||||
OCT = 20,
|
OCT = 20,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// MRIPDFF
|
||||||
|
/// </summary>
|
||||||
|
MRIPDFF = 21,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1913,6 +1918,10 @@ public enum SUVChangeVSBaseline
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FCT = 112,
|
FCT = 112,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 脂肪分数
|
||||||
|
/// </summary>
|
||||||
|
FatFraction = 121,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2263,6 +2272,10 @@ public enum SUVChangeVSBaseline
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Undetermined = 1021,
|
Undetermined = 1021,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 肝脏分段
|
||||||
|
/// </summary>
|
||||||
|
liverSegmentation = 1106,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,11 @@ public class Hospital : BaseFullAuditEntity
|
||||||
public string CountryCN { get; set; } = string.Empty;
|
public string CountryCN { get; set; } = string.Empty;
|
||||||
public string ProvinceCN { get; set; } = string.Empty;
|
public string ProvinceCN { get; set; } = string.Empty;
|
||||||
public string CityCN { get; set; } = string.Empty;
|
public string CityCN { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否确认
|
||||||
|
/// </summary>
|
||||||
|
public bool IsConfirm { get; set; } = true;
|
||||||
[Comment("中心Id")]
|
[Comment("中心Id")]
|
||||||
public Guid? SiteId { get; set; } = Guid.Empty;
|
public Guid? SiteId { get; set; } = Guid.Empty;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,29 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Hospital : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<bool>(
|
||||||
|
name: "IsConfirm",
|
||||||
|
table: "Hospital",
|
||||||
|
type: "bit",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "IsConfirm",
|
||||||
|
table: "Hospital");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2625,6 +2625,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasMaxLength(400)
|
.HasMaxLength(400)
|
||||||
.HasColumnType("nvarchar(400)");
|
.HasColumnType("nvarchar(400)");
|
||||||
|
|
||||||
|
b.Property<bool>("IsConfirm")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
b.Property<string>("Province")
|
b.Property<string>("Province")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(400)
|
.HasMaxLength(400)
|
||||||
|
|
Loading…
Reference in New Issue