Search in sources :

Example 6 with ParticipantRole

use of com.odysseusinc.arachne.portal.model.ParticipantRole in project ArachneCentralAPI by OHDSI.

the class BaseStudyController method updateParticipantRole.

@ApiOperation("Update participant.")
@RequestMapping(value = "/api/v1/study-management/studies/{studyId}/participants/{userUuid}", method = PUT)
public JsonResult<Boolean> updateParticipantRole(@PathVariable("studyId") Long studyId, @PathVariable("userUuid") String userUuid, @RequestBody @Valid UpdateParticipantDTO participantDTO) throws NotExistException, AlreadyExistException, ValidationException {
    if (participantDTO.getRole() != null) {
        ParticipantRole newRole = ParticipantRole.valueOf(participantDTO.getRole());
        studyService.updateParticipantRole(studyId, UserIdUtils.uuidToId(userUuid), newRole);
    }
    return new JsonResult<>(NO_ERROR, Boolean.TRUE);
}
Also used : JsonResult(com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult) ParticipantRole(com.odysseusinc.arachne.portal.model.ParticipantRole) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with ParticipantRole

use of com.odysseusinc.arachne.portal.model.ParticipantRole 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

ParticipantRole (com.odysseusinc.arachne.portal.model.ParticipantRole)7 Analysis (com.odysseusinc.arachne.portal.model.Analysis)3 LinkedList (java.util.LinkedList)3 OptionDTO (com.odysseusinc.arachne.commons.api.v1.dto.OptionDTO)2 ParticipantDTO (com.odysseusinc.arachne.portal.api.v1.dto.ParticipantDTO)2 ParticipantExtendedDTO (com.odysseusinc.arachne.portal.api.v1.dto.ParticipantExtendedDTO)2 IUser (com.odysseusinc.arachne.portal.model.IUser)2 UserStudyExtended (com.odysseusinc.arachne.portal.model.UserStudyExtended)2 JsonResult (com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult)1 DataOwnerParticipantDTO (com.odysseusinc.arachne.portal.api.v1.dto.DataOwnerParticipantDTO)1 DataSourceDTO (com.odysseusinc.arachne.portal.api.v1.dto.DataSourceDTO)1 StudyMediumDTO (com.odysseusinc.arachne.portal.api.v1.dto.StudyMediumDTO)1 BaseConversionServiceAwareConverter (com.odysseusinc.arachne.portal.api.v1.dto.converters.BaseConversionServiceAwareConverter)1 StudyStatusDTO (com.odysseusinc.arachne.portal.api.v1.dto.dictionary.StudyStatusDTO)1 DataNode (com.odysseusinc.arachne.portal.model.DataNode)1 DataSource (com.odysseusinc.arachne.portal.model.DataSource)1 CONTRIBUTOR (com.odysseusinc.arachne.portal.model.ParticipantRole.CONTRIBUTOR)1 LEAD_INVESTIGATOR (com.odysseusinc.arachne.portal.model.ParticipantRole.LEAD_INVESTIGATOR)1 Study (com.odysseusinc.arachne.portal.model.Study)1 StudyDataSourceLink (com.odysseusinc.arachne.portal.model.StudyDataSourceLink)1