use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisDTO in project ArachneCentralAPI by OHDSI.
the class SubmissionInsightToSubmissionInsightDTOConverter method convert.
@Override
public SubmissionInsightDTO convert(SubmissionInsight source) {
final Submission submission = source.getSubmission();
final SubmissionInsightDTO dto = new SubmissionInsightDTO();
SubmissionDTO shortSubmissionDTO = new SubmissionDTO();
shortSubmissionDTO.setId(submission.getId());
shortSubmissionDTO.setCreatedAt(submission.getCreated());
shortSubmissionDTO.setStatus(conversionService.convert(submission.getStatus(), SubmissionStatusDTO.class));
shortSubmissionDTO.setAuthor(conversionService.convert(submission.getAuthor(), ShortUserDTO.class));
dto.setCreated(source.getCreated());
dto.setName(source.getName());
dto.setDescription(source.getDescription());
dto.setSubmission(shortSubmissionDTO);
final List<Commentable> submissionFileDTOS = source.getSubmissionInsightSubmissionFiles().stream().map(submissionFile -> conversionService.convert(submissionFile, CommentableSubmissionFileDTO.class)).collect(Collectors.toList());
dto.setCodeFiles(submissionFileDTOS);
final List<Commentable> resultFileDTOS = submission.getResultFiles().stream().map(resultFile -> conversionService.convert(resultFile, CommentableResultFileDTO.class)).collect(Collectors.toList());
dto.setResultFiles(resultFileDTOS);
dto.setDataSource(conversionService.convert(submission.getDataSource(), DataSourceDTO.class));
final AnalysisDTO analysisDTO = analysisConverter(source.getSubmission().getAnalysis());
dto.setAnalysis(analysisDTO);
dto.setCommentsCount(source.getCommentsCount());
dto.setPermissions(conversionService.convert(source, PermissionsDTO.class));
return dto;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisDTO in project ArachneCentralAPI by OHDSI.
the class AnalysisToShortBaseAnalysisDTOConverter method convert.
@Override
public ShortBaseAnalysisDTO convert(Analysis source) {
ShortBaseAnalysisDTO analysisDTO = new ShortBaseAnalysisDTO();
analysisDTO.setId(source.getId());
analysisDTO.setCreated(source.getCreated());
analysisDTO.setType(new OptionDTO(source.getType().name(), source.getType().getTitle()));
return analysisDTO;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisDTO in project ArachneCentralAPI by OHDSI.
the class AnalysisToBaseAnalysisDTOConverter method convert.
@Override
public BaseAnalysisDTO convert(Analysis source) {
ShortBaseAnalysisDTO baseDTO = conversionService.convert(source, ShortBaseAnalysisDTO.class);
BaseAnalysisDTO analysisDTO = new BaseAnalysisDTO(baseDTO);
analysisDTO.setAuthor(conversionService.convert(source.getAuthor(), UserInfoDTO.class));
analysisDTO.setTitle(source.getTitle());
analysisDTO.setDescription(source.getDescription());
analysisDTO.setUpdated(source.getUpdated());
analysisDTO.setStudy(conversionService.convert(source.getStudy(), StudyShortDTO.class));
analysisDTO.setPermissions(conversionService.convert(source, PermissionsDTO.class));
return analysisDTO;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisDTO in project ArachneCentralAPI by OHDSI.
the class AnalysisControllerTests method testUpdateAnalysisType.
@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetups({ @DatabaseSetup("/data/study-with-contributor.xml"), @DatabaseSetup("/data/analysis/analysis-before-updating.xml") })
@ExpectedDatabases({ @ExpectedDatabase(value = "/data/study-with-contributor.xml", assertionMode = NON_STRICT), @ExpectedDatabase(value = "/data/analysis/analysis-after-type-updating.xml", assertionMode = NON_STRICT) })
public void testUpdateAnalysisType() throws Exception {
AnalysisUpdateDTO analysisDTO = new AnalysisUpdateDTO();
analysisDTO.setTypeId(CommonAnalysisType.COHORT_CHARACTERIZATION.name());
testUpdate(analysisDTO, UPDATED_ANALYSIS_TYPE_JSON_OBJECT, "Cohort Characterization");
}
use of com.odysseusinc.arachne.portal.api.v1.dto.AnalysisDTO in project ArachneCentralAPI by OHDSI.
the class SubmissionInsightToSubmissionInsightDTOConverter method analysisConverter.
private AnalysisDTO analysisConverter(final Analysis analysis) {
final AnalysisDTO analysisDTO = new AnalysisDTO();
analysisDTO.setId(analysis.getId());
analysisDTO.setTitle(analysis.getTitle());
final StudyShortDTO studyDTO = new StudyShortDTO();
final Study study = analysis.getStudy();
studyDTO.setId(study.getId());
studyDTO.setTitle(study.getTitle());
studyDTO.setKind(study.getKind());
analysisDTO.setStudy(studyDTO);
return analysisDTO;
}
Aggregations