修改一版
This commit is contained in:
@@ -16,7 +16,7 @@ namespace IRaCIS.Application.Services
|
||||
/// 临床数据配置
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Reading")]
|
||||
public class ClinicalDataSetService : BaseService
|
||||
public class ReadingClinicalDataService : BaseService
|
||||
{
|
||||
|
||||
public IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
@@ -25,7 +25,7 @@ namespace IRaCIS.Application.Services
|
||||
private readonly IRepository<ClinicalDataSystemSet> _clinicalDataSystemSetRepository;
|
||||
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||
|
||||
public ClinicalDataSetService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||
public ReadingClinicalDataService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||
|
||||
IRepository<ClinicalDataTrialSet> ClinicalDataTrialSetRepository,
|
||||
IRepository<ClinicalDataSystemSet> ClinicalDataSystemSetRepository,
|
||||
@@ -79,6 +79,7 @@ namespace IRaCIS.Application.Services
|
||||
.ProjectTo<ClinicalDataSystemSetView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目的临床数据
|
||||
/// </summary>
|
||||
|
||||
@@ -89,9 +89,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
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 AddOrUpdateReadingClinicalDataDto
|
||||
{
|
||||
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 对象ID
|
||||
/// </summary>
|
||||
public Guid objectId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 临床数据类型Id
|
||||
/// </summary>
|
||||
public Guid ClinicalDataTrialSetId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 临床数据类型Id
|
||||
/// </summary>
|
||||
public bool IsVisit { get; set; }
|
||||
}
|
||||
|
||||
public class GetTrialClinicalData
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using IRaCIS.Core.Application.Service.WorkLoad.DTO;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Domain.Share.Reading;
|
||||
using MassTransit;
|
||||
|
||||
namespace IRaCIS.Application.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 临床数据配置
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Reading")]
|
||||
public class ClinicalDataSetService : BaseService
|
||||
{
|
||||
private readonly IRepository<ReadingClinicalData> _readingClinicalDataRepository;
|
||||
|
||||
public ClinicalDataSetService(IRepository<ReadingClinicalData> readingClinicalDataRepository
|
||||
)
|
||||
{
|
||||
this._readingClinicalDataRepository = readingClinicalDataRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新增或者修改
|
||||
/// </summary>
|
||||
/// <param name="indto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput> AddOrUpdateReadingClinicalData(AddOrUpdateReadingClinicalDataDto indto)
|
||||
{
|
||||
var entity = await _readingClinicalDataRepository.InsertOrUpdateAsync(indto,true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
|
||||
|
||||
//public async Task<List<>> GetTrialClinicalData()
|
||||
|
||||
///// <summary>
|
||||
///// 获取系统临床数据(系统)
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//[HttpPost]
|
||||
//public async Task<List<ClinicalDataSystemSetView>> GetSystemClinicalDataSystemSetList(GetTrialClinicalDataSystemIndto inDto)
|
||||
//{
|
||||
// return await _clinicalDataSystemSetRepository.AsQueryable()
|
||||
// .WhereIf(inDto.ClinicalDataLevel != null, x => x.ClinicalDataLevel == inDto.ClinicalDataLevel)
|
||||
// .WhereIf(inDto.ClinicalUploadType != null, x => x.ClinicalUploadType == inDto.ClinicalUploadType)
|
||||
// .WhereIf(inDto.ClinicalDataSetName != String.Empty, x => x.ClinicalDataSetName.Contains(inDto.ClinicalDataSetName))
|
||||
|
||||
// .ProjectTo<ClinicalDataSystemSetView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
//}
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 获取项目的临床数据
|
||||
///// </summary>
|
||||
///// <param name="inDto"></param>
|
||||
///// <returns></returns>
|
||||
//[HttpPost]
|
||||
//public async Task<List<ClinicalDataTrialSetView>> GetTrialClinicalDataTrialSetList(GetTrialClinicalDataTrialIndto inDto)
|
||||
//{
|
||||
// await this.AddTrialClinicalDataTrialSet(inDto.TrialId);
|
||||
// return await _clinicalDataTrialSetRepository.AsQueryable()
|
||||
|
||||
// .Where(x => x.TrialId == inDto.TrialId)
|
||||
// .WhereIf(inDto.ClinicalDataLevel!=null,x=>x.ClinicalDataLevel== inDto.ClinicalDataLevel)
|
||||
// .WhereIf(inDto.ClinicalUploadType != null, x => x.ClinicalUploadType == inDto.ClinicalUploadType)
|
||||
// .WhereIf(inDto.ClinicalDataSetName != String.Empty, x => x.ClinicalDataSetName.Contains(inDto.ClinicalDataSetName))
|
||||
// .ProjectTo<ClinicalDataTrialSetView>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 将系统配置添加到项目配置
|
||||
///// </summary>
|
||||
///// <param name="trialId"></param>
|
||||
///// <returns></returns>
|
||||
|
||||
//private async Task<IResponseOutput> AddTrialClinicalDataTrialSet(Guid trialId)
|
||||
//{
|
||||
// var systemIds = await _clinicalDataSystemSetRepository.Select(x => x.Id).ToListAsync();
|
||||
// var trialSystemIds =await _clinicalDataTrialSetRepository.Where(x => x.TrialId == trialId && x.SystemClinicalDataSetId != null).Select(x => x.SystemClinicalDataSetId.Value).ToListAsync();
|
||||
// var needAddids = systemIds.Except(trialSystemIds).ToList();
|
||||
// var systemDataList =await _clinicalDataSystemSetRepository.Where(x => needAddids.Contains(x.Id)).ToListAsync();
|
||||
// List<ClinicalDataTrialSet> dataSets = systemDataList.Select(x => new ClinicalDataTrialSet()
|
||||
// {
|
||||
// Id= NewId.NextGuid(),
|
||||
// SystemClinicalDataSetId=x.Id,
|
||||
// ClinicalDataSetName=x.ClinicalDataSetName,
|
||||
// ClinicalDataLevel=x.ClinicalDataLevel,
|
||||
// ClinicalUploadType=x.ClinicalUploadType,
|
||||
// TrialId= trialId,
|
||||
|
||||
// }).ToList();
|
||||
// await _clinicalDataTrialSetRepository.AddRangeAsync(dataSets);
|
||||
// var result= await _clinicalDataTrialSetRepository.SaveChangesAsync();
|
||||
// return ResponseOutput.Ok(result);
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 删除(项目)
|
||||
///// </summary>
|
||||
///// <param name="id"></param>
|
||||
///// <returns></returns>
|
||||
//[HttpDelete("{id:guid}")]
|
||||
//public async Task<IResponseOutput> DeleteClinicalTrialSetData(Guid id)
|
||||
//{
|
||||
// await _clinicalDataTrialSetRepository.DeleteFromQueryAsync(x=>x.Id== id,true);
|
||||
// return ResponseOutput.Result(true);
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 删除(系统)
|
||||
///// </summary>
|
||||
///// <param name="id"></param>
|
||||
///// <returns></returns>
|
||||
//[HttpDelete("{id:guid}")]
|
||||
//public async Task<IResponseOutput> DeleteClinicalSystemSetData(Guid id)
|
||||
//{
|
||||
// await _clinicalDataSystemSetRepository.DeleteFromQueryAsync(x => x.Id == id, true);
|
||||
// return ResponseOutput.Result(true);
|
||||
//}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user