use of com.odysseusinc.arachne.portal.api.v1.dto.DataSourceDTO in project ArachneCentralAPI by OHDSI.
the class BaseStudyToStudyDTOConverter method convert.
@Override
public DTO convert(final S source) {
final DTO studyDTO = createResultObject();
studyDTO.setStatus(conversionService.convert(source.getStatus(), StudyStatusDTO.class));
studyDTO.setTitle(source.getTitle());
studyDTO.setType(conversionService.convert(source.getType(), StudyTypeDTO.class));
studyDTO.setEndDate(source.getEndDate());
studyDTO.setStartDate(source.getStartDate());
studyDTO.setDescription(source.getDescription());
if (!CollectionUtils.isEmpty(source.getParticipants())) {
studyDTO.setParticipants(source.getParticipants().stream().map(link -> conversionService.convert(link, ParticipantDTO.class)).collect(Collectors.toList()));
}
final List<StudyDataSourceLink> foundLinks = studyService.getLinksByStudyId(source.getId(), EntityUtils.fromAttributePaths("dataSource.dataNode.dataNodeUsers.user"));
for (final StudyDataSourceLink studyDataSourceLink : foundLinks) {
final DataSourceDTO dataSourceDTO = conversionService.convert(studyDataSourceLink, DataSourceDTO.class);
studyDTO.getDataSources().add(dataSourceDTO);
}
List<Analysis> analyses = getAnalyses(source);
for (final Analysis analysis : analyses) {
studyDTO.getAnalyses().add(conversionService.convert(analysis, BaseAnalysisDTO.class));
}
List<StudyFile> files = studyService.getFilesByStudyId(source.getId(), EntityUtils.fromAttributePaths("author"));
for (final StudyFile studyFile : files) {
studyDTO.getFiles().add(conversionService.convert(studyFile, StudyFileDTO.class));
}
studyDTO.setCreated(source.getCreated());
studyDTO.setUpdated(source.getUpdated());
studyDTO.setId(source.getId());
studyDTO.setPermissions(conversionService.convert(source, PermissionsDTO.class));
studyDTO.setPaperId(source.getPaper() == null ? null : source.getPaper().getId());
studyDTO.setPrivacy(source.getPrivacy());
proceedAdditionalFields(studyDTO, source);
return studyDTO;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.DataSourceDTO in project ArachneCentralAPI by OHDSI.
the class StudyDataSourceLinkToDataSourceDTOConverter method convert.
@Override
public DataSourceDTO convert(final StudyDataSourceLink studyDataSourceLink) {
final DataSourceDTO dataSourceDTO = conversionService.convert(studyDataSourceLink.getDataSource(), DataSourceDTO.class);
dataSourceDTO.setStatus(studyDataSourceLink.getStatus().toString());
return dataSourceDTO;
}
Aggregations