修改一版
parent
404dc13001
commit
3dff501386
|
@ -445,6 +445,61 @@
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetAddOrEdit.TrialId">
|
||||||
|
<summary>
|
||||||
|
项目ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetAddOrEdit.ClinicalDataSetName">
|
||||||
|
<summary>
|
||||||
|
名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetAddOrEdit.ClinicalDataLevel">
|
||||||
|
<summary>
|
||||||
|
临床级别
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetAddOrEdit.ClinicalUploadType">
|
||||||
|
<summary>
|
||||||
|
上传方式
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetView.TrialId">
|
||||||
|
<summary>
|
||||||
|
项目ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetView.ClinicalDataSetName">
|
||||||
|
<summary>
|
||||||
|
名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetView.ClinicalDataLevel">
|
||||||
|
<summary>
|
||||||
|
临床级别
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetView.ClinicalUploadType">
|
||||||
|
<summary>
|
||||||
|
上传方式
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetView.SystemClinicalDataSetId">
|
||||||
|
<summary>
|
||||||
|
系统的ClinicalDataSetId
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetView.CreateTime">
|
||||||
|
<summary>
|
||||||
|
创建时间
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetView.CreateUserId">
|
||||||
|
<summary>
|
||||||
|
创建人
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataInDto.TrialId">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataInDto.TrialId">
|
||||||
<summary>
|
<summary>
|
||||||
项目Id
|
项目Id
|
||||||
|
@ -465,24 +520,9 @@
|
||||||
项目ID
|
项目ID
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataQuery.PageIndex">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataQuery.ClinicalDataSetName">
|
||||||
<summary>
|
<summary>
|
||||||
页码
|
名称
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataQuery.PageSize">
|
|
||||||
<summary>
|
|
||||||
每页大小
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataQuery.SortField">
|
|
||||||
<summary>
|
|
||||||
排序字段
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataQuery.SortAsc">
|
|
||||||
<summary>
|
|
||||||
排序字段
|
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetReadModuleDto.TrialSiteCode">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.GetReadModuleDto.TrialSiteCode">
|
||||||
|
@ -3149,6 +3189,39 @@
|
||||||
<param name="password"></param>
|
<param name="password"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:IRaCIS.Application.Services.ClinicalDataSetService">
|
||||||
|
<summary>
|
||||||
|
临床数据配置
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ClinicalDataSetService.AddOrUpdateClinicalDataSet(IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataSetAddOrEdit)">
|
||||||
|
<summary>
|
||||||
|
新增或者修改
|
||||||
|
</summary>
|
||||||
|
<param name="indto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ClinicalDataSetService.GetClinicalDataSetList(IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataQuery)">
|
||||||
|
<summary>
|
||||||
|
分页获取
|
||||||
|
</summary>
|
||||||
|
<param name="query"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ClinicalDataSetService.AddTrialClinicalDataSet(IRaCIS.Core.Application.Service.Reading.Dto.AddTrialClinicalDataSetInDto)">
|
||||||
|
<summary>
|
||||||
|
将系统配置添加到项目配置
|
||||||
|
</summary>
|
||||||
|
<param name="inDto"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="M:IRaCIS.Application.Services.ClinicalDataSetService.DeleteClinicalSetData(System.Guid)">
|
||||||
|
<summary>
|
||||||
|
删除
|
||||||
|
</summary>
|
||||||
|
<param name="clinicalDataId"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:IRaCIS.Application.Services.PreviousPDFService">
|
<member name="T:IRaCIS.Application.Services.PreviousPDFService">
|
||||||
<summary>
|
<summary>
|
||||||
临床数据 原表
|
临床数据 原表
|
||||||
|
|
|
@ -0,0 +1,111 @@
|
||||||
|
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
|
||||||
|
{
|
||||||
|
|
||||||
|
public IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
|
private readonly IRepository<ClinicalData> _clinicalDataRepository;
|
||||||
|
private readonly IRepository<ClinicalDataSet> _clinicalDataSetRepository;
|
||||||
|
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||||
|
|
||||||
|
public ClinicalDataSetService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
|
IRepository<ClinicalData> clinicalDataRepository,
|
||||||
|
IRepository<ClinicalDataSet> ClinicalDataSetRepository,
|
||||||
|
IRepository<PreviousPDF> previousPDFRepository
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_subjectVisitRepository = subjectVisitRepository;
|
||||||
|
_clinicalDataRepository = clinicalDataRepository;
|
||||||
|
_clinicalDataSetRepository = ClinicalDataSetRepository;
|
||||||
|
this._previousPDFRepository = previousPDFRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 新增或者修改
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="indto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput> AddOrUpdateClinicalDataSet(ClinicalDataSetAddOrEdit indto)
|
||||||
|
{
|
||||||
|
var entity = await _clinicalDataSetRepository.InsertOrUpdateAsync(indto,true);
|
||||||
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页获取
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<PageOutput<ClinicalDataSetView>> GetClinicalDataSetList(ClinicalDataQuery query)
|
||||||
|
{
|
||||||
|
var readquery = _clinicalDataSetRepository.AsQueryable()
|
||||||
|
.Where( x => x.TrialId == query.TrialId)
|
||||||
|
.WhereIf(query.ClinicalDataSetName!=string.Empty,x=>x.ClinicalDataSetName.Contains(query.ClinicalDataSetName))
|
||||||
|
.ProjectTo<ClinicalDataSetView>(_mapper.ConfigurationProvider);
|
||||||
|
var pageList = await readquery.ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField == null ? "CreateTime" : query.SortField,
|
||||||
|
query.Asc);
|
||||||
|
|
||||||
|
return pageList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 将系统配置添加到项目配置
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inDto"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput> AddTrialClinicalDataSet(AddTrialClinicalDataSetInDto inDto)
|
||||||
|
{
|
||||||
|
var trialSystemIds =await _clinicalDataSetRepository.Where(x => x.TrialId == inDto.TrialId && x.SystemClinicalDataSetId != null).Select(x => x.SystemClinicalDataSetId.Value).ToListAsync();
|
||||||
|
var needAddids = inDto.Ids.Except(trialSystemIds).ToList();
|
||||||
|
var systemDataList =await _clinicalDataSetRepository.Where(x => needAddids.Contains(x.Id)).ToListAsync();
|
||||||
|
List<ClinicalDataSet> dataSets = systemDataList.Select(x => new ClinicalDataSet()
|
||||||
|
{
|
||||||
|
Id= NewId.NextGuid(),
|
||||||
|
SystemClinicalDataSetId=x.Id,
|
||||||
|
ClinicalDataSetName=x.ClinicalDataSetName,
|
||||||
|
ClinicalDataLevel=x.ClinicalDataLevel,
|
||||||
|
ClinicalUploadType=x.ClinicalUploadType,
|
||||||
|
TrialId=inDto.TrialId,
|
||||||
|
}).ToList();
|
||||||
|
await _clinicalDataSetRepository.AddRangeAsync(dataSets);
|
||||||
|
var result= await _clinicalDataSetRepository.SaveChangesAsync();
|
||||||
|
return ResponseOutput.Ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="clinicalDataId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpDelete("{id:guid}")]
|
||||||
|
public async Task<IResponseOutput> DeleteClinicalSetData(Guid id)
|
||||||
|
{
|
||||||
|
await _clinicalDataSetRepository.DeleteFromQueryAsync(x=>x.Id== id,true);
|
||||||
|
return ResponseOutput.Result(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using IRaCIS.Core.Domain.Share.Reading;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -13,11 +14,81 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class ClinicalDataSetAddOrEdit
|
||||||
|
{
|
||||||
|
public Guid? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string ClinicalDataSetName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 临床级别
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalLevel ClinicalDataLevel { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传方式
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalUploadType ClinicalUploadType { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class ClinicalDataView : ClinicalData
|
public class ClinicalDataView : ClinicalData
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ClinicalDataSetView
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string ClinicalDataSetName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 临床级别
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalLevel ClinicalDataLevel { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传方式
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalUploadType ClinicalUploadType { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 系统的ClinicalDataSetId
|
||||||
|
/// </summary>
|
||||||
|
public Guid? SystemClinicalDataSetId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人
|
||||||
|
/// </summary>
|
||||||
|
public Guid CreateUserId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class ClinicalDataInDto
|
public class ClinicalDataInDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -35,34 +106,24 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid VisitOrReadId { get; set; }
|
public Guid VisitOrReadId { get; set; }
|
||||||
}
|
}
|
||||||
public class ClinicalDataQuery
|
public class ClinicalDataQuery:PageInput
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 项目ID
|
/// 项目ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? TrialId { get; set; }
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 页码
|
/// 名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int PageIndex { get; set; } = 1;
|
public string ClinicalDataSetName { get; set; }=string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
}
|
||||||
/// 每页大小
|
|
||||||
/// </summary>
|
|
||||||
public int PageSize { get; set; } = 10;
|
|
||||||
|
|
||||||
|
public class AddTrialClinicalDataSetInDto
|
||||||
|
{
|
||||||
|
public List<Guid> Ids { get; set; } = new List<Guid>();
|
||||||
|
|
||||||
/// <summary>
|
public Guid TrialId { get; set; }
|
||||||
/// 排序字段
|
|
||||||
/// </summary>
|
|
||||||
public string? SortField { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序字段
|
|
||||||
/// </summary>
|
|
||||||
public bool SortAsc { get; set; } = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<ClinicalData, ClinicalDataAddOrEdit>().ReverseMap();
|
CreateMap<ClinicalData, ClinicalDataAddOrEdit>().ReverseMap();
|
||||||
|
|
||||||
|
CreateMap<ClinicalDataSet, ClinicalDataSetAddOrEdit>().ReverseMap();
|
||||||
|
|
||||||
CreateMap<ClinicalData, ClinicalDataView>();
|
CreateMap<ClinicalData, ClinicalDataView>();
|
||||||
|
|
||||||
|
CreateMap<ClinicalDataSet, ClinicalDataSetView>();
|
||||||
|
|
||||||
CreateMap<PreviousPDF, PreviousPDFAddOrEdit>().ReverseMap();
|
CreateMap<PreviousPDF, PreviousPDFAddOrEdit>().ReverseMap();
|
||||||
|
|
||||||
CreateMap<PreviousPDF, PreviousPDFView>();
|
CreateMap<PreviousPDF, PreviousPDFView>();
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using IRaCIS.Core.Domain.Share.Reading;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Domain.Models
|
||||||
|
{
|
||||||
|
///<summary>
|
||||||
|
/// 临床资料配置
|
||||||
|
///</summary>
|
||||||
|
[Table("ClinicalDataSet")]
|
||||||
|
public class ClinicalDataSet : Entity, IAuditAdd
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string ClinicalDataSetName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 临床级别
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalLevel ClinicalDataLevel { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传方式
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalUploadType ClinicalUploadType { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 系统的ClinicalDataSetId
|
||||||
|
/// </summary>
|
||||||
|
public Guid? SystemClinicalDataSetId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人
|
||||||
|
/// </summary>
|
||||||
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -183,6 +183,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
public virtual DbSet<ReadModule> ReadModule { get; set; }
|
public virtual DbSet<ReadModule> ReadModule { get; set; }
|
||||||
public virtual DbSet<ReadModuleView> ReadModuleView { get; set; }
|
public virtual DbSet<ReadModuleView> ReadModuleView { get; set; }
|
||||||
|
|
||||||
|
public virtual DbSet<ClinicalDataSet> ClinicalDataSet { get; set; }
|
||||||
public virtual DbSet<ClinicalData> ClinicalData { get; set; }
|
public virtual DbSet<ClinicalData> ClinicalData { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue