Uat_Study
he 2022-06-01 09:38:22 +08:00
parent 03a206ed5e
commit ee99818b6d
2 changed files with 31 additions and 13 deletions

View File

@ -402,22 +402,40 @@ namespace IRaCIS.Core.API.Controllers
/// </summary>
/// <param name="clinicalDataId"></param>
/// <returns></returns>
[HttpPost("ClinicalData/UploadClinicalData/{trialId:guid}/{subjectId:guid}")]
[HttpPost("ClinicalData/UploadClinicalData/{id:guid}/{isVisit:bool}")]
[DisableRequestSizeLimit]
public async Task<IResponseOutput> UploadClinicalData(Guid trialId,Guid subjectId)
public async Task<IResponseOutput> UploadClinicalData(Guid id, bool isVisit)
{
var filerelativePath = string.Empty;
if (isVisit)
{
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, trialId, subjectId);
var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetClinicalDataPath(_hostEnvironment, fileName, sv.TrialId, sv.SiteId, sv.SubjectId, id);
//插入临床pdf 路径
filerelativePath = relativePath;
return relativePath;
return serverFilePath;
});
await _repository.SaveChangesAsync();
}
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.Value, id);
//插入临床pdf 路径
filerelativePath = relativePath;
return serverFilePath;
});
}
return ResponseOutput.Ok(filerelativePath);
}

View File

@ -171,7 +171,7 @@
<param name="subjectVisitId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadClinicalData(System.Guid,System.Guid)">
<member name="M:IRaCIS.Core.API.Controllers.StudyController.UploadClinicalData(System.Guid,System.Boolean)">
<summary>
上传临床数据
</summary>