Search in sources :

Example 1 with SubmissionGroupDTO

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;
    });
}
Also used : SubmissionGroupDTO(com.odysseusinc.arachne.portal.api.v1.dto.SubmissionGroupDTO) Submission(com.odysseusinc.arachne.portal.model.Submission) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with SubmissionGroupDTO

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;
}
Also used : SubmissionGroupDTO(com.odysseusinc.arachne.portal.api.v1.dto.SubmissionGroupDTO) List(java.util.List) Component(org.springframework.stereotype.Component) Map(java.util.Map) SubmissionDTO(com.odysseusinc.arachne.portal.api.v1.dto.SubmissionDTO) Submission(com.odysseusinc.arachne.portal.model.Submission) SubmissionGroup(com.odysseusinc.arachne.portal.model.SubmissionGroup) Collectors(java.util.stream.Collectors) SubmissionGroupDTO(com.odysseusinc.arachne.portal.api.v1.dto.SubmissionGroupDTO) SubmissionDTO(com.odysseusinc.arachne.portal.api.v1.dto.SubmissionDTO)

Aggregations

SubmissionGroupDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionGroupDTO)2 Submission (com.odysseusinc.arachne.portal.model.Submission)2 SubmissionDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionDTO)1 SubmissionGroup (com.odysseusinc.arachne.portal.model.SubmissionGroup)1 ApiOperation (io.swagger.annotations.ApiOperation)1 List (java.util.List)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 Component (org.springframework.stereotype.Component)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1