修改一版
parent
0a77fc45b7
commit
e97538015d
|
@ -382,29 +382,18 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);
|
await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId);
|
||||||
var sv = _repository.Where<SubjectVisit>(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefault().IfNullThrowException();
|
var sv = _repository.Where<SubjectVisit>(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefault().IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
ClinicalData? clinical = await _clinicalDataRepository.Where(x => x.VisitOrReadId == subjectVisitId && x.ClinicalLevel == ClinicalLevel.Subject).FirstOrDefaultAsync();
|
|
||||||
if (clinical == null)
|
|
||||||
{
|
|
||||||
clinical = new ClinicalData()
|
|
||||||
{
|
|
||||||
ClinicalLevel = ClinicalLevel.Subject,
|
|
||||||
SubjectId = sv.SubjectId,
|
|
||||||
DataType = ClinicalDataType.MedicalHistory,
|
|
||||||
TrialId = sv.TrialId,
|
|
||||||
UploadType = ClinicalUploadType.PDF,
|
|
||||||
VisitOrReadId = subjectVisitId,
|
|
||||||
Id= NewId.NextGuid(),
|
|
||||||
};
|
|
||||||
|
|
||||||
await _clinicalDataRepository.AddAsync(clinical);
|
|
||||||
|
|
||||||
}
|
|
||||||
await FileUploadAsync(async (fileName) =>
|
await FileUploadAsync(async (fileName) =>
|
||||||
{
|
{
|
||||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetClinicalDataPath(_hostEnvironment, fileName, sv.TrialId, sv.SiteId, sv.SubjectId, subjectVisitId);
|
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetClinicalDataPath(_hostEnvironment, fileName, sv.TrialId, sv.SiteId, sv.SubjectId, subjectVisitId);
|
||||||
//插入临床pdf 路径
|
//插入临床pdf 路径
|
||||||
await _repository.AddAsync(new PreviousPDF() { ClinicalDataId= clinical.Id, SubjectVisitId = subjectVisitId, Path = relativePath, FileName = fileRealName });
|
await _repository.AddAsync(new PreviousPDF() { SubjectVisitId = subjectVisitId,
|
||||||
|
|
||||||
|
IsVisist=true,
|
||||||
|
DataType= ClinicalDataType.MedicalHistory,
|
||||||
|
UploadType=ClinicalUploadType.PDF,
|
||||||
|
SubjectId= sv.SubjectId,
|
||||||
|
TrialId=sv.TrialId,
|
||||||
|
ClinicalLevel = ClinicalLevel.Subject, Path = relativePath, FileName = fileRealName });
|
||||||
return serverFilePath;
|
return serverFilePath;
|
||||||
});
|
});
|
||||||
await _repository.SaveChangesAsync();
|
await _repository.SaveChangesAsync();
|
||||||
|
@ -417,25 +406,24 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="clinicalDataId"></param>
|
/// <param name="clinicalDataId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("ClinicalData/UploadClinicalData/{clinicalDataId:guid}")]
|
[HttpPost("ClinicalData/UploadClinicalData/{trialId:guid}/{subjectId:guid}")]
|
||||||
[DisableRequestSizeLimit]
|
[DisableRequestSizeLimit]
|
||||||
public async Task<IResponseOutput> UploadClinicalData(Guid clinicalDataId)
|
public async Task<IResponseOutput> UploadClinicalData(Guid trialId,Guid subjectId)
|
||||||
{
|
{
|
||||||
|
|
||||||
var sv = _repository.Where<ClinicalData>(t => t.Id == clinicalDataId).Select(t => new { t.TrialId, t.SubjectId }).FirstOrDefault().IfNullThrowException();
|
|
||||||
|
var filerelativePath = string.Empty;
|
||||||
await FileUploadAsync(async (fileName) =>
|
await FileUploadAsync(async (fileName) =>
|
||||||
{
|
{
|
||||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetClinicalDataPath(_hostEnvironment, fileName, sv.TrialId.Value, sv.SubjectId.Value, clinicalDataId);
|
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetClinicalDataPath(_hostEnvironment, fileName, trialId, subjectId);
|
||||||
|
filerelativePath = relativePath;
|
||||||
|
|
||||||
//插入临床pdf 路径
|
return relativePath;
|
||||||
await _repository.AddAsync(new PreviousPDF() { SubjectVisitId = clinicalDataId, ClinicalDataId= clinicalDataId, Path = relativePath, FileName = fileRealName });
|
|
||||||
|
|
||||||
return serverFilePath;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await _repository.SaveChangesAsync();
|
await _repository.SaveChangesAsync();
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok(filerelativePath);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上传非Dicom 文件 支持压缩包 多文件上传
|
/// 上传非Dicom 文件 支持压缩包 多文件上传
|
||||||
|
|
|
@ -171,7 +171,7 @@
|
||||||
<param name="subjectVisitId"></param>
|
<param name="subjectVisitId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadClinicalData(System.Guid)">
|
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadClinicalData(System.Guid,System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
上传临床数据
|
上传临床数据
|
||||||
</summary>
|
</summary>
|
||||||
|
|
|
@ -231,18 +231,18 @@ public static class FileStoreHelper
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static (string PhysicalPath, string RelativePath, string FileRealName) GetClinicalDataPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId , Guid subjectId, Guid clinicalDataId)
|
public static (string PhysicalPath, string RelativePath, string FileRealName) GetClinicalDataPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId , Guid subjectId)
|
||||||
{
|
{
|
||||||
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
|
||||||
|
|
||||||
string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), subjectId.ToString(), clinicalDataId.ToString(), StaticData.Folder.TreatmenthistoryFolder);
|
string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), subjectId.ToString(), StaticData.Folder.TreatmenthistoryFolder);
|
||||||
|
|
||||||
if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath);
|
if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath);
|
||||||
|
|
||||||
var (trustedFileNameForFileStorage, fileRealName) = FileStoreHelper.GetStoreFileName(fileName);
|
var (trustedFileNameForFileStorage, fileRealName) = FileStoreHelper.GetStoreFileName(fileName);
|
||||||
|
|
||||||
|
|
||||||
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{subjectId}/{clinicalDataId}/{StaticData.Folder.TreatmenthistoryFolder}/{trustedFileNameForFileStorage}";
|
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{subjectId}/{StaticData.Folder.TreatmenthistoryFolder}/{trustedFileNameForFileStorage}";
|
||||||
|
|
||||||
var serverFilePath = Path.Combine(uploadFolderPath, trustedFileNameForFileStorage);
|
var serverFilePath = Path.Combine(uploadFolderPath, trustedFileNameForFileStorage);
|
||||||
|
|
||||||
|
|
|
@ -512,6 +512,46 @@
|
||||||
数据
|
数据
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFInDto.TrialId">
|
||||||
|
<summary>
|
||||||
|
项目Id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFInDto.SubjectId">
|
||||||
|
<summary>
|
||||||
|
受试者ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFInDto.VisitOrReadId">
|
||||||
|
<summary>
|
||||||
|
访视或者阅片ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFQuery.TrialId">
|
||||||
|
<summary>
|
||||||
|
项目ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFQuery.PageIndex">
|
||||||
|
<summary>
|
||||||
|
页码
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFQuery.PageSize">
|
||||||
|
<summary>
|
||||||
|
每页大小
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFQuery.SortField">
|
||||||
|
<summary>
|
||||||
|
排序字段
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFQuery.SortAsc">
|
||||||
|
<summary>
|
||||||
|
排序字段
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.SetReadingPeriodSetEffect.Id">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.SetReadingPeriodSetEffect.Id">
|
||||||
<summary>
|
<summary>
|
||||||
项目ID
|
项目ID
|
||||||
|
@ -927,9 +967,69 @@
|
||||||
<member name="T:IRaCIS.Core.Application.Contracts.PreviousSurgeryQuery">
|
<member name="T:IRaCIS.Core.Application.Contracts.PreviousSurgeryQuery">
|
||||||
<summary>PreviousSurgeryQuery 列表查询参数模型</summary>
|
<summary>PreviousSurgeryQuery 列表查询参数模型</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFView.IsVisist">
|
||||||
|
<summary>
|
||||||
|
是否是访视
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFView.ClinicalLevel">
|
||||||
|
<summary>
|
||||||
|
临床级别
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFView.DataType">
|
||||||
|
<summary>
|
||||||
|
数据类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFView.UploadType">
|
||||||
|
<summary>
|
||||||
|
上传方式
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFView.TrialId">
|
||||||
|
<summary>
|
||||||
|
项目Id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFView.SubjectId">
|
||||||
|
<summary>
|
||||||
|
受试者ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:IRaCIS.Core.Application.Contracts.PreviousPDFAddOrEdit">
|
<member name="T:IRaCIS.Core.Application.Contracts.PreviousPDFAddOrEdit">
|
||||||
<summary> PreviousPDFAddOrEdit 列表查询参数模型</summary>
|
<summary> PreviousPDFAddOrEdit 列表查询参数模型</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFAddOrEdit.IsVisist">
|
||||||
|
<summary>
|
||||||
|
是否是访视
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFAddOrEdit.ClinicalLevel">
|
||||||
|
<summary>
|
||||||
|
临床级别
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFAddOrEdit.DataType">
|
||||||
|
<summary>
|
||||||
|
数据类型
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFAddOrEdit.UploadType">
|
||||||
|
<summary>
|
||||||
|
上传方式
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFAddOrEdit.TrialId">
|
||||||
|
<summary>
|
||||||
|
项目Id
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Contracts.PreviousPDFAddOrEdit.SubjectId">
|
||||||
|
<summary>
|
||||||
|
受试者ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Contracts.DTO.GetConsistencyCheckFileDto.FileName">
|
<member name="P:IRaCIS.Core.Application.Contracts.DTO.GetConsistencyCheckFileDto.FileName">
|
||||||
<summary>
|
<summary>
|
||||||
文件名称
|
文件名称
|
||||||
|
@ -2577,37 +2677,30 @@
|
||||||
<param name="password"></param>
|
<param name="password"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:IRaCIS.Application.Services.ClinicalDataService">
|
<member name="T:IRaCIS.Application.Services.PreviousPDFService">
|
||||||
<summary>
|
<summary>
|
||||||
临床数据
|
临床数据 原表
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ClinicalDataService.AddOrUpdateClinicalDataService(IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataAddOrEdit)">
|
<member name="M:IRaCIS.Application.Services.PreviousPDFService.AddOrUpdatePreviousPDFService(IRaCIS.Core.Application.Contracts.PreviousPDFAddOrEdit)">
|
||||||
<summary>
|
<summary>
|
||||||
新增或者修改
|
新增或者修改
|
||||||
</summary>
|
</summary>
|
||||||
<param name="addOrEditClinicalData"></param>
|
<param name="addOrEditPreviousPDF"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ClinicalDataService.GetClinicalDataList(IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataQuery)">
|
<member name="M:IRaCIS.Application.Services.PreviousPDFService.PreviousPDFView(IRaCIS.Core.Application.Service.Reading.Dto.PreviousPDFInDto)">
|
||||||
<summary>
|
|
||||||
分页获取
|
|
||||||
</summary>
|
|
||||||
<param name="query"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:IRaCIS.Application.Services.ClinicalDataService.ClinicalDataView(IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataInDto)">
|
|
||||||
<summary>
|
<summary>
|
||||||
获取
|
获取
|
||||||
</summary>
|
</summary>
|
||||||
<param name="query"></param>
|
<param name="query"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Application.Services.ClinicalDataService.DeleteClinicalData(System.Guid)">
|
<member name="M:IRaCIS.Application.Services.PreviousPDFService.DeletePreviousPDF(System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
删除
|
删除
|
||||||
</summary>
|
</summary>
|
||||||
<param name="clinicalDataId"></param>
|
<param name="PreviousPDFId"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:IRaCIS.Application.Services.ReadingPeriodSetService">
|
<member name="T:IRaCIS.Application.Services.ReadingPeriodSetService">
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
// 生成时间 2021-11-22 11:27:53
|
// 生成时间 2021-11-22 11:27:53
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
using IRaCIS.Core.Domain.Share.Reading;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Contracts
|
namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
/// <summary> PreviousSurgeryView 列表视图模型 </summary>
|
/// <summary> PreviousSurgeryView 列表视图模型 </summary>
|
||||||
|
@ -54,6 +56,37 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
public string FullFilePath { get; set; } = string.Empty;
|
public string FullFilePath { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是访视
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsVisist { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 临床级别
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalLevel? ClinicalLevel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据类型
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalDataType? DataType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传方式
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalUploadType? UploadType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 受试者ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid? SubjectId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,6 +98,36 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public Guid SubjectVisitId { get; set; }
|
public Guid SubjectVisitId { get; set; }
|
||||||
public string Path { get; set; } = string.Empty;
|
public string Path { get; set; } = string.Empty;
|
||||||
public string FileName { get; set; } = string.Empty;
|
public string FileName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是访视
|
||||||
|
/// </summary>
|
||||||
|
public bool? IsVisist { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 临床级别
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalLevel? ClinicalLevel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据类型
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalDataType? DataType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传方式
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalUploadType? UploadType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 受试者ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid? SubjectId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,94 +1,107 @@
|
||||||
using IRaCIS.Application.Interfaces;
|
//using IRaCIS.Application.Interfaces;
|
||||||
using IRaCIS.Core.Infra.EFCore;
|
//using IRaCIS.Core.Infra.EFCore;
|
||||||
using IRaCIS.Core.Domain.Share;
|
//using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Application.Filter;
|
//using IRaCIS.Core.Application.Filter;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
//using Microsoft.AspNetCore.Mvc;
|
||||||
using IRaCIS.Core.Application.Service.WorkLoad.DTO;
|
//using IRaCIS.Core.Application.Service.WorkLoad.DTO;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
//using Microsoft.AspNetCore.Authorization;
|
||||||
using IRaCIS.Core.Application.Auth;
|
//using IRaCIS.Core.Application.Auth;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
//using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Domain.Share.Reading;
|
//using IRaCIS.Core.Domain.Share.Reading;
|
||||||
|
|
||||||
namespace IRaCIS.Application.Services
|
//namespace IRaCIS.Application.Services
|
||||||
{
|
//{
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
/// 临床数据
|
// /// 临床数据
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "Reading")]
|
// [ApiExplorerSettings(GroupName = "Reading")]
|
||||||
public class ClinicalDataService : BaseService
|
// public class ClinicalDataService : BaseService
|
||||||
{
|
// {
|
||||||
|
|
||||||
public IRepository<SubjectVisit> _subjectVisitRepository;
|
// public IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
private readonly IRepository<ClinicalData> _clinicalDataRepository;
|
// private readonly IRepository<ClinicalData> _clinicalDataRepository;
|
||||||
public ClinicalDataService(IRepository<SubjectVisit> subjectVisitRepository,
|
// private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||||
IRepository<ClinicalData> clinicalDataRepository
|
|
||||||
)
|
// public ClinicalDataService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
{
|
// IRepository<ClinicalData> clinicalDataRepository,
|
||||||
_subjectVisitRepository = subjectVisitRepository;
|
// IRepository<PreviousPDF> previousPDFRepository
|
||||||
_clinicalDataRepository = clinicalDataRepository;
|
// )
|
||||||
}
|
// {
|
||||||
|
// _subjectVisitRepository = subjectVisitRepository;
|
||||||
|
// _clinicalDataRepository = clinicalDataRepository;
|
||||||
|
// this._previousPDFRepository = previousPDFRepository;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
/// 新增或者修改
|
// /// 新增或者修改
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
/// <param name="addOrEditClinicalData"></param>
|
// /// <param name="addOrEditClinicalData"></param>
|
||||||
/// <returns></returns>
|
// /// <returns></returns>
|
||||||
[HttpPost]
|
// [HttpPost]
|
||||||
public async Task<IResponseOutput> AddOrUpdateClinicalDataService(ClinicalDataAddOrEdit addOrEditClinicalData)
|
// public async Task<IResponseOutput> AddOrUpdateClinicalDataService(ClinicalDataAddOrEdit addOrEditClinicalData)
|
||||||
{
|
// {
|
||||||
var entity = await _repository.InsertOrUpdateAsync<ClinicalData, ClinicalDataAddOrEdit>(addOrEditClinicalData, true);
|
// var entity = await _repository.InsertOrUpdateAsync<ClinicalData, ClinicalDataAddOrEdit>(addOrEditClinicalData, true);
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
// return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
}
|
// }
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
/// 分页获取
|
// /// 分页获取
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
/// <param name="query"></param>
|
// /// <param name="query"></param>
|
||||||
/// <returns></returns>
|
// /// <returns></returns>
|
||||||
[HttpPost]
|
// [HttpPost]
|
||||||
public async Task<PageOutput<ClinicalDataView>> GetClinicalDataList(ClinicalDataQuery query)
|
// public async Task<PageOutput<ClinicalDataView>> GetClinicalDataList(ClinicalDataQuery query)
|
||||||
{
|
// {
|
||||||
|
|
||||||
var readquery = _clinicalDataRepository.AsQueryable()
|
// var readquery = _clinicalDataRepository.AsQueryable()
|
||||||
.WhereIf(query.TrialId!=null,x=>x.TrialId==query.TrialId)
|
// .WhereIf(query.TrialId!=null,x=>x.TrialId==query.TrialId)
|
||||||
|
// .ProjectTo<ClinicalDataView>(_mapper.ConfigurationProvider);
|
||||||
|
// var pageList= await readquery.ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField == null ? "CreateTime" : query.SortField,
|
||||||
|
// query.SortAsc);
|
||||||
|
|
||||||
.ProjectTo<ClinicalDataView>(_mapper.ConfigurationProvider);
|
// return pageList;
|
||||||
var pageList= await readquery.ToPagedListAsync(query.PageIndex, query.PageSize, query.SortField == null ? "CreateTime" : query.SortField,
|
// }
|
||||||
query.SortAsc);
|
|
||||||
|
|
||||||
return pageList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取
|
// /// <summary>
|
||||||
/// </summary>
|
// /// 获取
|
||||||
/// <param name="query"></param>
|
// /// </summary>
|
||||||
/// <returns></returns>
|
// /// <param name="query"></param>
|
||||||
[HttpPost]
|
// /// <returns></returns>
|
||||||
public async Task<List<ClinicalDataView>> ClinicalDataView(ClinicalDataInDto inDto)
|
// [HttpPost]
|
||||||
{
|
// public async Task<dynamic> ClinicalDataView(ClinicalDataInDto inDto)
|
||||||
var list= await _clinicalDataRepository.AsQueryable().Where(x => x.TrialId == inDto.TrialId)
|
// {
|
||||||
.Where(x => (x.ClinicalLevel == ClinicalLevel.Subject && x.SubjectId == inDto.SubjectId) || x.VisitOrReadId == inDto.VisitOrReadId)
|
// var list= await _previousPDFRepository.AsQueryable().Where(x => x.TrialId == inDto.TrialId)
|
||||||
.ProjectTo<ClinicalDataView>(_mapper.ConfigurationProvider)
|
// .Where(x => (x.ClinicalLevel == ClinicalLevel.Subject && x.SubjectId == inDto.SubjectId) || x.SubjectVisitId == inDto.VisitOrReadId)
|
||||||
.ToListAsync();
|
// .Select(x=>new {
|
||||||
return list;
|
// x.Path,
|
||||||
}
|
// x.DataType,
|
||||||
|
// x.CreateTime,
|
||||||
|
// x.ClinicalLevel,
|
||||||
|
// x.FileName,
|
||||||
|
// x.UploadType,
|
||||||
|
// x.Id,
|
||||||
|
// })
|
||||||
|
// .ToListAsync();
|
||||||
|
// return list;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
/// 删除
|
// /// 删除
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
/// <param name="clinicalDataId"></param>
|
// /// <param name="clinicalDataId"></param>
|
||||||
/// <returns></returns>
|
// /// <returns></returns>
|
||||||
[HttpDelete("{ClinicalDataId:guid}")]
|
// [HttpDelete("{ClinicalDataId:guid}")]
|
||||||
public async Task<IResponseOutput> DeleteClinicalData(Guid clinicalDataId)
|
// public async Task<IResponseOutput> DeleteClinicalData(Guid clinicalDataId)
|
||||||
{
|
// {
|
||||||
var success = await _repository.BatchDeleteAsync<ClinicalData>(t => t.Id == clinicalDataId);
|
// var success = await _repository.BatchDeleteAsync<ClinicalData>(t => t.Id == clinicalDataId);
|
||||||
return ResponseOutput.Result(success);
|
// return ResponseOutput.Result(success);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
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 PreviousPDFInDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 项目Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 受试者ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid SubjectId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 访视或者阅片ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid VisitOrReadId { get; set; }
|
||||||
|
}
|
||||||
|
public class PreviousPDFQuery
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 项目ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 页码
|
||||||
|
/// </summary>
|
||||||
|
public int PageIndex { get; set; } = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 每页大小
|
||||||
|
/// </summary>
|
||||||
|
public int PageSize { get; set; } = 10;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 排序字段
|
||||||
|
/// </summary>
|
||||||
|
public string? SortField { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 排序字段
|
||||||
|
/// </summary>
|
||||||
|
public bool SortAsc { get; set; } = true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
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 IRaCIS.Core.Application.Contracts;
|
||||||
|
|
||||||
|
namespace IRaCIS.Application.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 临床数据 原表
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(GroupName = "Reading")]
|
||||||
|
public class PreviousPDFService : BaseService
|
||||||
|
{
|
||||||
|
|
||||||
|
public IRepository<SubjectVisit> _subjectVisitRepository;
|
||||||
|
private readonly IRepository<PreviousPDF> _previousPDFRepository;
|
||||||
|
|
||||||
|
public PreviousPDFService(IRepository<SubjectVisit> subjectVisitRepository,
|
||||||
|
IRepository<PreviousPDF> PreviousPDFRepository
|
||||||
|
)
|
||||||
|
{
|
||||||
|
_subjectVisitRepository = subjectVisitRepository;
|
||||||
|
_previousPDFRepository = PreviousPDFRepository;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 新增或者修改
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="addOrEditPreviousPDF"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<IResponseOutput> AddOrUpdatePreviousPDFService(PreviousPDFAddOrEdit addOrEditPreviousPDF)
|
||||||
|
{
|
||||||
|
var entity = await _repository.InsertOrUpdateAsync<PreviousPDF, PreviousPDFAddOrEdit>(addOrEditPreviousPDF, true);
|
||||||
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="query"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<dynamic> PreviousPDFView(PreviousPDFInDto inDto)
|
||||||
|
{
|
||||||
|
var list= await _previousPDFRepository.AsQueryable().Where(x => x.TrialId == inDto.TrialId)
|
||||||
|
.Where(x => (x.ClinicalLevel == ClinicalLevel.Subject && x.SubjectId == inDto.SubjectId) || x.SubjectVisitId == inDto.VisitOrReadId)
|
||||||
|
.Select(x=>new {
|
||||||
|
x.Path,
|
||||||
|
x.DataType,
|
||||||
|
x.CreateTime,
|
||||||
|
x.ClinicalLevel,
|
||||||
|
x.FileName,
|
||||||
|
x.UploadType,
|
||||||
|
x.Id,
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 删除
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PreviousPDFId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpDelete("{previousPDFId:guid}")]
|
||||||
|
public async Task<IResponseOutput> DeletePreviousPDF(Guid previousPDFId)
|
||||||
|
{
|
||||||
|
var success = await _repository.BatchDeleteAsync<PreviousPDF>(t => t.Id == previousPDFId);
|
||||||
|
return ResponseOutput.Result(success);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using IRaCIS.Application.Contracts;
|
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
public class ReadingConfig : Profile
|
public class ReadingConfig : Profile
|
||||||
|
@ -19,6 +19,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<ClinicalData, ClinicalDataView>();
|
CreateMap<ClinicalData, ClinicalDataView>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CreateMap<PreviousPDF, PreviousPDFAddOrEdit>().ReverseMap();
|
||||||
|
|
||||||
|
CreateMap<PreviousPDF, PreviousPDFView>();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,11 +60,6 @@ namespace IRaCIS.Core.Domain.Share.Reading
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum ReadingPeriodStatus
|
public enum ReadingPeriodStatus
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 无
|
|
||||||
/// </summary>
|
|
||||||
None = 0,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 已生效
|
/// 已生效
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||||
// 生成时间 2021-12-09 11:35:31
|
// 生成时间 2021-12-09 11:35:31
|
||||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||||
|
using IRaCIS.Core.Domain.Share.Reading;
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
@ -47,10 +48,36 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
[Required]
|
[Required]
|
||||||
public Guid CreateUserId { get; set; }
|
public Guid CreateUserId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 临床数据ID
|
/// 是否是访视
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? ClinicalDataId { get; set; }
|
public bool? IsVisist { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 临床级别
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalLevel? ClinicalLevel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据类型
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalDataType? DataType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传方式
|
||||||
|
/// </summary>
|
||||||
|
public ClinicalUploadType? UploadType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid? TrialId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 受试者ID
|
||||||
|
/// </summary>
|
||||||
|
public Guid? SubjectId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue