Uat_Study
parent
276e7ee729
commit
b4b4c82e59
|
@ -42,6 +42,50 @@ namespace IRaCIS.Core.Application.Service
|
|||
_systemClinicalQuestionRepository = systemClinicalQuestionRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取计算问题
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<GetClinicalCalculateQuestionsOutDto>> GetClinicalCalculateQuestions(GetClinicalCalculateQuestionsInDto inDto)
|
||||
{
|
||||
var result = await _trialClinicalQuestionRepository
|
||||
|
||||
.Where(x => x.TrialClinicalId == inDto.TrialClinicalId)
|
||||
.WhereIf(!inDto.ClinicalQuestionType.IsNullOrEmpty(), x => x.ClinicalQuestionType == inDto.ClinicalQuestionType)
|
||||
.OrderBy(x => x.ShowOrder)
|
||||
.Select(x => new GetClinicalCalculateQuestionsOutDto
|
||||
()
|
||||
{
|
||||
QuestionId = x.Id,
|
||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
||||
|
||||
}).ToListAsync();
|
||||
|
||||
var tablequestion = await _trialClinicalTableQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId && x.ClinicalTableQuestionType == "number").Select(x =>
|
||||
new
|
||||
{
|
||||
TableQuestionId = x.Id,
|
||||
QuestionId= x.QuestionId,
|
||||
QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us)
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
result.ForEach(x =>
|
||||
{
|
||||
x.TableQuestions = tablequestion.Where(y => x.QuestionId == y.QuestionId).Select(y => new CalculateQuestion()
|
||||
{
|
||||
|
||||
QuestionId = y.QuestionId,
|
||||
QuestionName = y.QuestionName
|
||||
|
||||
}).ToList();
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取系统临床数据预览
|
||||
/// </summary>
|
||||
|
|
|
@ -10,6 +10,33 @@ using System.Threading.Tasks;
|
|||
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
{
|
||||
|
||||
|
||||
|
||||
#region 获取计算问题
|
||||
public class GetClinicalCalculateQuestionsOutDto
|
||||
{
|
||||
public Guid QuestionId { get; set; }
|
||||
|
||||
public string QuestionName { get; set; }
|
||||
|
||||
public List<CalculateQuestion> TableQuestions { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class GetClinicalCalculateQuestionsInDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目临床数据Id
|
||||
/// </summary>
|
||||
public Guid TrialClinicalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 临床问题类型(分组,单选。)
|
||||
/// </summary>
|
||||
public string ClinicalQuestionType { get; set; } = string.Empty;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 预览
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue