use of com.odysseusinc.arachne.portal.api.v1.dto.SubmissionGroupDTO in project ArachneCentralAPI by OHDSI.
the class BaseAnalysisController method getSubmissionGroups.
@ApiOperation("Get submission groups.")
@RequestMapping(value = "/api/v1/analysis-management/analyses/{analysisId}/submission-groups", method = GET)
public Page<SubmissionGroupDTO> getSubmissionGroups(@PathVariable("analysisId") Long id, @ModelAttribute SubmissionGroupSearch submissionGroupSearch) {
submissionGroupSearch.setAnalysisId(id);
return submissionService.getSubmissionGroups(submissionGroupSearch).map(sg -> {
SubmissionGroupDTO sgDTO = conversionService.convert(sg, SubmissionGroupDTO.class);
sgDTO.getSubmissions().forEach(sd -> {
Submission s = ((Submission) sd.getConversionSource());
sd.setAvailableActionList(submissionService.getSubmissionActions(s));
});
return sgDTO;
});
}
use of com.odysseusinc.arachne.portal.api.v1.dto.SubmissionGroupDTO in project ArachneCentralAPI by OHDSI.
the class SubmissionGroupToSubmissionGroupDTOConverter method convert.
@Override
public SubmissionGroupDTO convert(SubmissionGroup submissionGroup) {
SubmissionGroupDTO dto = new SubmissionGroupDTO();
dto.setId(submissionGroup.getId());
dto.setCreated(submissionGroup.getCreated());
if (conversionService.canConvert(Submission.class, SubmissionDTO.class)) {
List<SubmissionDTO> submissions = submissionGroup.getSubmissions().stream().map(s -> conversionService.convert(s, SubmissionDTO.class)).collect(Collectors.toList());
dto.setSubmissions(submissions);
}
dto.setQueryFilesCount(submissionGroup.getFiles().size());
dto.setChecksum(submissionGroup.getChecksum());
dto.setAnalysisType(submissionGroup.getAnalysisType());
return dto;
}
Aggregations