Search in sources :

Example 1 with OptionDTO

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;
}
Also used : ShortBaseAnalysisDTO(com.odysseusinc.arachne.portal.api.v1.dto.ShortBaseAnalysisDTO) OptionDTO(com.odysseusinc.arachne.commons.api.v1.dto.OptionDTO)

Example 2 with OptionDTO

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;
}
Also used : DataOwnerParticipantDTO(com.odysseusinc.arachne.portal.api.v1.dto.DataOwnerParticipantDTO) IUser(com.odysseusinc.arachne.portal.model.IUser) ParticipantDTO(com.odysseusinc.arachne.portal.api.v1.dto.ParticipantDTO) DataOwnerParticipantDTO(com.odysseusinc.arachne.portal.api.v1.dto.DataOwnerParticipantDTO) OptionDTO(com.odysseusinc.arachne.commons.api.v1.dto.OptionDTO) UserStudyExtended(com.odysseusinc.arachne.portal.model.UserStudyExtended) ParticipantRole(com.odysseusinc.arachne.portal.model.ParticipantRole) DataSource(com.odysseusinc.arachne.portal.model.DataSource)

Example 3 with OptionDTO

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;
}
Also used : IUser(com.odysseusinc.arachne.portal.model.IUser) OptionDTO(com.odysseusinc.arachne.commons.api.v1.dto.OptionDTO) ParticipantExtendedDTO(com.odysseusinc.arachne.portal.api.v1.dto.ParticipantExtendedDTO) ParticipantRole(com.odysseusinc.arachne.portal.model.ParticipantRole)

Aggregations

OptionDTO (com.odysseusinc.arachne.commons.api.v1.dto.OptionDTO)3 IUser (com.odysseusinc.arachne.portal.model.IUser)2 ParticipantRole (com.odysseusinc.arachne.portal.model.ParticipantRole)2 DataOwnerParticipantDTO (com.odysseusinc.arachne.portal.api.v1.dto.DataOwnerParticipantDTO)1 ParticipantDTO (com.odysseusinc.arachne.portal.api.v1.dto.ParticipantDTO)1 ParticipantExtendedDTO (com.odysseusinc.arachne.portal.api.v1.dto.ParticipantExtendedDTO)1 ShortBaseAnalysisDTO (com.odysseusinc.arachne.portal.api.v1.dto.ShortBaseAnalysisDTO)1 DataSource (com.odysseusinc.arachne.portal.model.DataSource)1 UserStudyExtended (com.odysseusinc.arachne.portal.model.UserStudyExtended)1