修改一版

This commit is contained in:
he
2022-06-27 14:35:38 +08:00
parent 37320c5be5
commit b26e596ffb
5 changed files with 66 additions and 2 deletions
@@ -31,6 +31,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public bool IsEnable { get; set; }
}
public class GetPreviewTheQuestionInDto
{
[NotDefault]
public Guid Id { get; set; }
}
public class AddOrUpdateReadingQuestionCriterionSystemInDto
{
public Guid? Id { get; set; }
@@ -14,5 +14,8 @@ namespace IRaCIS.Core.Application.Contracts
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List<GetTrialReadingQuestionOutDto> questionlists);
}
}
@@ -419,8 +419,8 @@ namespace IRaCIS.Application.Services
/// </summary>
/// <param name="trialReadingQuestion"></param>
/// <param name="questionlists"></param>
private void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List<GetTrialReadingQuestionOutDto> questionlists)
[NonDynamicMethod]
public void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List<GetTrialReadingQuestionOutDto> questionlists)
{
trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId).ToList();
if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0)
@@ -30,6 +30,7 @@ namespace IRaCIS.Application.Services
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
private readonly IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository;
private readonly IRepository<Dictionary> _dictionaryRepository;
private readonly IReadingImageTaskService _readingImageTaskService;
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswer;
private readonly IRepository<PreviousPDF> _previousPDFRepository;
@@ -42,6 +43,7 @@ namespace IRaCIS.Application.Services
IRepository<ClinicalDataTrialSet> ClinicalDataTrialSetRepository,
IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
IRepository<Dictionary> dictionaryRepository,
IReadingImageTaskService readingImageTaskService,
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswer,
IRepository<PreviousPDF> previousPDFRepository
)
@@ -54,6 +56,7 @@ namespace IRaCIS.Application.Services
this._clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository;
this._clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository;
this._dictionaryRepository = dictionaryRepository;
this._readingImageTaskService = readingImageTaskService;
this._readingTaskQuestionAnswer = readingTaskQuestionAnswer;
this._previousPDFRepository = previousPDFRepository;
}
@@ -438,6 +441,39 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Ok(entity.Id.ToString());
}
/// <summary>
/// 获取预览问题信息
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<GetTrialReadingQuestionOutDto>> GetPreviewTheQuestion(GetPreviewTheQuestionInDto inDto)
{
var trialQuestionQuery = from trialQuestion in _readingQuestionTrialRepository.Where(x=>x.ReadingQuestionCriterionTrialId== inDto.Id)
select new GetTrialReadingQuestionOutDto()
{
ReadingQuestionTrialId = trialQuestion.Id,
ReadingQuestionCriterionTrialId = trialQuestion.ReadingQuestionCriterionTrialId,
TrialId = trialQuestion.TrialId,
Type = trialQuestion.Type,
ParentTriggerValue = trialQuestion.ParentTriggerValue,
GroupName = trialQuestion.GroupName,
QuestionName = trialQuestion.QuestionName,
IsRequired = trialQuestion.IsRequired,
ShowOrder = trialQuestion.ShowOrder,
ParentId = trialQuestion.ParentId,
TypeValue = trialQuestion.TypeValue,
Answer = string.Empty
};
var qusetionList = await trialQuestionQuery.OrderBy(x => x.ShowOrder).ToListAsync();
List<GetTrialReadingQuestionOutDto> readingQuestionList = qusetionList.Where(x => x.ParentId == null).ToList();
readingQuestionList.ForEach(x =>
{
_readingImageTaskService.FindChildQuestion(x, qusetionList);
});
return readingQuestionList;
}
///// <summary>
///// 设置项目标准是否生效