use of com.odysseusinc.arachne.portal.api.v1.dto.PaperDTO 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.PaperDTO in project ArachneCentralAPI by OHDSI.
the class BasePaperToShortPaperDTOConverter method convert.
@Override
public SPD convert(P paper) {
final SPD paperDTO = createResultObject();
paperDTO.setId(paper.getId());
paperDTO.setPublishState(paper.getPublishState());
paperDTO.setPublishedDate(paper.getPublishedDate());
final Study study = paper.getStudy();
final StudyMediumDTO studyDTO = conversionService.convert(study, StudyMediumDTO.class);
paperDTO.setStudy(studyDTO);
proceedAdditionalFields(paperDTO, paper);
return paperDTO;
}
Aggregations