use of com.odysseusinc.arachne.commons.api.v1.dto.OptionDTO 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.commons.api.v1.dto.OptionDTO 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;
}
use of com.odysseusinc.arachne.commons.api.v1.dto.OptionDTO in project ArachneCentralAPI by OHDSI.
the class ParticipantLinkToParticipantExtendedDTOConverter method convert.
@Override
public ParticipantExtendedDTO convert(ParticipantLink participantLink) {
final ParticipantExtendedDTO participantDTO = new ParticipantExtendedDTO();
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());
participantDTO.setAffilation(user.getAffiliation());
participantDTO.setProfessionalType(user.getProfessionalType());
return participantDTO;
}
Aggregations