use of com.odysseusinc.arachne.portal.api.v1.dto.DataOwnerParticipantDTO in project ArachneCentralAPI by OHDSI.
the class ParticipantLinkToParticipantDTOConverter method convert.
@Override
public ParticipantDTO convert(ParticipantLink participantLink) {
ParticipantDTO participantDTO = new ParticipantDTO();
ParticipantRole role = participantLink.getRole();
final IUser user = participantLink.getUser();
participantDTO.setId(user.getUuid());
participantDTO.setFullName(user.getFullName());
participantDTO.setRole(new OptionDTO(role.name(), role.toString()));
participantDTO.setStatus(participantLink.getStatus().toString());
if (participantLink instanceof UserStudyExtended) {
if (DECLINED == participantLink.getStatus() && !isEmpty(((UserStudyExtended) participantLink).getComment())) {
participantDTO.setComment(((UserStudyExtended) participantLink).getComment());
}
if (role.equals(ParticipantRole.DATA_SET_OWNER)) {
DataSource ownedDataSource = ((UserStudyExtended) participantLink).getDataSource();
participantDTO = new DataOwnerParticipantDTO(participantDTO, ownedDataSource.getId());
}
}
return participantDTO;
}
Aggregations