Uat_Study
parent
bae12fcd0a
commit
e4e1f18cff
|
@ -1155,162 +1155,8 @@ namespace IRaCIS.Application.Services
|
|||
}
|
||||
#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
|
||||
|
||||
|
||||
|
||||
#region 阅片任务 提交填写表单
|
||||
|
@ -1480,21 +1326,7 @@ namespace IRaCIS.Application.Services
|
|||
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>
|
||||
/// 提交Dicom阅片信息
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
|
||||
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync();
|
||||
if (trialCriterion.SynchronizeOriginalTime == null && trialCriterion.ReadingQuestionCriterionSystemId != null)
|
||||
{
|
||||
|
@ -173,15 +172,14 @@ namespace IRaCIS.Core.Application
|
|||
[HttpPost]
|
||||
public async Task<GetOncologySetOutDto> GetOncologySet(GetOncologySetInDto inDto)
|
||||
{
|
||||
|
||||
|
||||
var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
return new GetOncologySetOutDto
|
||||
{
|
||||
EvaluationReason = trialCriterion.EvaluationReason.IsNullOrEmpty()? ReadingCommon.EvaluationReason : trialCriterion.EvaluationReason,
|
||||
OncologyAssessIds = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.TrialReadingCriterionId && x.ParentCode == "OncologyAssess").Select(x => x.DictionaryId).ToListAsync(),
|
||||
IsSystemCriterion= trialCriterion.ReadingQuestionCriterionSystemId!=null,
|
||||
IsSystemCriterion= trialCriterion.ReadingQuestionCriterionSystemId!=null,
|
||||
IsSign = trialCriterion.ReadingInfoSignTime != null,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue