修改
This commit is contained in:
@@ -362,9 +362,6 @@ namespace IRaCIS.Core.API.Controllers
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 上传临床数据 多文件
|
||||
/// </summary>
|
||||
@@ -397,48 +394,29 @@ namespace IRaCIS.Core.API.Controllers
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 上传临床数据(废弃)
|
||||
/// 上传阅片临床数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="isVisit"></param>
|
||||
/// <param name="readingClinicalDataId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("ClinicalData/UploadClinicalData/{trialId:guid}/{id:guid}/{isVisit:bool}")]
|
||||
[HttpPost("ClinicalData/UploadClinicalData/{trialId:guid}/{readingClinicalDataId:guid}")]
|
||||
[DisableRequestSizeLimit]
|
||||
public async Task<IResponseOutput> UploadClinicalData(Guid id, bool isVisit)
|
||||
public async Task<IResponseOutput> UploadReadClinicalData(Guid readingClinicalDataId)
|
||||
{
|
||||
var filerelativePath = string.Empty;
|
||||
if (isVisit)
|
||||
|
||||
// 写法一致 使用 _repository
|
||||
var clinicalData = (await _repository.Where<ReadingClinicalData>(x => x.Id == readingClinicalDataId).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
var siteid =await _repository.Where<Subject>(x => x.Id == clinicalData.SubjectId).Select(x => x.SiteId).FirstOrDefaultAsync();
|
||||
await FileUploadAsync(async (fileName) =>
|
||||
{
|
||||
var sv = _repository.Where<SubjectVisit>(t => t.Id == id).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefault().IfNullThrowException();
|
||||
await FileUploadAsync(async (fileName) =>
|
||||
{
|
||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetClinicalDataPath(_hostEnvironment, fileName, sv.TrialId, sv.SiteId, sv.SubjectId, id);
|
||||
//插入临床pdf 路径
|
||||
filerelativePath = relativePath;
|
||||
return serverFilePath;
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
var subjectId = await _repository.Where<ReadModule>(x => x.Id == id).Select(x =>
|
||||
x.SubjectId
|
||||
).FirstOrDefaultAsync();
|
||||
var subject = await _repository.Where<Subject>(x => x.Id == subjectId).Select(x => new
|
||||
{
|
||||
x.TrialId,
|
||||
x.SiteId,
|
||||
}).FirstOrDefaultAsync();
|
||||
await FileUploadAsync(async (fileName) =>
|
||||
{
|
||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetClinicalDataPath(_hostEnvironment, fileName, subject.TrialId, subject.SiteId, subjectId, id);
|
||||
//插入临床pdf 路径
|
||||
filerelativePath = relativePath;
|
||||
return serverFilePath;
|
||||
});
|
||||
}
|
||||
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetReadClinicalDataPath(_hostEnvironment, fileName, clinicalData.TrialId, siteid, clinicalData.SubjectId, clinicalData.ObjectId, clinicalData.Id);
|
||||
//插入临床pdf 路径
|
||||
filerelativePath = relativePath;
|
||||
return serverFilePath;
|
||||
});
|
||||
|
||||
return ResponseOutput.Ok(filerelativePath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user