Uat_Study
parent
0a69979417
commit
ca36fd35a6
|
@ -0,0 +1,185 @@
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||||
|
// 生成时间 2023-06-15 15:06:06
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using MassTransit;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Application.Service
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 临床答案
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(GroupName = "Reading")]
|
||||||
|
public class ClinicalAnswerService : BaseService
|
||||||
|
{
|
||||||
|
|
||||||
|
private readonly IRepository<TrialClinicalQuestion> _trialClinicalQuestionRepository;
|
||||||
|
|
||||||
|
private readonly IRepository<SystemClinicalQuestion> _systemClinicalQuestionRepository;
|
||||||
|
|
||||||
|
|
||||||
|
private readonly IRepository<SystemClinicalTableQuestion> _systemClinicalTableQuestionRepository;
|
||||||
|
|
||||||
|
private readonly IRepository<TrialClinicalTableQuestion> _trialClinicalTableQuestionRepository;
|
||||||
|
|
||||||
|
private readonly IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository;
|
||||||
|
|
||||||
|
private readonly IRepository<ClinicalForm> _clinicalFormRepository;
|
||||||
|
|
||||||
|
private readonly IRepository<ClinicalQuestionAnswer> _clinicalQuestionAnswerRepository;
|
||||||
|
|
||||||
|
private readonly IRepository<ClinicalTableAnswer> _clinicalTableAnswerRepository;
|
||||||
|
|
||||||
|
private readonly IClinicalQuestionService _iClinicalQuestionService;
|
||||||
|
|
||||||
|
|
||||||
|
public ClinicalAnswerService(IRepository<TrialClinicalQuestion> trialClinicalQuestionRepository,
|
||||||
|
IRepository<SystemClinicalTableQuestion> systemClinicalTableQuestionRepository,
|
||||||
|
IRepository<TrialClinicalTableQuestion> trialClinicalTableQuestionRepository,
|
||||||
|
IRepository<ClinicalForm> clinicalFormRepository,
|
||||||
|
IRepository<ClinicalTableAnswer> clinicalTableAnswerRepository,
|
||||||
|
IRepository<ClinicalQuestionAnswer> clinicalQuestionAnswerRepository,
|
||||||
|
IClinicalQuestionService iClinicalQuestionService,
|
||||||
|
IRepository<ClinicalDataTrialSet> clinicalDataTrialSetRepository,
|
||||||
|
IRepository<SystemClinicalQuestion> systemClinicalQuestionRepository
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_clinicalQuestionAnswerRepository = clinicalQuestionAnswerRepository;
|
||||||
|
_systemClinicalTableQuestionRepository = systemClinicalTableQuestionRepository;
|
||||||
|
_trialClinicalQuestionRepository = trialClinicalQuestionRepository;
|
||||||
|
_trialClinicalTableQuestionRepository = trialClinicalTableQuestionRepository;
|
||||||
|
_systemClinicalQuestionRepository = systemClinicalQuestionRepository;
|
||||||
|
_clinicalDataTrialSetRepository = clinicalDataTrialSetRepository;
|
||||||
|
_clinicalFormRepository = clinicalFormRepository;
|
||||||
|
_clinicalTableAnswerRepository = clinicalTableAnswerRepository;
|
||||||
|
_iClinicalQuestionService = iClinicalQuestionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取CRC受试者临床数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<List<GetCRCSubjectClinicalOutDto>> GetCRCSubjectClinicalList(GetCRCSubjectClinicalInDto inDto)
|
||||||
|
{
|
||||||
|
var result =await _clinicalDataTrialSetRepository.Where(x => x.TrialId == inDto.TrialId).OrderBy(x=>x.ClinicalDataSetName).Select(x => new GetCRCSubjectClinicalOutDto()
|
||||||
|
{
|
||||||
|
ClinicalDataTrialSetId = x.Id,
|
||||||
|
ClinicalDataSetName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us),
|
||||||
|
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var clinicalData = await _clinicalFormRepository.Where(x => x.SubjectId == inDto.TrialId).ToListAsync();
|
||||||
|
|
||||||
|
result.ForEach(x =>
|
||||||
|
{
|
||||||
|
x.ClinicalCount = clinicalData.Where(y => y.ClinicalDataTrialSetId == x.ClinicalDataTrialSetId).Count();
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取表单列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<GetClinicalQuestionAnswerListOutDto> GetClinicalQuestionFormList(GetClinicalQuestionAnswerListInDto inDto)
|
||||||
|
{
|
||||||
|
var result = new GetClinicalQuestionAnswerListOutDto();
|
||||||
|
result.AnswerList = new List<Dictionary<string, string>>();
|
||||||
|
result.QuestionList=await _trialClinicalQuestionRepository.Where(x=>x.TrialClinicalId==inDto.ClinicalDataTrialSetId
|
||||||
|
&&x.ClinicalQuestionType!= ReadingQestionType.Group
|
||||||
|
&& x.ClinicalQuestionType != ReadingQestionType.Table).OrderBy(x=>x.ShowOrder)
|
||||||
|
.ProjectTo<TrialClinicalQuestionDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
var answers = await _clinicalQuestionAnswerRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ClinicalDataTrialSetId == inDto.ClinicalDataTrialSetId)
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
x.ClinicalFormId,
|
||||||
|
x.ClinicalForm.CheckDate,
|
||||||
|
x.QuestionId,
|
||||||
|
x.Answer
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
var ClinicalFormIds = answers.OrderBy(x=>x.CheckDate).Select(x => x.ClinicalFormId).Distinct().ToList();
|
||||||
|
ClinicalFormIds.ForEach(x =>
|
||||||
|
{
|
||||||
|
var dic = answers.Where(y => y.ClinicalFormId == x).ToDictionary(x => x.QuestionId.ToString(), x => x.Answer);
|
||||||
|
dic.Add("clinicalFormId", x.ToString());
|
||||||
|
result.AnswerList.Add(dic);
|
||||||
|
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取临床数据表单问题
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<GetClinicalFormInfoOutDto> GetClinicalFormInfo(GetClinicalFormInfoInDto inDto)
|
||||||
|
{
|
||||||
|
var formInfo = await _clinicalFormRepository.Where(x => x.Id == inDto.ClinicalFormId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var questionAnswer = await _clinicalQuestionAnswerRepository.Where(x => x.ClinicalFormId == inDto.ClinicalFormId).Select(x => new ClinicalFormQuestionAnswer
|
||||||
|
{
|
||||||
|
QuestionId = x.QuestionId,
|
||||||
|
Answer = x.Answer
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
var tableAnswer = await _clinicalTableAnswerRepository.Where(x => x.ClinicalFormId == inDto.ClinicalFormId).Select(x => new ClinicalFormTableQuestionAnswer
|
||||||
|
{
|
||||||
|
TableQuestionId = x.TableQuestionId,
|
||||||
|
Answer = x.Answer,
|
||||||
|
QuestionId = x.QuestionId,
|
||||||
|
RowIndex = x.ClinicalAnswerRowInfo.RowIndex
|
||||||
|
}).ToListAsync();
|
||||||
|
|
||||||
|
var questions = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == formInfo.ClinicalDataTrialSetId)
|
||||||
|
.ProjectTo<ClinicalQuestionPreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
var tableQuestions = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == formInfo.ClinicalDataTrialSetId)
|
||||||
|
.ProjectTo<ClinicalTablePreviewDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var result = questions.Where(x => x.ClinicalQuestionType == ReadingQestionType.Group).ToList();
|
||||||
|
|
||||||
|
result.ForEach(x =>
|
||||||
|
{
|
||||||
|
_iClinicalQuestionService.FindChildQuestion(x, questions, tableQuestions, questionAnswer, tableAnswer);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new GetClinicalFormInfoOutDto()
|
||||||
|
{
|
||||||
|
|
||||||
|
Question = result
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 提交临床数据表单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task SubmitClinicalForm(SubmitClinicalFormInDto inDto)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -101,14 +101,27 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="item"></param>
|
/// <param name="item"></param>
|
||||||
/// <param name="questions"></param>
|
/// <param name="questions"></param>
|
||||||
/// <param name="tableQuestions"></param>
|
/// <param name="tableQuestions"></param>
|
||||||
public void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions)
|
public void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions,List<ClinicalFormQuestionAnswer> answers, List<ClinicalFormTableQuestionAnswer> tableAnswers)
|
||||||
{
|
{
|
||||||
item.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).ToList();
|
item.Childrens = questions.Where(x => (x.ParentId == item.Id)||(x.GroupId== item.Id&&x.ParentId==null)).ToList();
|
||||||
|
item.Answer = answers.Where(x => x.QuestionId == item.Id).Select(x => x.Answer).FirstOrDefault()??string.Empty;
|
||||||
|
|
||||||
item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).ToList();
|
var tableIndexs = tableAnswers.Where(x => x.QuestionId == item.Id).Select(x => x.RowIndex).Distinct().OrderBy(x=>x).ToList();
|
||||||
|
|
||||||
|
item.TableAnswer = new List<Dictionary<Guid, string>>();
|
||||||
|
|
||||||
|
tableIndexs.ForEach(x =>
|
||||||
|
{
|
||||||
|
item.TableAnswer.Add(tableAnswers.Where(y => y.RowIndex == x).ToDictionary(y => y.TableQuestionId, y => y.Answer));
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
item.TableQuestions = tableQuestions.Where(x => x.QuestionId == item.Id).OrderBy(x=>x.ShowOrder).ToList();
|
||||||
|
|
||||||
item.Childrens.ForEach(x => {
|
item.Childrens.ForEach(x => {
|
||||||
this.FindChildQuestion(x, questions, tableQuestions);
|
this.FindChildQuestion(x, questions, tableQuestions, answers, tableAnswers);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,85 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
|
{
|
||||||
|
public class GetCRCSubjectClinicalInDto
|
||||||
|
{
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class GetCRCSubjectClinicalOutDto
|
||||||
|
{
|
||||||
|
public Guid ClinicalDataTrialSetId { get; set; }
|
||||||
|
|
||||||
|
public string ClinicalDataSetName { get; set; }
|
||||||
|
|
||||||
|
public int ClinicalCount { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class GetClinicalQuestionAnswerListInDto
|
||||||
|
{
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
public Guid ClinicalDataTrialSetId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class GetClinicalQuestionAnswerListOutDto
|
||||||
|
{
|
||||||
|
public List<TrialClinicalQuestionDto> QuestionList { get; set; }
|
||||||
|
|
||||||
|
public List<Dictionary<string, string>> AnswerList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetClinicalFormInfoInDto
|
||||||
|
{
|
||||||
|
public Guid ClinicalFormId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetClinicalFormInfoOutDto
|
||||||
|
{
|
||||||
|
public List<ClinicalQuestionPreviewDto> Question { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ClinicalFormQuestionAnswer
|
||||||
|
{
|
||||||
|
public Guid QuestionId { get; set; }
|
||||||
|
|
||||||
|
public string Answer { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ClinicalFormTableQuestionAnswer
|
||||||
|
{
|
||||||
|
public Guid TableQuestionId { get; set; }
|
||||||
|
|
||||||
|
public int RowIndex { get; set; }
|
||||||
|
|
||||||
|
public Guid QuestionId { get; set; }
|
||||||
|
|
||||||
|
public string Answer { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SubmitClinicalFormInDto
|
||||||
|
{
|
||||||
|
public Guid? ClinicalFormId { get; set; }
|
||||||
|
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
public Guid ClinicalDataTrialSetId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public List<ClinicalFormQuestionAnswer> QuestionAnswers { get; set; }
|
||||||
|
|
||||||
|
public List<List<ClinicalFormQuestionAnswer>> TableQuestionAnswer { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -37,6 +37,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid SystemClinicalId { get; set; }
|
public Guid SystemClinicalId { get; set; }
|
||||||
|
|
||||||
|
public string Answer { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 子问题
|
/// 子问题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -46,11 +48,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// 表格问题
|
/// 表格问题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<ClinicalTablePreviewDto> TableQuestions { get; set; } = new List<ClinicalTablePreviewDto>();
|
public List<ClinicalTablePreviewDto> TableQuestions { get; set; } = new List<ClinicalTablePreviewDto>();
|
||||||
|
|
||||||
|
public List<Dictionary<Guid,string>> TableAnswer { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统临床数据问题
|
/// 项目临床数据问题
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ClinicalTablePreviewDto : TrialClinicalTableQuestionDto
|
public class ClinicalTablePreviewDto : TrialClinicalTableQuestionDto
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Interfaces
|
||||||
Task SynchronizationQuestion(List<SynchronizationQuestionDto> inDto);
|
Task SynchronizationQuestion(List<SynchronizationQuestionDto> inDto);
|
||||||
|
|
||||||
|
|
||||||
|
void FindChildQuestion(ClinicalQuestionPreviewDto item, List<ClinicalQuestionPreviewDto> questions, List<ClinicalTablePreviewDto> tableQuestions, List<ClinicalFormQuestionAnswer> answers, List<ClinicalFormTableQuestionAnswer> tableAnswers);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||||
|
// 生成时间 2023-06-26 11:01:54
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
namespace IRaCIS.Core.Domain.Models
|
||||||
|
{
|
||||||
|
///<summary>
|
||||||
|
///ClinicalAnswerRowInfo
|
||||||
|
///</summary>
|
||||||
|
[Table("ClinicalAnswerRowInfo")]
|
||||||
|
public class ClinicalAnswerRowInfo : Entity, IAuditAdd
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 受试者Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表单Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid ClinicalFormId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 问题Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid QuestionId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// RowIndex
|
||||||
|
/// </summary>
|
||||||
|
public int RowIndex { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||||
|
// 生成时间 2023-06-26 11:39:53
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
namespace IRaCIS.Core.Domain.Models
|
||||||
|
{
|
||||||
|
///<summary>
|
||||||
|
///ClinicalForm
|
||||||
|
///</summary>
|
||||||
|
[Table("ClinicalForm")]
|
||||||
|
public class ClinicalForm : Entity, IAuditAdd
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 受试者Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 检查日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CheckDate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人
|
||||||
|
/// </summary>
|
||||||
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ClinicalDataTrialSetId
|
||||||
|
/// </summary>
|
||||||
|
public Guid ClinicalDataTrialSetId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||||
|
// 生成时间 2023-06-26 10:58:41
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
namespace IRaCIS.Core.Domain.Models
|
||||||
|
{
|
||||||
|
///<summary>
|
||||||
|
///ClinicalQuestionAnswer
|
||||||
|
///</summary>
|
||||||
|
[Table("ClinicalQuestionAnswer")]
|
||||||
|
public class ClinicalQuestionAnswer : Entity, IAuditAdd
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 受试者Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表单Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid ClinicalFormId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建用户
|
||||||
|
/// </summary>
|
||||||
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 问题Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid QuestionId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Answer
|
||||||
|
/// </summary>
|
||||||
|
public string Answer { get; set; }
|
||||||
|
|
||||||
|
public Guid ClinicalDataTrialSetId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
[ForeignKey("ClinicalFormId")]
|
||||||
|
public ClinicalForm ClinicalForm { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||||
|
// 生成时间 2023-06-26 11:03:26
|
||||||
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
namespace IRaCIS.Core.Domain.Models
|
||||||
|
{
|
||||||
|
///<summary>
|
||||||
|
///ClinicalTableAnswer
|
||||||
|
///</summary>
|
||||||
|
[Table("ClinicalTableAnswer")]
|
||||||
|
public class ClinicalTableAnswer : Entity, IAuditAdd
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 受试者Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表单Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid ClinicalFormId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建日期
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 问题Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid QuestionId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 答案行的Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid RowId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 答案
|
||||||
|
/// </summary>
|
||||||
|
public string Answer { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 表格问题id
|
||||||
|
/// </summary>
|
||||||
|
public Guid TableQuestionId { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
[ForeignKey("RowId")]
|
||||||
|
public ClinicalAnswerRowInfo ClinicalAnswerRowInfo { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -86,3 +86,9 @@ WHERE
|
||||||
AND OBJECTPROPERTY(i.object_id, 'IsSystemTable') = 0
|
AND OBJECTPROPERTY(i.object_id, 'IsSystemTable') = 0
|
||||||
AND OBJECTPROPERTY(i.object_id, 'IsMSShipped') = 0
|
AND OBJECTPROPERTY(i.object_id, 'IsMSShipped') = 0
|
||||||
AND OBJECT_NAME(i.object_id) <> 'sysdiagrams';
|
AND OBJECT_NAME(i.object_id) <> 'sysdiagrams';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------维护临床数据是否应用 之前默认都是应用 现在添加字段 把状态都改为应用
|
||||||
|
update ClinicalDataTrialSet set IsApply=1
|
|
@ -411,6 +411,15 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
public virtual DbSet<SystemClinicalTableQuestion> SystemClinicalTableQuestion { get; set; }
|
public virtual DbSet<SystemClinicalTableQuestion> SystemClinicalTableQuestion { get; set; }
|
||||||
|
|
||||||
public virtual DbSet<TrialClinicalTableQuestion> TrialClinicalTableQuestion { get; set; }
|
public virtual DbSet<TrialClinicalTableQuestion> TrialClinicalTableQuestion { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<ClinicalQuestionAnswer> ClinicalQuestionAnswer { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<ClinicalAnswerRowInfo> ClinicalAnswerRowInfo { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<ClinicalTableAnswer> ClinicalTableAnswer { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public virtual DbSet<ClinicalForm> ClinicalForm { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true";
|
public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true";
|
||||||
public static readonly string DbDatabase = "IRaCIS_New_Tet";
|
public static readonly string DbDatabase = "IRaCIS_New_Tet";
|
||||||
//表名称用字符串,拼接
|
//表名称用字符串,拼接
|
||||||
public static readonly string TableName = "SystemClinicalTableQuestion";
|
public static readonly string TableName = "ClinicalForm";
|
||||||
//具体文件里面 例如service 可以配置是否分页
|
//具体文件里面 例如service 可以配置是否分页
|
||||||
}
|
}
|
||||||
#>
|
#>
|
||||||
|
|
Loading…
Reference in New Issue