use of com.odysseusinc.arachne.portal.api.v1.dto.PaperFileDTO in project ArachneCentralAPI by OHDSI.
the class BasePaperToPaperDTOConverter method convert.
@Override
public PD convert(P paper) {
final PD paperDTO = createResultObject();
paperDTO.setId(paper.getId());
final Study study = paper.getStudy();
final StudyMediumDTO studyDTO = conversionService.convert(study, StudyMediumDTO.class);
paperDTO.setStudy(studyDTO);
paperDTO.setPublishState(paper.getPublishState());
paperDTO.setPublishedDate(paper.getPublishedDate());
final List<PaperFileDTO> protocols = paper.getProtocols().stream().map(protocolFile -> conversionService.convert(protocolFile, PaperFileDTO.class)).collect(Collectors.toList());
paperDTO.setProtocols(protocols);
final List<PaperFileDTO> paperFileDTOs = paper.getPapers().stream().map(paperFile -> conversionService.convert(paperFile, PaperFileDTO.class)).collect(Collectors.toList());
paperDTO.setPapers(paperFileDTOs);
paperDTO.setPermissions(conversionService.convert(paper, PermissionsDTO.class));
proceedAdditionalFields(paperDTO, paper);
return paperDTO;
}
use of com.odysseusinc.arachne.portal.api.v1.dto.PaperFileDTO in project ArachneCentralAPI by OHDSI.
the class PaperFileToPaperFileDTOConverter method convert.
@Override
public PaperFileDTO convert(AbstractPaperFile paperFile) {
final PaperFileDTO paperFileDTO = new PaperFileDTO();
paperFileDTO.setUuid(paperFile.getUuid());
paperFileDTO.setName(paperFile.getRealName());
paperFileDTO.setLabel(paperFile.getLabel());
paperFileDTO.setCreated(paperFile.getCreated());
paperFileDTO.setUpdated(paperFile.getUpdated());
paperFileDTO.setDocType(paperFile.getContentType());
final UserInfoDTO authorDTO = conversionService.convert(paperFile.getAuthor(), UserInfoDTO.class);
paperFileDTO.setAuthor(authorDTO);
paperFileDTO.setLink(paperFile.getLink());
paperFileDTO.setAntivirusStatus(paperFile.getAntivirusStatus());
paperFileDTO.setAntivirusDescription(paperFile.getAntivirusDescription());
paperFileDTO.setInsightId(paperFile.getPaper().getId());
return paperFileDTO;
}
Aggregations