Uat_Study
parent
ea48fcac64
commit
5360c577af
|
@ -39,7 +39,10 @@
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------Reading-----------------------------------------------------------------
|
//-------------------------------------------------------------------------------------Reading-----------------------------------------------------------------
|
||||||
//ClinicalDataSetService
|
//ClinicalDataSetService
|
||||||
|
"ClinicalDataSet_Apply": "",
|
||||||
"ClinicalDataSet_DupTypeFail": "The same type of clinical data exists. The operation failed.",
|
"ClinicalDataSet_DupTypeFail": "The same type of clinical data exists. The operation failed.",
|
||||||
|
//ClinicalQuestionService
|
||||||
|
"ClinicalQuestion_Repeat": "",
|
||||||
//ReadingClinicalDataService
|
//ReadingClinicalDataService
|
||||||
"ReadingClinicalData_DupTypeFail": "The same type of clinical data exists. The operation failed.",
|
"ReadingClinicalData_DupTypeFail": "The same type of clinical data exists. The operation failed.",
|
||||||
"ReadingClinicalData_Unchecked": "The current clinical data status is not verified and signing is not allowed!",
|
"ReadingClinicalData_Unchecked": "The current clinical data status is not verified and signing is not allowed!",
|
||||||
|
|
|
@ -39,7 +39,10 @@
|
||||||
|
|
||||||
// ------------------------------------------------------------Reading--------------------------------------------------------------------
|
// ------------------------------------------------------------Reading--------------------------------------------------------------------
|
||||||
//ClinicalDataSetService
|
//ClinicalDataSetService
|
||||||
|
"ClinicalDataSet_Apply": "当前临床数据需要配置一个检查日期才能应用",
|
||||||
"ClinicalDataSet_DupTypeFail": "存在同类型的临床数据,操作失败",
|
"ClinicalDataSet_DupTypeFail": "存在同类型的临床数据,操作失败",
|
||||||
|
//ClinicalQuestionService
|
||||||
|
"ClinicalQuestion_Repeat": "存在相同的问题名称!",
|
||||||
//ReadingClinicalDataService
|
//ReadingClinicalDataService
|
||||||
"ReadingClinicalData_DupTypeFail": "存在同类型的临床数据,操作失败",
|
"ReadingClinicalData_DupTypeFail": "存在同类型的临床数据,操作失败",
|
||||||
"ReadingClinicalData_Unchecked": "当前临床数据状态不是已核查状态,不允许签名!",
|
"ReadingClinicalData_Unchecked": "当前临床数据状态不是已核查状态,不允许签名!",
|
||||||
|
|
|
@ -3,6 +3,8 @@ using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
|
@ -20,7 +22,9 @@ namespace IRaCIS.Application.Services
|
||||||
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||||
private readonly IRepository<Dictionary> _dictionaryRepository;
|
private readonly IRepository<Dictionary> _dictionaryRepository;
|
||||||
private readonly IRepository<Trial> _trialRepository;
|
private readonly IRepository<Trial> _trialRepository;
|
||||||
|
private readonly IRepository<TrialClinicalQuestion> _trialClinicalQuestionRepository;
|
||||||
|
|
||||||
|
private readonly IRepository<SystemClinicalQuestion> _systemClinicalQuestionRepository;
|
||||||
|
|
||||||
public ClinicalDataSetService(IRepository<SubjectVisit> subjectVisitRepository,
|
public ClinicalDataSetService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
IClinicalQuestionService iClinicalQuestionService,
|
IClinicalQuestionService iClinicalQuestionService,
|
||||||
|
@ -28,6 +32,9 @@ namespace IRaCIS.Application.Services
|
||||||
IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
|
IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
|
||||||
IRepository<PreviousPDF> previousPDFRepository,
|
IRepository<PreviousPDF> previousPDFRepository,
|
||||||
IRepository<Dictionary> dictionaryRepository,
|
IRepository<Dictionary> dictionaryRepository,
|
||||||
|
IRepository<TrialClinicalQuestion> trialClinicalQuestionRepository,
|
||||||
|
IRepository<SystemClinicalQuestion> systemClinicalQuestionRepository,
|
||||||
|
|
||||||
IRepository<Trial> trialRepository
|
IRepository<Trial> trialRepository
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +42,8 @@ namespace IRaCIS.Application.Services
|
||||||
{
|
{
|
||||||
_iClinicalQuestionService = iClinicalQuestionService;
|
_iClinicalQuestionService = iClinicalQuestionService;
|
||||||
_subjectVisitRepository = subjectVisitRepository;
|
_subjectVisitRepository = subjectVisitRepository;
|
||||||
|
_trialClinicalQuestionRepository = trialClinicalQuestionRepository;
|
||||||
|
_systemClinicalQuestionRepository = systemClinicalQuestionRepository;
|
||||||
_clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository;
|
_clinicalDataTrialSetRepository = ClinicalDataTrialSetRepository;
|
||||||
_clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository;
|
_clinicalDataSystemSetRepository = ClinicalDataSystemSetRepository;
|
||||||
this._previousPDFRepository = previousPDFRepository;
|
this._previousPDFRepository = previousPDFRepository;
|
||||||
|
@ -44,6 +52,58 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 应用系统临床数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput> ApplySystemClinical(ApplySystemClinicalInDto inDto)
|
||||||
|
{
|
||||||
|
if (_systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId && x.IsCheckDate).Count() != 1)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["ClinicalDataSet_Apply"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
await _clinicalDataSystemSetRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.SystemClinicalId, x => new ClinicalDataSystemSet()
|
||||||
|
{
|
||||||
|
IsApply = true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
await _clinicalDataSystemSetRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 应用项目临床数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="BusinessValidationFailedException"></exception>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput> ApplyTrialClinical(ApplyTrialClinicalInDto inDto)
|
||||||
|
{
|
||||||
|
if (_trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId && x.IsCheckDate).Count() != 1)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["ClinicalDataSet_Apply"]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
await _clinicalDataTrialSetRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.TrialClinicalId, x => new ClinicalDataTrialSet()
|
||||||
|
{
|
||||||
|
IsApply = true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
await _clinicalDataTrialSetRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
return ResponseOutput.Ok(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 系统
|
#region 系统
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -54,7 +114,10 @@ namespace IRaCIS.Application.Services
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateClinicalDataSystemSet(ClinicalDataSystemSetAddOrEdit indto)
|
public async Task<IResponseOutput> AddOrUpdateClinicalDataSystemSet(ClinicalDataSystemSetAddOrEdit indto)
|
||||||
{
|
{
|
||||||
|
if (indto.ClinicalUploadType == ClinicalUploadType.Table || indto.ClinicalUploadType == ClinicalUploadType.PDF)
|
||||||
|
{
|
||||||
|
indto.IsApply = true;
|
||||||
|
}
|
||||||
var dictionary = await _dictionaryRepository.Where(x => x.Parent.Code == "ClinicalDataType" && x.Code == indto.ClinicalDataSetEnum.ToString()).FirstNotNullAsync();
|
var dictionary = await _dictionaryRepository.Where(x => x.Parent.Code == "ClinicalDataType" && x.Code == indto.ClinicalDataSetEnum.ToString()).FirstNotNullAsync();
|
||||||
indto.ClinicalDataSetName = dictionary.ValueCN;
|
indto.ClinicalDataSetName = dictionary.ValueCN;
|
||||||
indto.ClinicalDataSetEnName = dictionary.Value;
|
indto.ClinicalDataSetEnName = dictionary.Value;
|
||||||
|
@ -130,6 +193,12 @@ namespace IRaCIS.Application.Services
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateClinicalDataTrialSet(ClinicalDataTrialSetAddOrEdit indto)
|
public async Task<IResponseOutput> AddOrUpdateClinicalDataTrialSet(ClinicalDataTrialSetAddOrEdit indto)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (indto.ClinicalUploadType == ClinicalUploadType.Table || indto.ClinicalUploadType == ClinicalUploadType.PDF)
|
||||||
|
{
|
||||||
|
indto.IsApply = true;
|
||||||
|
}
|
||||||
|
|
||||||
var existsQuery = _clinicalDataTrialSetRepository
|
var existsQuery = _clinicalDataTrialSetRepository
|
||||||
.WhereIf(indto.Id != null, x => x.Id != indto.Id)
|
.WhereIf(indto.Id != null, x => x.Id != indto.Id)
|
||||||
.Where(x => (x.ClinicalDataSetName == indto.ClinicalDataSetName||x.ClinicalDataSetEnName==indto.ClinicalDataSetEnName) && x.TrialId == indto.TrialId);
|
.Where(x => (x.ClinicalDataSetName == indto.ClinicalDataSetName||x.ClinicalDataSetEnName==indto.ClinicalDataSetEnName) && x.TrialId == indto.TrialId);
|
||||||
|
|
|
@ -72,6 +72,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateTrialClinicalQuestion(TrialClinicalQuestionDto inDto)
|
public async Task<IResponseOutput> AddOrUpdateTrialClinicalQuestion(TrialClinicalQuestionDto inDto)
|
||||||
{
|
{
|
||||||
|
if (await _trialClinicalQuestionRepository.AnyAsync(x =>x.TrialClinicalId==inDto.TrialClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
|
||||||
|
}
|
||||||
|
|
||||||
var entity = await _trialClinicalQuestionRepository.InsertOrUpdateAsync(inDto, true);
|
var entity = await _trialClinicalQuestionRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
|
||||||
|
@ -149,6 +154,11 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateSystemClinicalQuestion(SystemClinicalQuestionDto inDto)
|
public async Task<IResponseOutput> AddOrUpdateSystemClinicalQuestion(SystemClinicalQuestionDto inDto)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (await _systemClinicalQuestionRepository.AnyAsync(x => x.SystemClinicalId == inDto.SystemClinicalId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
|
||||||
|
}
|
||||||
var entity = await _systemClinicalQuestionRepository.InsertOrUpdateAsync(inDto, true);
|
var entity = await _systemClinicalQuestionRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
|
||||||
|
@ -230,6 +240,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateSystemClinicalTableQuestion(SystemClinicalTableQuestionDto inDto)
|
public async Task<IResponseOutput> AddOrUpdateSystemClinicalTableQuestion(SystemClinicalTableQuestionDto inDto)
|
||||||
{
|
{
|
||||||
|
if (await _systemClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
|
||||||
|
}
|
||||||
|
|
||||||
var entity = await _systemClinicalTableQuestionRepository.InsertOrUpdateAsync(inDto, true);
|
var entity = await _systemClinicalTableQuestionRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
|
|
||||||
|
@ -281,7 +295,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateTrialClinicalTableQuestion(TrialClinicalTableQuestionDto inDto)
|
public async Task<IResponseOutput> AddOrUpdateTrialClinicalTableQuestion(TrialClinicalTableQuestionDto inDto)
|
||||||
{
|
{
|
||||||
|
if (await _trialClinicalTableQuestionRepository.AnyAsync(x => x.QuestionId == inDto.QuestionId && x.Id != inDto.Id && x.QuestionName == inDto.QuestionName))
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk(_localizer["ClinicalQuestion_Repeat"]);
|
||||||
|
}
|
||||||
var entity = await _trialClinicalTableQuestionRepository.InsertOrUpdateAsync(inDto, true);
|
var entity = await _trialClinicalTableQuestionRepository.InsertOrUpdateAsync(inDto, true);
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
|
|
@ -13,6 +13,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
{
|
{
|
||||||
public Guid? Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否应用
|
||||||
|
/// </summary>
|
||||||
|
public bool IsApply { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 名称
|
/// 名称
|
||||||
|
@ -73,10 +77,23 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
//public List<int> CriterionEnumList { get; set; }
|
//public List<int> CriterionEnumList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ApplySystemClinicalInDto
|
||||||
|
{
|
||||||
|
public Guid SystemClinicalId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ApplyTrialClinicalInDto
|
||||||
|
{
|
||||||
|
public Guid TrialClinicalId { get; set; }
|
||||||
|
}
|
||||||
public class ClinicalDataSystemSetAddOrEdit
|
public class ClinicalDataSystemSetAddOrEdit
|
||||||
{
|
{
|
||||||
public Guid? Id { get; set; }
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否应用
|
||||||
|
/// </summary>
|
||||||
|
public bool IsApply { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 枚举
|
/// 枚举
|
||||||
|
|
|
@ -88,6 +88,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// 显示类型
|
/// 显示类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show;
|
public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是检查日期
|
||||||
|
/// </summary>
|
||||||
|
public bool IsCheckDate { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -102,6 +102,11 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show;
|
public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是检查日期
|
||||||
|
/// </summary>
|
||||||
|
public bool IsCheckDate { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,11 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show;
|
public ClinicalQuestionShow ClinicalQuestionShowEnum { get; set; } = ClinicalQuestionShow.Show;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是检查日期
|
||||||
|
/// </summary>
|
||||||
|
public bool IsCheckDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义计算标记
|
/// 自定义计算标记
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue