use of com.odysseusinc.arachne.portal.api.v1.dto.SubmissionStatusHistoryElementDTO in project ArachneCentralAPI by OHDSI.
the class BaseSubmissionController method getStatusHistory.
@ApiOperation("Get status history of the submission")
@RequestMapping(value = "/api/v1/analysis-management/submissions/{submissionId}/status-history", method = GET)
public JsonResult<List<SubmissionStatusHistoryElementDTO>> getStatusHistory(@PathVariable("submissionId") Long submissionId) throws NotExistException {
Submission submission = submissionService.getSubmissionById(submissionId);
List<SubmissionStatusHistoryElement> submissionStatusHistory = submissionService.getSubmissionStatusHistory(submission.getSubmissionGroup().getAnalysis().getId(), submissionId);
List<SubmissionStatusHistoryElementDTO> convert = new LinkedList<>();
for (SubmissionStatusHistoryElement submissionStatusHistoryElement : submissionStatusHistory) {
convert.add(conversionService.convert(submissionStatusHistoryElement, SubmissionStatusHistoryElementDTO.class));
}
JsonResult<List<SubmissionStatusHistoryElementDTO>> result = new JsonResult<>(NO_ERROR);
result.setResult(convert);
return result;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.SubmissionStatusHistoryElementDTO in project ArachneCentralAPI by OHDSI.
the class SubmissionStatusHistoryToSubmissionStatusHistoryDTOConverter method convert.
@Override
public SubmissionStatusHistoryElementDTO convert(SubmissionStatusHistoryElement source) {
Date date = source.getDate();
SubmissionStatus status = source.getStatus();
SubmissionStatusDTO submissionStatusDTO = null;
if (status != null) {
submissionStatusDTO = new SubmissionStatusDTO(status);
}
IUser author = source.getAuthor();
ShortUserDTO shortUser = null;
if (author != null) {
shortUser = conversionService.convert(author, ShortUserDTO.class);
}
return new SubmissionStatusHistoryElementDTO(date, submissionStatusDTO, shortUser, source.getComment());
}
Aggregations