Search in sources :

Example 6 with SubmissionGroup

use of com.odysseusinc.arachne.portal.model.SubmissionGroup 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)

Example 7 with SubmissionGroup

use of com.odysseusinc.arachne.portal.model.SubmissionGroup in project ArachneCentralAPI by OHDSI.

the class AnalysisHelperTest method cleanup.

private void cleanup(List<Submission> submissions, Analysis analysis, Study study) {
    SubmissionGroup group = submissions.iterator().next().getSubmissionGroup();
    group.getFiles().forEach(file -> FileUtils.deleteQuietly(analysisHelper.getSubmissionFile(file).toFile()));
    analysis.getFiles().forEach(analysisFile -> FileUtils.deleteQuietly(analysisHelper.getAnalysisFolder(analysis).resolve(analysisFile.getUuid()).toFile()));
    analysisFileRepository.deleteAll();
    submissionFileRepository.deleteAll();
    studyRepository.delete(study);
}
Also used : SubmissionGroup(com.odysseusinc.arachne.portal.model.SubmissionGroup)

Aggregations

SubmissionGroup (com.odysseusinc.arachne.portal.model.SubmissionGroup)7 Submission (com.odysseusinc.arachne.portal.model.Submission)4 LinkedList (java.util.LinkedList)4 AnalysisFile (com.odysseusinc.arachne.portal.model.AnalysisFile)3 SubmissionFile (com.odysseusinc.arachne.portal.model.SubmissionFile)3 Path (java.nio.file.Path)3 List (java.util.List)3 Map (java.util.Map)3 Analysis (com.odysseusinc.arachne.portal.model.Analysis)2 IDataSource (com.odysseusinc.arachne.portal.model.IDataSource)2 InputStream (java.io.InputStream)2 SequenceInputStream (java.io.SequenceInputStream)2 Date (java.util.Date)2 Collectors (java.util.stream.Collectors)2 ZipOutputStream (java.util.zip.ZipOutputStream)2 EntityGraph (com.cosium.spring.data.jpa.entity.graph.domain.EntityGraph)1 EntityGraphUtils (com.cosium.spring.data.jpa.entity.graph.domain.EntityGraphUtils)1 ApproveDTO (com.odysseusinc.arachne.portal.api.v1.dto.ApproveDTO)1 SubmissionDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionDTO)1 SubmissionGroupDTO (com.odysseusinc.arachne.portal.api.v1.dto.SubmissionGroupDTO)1