Uat_Study
parent
bae12fcd0a
commit
e4e1f18cff
|
@ -1155,161 +1155,7 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 获取阅片非Dicom文件
|
|
||||||
/// <summary>
|
|
||||||
/// 获取阅片非Dicom文件
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<(List<NoneDicomStudyView>, object)> GetReadingImageFile(GetReadingImgInDto inDto)
|
|
||||||
{
|
|
||||||
var task = await GetNextTask(new GetNextTaskInDto()
|
|
||||||
{
|
|
||||||
TrialId = inDto.TrialId,
|
|
||||||
SubjectId = inDto.SubjectId,
|
|
||||||
VisistTaskId = inDto.VisistTaskId,
|
|
||||||
});
|
|
||||||
List<Guid> visitIds = new List<Guid>();
|
|
||||||
if (task.ReadingCategory == ReadingCategory.Visit)
|
|
||||||
{
|
|
||||||
visitIds.Add(task.VisistId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// 阅片期取前面所有的图像
|
|
||||||
visitIds.AddRange(await _subjectVisitRepository.Where(x => x.VisitNum <= task.VisitNum && x.SubjectId == task.SubjectId).Select(x => x.Id).ToListAsync());
|
|
||||||
}
|
|
||||||
List<NoneDicomStudyView> result = await _noneDicomStudyRepository.Where(t => visitIds.Contains(t.SubjectVisitId))
|
|
||||||
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken }).ToListAsync();
|
|
||||||
|
|
||||||
var taskinfo=await _visitTaskRepository.Where(x=>x.Id==inDto.VisistTaskId).FirstNotNullAsync();
|
|
||||||
|
|
||||||
var trialInfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => new
|
|
||||||
{
|
|
||||||
x.ClinicalInformationTransmissionEnum,
|
|
||||||
}).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
|
|
||||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).Select(x => new
|
|
||||||
{
|
|
||||||
x.IsReadingShowPreviousResults,
|
|
||||||
x.IsReadingShowSubjectInfo,
|
|
||||||
x.CriterionName,
|
|
||||||
x.Id,
|
|
||||||
x.ReadingTool,
|
|
||||||
|
|
||||||
}).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
|
|
||||||
bool isExistsClinicalData = false;
|
|
||||||
if (trialInfo.ClinicalInformationTransmissionEnum == 1)
|
|
||||||
{
|
|
||||||
isExistsClinicalData = (await _readingClinicalDataService.GetClinicalDataList(new GetReadingOrTaskClinicalDataListInDto()
|
|
||||||
{
|
|
||||||
|
|
||||||
SubjectId = task.SubjectId,
|
|
||||||
TrialId = inDto.TrialId,
|
|
||||||
VisitTaskId = task.VisitTaskId,
|
|
||||||
})).Count() > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == task.VisitTaskId).FirstNotNullAsync();
|
|
||||||
|
|
||||||
return (result, new
|
|
||||||
{
|
|
||||||
VisitTaskId = task.VisitTaskId,
|
|
||||||
SubjectId = task.SubjectId,
|
|
||||||
SubjectCode = taskInfo.BlindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : taskInfo.BlindSubjectCode,
|
|
||||||
ReadingCategory = task.ReadingCategory,
|
|
||||||
TaskBlindName = task.TaskBlindName,
|
|
||||||
IsReadingShowPreviousResults = criterionInfo.IsReadingShowPreviousResults,
|
|
||||||
IsReadingShowSubjectInfo = criterionInfo.IsReadingShowSubjectInfo,
|
|
||||||
IsExistsClinicalData = isExistsClinicalData,
|
|
||||||
TrialCriterionName= criterionInfo.CriterionName,
|
|
||||||
TrialCriterionId = criterionInfo.Id
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region 找子问题
|
|
||||||
/// <summary>
|
|
||||||
/// 找子问题
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item"></param>
|
|
||||||
/// <param name="questionlists"></param>
|
|
||||||
/// <param name="tableQuestions"></param>
|
|
||||||
[NonDynamicMethod]
|
|
||||||
public void FindChildQuestion(GetTrialReadingQuestionOutDto item, List<GetTrialReadingQuestionOutDto> questionlists, List<TableQuestionDataInfo> tableQuestions)
|
|
||||||
{
|
|
||||||
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName)).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
item.Childrens.AddRange(tableQuestions.Where(x => x.ReadingQuestionId == item.Id).Select(x => new GetTrialReadingQuestionOutDto
|
|
||||||
{
|
|
||||||
Childrens = new List<GetTrialReadingQuestionOutDto>(),
|
|
||||||
ShowOrder = x.ShowOrder,
|
|
||||||
GroupName = string.Empty,
|
|
||||||
Id = x.Id,
|
|
||||||
Type = x.Type,
|
|
||||||
DictionaryCode=x.DictionaryCode,
|
|
||||||
TableQuestionType = x.TableQuestionType,
|
|
||||||
DependParentId = x.DependParentId,
|
|
||||||
IsDepend = x.IsDepend,
|
|
||||||
QuestionMark = x.QuestionMark,
|
|
||||||
QuestionGenre=x.QuestionGenre,
|
|
||||||
TypeValue = x.TypeValue,
|
|
||||||
RelevanceId = x.RelevanceId,
|
|
||||||
IsRequired = x.IsRequired,
|
|
||||||
RelevanceValue = x.RelevanceValue,
|
|
||||||
ImageCount = 0,
|
|
||||||
ParentId = item.Id,
|
|
||||||
DataTableColumn = x.DataTableColumn,
|
|
||||||
LesionType = item.LesionType,
|
|
||||||
QuestionName = x.QuestionName,
|
|
||||||
RelationQuestions = tableQuestions.Where(z => (z.DependParentId ?? default(Guid)) == x.Id).Select(x => new GetTrialReadingQuestionOutDto
|
|
||||||
{
|
|
||||||
Childrens = new List<GetTrialReadingQuestionOutDto>(),
|
|
||||||
ShowOrder = x.ShowOrder,
|
|
||||||
GroupName = string.Empty,
|
|
||||||
Id = x.Id,
|
|
||||||
Type = x.Type,
|
|
||||||
QuestionGenre=x.QuestionGenre,
|
|
||||||
TableQuestionType = x.TableQuestionType,
|
|
||||||
DependParentId = x.DependParentId,
|
|
||||||
DictionaryCode = x.DictionaryCode,
|
|
||||||
IsDepend = x.IsDepend,
|
|
||||||
QuestionMark = x.QuestionMark,
|
|
||||||
TypeValue = x.TypeValue,
|
|
||||||
RelevanceId = x.RelevanceId,
|
|
||||||
RelevanceValue = x.RelevanceValue,
|
|
||||||
ImageCount = 0,
|
|
||||||
ParentId = item.Id,
|
|
||||||
DataTableColumn = x.DataTableColumn,
|
|
||||||
LesionType = item.LesionType,
|
|
||||||
QuestionName = x.QuestionName,
|
|
||||||
RelationQuestions = new List<GetTrialReadingQuestionOutDto>(),
|
|
||||||
Remark = x.Remark,
|
|
||||||
|
|
||||||
}).ToList(),
|
|
||||||
Remark = x.Remark,
|
|
||||||
|
|
||||||
}));
|
|
||||||
if (item.Childrens != null && item.Childrens.Count != 0)
|
|
||||||
{
|
|
||||||
item.Childrens.ForEach(x =>
|
|
||||||
{
|
|
||||||
this.FindChildQuestion(x, questionlists, tableQuestions);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1480,22 +1326,8 @@ namespace IRaCIS.Application.Services
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 提交访视阅片问题
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inDto"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[NonDynamicMethod]
|
|
||||||
public async Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto)
|
|
||||||
{
|
|
||||||
await VerifyTaskIsSign(inDto.VisitTaskId);
|
|
||||||
await this.SaveVisitTaskQuestions(inDto);
|
|
||||||
|
|
||||||
|
|
||||||
await this.SubmitTaskChangeState(inDto.VisitTaskId);
|
|
||||||
return ResponseOutput.Ok(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 提交Dicom阅片信息
|
/// 提交Dicom阅片信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -0,0 +1,194 @@
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
|
using MassTransit;
|
||||||
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
|
using Panda.DynamicWebApi.Attributes;
|
||||||
|
using AutoMapper;
|
||||||
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using IRaCIS.Core.Application.Service;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
|
||||||
|
namespace IRaCIS.Application.Services
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 非Dicom
|
||||||
|
/// </summary>
|
||||||
|
public partial class ReadingImageTaskService : BaseService, IReadingImageTaskService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 提交访视阅片问题
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[NonDynamicMethod]
|
||||||
|
public async Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto)
|
||||||
|
{
|
||||||
|
await VerifyTaskIsSign(inDto.VisitTaskId);
|
||||||
|
await this.SaveVisitTaskQuestions(inDto);
|
||||||
|
|
||||||
|
|
||||||
|
await this.SubmitTaskChangeState(inDto.VisitTaskId);
|
||||||
|
return ResponseOutput.Ok(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 获取阅片非Dicom文件
|
||||||
|
/// <summary>
|
||||||
|
/// 获取阅片非Dicom文件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<(List<NoneDicomStudyView>, object)> GetReadingImageFile(GetReadingImgInDto inDto)
|
||||||
|
{
|
||||||
|
var task = await GetNextTask(new GetNextTaskInDto()
|
||||||
|
{
|
||||||
|
TrialId = inDto.TrialId,
|
||||||
|
SubjectId = inDto.SubjectId,
|
||||||
|
VisistTaskId = inDto.VisistTaskId,
|
||||||
|
});
|
||||||
|
List<Guid> visitIds = new List<Guid>();
|
||||||
|
if (task.ReadingCategory == ReadingCategory.Visit)
|
||||||
|
{
|
||||||
|
visitIds.Add(task.VisistId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 阅片期取前面所有的图像
|
||||||
|
visitIds.AddRange(await _subjectVisitRepository.Where(x => x.VisitNum <= task.VisitNum && x.SubjectId == task.SubjectId).Select(x => x.Id).ToListAsync());
|
||||||
|
}
|
||||||
|
List<NoneDicomStudyView> result = await _noneDicomStudyRepository.Where(t => visitIds.Contains(t.SubjectVisitId))
|
||||||
|
.ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken }).ToListAsync();
|
||||||
|
|
||||||
|
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisistTaskId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var trialInfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).Select(x => new
|
||||||
|
{
|
||||||
|
x.ClinicalInformationTransmissionEnum,
|
||||||
|
}).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).Select(x => new
|
||||||
|
{
|
||||||
|
x.IsReadingShowPreviousResults,
|
||||||
|
x.IsReadingShowSubjectInfo,
|
||||||
|
x.CriterionName,
|
||||||
|
x.Id,
|
||||||
|
x.ReadingTool,
|
||||||
|
|
||||||
|
}).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
|
bool isExistsClinicalData = false;
|
||||||
|
if (trialInfo.ClinicalInformationTransmissionEnum == 1)
|
||||||
|
{
|
||||||
|
isExistsClinicalData = (await _readingClinicalDataService.GetClinicalDataList(new GetReadingOrTaskClinicalDataListInDto()
|
||||||
|
{
|
||||||
|
|
||||||
|
SubjectId = task.SubjectId,
|
||||||
|
TrialId = inDto.TrialId,
|
||||||
|
VisitTaskId = task.VisitTaskId,
|
||||||
|
})).Count() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == task.VisitTaskId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
return (result, new
|
||||||
|
{
|
||||||
|
VisitTaskId = task.VisitTaskId,
|
||||||
|
SubjectId = task.SubjectId,
|
||||||
|
SubjectCode = taskInfo.BlindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : taskInfo.BlindSubjectCode,
|
||||||
|
ReadingCategory = task.ReadingCategory,
|
||||||
|
TaskBlindName = task.TaskBlindName,
|
||||||
|
IsReadingShowPreviousResults = criterionInfo.IsReadingShowPreviousResults,
|
||||||
|
IsReadingShowSubjectInfo = criterionInfo.IsReadingShowSubjectInfo,
|
||||||
|
IsExistsClinicalData = isExistsClinicalData,
|
||||||
|
TrialCriterionName = criterionInfo.CriterionName,
|
||||||
|
TrialCriterionId = criterionInfo.Id
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region 找子问题
|
||||||
|
/// <summary>
|
||||||
|
/// 找子问题
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item"></param>
|
||||||
|
/// <param name="questionlists"></param>
|
||||||
|
/// <param name="tableQuestions"></param>
|
||||||
|
[NonDynamicMethod]
|
||||||
|
public void FindChildQuestion(GetTrialReadingQuestionOutDto item, List<GetTrialReadingQuestionOutDto> questionlists, List<TableQuestionDataInfo> tableQuestions)
|
||||||
|
{
|
||||||
|
item.Childrens = questionlists.Where(x => x.ParentId == item.Id || (item.Type == ReadingQestionType.Group && x.Type != ReadingQestionType.Group && x.ParentId == null && x.GroupName == item.GroupName)).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
item.Childrens.AddRange(tableQuestions.Where(x => x.ReadingQuestionId == item.Id).Select(x => new GetTrialReadingQuestionOutDto
|
||||||
|
{
|
||||||
|
Childrens = new List<GetTrialReadingQuestionOutDto>(),
|
||||||
|
ShowOrder = x.ShowOrder,
|
||||||
|
GroupName = string.Empty,
|
||||||
|
Id = x.Id,
|
||||||
|
Type = x.Type,
|
||||||
|
DictionaryCode = x.DictionaryCode,
|
||||||
|
TableQuestionType = x.TableQuestionType,
|
||||||
|
DependParentId = x.DependParentId,
|
||||||
|
IsDepend = x.IsDepend,
|
||||||
|
QuestionMark = x.QuestionMark,
|
||||||
|
QuestionGenre = x.QuestionGenre,
|
||||||
|
TypeValue = x.TypeValue,
|
||||||
|
RelevanceId = x.RelevanceId,
|
||||||
|
IsRequired = x.IsRequired,
|
||||||
|
RelevanceValue = x.RelevanceValue,
|
||||||
|
ImageCount = 0,
|
||||||
|
ParentId = item.Id,
|
||||||
|
DataTableColumn = x.DataTableColumn,
|
||||||
|
LesionType = item.LesionType,
|
||||||
|
QuestionName = x.QuestionName,
|
||||||
|
RelationQuestions = tableQuestions.Where(z => (z.DependParentId ?? default(Guid)) == x.Id).Select(x => new GetTrialReadingQuestionOutDto
|
||||||
|
{
|
||||||
|
Childrens = new List<GetTrialReadingQuestionOutDto>(),
|
||||||
|
ShowOrder = x.ShowOrder,
|
||||||
|
GroupName = string.Empty,
|
||||||
|
Id = x.Id,
|
||||||
|
Type = x.Type,
|
||||||
|
QuestionGenre = x.QuestionGenre,
|
||||||
|
TableQuestionType = x.TableQuestionType,
|
||||||
|
DependParentId = x.DependParentId,
|
||||||
|
DictionaryCode = x.DictionaryCode,
|
||||||
|
IsDepend = x.IsDepend,
|
||||||
|
QuestionMark = x.QuestionMark,
|
||||||
|
TypeValue = x.TypeValue,
|
||||||
|
RelevanceId = x.RelevanceId,
|
||||||
|
RelevanceValue = x.RelevanceValue,
|
||||||
|
ImageCount = 0,
|
||||||
|
ParentId = item.Id,
|
||||||
|
DataTableColumn = x.DataTableColumn,
|
||||||
|
LesionType = item.LesionType,
|
||||||
|
QuestionName = x.QuestionName,
|
||||||
|
RelationQuestions = new List<GetTrialReadingQuestionOutDto>(),
|
||||||
|
Remark = x.Remark,
|
||||||
|
|
||||||
|
}).ToList(),
|
||||||
|
Remark = x.Remark,
|
||||||
|
|
||||||
|
}));
|
||||||
|
if (item.Childrens != null && item.Childrens.Count != 0)
|
||||||
|
{
|
||||||
|
item.Childrens.ForEach(x =>
|
||||||
|
{
|
||||||
|
this.FindChildQuestion(x, questionlists, tableQuestions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
|
@ -137,7 +137,6 @@ namespace IRaCIS.Core.Application
|
||||||
public async Task<GetTrialReadingInfoOutDto> GetCriterionReadingInfo(GetTrialReadingInfoInDto inDto)
|
public async Task<GetTrialReadingInfoOutDto> GetCriterionReadingInfo(GetTrialReadingInfoInDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
|
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
|
||||||
if (trialCriterion.SynchronizeOriginalTime == null && trialCriterion.ReadingQuestionCriterionSystemId != null)
|
if (trialCriterion.SynchronizeOriginalTime == null && trialCriterion.ReadingQuestionCriterionSystemId != null)
|
||||||
{
|
{
|
||||||
|
@ -176,7 +175,6 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstOrDefaultAsync();
|
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
|
||||||
return new GetOncologySetOutDto
|
return new GetOncologySetOutDto
|
||||||
{
|
{
|
||||||
EvaluationReason = trialCriterion.EvaluationReason.IsNullOrEmpty()? ReadingCommon.EvaluationReason : trialCriterion.EvaluationReason,
|
EvaluationReason = trialCriterion.EvaluationReason.IsNullOrEmpty()? ReadingCommon.EvaluationReason : trialCriterion.EvaluationReason,
|
||||||
|
|
Loading…
Reference in New Issue